-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Option not to load on server #195
Comments
Hello @overlookmotel, thanks for providing it! I think this feature is great and must be part of loadable ecosystem. I would be very happy to review your PR if you want to implement it. But can you please use |
Hi @neoziro. Thanks very much for swift reply and your willingness to entertain this. I'm fine with |
No it is OK, by default it will be |
OK great. I've started work on this and it seems pretty simple, but still need to write tests. I'll make a PR in a few weeks time. |
Hi @neoziro. Thanks for implementing this. I was working on it but been delayed by other work. Great that you've gone and done it! |
🚀 Feature Proposal
An option called e.g.
noSsr
to prevent a loadable component being rendered to HTML on the server.If option is set, the fallback will be rendered on the server and no chunk sent to
ChunkExtractor
. The client will then initially render the fallback and async load the component (same as if you weren't using SSR at all).Motivation
Often it's useful to be able to server render only parts of the app, and leave completing the render to the client. This allows:
Example use cases:
Example
On server, this component would just render the fallback.
Pitch
In my opinion, this feature is pretty key to striking a nice balance between the pros and cons of SSR.
This kind of approach is likely to be easier with React's forthcoming async renderer, so it'd be great to allow people to start working in this way before that drops.
As a bonus, I'm happy to implement it myself, and I don't think it'd be very difficult!
If I worked up a PR, would you be likely to accept it?
The text was updated successfully, but these errors were encountered: