Skip to content

fix: include path in MF2 remote public path#1114

Merged
jbroma merged 2 commits into
mainfrom
fix/resolver-plugin-public-path
Apr 3, 2025
Merged

fix: include path in MF2 remote public path#1114
jbroma merged 2 commits into
mainfrom
fix/resolver-plugin-public-path

Conversation

@jbroma
Copy link
Copy Markdown
Contributor

@jbroma jbroma commented Apr 3, 2025

Summary

This PR fixes the incorrect URL rebasing when resolving MF2 remotes. Previously we were only replacing the base URL (without path) and this caused a regression when publicPath of a remote is set to a URL with a path (e.g. http://localhost:8081/ios).

Since all MF2 assets are always generated with a flat directory structure (meaning they will all exist next to each other, in the same directory), we can take the last part of the URL (after last '/') and rebase it onto the publicPath of an entrypoint of a remote.

Examples:

URL Type Example 1 Example 2
Initial URL noop:///asset.js http://localhost:8081/ios/chunk.js
Entry URL https://example.com/ios/mf-manfiest.js https://example.com/ios/entry.js
Target URL https://example.com/ios/asset.js https://example.com/ios/chunk.js

Test plan

  • - tests pass
  • - testers work with both manifests and containers as entrypoints

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 3, 2025

🦋 Changeset detected

Latest commit: 98341ef

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

This PR includes changesets to release 6 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-expo-modules Patch
@callstack/repack-plugin-nativewind Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init 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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repack-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2025 5:08pm

@jbroma jbroma merged commit b98e72f into main Apr 3, 2025
5 checks passed
@jbroma jbroma deleted the fix/resolver-plugin-public-path branch April 3, 2025 17:14
jbroma added a commit that referenced this pull request Apr 3, 2025
* fix: include path in remote public path

* chore: changeset
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