test(nextjs-mf): extract pages-router fixtures#4530
Conversation
|
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b86cb5b05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| React.useEffect(() => { | ||
| let isMounted = true; | ||
|
|
||
| import('checkout/pages/checkout/index').then((mod) => { |
There was a problem hiding this comment.
Forward getInitialProps in checkout page proxy
Loading checkout/pages/checkout/index only inside useEffect makes this route client-only for the federated page, so Next.js cannot run the remote page's getInitialProps during SSR. The previous implementation explicitly forwarded Page.getInitialProps, but this proxy never does, which drops the data-loading contract defined in apps/3002-checkout/pages/checkout/index.tsx and can leave /checkout with fallback/empty props on first render.
Useful? React with 👍 / 👎.
| React.useEffect(() => { | ||
| let isMounted = true; | ||
|
|
||
| import('shop/pages/shop/index').then((mod) => { |
There was a problem hiding this comment.
Forward getInitialProps in shop page proxy
This proxy also fetches the remote page only after mount, but it no longer forwards the remote static data loader, so Shop.getInitialProps from apps/3001-shop/pages/shop/index.tsx is never executed by Next.js when serving /shop from the checkout app. That is a behavioral regression from the prior re-export pattern and removes SSR data hydration for this federated route.
Useful? React with 👍 / 👎.
|
Closing per request. |
Summary
Extract the pages-router fixture migration and E2E harness updates on top of the v9 core lane.
Included
3000-home,3001-shop, and3002-checkoutfixture updatesValidation
pnpm run ci:local --only=e2e-next-prodpassed locally on the restacked pages-router branche2e-next-devande2e-next-prodjobsPR Stack
This PR is 3/4 in the stack.
Stack order (base -> tip):
Navigation:
#4529 -> #4528 -> #4530 -> #4425codex/nextjs-mf-v9-pages-routerintocodex/nextjs-mf-v9-core