Implement in react-redux-universal-hot-example #13
Comments
That would be an interesting experiment, and I'm sure I'd learn a few things about why redux-router works the way it does. I don't think I'll have time to do it in the next few days (not really familiar with it) but I'll keep this issue open and maybe next week I can take a shot. |
Totally--I'm interested too, but pretty busy myself. I haven't personally run into any issues with redux-router in my project, so it's low priority for my own needs. |
Alright, I did an initial port here: jlongster/react-redux-universal-hot-example@e13b935?diff=split Who else should I loop in? @stevoland @erikras @justingreenberg? I'll play around with it for a few more days. It's more elegant IMHO. Particularly server-rendering. No more hacks to store the data fetching promise on the state or anything like that. The state should stay pure. You can just use react-router straight up. |
Looks good at first glance--thanks for doing this! I'll try and take a look tomorrow and port it into my project. |
@jlongster Thanks for putting this together so quickly. I was struggling with I found a small change here: |
@jlongster dispatching during this stage gave me this warning on the client while transitioning: |
If you guys could kick the tires on this a bit more, I'd love to merge it. |
I definitely think we should test this out for about a week before merging, just to make sure! But looks great. |
Will kick around some more soon, been a busy week at work. @Dattaya thanks for the report. |
I think |
@louissmit I think Looks great! I'm starting a project right now and this is going in for sure. |
@stevoland I'm not sure I see how it no longer blocks, but in either case the widgets example is broken in its current implementation. I'm new to this boilerplate and redux so I'm just trying to figure out how it works. (: |
@louissmit haven't had a chance to flesh all this out yet, this week has been busy. I'm going to work on it some this weekend. On the client-side, it does not block, but that's just the strategy I chose for now. It we want it to block to emulate the previous behavior, we just need to use |
Glad to hear @stevoland likes this! I think I'll have some time today to try it. My project relies on both fetchData and fetchDataDeferred, so if I can get it working I'd be stoked! |
Dispatching in createElement might not be a good way of doing things. @timdorr hasn't written anything here yet (I asked him to give some advice), but this is what he recommended, how he implemented data pre-fetch on the client https://gist.github.com/timdorr/3ffe30e3c4e116019bc3 this is one way to implement |
Note that there are a few libraries out there for the exact same thing, such as |
thanks @timdorr |
The biggest thing |
Just gave it a whirl:
I'm not sure where the |
More information: the Per the warning, |
As a hack, wrap |
As for the issue with blocking route transitions, would it be sensible to create a |
@timdorr |
@jlongster there are a couple of serious errors in the example implementation, please see my comments: |
I've been moving forward slowly with this project because I really wanted to think some things though. This PR implements a very different way to sync route changes: #40 It looks like that works well, and I still want to add a test suite to this project. I wanted to wait until this stabilizes a bit before fully porting that project. It will be soon though. |
@sompylasar - not sure if my question on jlongster/react-redux-universal-hot-example@e13b935?diff=split#commitcomment-14403070 will come through - so here it is - how do we reproduce the server-hang-on-rejected-promise issue. I had little luck reproducing it. |
And another issue not-related-to-this-project-but-to-jlongster/react-redux-universal-hot-example... @quicksnap - re: the setState() issue - did you notice the same problem on the Chat component? https://monosnap.com/file/ouGicqqm47vq3YIqiqT2aNYEsLgbFD.png |
@glennr replied there. |
@glennr I ran this in my own project based off the boilerplate, so Chat isn't present. However, the issue will be present in various states. |
hey guys thanks :) |
Shameless plug: I have a universal boilerplate application that's working with redux-simple-router and koa. https://github.com/tomatau/breko-hub - the integration seems to work consistently and takes place in Any criticism on the approach taken is more than welcome! |
I also noticed Chat isn't in this version of the boilerplate. Is there a reason why it was excluded? |
Not sure what the timeline is like for this, but I made a PR bringing much of this and its open pull requests into example project, along with universal-redux npm package. That PR is here: erikras/react-redux-universal-hot-example#685 |
getting the setState error on the client as well:
|
I followed the structure you recommended for server side rendering, ie. if the component has a Specifically, I have a search component that clears its cache within what is happening now is: as we transition from A to B:
this is breaking for me because If i fetch the results in component B's |
Somebody might find it useful to take a look at the code in this PR as well as the associated discussion: jlongster/react-redux-universal-hot-example#4 |
As someone who was enthusiastically following the redux-simple-router, just checking in if there are any updates here and if it would play well with the react-router 2.0? :) @jlongster @mariocasciaro |
We're working on a new API in #141 and just landed it. Basically we're still settling on the right solution so I'm not focusing on any template/boilerplate project yet until we've stabilized. I think what's on master might be pretty robust, but we'll see. |
Is this still being pursued? 2.0 is out, so now's the time! |
@timdorr I believe this issue would still be problematic for RRUHE: jlongster/react-redux-universal-hot-example#4 I've managed to bring version 2.0.1 (and react-router 2.0.0-rc5) into universal-redux 3.0.0-rc7 (https://github.com/bdefore/universal-redux). It's working like a charm there using async-props rather than the serverside fetching mechanism of RRUHE. |
I'm going to close this, as it can either be tracked on @jlongster's repo or the original. Either way, outside of specific fixes the library has to make (which would require issues here), there isn't really anything to do in this repo. |
I like proposed solutions to this problem. There is another one--bring back Here're few potential benefits:
If you want to see error handling in action, take a look at my repository https://github.com/Dattaya/isomorphic-redux-plus/tree/universal-router I use it because it's dead simple which means it's much easier to experiment with + hot-reloading is blazingly fast. |
Update on this: we have an experimental branch, IMO, it's best to discuss ideas in RRUHE repo if it doesn't directly relate to react-router-redux so not to drain on the collaborators here. |
I'll open then a new issue in RRUHE sometime this week. |
There's some talk about this library in erikras/react-redux-universal-hot-example#439
Would you be interested in starting a branch to integrate this library as a replacement? It could serve as a good example on how to migrate from redux-router to redux-simple-router, and could uncover pain points along the way.
I'd be happy to help, too. But for the next few days, probably not much.
If you think it would not serve as a good replacement, that would be great information, too!
The text was updated successfully, but these errors were encountered: