Skip to content

Comments

feat: tsup build alignment and local setup fixes#4460

Open
ScriptedAlchemy wants to merge 51 commits intomainfrom
feat/tsup
Open

feat: tsup build alignment and local setup fixes#4460
ScriptedAlchemy wants to merge 51 commits intomainfrom
feat/tsup

Conversation

@ScriptedAlchemy
Copy link
Member

Summary

  • align tsup package build configs to use unbundled outputs where applicable
  • ensure module federation packages are treated as external in tsup package configs
  • improve local CI portability by adding a macOS-safe CPU core detection fallback
  • fix codex setup script for worktree installs when no extra install args are passed

Validation

  • pnpm run ci:local --only=build-and-test (in progress previously; build stages validated)
  • npx nx run-many --targets=build --projects=error-codes,runtime,runtime-core,runtime-tools,inject-external-runtime-core-plugin,webpack-bundler-runtime,sdk --parallel=3 --skip-nx-cache
  • ./scripts/codex-setup.sh -- --frozen-lockfile

cursoragent and others added 29 commits February 17, 2026 20:44
Co-authored-by: zackary.l.jackson <zackary.l.jackson@gmail.com>
Use tsdown with nx run-commands for migrated packages and align export and type outputs for publint.
Remove legacy rollup configs and add shared migration scaffolding.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align package build metadata with tsdown output and type extension updates.
Remove CJS fallback from ESM runtime alias resolution for consistent module format selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use .d.mts for import types so exports match emitted ESM declaration files.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit ef7c273
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/699690ba42f879000802526c
😎 Deploy Preview https://deploy-preview-4460--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: ef7c273

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Bundle Size Report

20 package(s) changed, 21 unchanged.

Package Total dist Delta ESM gzip Delta
dts-plugin 296.2 kB -338423 B (-52.7%) 4.3 kB -19549 B (-81.6%)
node 191.4 kB +68.3 kB (+55.5%) 217 B -272 B (-55.6%)
runtime-core 244.7 kB -61822 B (-19.8%) 474 B -25616 B (-98.2%)
native-federation-tests 91.9 kB +45.2 kB (+96.8%) 745 B +640 B (+609.5%)
native-federation-typescript 90.4 kB +44.9 kB (+98.6%) 629 B +519 B (+471.8%)
vue3-bridge 137.6 kB -21829 B (-13.4%) 21.1 kB -2231 B (-9.4%)
webpack-bundler-runtime 89.3 kB +12.8 kB (+16.7%) 405 B -5622 B (-93.3%)
retry-plugin 60.6 kB +12.5 kB (+26.0%) 2.8 kB -426 B (-13.0%)
nextjs-mf 122.6 kB +11.3 kB (+10.1%) 157 B -127 B (-44.7%)
utils 120.6 kB +10.0 kB (+9.0%) 328 B no change
sdk 112.0 kB +7.4 kB (+7.1%) 755 B -7561 B (-90.9%)
data-prefetch 118.8 kB +6.0 kB (+5.3%) 105 B no change
error-codes 11.8 kB +5.4 kB (+85.5%) 189 B -650 B (-77.5%)
managers 70.0 kB +5.3 kB (+8.1%) 334 B no change
bridge-react 356.7 kB -2970 B (-0.8%) 1.3 kB +3 B (+0.2%)
runtime-tools 4.8 kB +1.2 kB (+33.7%) 95 B -37 B (-28.0%)
runtime 17.1 kB -768 B (-4.2%) 634 B -124 B (-16.4%)
inject-external-runtime-core-plugin 5.4 kB +360 B (+7.0%) 548 B +3 B (+0.6%)
enhanced 1.29 MB -180 B (-0.0%) 744 B no change
rspack 58.3 kB +78 B (+0.1%) 211 B no change

Total dist: 6.71 MB (-189733 B (-2.6%))
Total ESM gzip: 79.0 kB (-61050 B (-43.0%))

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abd52781ca

ℹ️ 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".

Comment on lines +2 to +6
'@module-federation/webpack-bundler-runtime': patch
'@module-federation/runtime-core': patch
'@module-federation/utilities': patch
'@module-federation/node': patch
'@module-federation/sdk': patch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing changesets for modified publishable packages

This commit changes behavior/exports in additional publishable packages (for example @module-federation/runtime-tools, @module-federation/data-prefetch, @module-federation/enhanced, @module-federation/rspack, and @module-federation/inject-external-runtime-core-plugin), but they are not listed in any changeset, so release automation will skip versioning/publishing those updates and users will not receive the shipped fixes. This also violates the repository rule in AGENTS.md (“If a publishable package behavior changes, add a changeset”).

Useful? React with 👍 / 👎.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/devtools@ef7c273

@module-federation/cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/cli@ef7c273

create-module-federation

pnpm add https://pkg.pr.new/module-federation/core/create-module-federation@ef7c273

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/data-prefetch@ef7c273

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/dts-plugin@ef7c273

@module-federation/enhanced

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/enhanced@ef7c273

@module-federation/error-codes

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/error-codes@ef7c273

@module-federation/managers

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/managers@ef7c273

@module-federation/manifest

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/manifest@ef7c273

@module-federation/metro

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro@ef7c273

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnc-cli@ef7c273

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnef@ef7c273

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/modern-js-v3@ef7c273

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/retry-plugin@ef7c273

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rsbuild-plugin@ef7c273

@module-federation/rspack

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspack@ef7c273

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspress-plugin@ef7c273

@module-federation/runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime@ef7c273

@module-federation/runtime-core

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-core@ef7c273

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-tools@ef7c273

@module-federation/sdk

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/sdk@ef7c273

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/third-party-dts-extractor@ef7c273

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-frontend@ef7c273

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-server@ef7c273

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/webpack-bundler-runtime@ef7c273

@module-federation/bridge-react

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react@ef7c273

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react-webpack-plugin@ef7c273

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-shared@ef7c273

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-vue3@ef7c273

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/inject-external-runtime-core-plugin@ef7c273

commit: ef7c273

ScriptedAlchemy and others added 16 commits February 18, 2026 00:28
Use tsdown define-based format branching in sdk node loader.
Remove nextjs-mf rollup leftovers and emit both cjs and esm outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace tsup-based build configs and Nx commands with tsdown for the remaining package set, and update native-federation-tests runtime usage/types to tsdown. Remove obsolete tsup configs and refresh the lockfile.

Co-authored-by: Cursor <cursoragent@cursor.com>
Centralize non-webpack require access in sdk bundler helpers and switch
node/sdk runtime loaders to explicit IS_ESM_BUILD if/else branches so ESM
outputs avoid eval('require') while CJS keeps native require behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove unused legacy rollup config files left after migration.
Align package exports with emitted cjs/mjs and d.cts/d.mts outputs.
Fail fast when data-prefetch runtime plugin files cannot be resolved.

Co-authored-by: Cursor <cursoragent@cursor.com>
…nching

Fix dts-plugin publint failure by emitting .mjs for ESM output and
splitting exports into proper import/require conditions. Fix node
runtimePlugin and stratagies to use createRequire(import.meta.url) in
ESM branches instead of bare require('node:module').

Co-authored-by: Cursor <cursoragent@cursor.com>
Rolldown's dead-code elimination needs explicit if/else blocks rather
than early returns to fully remove the unused branch from each build
target output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The Jest test runner uses tsconfig with module:commonjs which rejects
import.meta (TS1343). These lines are tree-shaken in CJS builds and
only execute in ESM output where import.meta is valid.

Co-authored-by: Cursor <cursoragent@cursor.com>
…est output

Use explicit getNodeRequire branching for ESM and CJS compatibility.
Align native federation test bundles to emit CJS `.js` for existing assertions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore third-party-dts-extractor to the tsup build flow used on main.
Reinstate tsup as a workspace dev dependency for extractor build and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants