feat(routing): Code splitting, named routes, no SSR mismatch issues#1298
Open
grgur wants to merge 1 commit intoerikras:masterfrom
Open
feat(routing): Code splitting, named routes, no SSR mismatch issues#1298grgur wants to merge 1 commit intoerikras:masterfrom
grgur wants to merge 1 commit intoerikras:masterfrom
Conversation
bertho-zero
reviewed
Oct 14, 2016
| } | ||
| } | ||
| const routes = getRoutes(store); | ||
| match({ history, routes: routes }, () => { |
There was a problem hiding this comment.
match is useless here, no ?
You don't use parameters of callback, can you explain to me why you have put a match?
Author
There was a problem hiding this comment.
Good question. match is going to wait until React Router has finished getting components. In other words, React Router will fetch chunks and tell us via match when it's ready to render the entire view.
If we don't wait then React Router will render the view without chunks and that view will be different than what we got from server side rendering. This will cause React to discard SSR content.
timworx
reviewed
Dec 14, 2016
| childRoutes: [{ | ||
| path: 'login', | ||
| getComponent(nextState, cb) { | ||
| console.time('gettingComponent'); |
There was a problem hiding this comment.
Did you mean to leave these console.time calls in? :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I reused @leifdalan's PR #1216 to enable code splitting with additional features: