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

SSR: Preload Feature App modules before hydrating in the client #27

Closed
5 tasks done
clebert opened this issue Nov 23, 2018 · 0 comments · Fixed by #324
Closed
5 tasks done

SSR: Preload Feature App modules before hydrating in the client #27

clebert opened this issue Nov 23, 2018 · 0 comments · Fixed by #324
Assignees
Milestone

Comments

@clebert
Copy link
Member

clebert commented Nov 23, 2018

After rendering Feature Apps on the server the JS files of the Feature Apps that were rendered on the server need to be loaded before hydrating.

  • The integrator collects Feature App URLs for hydration via the FeatureAppLoader who knows which Feature Apps have been rendered on the server. The FeatureAppLoader adds the URLs with a addUrlForHydration function that is provided via the FeatureHubContext.
  • The set of URLs is serialized into the HTML document by the integrator.
  • On the client the integrator loads the URLs from the HTML document and calls the preloadFeatureApp method of the FeatureAppManager for all URLs before hydrating.
  • We need to document the known edge case, maybe in the FAQ.
    • When a server-rendered Feature App view requires additional JS chunks in the client (via code splitting), then we can't guarantee that hydrating works without visual impact.
  • Not appearing anymore is "Warning: Did not expect server HTML to contain a..."

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants