fix(esbuild): honor absWorkingDir for remote output - #5097
Open
ScriptedAlchemy wants to merge 16 commits into
Open
ScriptedAlchemy wants to merge 16 commits into
ScriptedAlchemy wants to merge 16 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🦋 Changeset detectedLatest commit: 9f7dc23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/metro-plugin-rock
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/observability-plugin
@module-federation/playground
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/rstest
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
ScriptedAlchemy
force-pushed
the
rfc5036/04-runtime-image-cache
branch
from
September 18, 2026 15:50
2d87526 to
92b0669
Compare
ScriptedAlchemy
force-pushed
the
rfc5036/05-esbuild-rollout
branch
from
September 18, 2026 15:55
57e443d to
012bbb2
Compare
ScriptedAlchemy
force-pushed
the
rfc5036/04-runtime-image-cache
branch
from
September 18, 2026 16:10
92b0669 to
c919e89
Compare
Resolve generated remote-entry files from esbuild's configured working directory. Test the public adapter without process-directory or resolver overrides.
ScriptedAlchemy
force-pushed
the
rfc5036/05-esbuild-rollout
branch
from
September 18, 2026 16:10
012bbb2 to
18957e7
Compare
writeRemoteManifest resolved the host package.json and wrote mf-manifest.json against process.cwd() instead of esbuild's absWorkingDir, same bug as the remote-entry rewrite fixed earlier on this branch. A build run from a different directory than its absWorkingDir wrote the manifest to the wrong place. Read absWorkingDir once at build setup and share it through a resolveFromWorkingDir helper used by the remote-entry rewrite, the manifest path, and the package.json lookup. Add a regression test that builds from a temp directory under os.tmpdir(), outside the package folder, and asserts the remote entry no longer contains __MODULE_MAP__ and the manifest lands under that build's own output directory.
The package.json lookup for the manifest build name resolves an absolute `/package.json` and falls back to the config name, as on main. Reading the package.json under absWorkingDir would change `buildName` for every build, so this PR only moves where the manifest is written.
This was referenced Sep 25, 2026
This was referenced Sep 25, 2026
ScriptedAlchemy
force-pushed
the
rfc5036/04-runtime-image-cache
branch
from
September 26, 2026 04:59
2d3ecfc to
f32aae6
Compare
ScriptedAlchemy
force-pushed
the
rfc5036/05-esbuild-rollout
branch
from
September 26, 2026 04:59
dc887b5 to
9f7dc23
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of RFC #5036. An alternate proposal is open at #5128 with its own stack. This PR stays open until the decision on #5036 is made.
Stack: 5 of 7. Base: #5096 (
rfc5036/04-runtime-image-cache). Next: #5098.Landing order: #5093 → #5094 → #5095 → #5096 → #5097 → #5098 → #5107.
What changes
An esbuild build whose
absWorkingDirdiffers fromprocess.cwd()now rewrites the right remote entry and writesmf-manifest.jsonto its own output directory. Before, theonEndrewrite resolved the metafile path from the process directory, andwriteRemoteManifestwrote the manifest againstprocess.cwd(). The manifest landed in the wrong place and could leave stray files behind. Other builds keep the same output.Output paths now come from one
absWorkingDir || process.cwd()read at build setup, shared by the remote-entry rewrite and the manifest path. The manifestbuildNamelookup is unchanged.This PR does not add condition selection to esbuild. It adds a regression test that the adapter still bundles the full runtime, which the adapter needs until a separate design for package conditions exists.
Verification
The branch history was rewritten on 2026-09-26 to remove attribution trailers from commit messages only. Every tree and patch is identical to the verified head;
9f7dc2319is the rewritten tip.The esbuild package now has a test script. One test runs a temporary producer through the public
moduleFederationPluginand requires container, remote, and shared runtime modules in the emitted graph.A second test builds from a directory outside the repo. It checks that the rewritten remote entry no longer contains the
__MODULE_MAP__placeholder and thatmf-manifest.jsonlands under that build's output directory, not next to the package source. Neither test changes the process directory or adds a custom resolver path.The esbuild build, test, and lint, Prettier, and
git diff --checkpass. Publint finished with the package's existing export warnings.CI at
9f7dc2319passed 9 checks, cancelled 4, and skipped 23.The 4 cancelled checks are
checkout-installandnode20-compatin Build Affected Packages,lint-depsin Lint Dependencies, andpublish-previewin pkg.pr.new Preview. Those three workflows each ran twice on this commit. They setcancel-in-progress: trueper PR, so the second run cancelled the first about a second after it started. The second run of each workflow passed on the same commit. The cancelled runs were not rerun.12 skipped checks are the jobs of the cancelled Build Affected Packages run, which wait on
checkout-install. The other 11 are the end-to-end suites in the second run, becausetools/scripts/ci-is-affected.mjsselected none of them for this diff. No end-to-end suite ran at this head.Deviations from the RFC
None noted.
Overlaps with open PRs
packages/esbuild/package.json. This PR does not include that change.absWorkingDirfix onmain(commit1b4ff2e7b), plus the manifest's shared-version lookup, which this PR does not include. The next merge ofmaininto this stack will conflict inpackages/esbuild/src/adapters/lib/plugin.tsandmanifest.ts; takemain's side.