-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace universal example with async-with-routing and async-universal #1403
Conversation
"react-dom": "^0.14.7", | ||
"react-redux": "^4.2.1", | ||
"react-router": "^2.0.0", | ||
"react-router-redux": "^3.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use 4.x instead? I think there’s a beta out. It has a slightly different API but it’s better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, it's done
Hi, thank you for contributing to examples. I don’t think we want any more counter examples. In fact it would be better to change the existing I would prefer if we:
Does this make sense? |
No problem how to deal with initialState on huge app? all the data store should be loaded on each "url entry"? or should we populate the initialState accordingly to url location on server side and duplicate the router.js? is there already an elegant way to do that? and finally should I stick on simple declarative router, or using a dynamic router? |
On the server side, you could
You don’t need to worry about |
thank you, I will try to produce something at the earliest |
I was looking for a simple example using react router with a universal app and I'm glad I stumbled upon this. Thank you, @xulien, and I'm really looking forward to seeing @gaearon's suggestions implemented. Question:
|
I'm not sure if I took the right way to track URL changes, but it's a first proposal to async-router |
@FarhadG my pleasure :) |
super(props) | ||
this.handleChange = this.handleChange.bind(this) | ||
this.handleRefreshClick = this.handleRefreshClick.bind(this) | ||
this.rootPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Can’t we just navigate to /stuff
?
Thank you for your work on this! I left a few comments inline. Please skim through my earlier comment too: #1403 (comment). Rather than create Basically |
I hadn't miss it, but I'm waited review on async-router. async-universal should coming soon Thanks for review |
Great, thanks! Can you please remove the irrelevant parts for now so it’s easier to review, and get lint to pass? Then I can merge this PR and you can work on the next one. |
hell time ended last week
it's miiine, my preeecious! and it seems I'm close to finish it. |
if I write server.js in CommonJS, it's the whole async-universal example I must rewrite in CommonJS, and it will not be more consistent !? |
No, just |
I suddenly doubt Second purpose is the right one? |
Yea, that’s what I meant (just for the sake of consistency). |
argl, sorry for noise |
@gaearon ready for (probably) the last review |
Awesomeee, good work @xulien! Can't wait for this to be merged 🔥 |
@mxstbr great thx, but I'll waiting review before to shout victory! ( I'm shaking on each push 😨 ) |
Replace universal example with async-with-routing and async-universal
this works is in safe hands, then i close this pull request. |
👍 Thanks for your work! Hopefully I’ll get to it soon. |
Reopening because I got stuck with #1800. There are still some things that need more work here, I’ll try to post a review when I get more time from other projects. |
Reclosing in favor of #1883. |
hi,
this is my proposal related to reactjs/react-router-redux#232 (comment)