Skip to content

Comments

Metro windows path resolution#4442

Draft
ScriptedAlchemy wants to merge 7 commits intomainfrom
cursor/metro-windows-path-resolution-47f0
Draft

Metro windows path resolution#4442
ScriptedAlchemy wants to merge 7 commits intomainfrom
cursor/metro-windows-path-resolution-47f0

Conversation

@ScriptedAlchemy
Copy link
Member

Description

Fixes an issue where Babel transformer paths were incorrectly handled on Windows due to invalid backslash escapes. This is resolved by:

  • Escaping the injected Babel transformer path using a JSON string literal.
  • Updating the transformer template to use require(...) without quotes for safe path replacement.
  • Adding a new unit test for metro-core to validate Windows path escaping.

Related Issue

No explicit issue provided, addresses a general "fix this" request related to Windows path handling.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Open in Cursor Open in Web

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 15, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@cursor cursor bot mentioned this pull request Feb 15, 2026
5 tasks
@netlify
Copy link

netlify bot commented Feb 15, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 2b12b3b
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69969041d543b600082bb20f
😎 Deploy Preview https://deploy-preview-4442--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 15, 2026

⚠️ No Changeset found

Latest commit: 2b12b3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2026

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/data-prefetch

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js-v3

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 2b12b3b

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

Bundle Size Report

1 package(s) changed, 40 unchanged.

Package Total dist Delta ESM gzip Delta
metro-core 222.6 kB +4.0 kB (+1.8%) 147 B no change

Total dist: 6.89 MB (+4.0 kB (+0.1%))
Total ESM gzip: 138.6 kB (no change)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

Android Release APK for all devices

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:38:19.776Z UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

iOS Release APP for simulators

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:41:03.386Z UTC

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

two nits


describe('createBabelTransformer', () => {
it('escapes Windows paths for require()', () => {
const tmpDirPath = fs.mkdtempSync(path.join(os.tmpdir(), 'mf-metro-'));
Copy link
Member

Choose a reason for hiding this comment

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

memfs perhaps?

Comment on lines +30 to +37
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/metro-core"],
"options": {
"jestConfig": "packages/metro-core/jest.config.ts",
"passWithNoTests": true
}
Copy link
Member

Choose a reason for hiding this comment

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

needs aligning with main, uses vitest now

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.

3 participants