feat(nextjs-mf): added nextjs-ssr-manifest example#4231
Conversation
|
Workflow status is failure ❌ |
|
Current blockers: this draft PR is conflicting and stale. The Next.js SSR manifest idea may still be useful, but it should be rebased/modernized against current |
d0c22d9 to
7298c96
Compare
| for (const folder of folders) { | ||
| describe(`${folder}`, () => { | ||
| const apps = getFiles(resolve(__dirname, '..', folder)); | ||
| for (app of apps) { |
| @@ -0,0 +1,27 @@ | |||
| import { Suspense, lazy } from 'react'; | |||
| import App from 'next/app'; | |||
| import dynamic from 'next/dynamic'; | |||
| @@ -0,0 +1,65 @@ | |||
| import React, { Suspense, lazy } from 'react'; | |||
| import Link from 'next/link'; | |||
| import dynamic from 'next/dynamic'; | |||
| @@ -0,0 +1,103 @@ | |||
| import React, { Fragment, Suspense, lazy } from 'react'; | |||
| @@ -0,0 +1,103 @@ | |||
| import React, { Fragment, Suspense, lazy } from 'react'; | |||
| import Head from 'next/head'; | |||
| import dynamic from 'next/dynamic'; | |||
| @@ -0,0 +1,21 @@ | |||
| import { Suspense, lazy } from 'react'; | |||
| import App from 'next/app'; | |||
| import dynamic from 'next/dynamic'; | |||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0c22d9c6b
ℹ️ 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".
| import { BaseMethods } from '../../cypress-e2e/common/base'; | ||
| import { baseSelectors, selectors } from '../../cypress-e2e/common/selectors'; | ||
| import { Constants } from '../../cypress-e2e/fixtures/constants'; |
There was a problem hiding this comment.
Restore the missing E2E helper imports
These imports point at ../../cypress-e2e, but a repo-wide search in this checkout finds no cypress-e2e directory (only the existing playwright-e2e helpers). Whenever the new e2e:ci script tries to compile this Cypress spec, module resolution fails before any of the manifest example is exercised, so either the shared Cypress helpers/config need to be added or the spec should use the existing Playwright test infrastructure.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,25 @@ | |||
| { | |||
| "name": "nextjs-ssr-manifest", | |||
There was a problem hiding this comment.
Register the example in the root workspace
This new package is not matched by the root pnpm-workspace.yaml (I checked the existing workspace entries around nextjs-ssr, and there is no nextjs-ssr-manifest entry). pnpm install --help says that installs run inside a workspace install dependencies for all workspace projects, but pnpm list --filter 'nextjs-ssr-manifest_*' --only-projects from the repo root returns no projects, so a normal root install or changed-package CI run will skip installing and testing this example; add nextjs-ssr-manifest and nextjs-ssr-manifest/* to the root workspace.
Useful? React with 👍 / 👎.
This is a clone of the
nextjs-ssrexample, but it uses mf-manifest.json instead of remoteEntry.js. Requires changes from this PR: module-federation/core#2726This requires some CORS config to allow the manifest to be fetched from the browser. I just added the following to the NextJS config in each app, but there are other ways to do it: