Skip to content

chore: upgrade node@20#4299

Merged
2heal1 merged 85 commits intomainfrom
workflow/node20
Jan 29, 2026
Merged

chore: upgrade node@20#4299
2heal1 merged 85 commits intomainfrom
workflow/node20

Conversation

@2heal1
Copy link
Copy Markdown
Member

@2heal1 2heal1 commented Jan 14, 2026

CHANGE SUMMARY: Node.js 20 and pnpm 10 Upgrade

This document summarizes the changes made to unify the repository's development and CI environment to Node.js 20 and pnpm 10.

1. Version Declaration Changes

Node.js

  • Root package.json:
    • engines.node was updated from ^18 to >=20.
  • .nvmrc Files:
    • All .nvmrc files (in the root, packages/chrome-devtools, apps/modernjs, and templates) were updated from 18.19.1 or lts/hydrogen to 20.
  • Sub-package package.json:
    • engines.node fields in sub-packages were not strictly enforced to ^20 to maintain broader compatibility, but the CI now runs on Node.js 20.

pnpm

  • Root package.json:
    • engines.pnpm was updated from ^8.11.0 to >=10.
    • packageManager was updated from pnpm@8.11.0 to pnpm@10.

2. GitHub Actions Workflow Changes

All workflows in .github/workflows/*.yml that use Node.js have been standardized:

  • Node.js Setup:

    • uses: actions/setup-node was unified to v6.
    • with.node-version was set to '20'.
    • cache: 'pnpm' is consistently used.
  • pnpm Setup:

    • A new step using uses: pnpm/action-setup@v4 with version: 10 has been added to all relevant workflows.
    • The previous method of installing pnpm via corepack prepare pnpm@8.11.0 --activate has been removed.
  • Specific Workflow Updates:

    • release.yml: The Node.js version was changed from 22 to 20.
    • e2e-metro.yml: Explicit Node.js and pnpm setup steps were added, as they were previously missing.

These changes ensure a consistent and up-to-date environment across all development and CI processes.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 14, 2026

🦋 Changeset detected

Latest commit: 03a3750

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@module-federation/enhanced Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/modernjsapp Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 14, 2026

Deploy Preview for module-federation-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 03a3750
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/697b17d143a2ec0008ea6ee6

ScriptedAlchemy and others added 26 commits January 28, 2026 17:06
nx format:write fails because pnpm's strict isolation prevents nx from
resolving prettier. Adding prettier as a dependency extension for nx
ensures the symlink is created properly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restores test fixture files that were inadvertently modified during the
NX migration, causing 4 test failures in reshake-share and server-strategy.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prevents pnpm from auto-installing next@15 (with react@19) into the
workspace, which caused dual React instance crashes in the Next.js 14
demo apps. With optional peers, nextjs-mf inherits whatever next/react
version the consuming app provides.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mark next as optional peer in @nx/next, @nx/module-federation, and
@storybook/nextjs via packageExtensions. This stops pnpm from
auto-installing next@15 (with react@19) which caused dual React
instance crashes in the Next.js 14 demo apps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The node package doesn't directly use react, react-dom, or next.
Removing these prevents pnpm from auto-installing conflicting
versions in the workspace.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Next.js requires webpack at runtime but can't resolve it through
pnpm's strict isolation. Adding webpack as a dependency extension
for next ensures proper resolution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The serve targets with nx:run-commands don't need dependsOn for
workspace package builds. The test:e2e orchestration already handles
building before serving. The dependsOn was causing serve to fail by
triggering unnecessary rebuilds of all 18 workspace packages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove devServerTarget from e2e configs since nx:run-commands serve
targets don't support the ready-signal that @nx/next:server provided.
Update test:e2e to start all 3 servers (including the app under test)
and use wait-on for all ports before running Cypress.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tration

- Add dependsOn: ["build"] to serve targets so production serve
  automatically triggers builds via Nx task graph
- Change test:e2e to parallel: false with sequential kill-port at
  start and end to prevent EADDRINUSE between test runs
- Remove inline build from production test:e2e since serve now
  depends on build via dependsOn

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…eanup

- Switch test:e2e back to parallel: true with 2 commands
- Integrate kill-port into serve command chain (runs before serve starts)
- Add cleanup kill-port after Cypress tests using ; (always runs)
- Preserve test exit code with EXIT=$? pattern
- Ensures reliable port cleanup between sequential test runs in CI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…0-home

Use bash -lc with trap EXIT and SERVE_PID tracking for reliable
background process cleanup during e2e tests, preventing port conflicts
between sequential CI test runs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace fragile per-app shell commands with a Node.js orchestration
script (run-next-e2e.mjs) that starts all 3 servers once, runs all
e2e suites sequentially, and cleans up reliably using detached process
groups with signal escalation. This eliminates EADDRINUSE port
conflicts in CI between sequential test runs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…next e2e

Replace the fixed 30s sleep in CI with wait-on TCP polling so tests
start as soon as servers are actually ready, reducing flakiness and
wasted time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix project name mismatches (@module-federation/ prefix) that prevented
cache disabling from taking effect, and broaden from build:production
to build so .next output is always rebuilt fresh.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The enhanced:test was using stale cached results from Nx Cloud,
causing tree-shaking-share tests to fail with MODULE_NOT_FOUND
errors in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tures

The committed test fixtures had stale content (extra Text export,
missing semicolons) that didn't match what ensureReshakeShareFixtures()
generates. Also revert enhanced:test cache disable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@2heal1 2heal1 merged commit c3c068e into main Jan 29, 2026
15 of 21 checks passed
@2heal1 2heal1 deleted the workflow/node20 branch January 29, 2026 08:32
@2heal1 2heal1 mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants