Skip to content

Conversation

ScriptedAlchemy
Copy link
Member

Summary

  • Replace Rollup with RSLib to simplify configuration and speed up builds
  • Switch Nx target to run rslib; add rslib.config.ts and @rslib/core
  • Remove Rollup config/deps; update ESLint ignore and tsconfig rootDir
  • Improve runtime sourcemaps for better debugging
  • Remove obsolete main.py; refresh lockfile

Details

This modernizes the esbuild package build:

  • Use @rslib/core for dual ESM/CJS outputs with DTS once from ESM
  • Keep MF runtime packages external; copy src/resolve to dist
  • Respect FEDERATION_DEBUG by switching to iife/var and disabling externals for debug output

Impact

  • Smaller, simpler build pipeline with fewer moving parts
  • Clearer sourcemaps in runtime for easier debugging
  • No breaking public API changes expected

Testing

  • pnpm -w build:pkg and pnpm -w test:pkg should pass
  • nx run esbuild:build:debug now proxies to rslib build with FEDERATION_DEBUG=true

Notes

Lockfile changes include adding @rslib/core and removing Rollup deps for esbuild package only.

Replace Rollup with RSLib to simplify config and speed builds.

- Switch Nx target to run rslib; add rslib.config.ts and @rslib/core

- Remove rollup config and dependencies; update eslint ignore

- Set tsconfig rootDir for esbuild

- Improve runtime sourcemaps for debugging

- Remove obsolete main.py and update lockfile
Copy link

changeset-bot bot commented Sep 8, 2025

🦋 Changeset detected

Latest commit: 467614b

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

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

Copy link

netlify bot commented Sep 8, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 467614b
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/68c3e33f87f56300085132e2
😎 Deploy Preview https://deploy-preview-4048--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.

@ScriptedAlchemy
Copy link
Member Author

@codex double check pr

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 suggestions.

"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",

[P1] Align esbuild package exports with rslib output filenames

The new rslib build emits default filenames like dist/index.js and dist/index.mjs for the CJS/ESM bundles, but the package metadata still points at dist/index.cjs.js and dist/index.esm.js (and the sub‑exports reference plugin.cjs.js, plugin.esm.js, etc.). After this migration the referenced files will not be generated, so requiring or importing @module-federation/esbuild or its subpaths will throw MODULE_NOT_FOUND. Configure rslib’s output to keep the old naming scheme or update these paths to the names rslib actually produces.


Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

@ScriptedAlchemy
Copy link
Member Author

@codex fix comments and also add a changeset

Copy link

Summary

Testing

  • ⚠️ pnpm -w build:pkg (failed: No existing Nx Cloud client and failed to download new version)
  • ⚠️ pnpm -w test:pkg (failed: No existing Nx Cloud client and failed to download new version)

View task →

@ScriptedAlchemy
Copy link
Member Author

@codex can we remove the sourcemap changes done to the runtime rollup config?

Copy link

Summary

  • Removed custom sourcemap options (sourcemapExcludeSources and sourcemapPathTransform) from the runtime Rollup configuration, reverting to Rollup’s default sourcemap behavior and retaining only sourcemap: true before chunk and filename settings packages/runtime/rollup.config.cjsL26-L67

Testing

  • ⚠️ NX_CLOUD_DISABLED=true pnpm -w build:pkg — No existing Nx Cloud client and failed to download new version
  • ⚠️ NX_CLOUD_DISABLED=true pnpm -w test:pkg — No existing Nx Cloud client and failed to download new version

View task →

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.

1 participant