Skip to content

fix: loading of 2nd level MF2 remotes#856

Merged
jbroma merged 3 commits intomainfrom
fix/federation-library-type
Jan 8, 2025
Merged

fix: loading of 2nd level MF2 remotes#856
jbroma merged 3 commits intomainfrom
fix/federation-library-type

Conversation

@jbroma
Copy link
Member

@jbroma jbroma commented Jan 8, 2025

Summary

If the library config is not set to script, MF2 will not handle 2nd level remotes correctly (as in remotes of remotes). This can be currently observed in the super app showcase where it fails to load AccountScreen inside of any of the MiniApps.

Setting library type to script results in preloadAssets flow being trigger, so to counter this I've added a noop handler inside generatePreloadAssets hook. This is not needed anyways since when this method is called the assets (chunks of the remote) are already loaded into the container variable in the global scope. Setting this to a noop avoids a flow which is tailored for the browser environment (with document object present)

This should most likely be fixed in MF2 core itself but the solution to a similar issue boils down to using script as a workaround for now.

Test plan

  • - 2nd level remotes load in super app showcase

@vercel
Copy link

vercel bot commented Jan 8, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
repack-website ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 0:05am

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2025

🦋 Changeset detected

Latest commit: 106a242

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

This PR includes changesets to release 4 packages
Name Type
@callstack/repack 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

@jbroma jbroma merged commit 9570c83 into main Jan 8, 2025
4 checks passed
@jbroma jbroma deleted the fix/federation-library-type branch January 8, 2025 12:47
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