Skip to content
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

Server-side rendering support #15

Closed
jonricaurte opened this issue Dec 13, 2016 · 6 comments
Closed

Server-side rendering support #15

jonricaurte opened this issue Dec 13, 2016 · 6 comments

Comments

@jonricaurte
Copy link

Server-side rendering support is a major feature to the react setup, so would be nice to have that, too.

@elboman
Copy link
Member

elboman commented Dec 13, 2016

We are working on it 😄 We have been talking about it internally and are trying to figure out a great and straightforward way to implement it.

Since the router is in charge of handling the resolves for each state, the best implementation would be to resolve the data on the server side, serialize it, send it to the client and re-hydrate the router state with the data, otherwise we would fetch all data twice.

This implementation has its limits as you would be able to only declare resolves that can be serialized. So no class instances or stuff like that.

I'll update here as soon as we have anything working ;)

@jonricaurte
Copy link
Author

Glad to hear!

This is the library I'm currently using with react-router:

https://github.com/makeomatic/redux-connect
API: https://github.com/makeomatic/redux-connect/blob/master/docs/API.MD

Using both redux and react-router along with redux-connect is a solution working for me for both client and server. Maybe have something similar, or maybe letting the router have plugins for specific kinds of stores like redux. The other one I was looking at was react-resolver, but it doesn't support redux out of the box:

https://github.com/ericclemmons/react-resolver

The only thing without using classes is you would have to have a nested component at the top level if you wanted to setState. Maybe that could be fine if it is just documented well. Decorators as resolvers makes it easy to see whats being injected into the props of the component but not necessarily required. Really like what you guys are doing! Miss ui-router to be honest.

This is the boilerplate I started with for my app which emphasizes the folder by feature/routes are folders (called fractal pattern in React but has been around for a while in Angular community thanks to John Papa):

https://github.com/davezuko/react-redux-starter-kit

Any kind of time frame you guys are looking at for a 1.0?

@lfender6445
Copy link

Any updates on this?

@elboman
Copy link
Member

elboman commented Jun 5, 2018

I have to be honest, I haven't work specifically on this feature, but we have made big changes since that should render this a lot easier to implement.
I guess it's time for me to work on it properly.

I'll keep you posted!

@stale
Copy link

stale bot commented Dec 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. This does not mean that the issue is invalid. Valid issues may be reopened. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 27, 2019
@stale
Copy link

stale bot commented Mar 29, 2020

This issue has been automatically closed.

@stale stale bot closed this as completed Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants