Cursor/ci failures investigation b06f#4462
Conversation
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>
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>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 21e247c The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 packages
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 |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…-to-vanilla-webpack-c57c' into cursor/ci-failures-investigation-b06f # Conflicts: # apps/bundle-size/project.json # apps/docs-ui/project.json # apps/manifest-demo/3009-webpack-provider/project.json # apps/manifest-demo/3010-rspack-provider/project.json # apps/manifest-demo/3011-rspack-manifest-provider/project.json # apps/manifest-demo/3012-rspack-js-entry-provider/project.json # apps/manifest-demo/webpack-host/cypress/support/e2e.ts # apps/manifest-demo/webpack-host/project.json # apps/manifest-demo/webpack-host/webpack.config.js # apps/node-dynamic-remote-new-version/project.json # apps/node-dynamic-remote/project.json # apps/node-remote/project.json # apps/react-ts-host/project.json # apps/react-ts-nested-remote/project.json # apps/react-ts-remote/project.json # apps/reactRemoteUI/project.json # apps/reactStorybook/project.json # apps/runtime-demo/3005-runtime-host/project.json # apps/runtime-demo/3006-runtime-remote/project.json # apps/runtime-demo/3007-runtime-remote/project.json # package.json # pnpm-lock.yaml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 029d3a49ee
ℹ️ 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".
| } else if (process.env['IS_ESM_BUILD'] === 'true') { | ||
| const { createRequire } = | ||
| require('node:module') as typeof import('node:module'); |
There was a problem hiding this comment.
Replace ESM require call with createRequire bootstrap
When the package is consumed through the new ESM export path, process.env.IS_ESM_BUILD is defined as 'true' in the tsdown build config, so this branch is taken and executes require('node:module'). In an actual ESM module, require is undefined, so any runtime path that calls getNodeRequire() will throw ReferenceError: require is not defined before chunk loading can proceed.
Useful? React with 👍 / 👎.
| export { NextFederationPlugin }; | ||
| export default NextFederationPlugin; |
There was a problem hiding this comment.
Restore CommonJS default export compatibility
Removing the module.exports assignment changes the CommonJS API shape from a directly constructible plugin to an export namespace object. That breaks existing usage patterns like const NextFederationPlugin = require('@module-federation/nextjs-mf'); new NextFederationPlugin(...), which now receives an object instead of the class/function and throws at runtime.
Useful? React with 👍 / 👎.
0f49d69
into
cursor/migration-from-nx-webpack-to-vanilla-webpack-c57c
Description
Related Issue
Types of changes
Checklist