-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
feat: support SSR data loader #2820
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
c23b291
to
1ce8b6a
Compare
1d849e7
to
494f102
Compare
86cee8a
to
120fa83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
This pull request introduces a new feature to support server-side rendering (SSR) data loading. The key changes include:
- Adds a new console log statement in the
packages/runtime/src/index.ts
file to log the runtime initialization process, including the name of the federation instance and whether an instance already exists. This provides better visibility into the runtime initialization process. - Integrates the new data loader functionality with the existing codebase, ensuring seamless compatibility and enabling server-side rendering of data.
- The new feature is expected to improve the overall performance and user experience of the application by allowing data to be loaded on the server-side, reducing the initial load time for the client.
File Summaries
File | Summary |
---|---|
packages/runtime/src/index.ts | The code changes introduce a new console log statement to log the runtime initialization process, including the name of the federation instance and whether an instance already exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incremental Review
Comments posted: 0
Configuration
Squadron Mode: essential
Commits Reviewed
9b6fc42d20d2a775def3419fb1ec0ec908346c95...4b7e155b668cba969b248fcb7cb62070f5d593a5
Files Reviewed
- packages/sdk/src/types/plugins/ModuleFederationPlugin.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- apps/modernjs-ssr-data-loader/host/CHANGELOG.md
- apps/modernjs-ssr-data-loader/host/modern.config.ts
- apps/modernjs-ssr-data-loader/host/module-federation.config.ts
- apps/modernjs-ssr-data-loader/host/package.json
- apps/modernjs-ssr-data-loader/host/project.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/Content.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/index.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/host/tsconfig.app.json
- apps/modernjs-ssr-data-loader/host/tsconfig.json
- apps/modernjs-ssr-data-loader/host/tsconfig.spec.json
- apps/modernjs-ssr-data-loader/remote/CHANGELOG.md
- apps/modernjs-ssr-data-loader/remote/modern.config.ts
- apps/modernjs-ssr-data-loader/remote/module-federation.config.ts
- apps/modernjs-ssr-data-loader/remote/package.json
- apps/modernjs-ssr-data-loader/remote/project.json
- apps/modernjs-ssr-data-loader/remote/src/.eslintrc.js
- apps/modernjs-ssr-data-loader/remote/src/components/Button.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/Image.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/remote/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/index.css
- apps/modernjs-ssr-data-loader/remote/src/routes/layout.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/page.tsx
- apps/modernjs-ssr-data-loader/remote/tsconfig.app.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.spec.json
- apps/modernjs-ssr/dynamic-nested-remote/package.json
- apps/modernjs-ssr/dynamic-remote-new-version/package.json
- apps/modernjs-ssr/dynamic-remote/package.json
- apps/modernjs-ssr/host/package.json
- apps/modernjs-ssr/nested-remote/package.json
- apps/modernjs-ssr/remote-new-version/package.json
- apps/modernjs-ssr/remote/package.json
- packages/modernjs/package.json
- packages/modernjs/src/cli/configPlugin.ts
- packages/modernjs/src/cli/dataLoader/ast/constant.ts
- packages/modernjs/src/cli/dataLoader/ast/generateRoutes.ts
- packages/modernjs/src/cli/dataLoader/ast/index.ts
- packages/modernjs/src/cli/dataLoader/generateRouteFile.ts
- packages/modernjs/src/cli/dataLoader/patchMFConfig.ts
- packages/modernjs/src/cli/dataLoader/plugin.ts
- packages/modernjs/src/cli/index.ts
- packages/modernjs/src/cli/mfRuntimePlugins/inject-node-fetch.ts
- packages/modernjs/src/cli/mfRuntimePlugins/node.ts
- packages/modernjs/src/cli/mfRuntimePlugins/resolve-entry-ipv4.ts
- packages/modernjs/src/cli/server/dataLoaderPlugin.ts
- packages/modernjs/src/cli/server/fetchRemoteFullRoutesMap.ts
- packages/modernjs/src/cli/ssrPlugin.ts
- packages/modernjs/src/cli/utils.spec.ts
- packages/modernjs/src/cli/utils.ts
- packages/modernjs/src/constant.ts
- packages/modernjs/src/interfaces/route.ts
- packages/modernjs/src/runtime/dataLoader/plugin.tsx
- packages/modernjs/src/runtime/dataLoader/utils.ts
- packages/modernjs/src/runtime/index.ts
- packages/modernjs/src/runtime/utils.ts
- packages/modernjs/src/runtime/withMFRouteId.ts
- packages/modernjs/src/ssr-runtime/plugin.tsx
- packages/modernjs/src/types/index.ts
- pnpm-lock.yaml
- pnpm-workspace.yaml
0648582
to
7128243
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incremental Review
Comments posted: 1
Configuration
Squadron Mode: essential
Commits Reviewed
3ffd8ff5fbfc0511411dddc69fb3c46a7589957e...0d1b3504147a1c60b3abdcb7098c1c12610fec8b
Files Reviewed
- packages/runtime/src/index.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- apps/modernjs-ssr-data-loader/host/CHANGELOG.md
- apps/modernjs-ssr-data-loader/host/modern.config.ts
- apps/modernjs-ssr-data-loader/host/module-federation.config.ts
- apps/modernjs-ssr-data-loader/host/package.json
- apps/modernjs-ssr-data-loader/host/project.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/Content.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/index.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/host/tsconfig.app.json
- apps/modernjs-ssr-data-loader/host/tsconfig.json
- apps/modernjs-ssr-data-loader/host/tsconfig.spec.json
- apps/modernjs-ssr-data-loader/remote/CHANGELOG.md
- apps/modernjs-ssr-data-loader/remote/modern.config.ts
- apps/modernjs-ssr-data-loader/remote/module-federation.config.ts
- apps/modernjs-ssr-data-loader/remote/package.json
- apps/modernjs-ssr-data-loader/remote/project.json
- apps/modernjs-ssr-data-loader/remote/src/.eslintrc.js
- apps/modernjs-ssr-data-loader/remote/src/components/Button.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/Image.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/remote/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/index.css
- apps/modernjs-ssr-data-loader/remote/src/routes/layout.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/page.tsx
- apps/modernjs-ssr-data-loader/remote/tsconfig.app.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.spec.json
- apps/modernjs-ssr/dynamic-nested-remote/package.json
- apps/modernjs-ssr/dynamic-remote-new-version/package.json
- apps/modernjs-ssr/dynamic-remote/package.json
- apps/modernjs-ssr/host/package.json
- apps/modernjs-ssr/nested-remote/package.json
- apps/modernjs-ssr/remote-new-version/package.json
- apps/modernjs-ssr/remote/package.json
- packages/modernjs/package.json
- packages/modernjs/src/cli/configPlugin.ts
- packages/modernjs/src/cli/dataLoader/ast/constant.ts
- packages/modernjs/src/cli/dataLoader/ast/generateRoutes.ts
- packages/modernjs/src/cli/dataLoader/ast/index.ts
- packages/modernjs/src/cli/dataLoader/clearMFCache.ts
- packages/modernjs/src/cli/dataLoader/generateRouteFile.ts
- packages/modernjs/src/cli/dataLoader/patchMFConfig.ts
- packages/modernjs/src/cli/dataLoader/plugin.ts
- packages/modernjs/src/cli/index.ts
- packages/modernjs/src/cli/mfRuntimePlugins/node-fetch.ts
- packages/modernjs/src/cli/mfRuntimePlugins/node.ts
- packages/modernjs/src/cli/mfRuntimePlugins/resolve-entry-ipv4.ts
- packages/modernjs/src/cli/server/dataLoaderPlugin.ts
- packages/modernjs/src/cli/server/fetchRemoteFullRoutesMap.ts
- packages/modernjs/src/cli/ssrPlugin.ts
- packages/modernjs/src/cli/utils.spec.ts
- packages/modernjs/src/cli/utils.ts
- packages/modernjs/src/constant.ts
- packages/modernjs/src/global.d.ts
- packages/modernjs/src/interfaces/route.ts
- packages/modernjs/src/runtime/dataLoader/plugin-inject-assets.tsx
- packages/modernjs/src/runtime/dataLoader/plugin.tsx
- packages/modernjs/src/runtime/dataLoader/utils.ts
- packages/modernjs/src/runtime/index.ts
- packages/modernjs/src/runtime/withMFRouteId.ts
- packages/modernjs/src/ssr-runtime/plugin.tsx
- packages/modernjs/src/types/index.ts
- pnpm-lock.yaml
- pnpm-workspace.yaml
- webpack/types.d.ts
154e8df
to
25e106b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incremental Review
Comments posted: 0
Configuration
Squadron Mode: essential
Commits Reviewed
13975e1793d1e1eda4b3aed0ed919fddcff02aaf...25e106b347f8adb299a4dbd0f090fe3789c589ce
Files Reviewed
- packages/runtime/src/index.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- apps/modernjs-ssr-data-loader/host/CHANGELOG.md
- apps/modernjs-ssr-data-loader/host/modern.config.ts
- apps/modernjs-ssr-data-loader/host/module-federation.config.ts
- apps/modernjs-ssr-data-loader/host/package.json
- apps/modernjs-ssr-data-loader/host/project.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/Content.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/index.css
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/nested-routes/pathname/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-one/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/federation/mf.json
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/layout.tsx
- apps/modernjs-ssr-data-loader/host/src/entry-two/routes/page.tsx
- apps/modernjs-ssr-data-loader/host/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/host/tsconfig.app.json
- apps/modernjs-ssr-data-loader/host/tsconfig.json
- apps/modernjs-ssr-data-loader/host/tsconfig.spec.json
- apps/modernjs-ssr-data-loader/remote/CHANGELOG.md
- apps/modernjs-ssr-data-loader/remote/modern.config.ts
- apps/modernjs-ssr-data-loader/remote/module-federation.config.ts
- apps/modernjs-ssr-data-loader/remote/package.json
- apps/modernjs-ssr-data-loader/remote/project.json
- apps/modernjs-ssr-data-loader/remote/src/.eslintrc.js
- apps/modernjs-ssr-data-loader/remote/src/components/Button.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/Image.tsx
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css
- apps/modernjs-ssr-data-loader/remote/src/components/stuff.module.css.d.ts
- apps/modernjs-ssr-data-loader/remote/src/modern-app-env.d.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/a/page.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/index.css
- apps/modernjs-ssr-data-loader/remote/src/routes/layout.tsx
- apps/modernjs-ssr-data-loader/remote/src/routes/page.data.ts
- apps/modernjs-ssr-data-loader/remote/src/routes/page.tsx
- apps/modernjs-ssr-data-loader/remote/tsconfig.app.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.json
- apps/modernjs-ssr-data-loader/remote/tsconfig.spec.json
- apps/modernjs-ssr/dynamic-nested-remote/package.json
- apps/modernjs-ssr/dynamic-remote-new-version/package.json
- apps/modernjs-ssr/dynamic-remote/package.json
- apps/modernjs-ssr/host/package.json
- apps/modernjs-ssr/nested-remote/package.json
- apps/modernjs-ssr/remote-new-version/package.json
- apps/modernjs-ssr/remote/package.json
- packages/modernjs/package.json
- packages/modernjs/src/cli/configPlugin.ts
- packages/modernjs/src/cli/dataLoader/ast/constant.ts
- packages/modernjs/src/cli/dataLoader/ast/generateRoutes.ts
- packages/modernjs/src/cli/dataLoader/ast/index.ts
- packages/modernjs/src/cli/dataLoader/clearMFCache.ts
- packages/modernjs/src/cli/dataLoader/generateRouteFile.ts
- packages/modernjs/src/cli/dataLoader/patchMFConfig.ts
- packages/modernjs/src/cli/dataLoader/plugin.ts
- packages/modernjs/src/cli/index.ts
- packages/modernjs/src/cli/mfRuntimePlugins/node-fetch.ts
- packages/modernjs/src/cli/mfRuntimePlugins/node.ts
- packages/modernjs/src/cli/mfRuntimePlugins/resolve-entry-ipv4.ts
- packages/modernjs/src/cli/server/dataLoaderPlugin.ts
- packages/modernjs/src/cli/server/fetchRemoteFullRoutesMap.ts
- packages/modernjs/src/cli/ssrPlugin.ts
- packages/modernjs/src/cli/utils.spec.ts
- packages/modernjs/src/cli/utils.ts
- packages/modernjs/src/constant.ts
- packages/modernjs/src/global.d.ts
- packages/modernjs/src/interfaces/route.ts
- packages/modernjs/src/runtime/dataLoader/plugin-inject-assets.tsx
- packages/modernjs/src/runtime/dataLoader/plugin.tsx
- packages/modernjs/src/runtime/dataLoader/utils.ts
- packages/modernjs/src/runtime/index.ts
- packages/modernjs/src/runtime/withMFRouteId.ts
- packages/modernjs/src/ssr-runtime/plugin.tsx
- packages/modernjs/src/types/index.ts
- pnpm-lock.yaml
- pnpm-workspace.yaml
- webpack/types.d.ts
b09a7f5
to
b319a4e
Compare
9d56403
to
d445dfc
Compare
50171aa
to
e923da0
Compare
d9242ab
to
aed4556
Compare
d501a48
to
78308d1
Compare
78308d1
to
382dcfe
Compare
Description
Related Issue
Types of changes
Checklist