Skip to content

Commit

Permalink
Reader: remove redundant section for feed pages (#45169)
Browse files Browse the repository at this point in the history
The section references the same module (`client/reader`) as the main `reader` section,
and doesn't do anything useful. It was added in #25741 to support logged-out redirects,
but these redirects were then implemented later at a framework level in #30537 and the
Reader-specific redirect code was removed. After that, the section became an empty shell.

Also moves the `/recommendations` redirect handler to `reader/search`, potentially removing
the need to load any other section than `reader/search` when handling the route.
  • Loading branch information
jsnajdr authored Aug 26, 2020
1 parent fda3c32 commit 8ab6d57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions client/reader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ export default async function () {
page( '/read/post/feed/:feed_id/:post_id', legacyRedirects );
page( '/read/post/id/:blog_id/:post_id', legacyRedirects );

// Old recommendations page
page( '/recommendations', '/read/search' );

// Old Freshly Pressed
page( '/read/fresh', '/discover' );
}
Expand Down
3 changes: 3 additions & 0 deletions client/reader/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ import { sidebar, updateLastRoute } from 'reader/controller';
import { makeLayout, render as clientRender } from 'controller';

export default function () {
// Old recommendations page
page( '/recommendations', '/read/search' );

page( '/read/search', updateLastRoute, sidebar, search, makeLayout, clientRender );
}
10 changes: 1 addition & 9 deletions client/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,6 @@ const sections = [
group: 'reader',
trackLoadPerformance: true,
},
{
name: 'reader',
paths: [ '/read/feeds/[^\\/]+', '/read/blogs/[^\\/]+', '/read/a8c', '/recommendations' ],
module: 'wp-calypso-client/reader',
secondary: true,
group: 'reader',
trackLoadPerformance: true,
},
{
name: 'reader',
paths: [ '/read/feeds/[^\\/]+/posts/[^\\/]+', '/read/blogs/[^\\/]+/posts/[^\\/]+' ],
Expand Down Expand Up @@ -356,7 +348,7 @@ const sections = [
},
{
name: 'reader',
paths: [ '/read/search' ],
paths: [ '/read/search', '/recommendations' ],
module: 'wp-calypso-client/reader/search',
secondary: true,
group: 'reader',
Expand Down

0 comments on commit 8ab6d57

Please sign in to comment.