Skip to content

fix: override only existing searchParams #1509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbroma
Copy link
Contributor

@jbroma jbroma commented May 27, 2025

Summary

Part of #1480

When implementing Module Federation for Metro, we're reusing existing lazy bundling for production bundles, and we wanted to clean up the bundlePaths for the production bundles by not adding any query params to it. Since the searchParams are entirely based on sourceUrl, we can avoid adding searchParams by having a clean sourceUrl.

This PR does two things:

  • - it makes the override of runModule & modulesOnly params happen only when those params are present
  • - prevents adding ? to the URL when there are no searchParams

Changelog: [Fix] Only override existing runModule & modulesOnly search params when processing bundle async paths

Note

Marking this as fix since the spec mentions overriding params and not setting them

Test plan

  • - existing tests pass

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels May 27, 2025
@vzaidman
Copy link
Contributor

Hey!
When spec mentions overriding params and not setting them?

@jbroma
Copy link
Contributor Author

jbroma commented May 28, 2025

hey @vzaidman 👋, I've taken that from here:

test('async bundle paths override modulesOnly and runModule', () => {

(although that might have been an over-interpretation on my side 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants