-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Documentation for SSR without Babel? #889
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
👋 No response yet! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
👋 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
👋 Sigh is this project even maintained still? Is every such project dead? |
React.lazy is now in react 18, and works on the server. One thing that is missing is "Injecting Into the SSR Stream", should rewrite the babel plugin so we give a Promise to React.lazy no need for the component magic except for a chunkextractor on the server sidethat outputs the tags incrementally. |
Seems like loadable-compnents has suspense support in client. Will give it a try with react 18 server side suspense and see. |
Copied this lazy from react 18, could be adapted to loadable https://codesandbox.io/s/react-18-custom-lazy-1liry3 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
💬 Questions and Help
Hi, I'm trying to migrate Docusaurus from
react-loadable
to@loadable/component
. Code-splitting is central in our architecture: every route component and its props are loaded as separate chunks. As of now, we useLoadable.Map
to load the chunks needed for rendering each component. The chunk names and paths are generated on server-side as aregistry.js
file, before starting the bundler:Where each chunk name maps to one
loader
, onewebpack
option, and onemodule
option, which we can directly pass toLoadable.Map
. There's anotherrouteChunkNames
file that maps each route to the chunks that need to be loaded. You can find the source code here, comments inlined: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus/src/client/exports/ComponentCreator.tsxWe don't use the Babel plugin provided by react-loadable, because we allow users to swap out JS loaders, so they may not use Babel (or our Babel config, at least) at all. Instead, because we have our own codegen, dynamically generating thousands of lines of repeating code is not a problem.
My questions are:
loadable
needs (requireAsync
,resolve
, etc.), what are the API specs for those options? They seem to be internal and contain a lot of boilerplate, but we are happy to implement whateverloadable
requires.Loadable.Map
, does that mean we have to implement our own equivalent withPromise.all
, etc.?loadable()
) if we don't use the Babel plugin?The text was updated successfully, but these errors were encountered: