Skip to content

Conversation

@2heal1
Copy link
Member

@2heal1 2heal1 commented Nov 12, 2024

Description

When shareStrategy is 'version-first' , it should make sure the remote shareScopeMap have been registered yet . So it should call initializeSharing before executing loadRemote/loadShare

Related Issue

#3209

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.

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2024

🦋 Changeset detected

Latest commit: 2708f0c

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

This PR includes changesets to release 27 packages
Name Type
@module-federation/webpack-bundler-runtime Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/nextjs-mf Patch
@module-federation/runtime-tools Patch
@module-federation/devtools Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/rspack Patch
@module-federation/modern-js Patch
@module-federation/rsbuild-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/sdk Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/error-codes Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
website-new 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

@netlify
Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 0354405
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/673307640349b100077a45b1
😎 Deploy Preview https://deploy-preview-3212--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 site configuration.

Copy link
Contributor

@squadronai squadronai bot left a comment

Choose a reason for hiding this comment

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

Summary

The pull request introduces a bug fix to the remote module in the runtime package. The core change ensures that the initializeSharing function is called before executing loadRemote or loadShare when the shareStrategy is set to 'version-first'. This change helps to ensure that the remote shareScopeMap has been registered before attempting to load the remote module. The change addresses an issue where the remote module may not have been properly registered, causing issues when loading the remote module.

File Summaries
File Summary
packages/runtime/src/remote/index.ts The code changes introduce a fix to ensure that the initializeSharing function is called before executing loadRemote or loadShare when the shareStrategy is set to 'version-first'. This change helps to ensure that the remote shareScopeMap has been registered before attempting to load the remote module.

Copy link
Contributor

@squadronai squadronai bot left a comment

Choose a reason for hiding this comment

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

Incremental Review

Comments posted: 6

Configuration

Squadron Mode: essential

Commits Reviewed

96efa7c9d967fe31f62fdf38ea47b2f71b1d53ce...2708f0cd01a0eee43bbf358560d41051e9d0684e

Files Reviewed
  • packages/runtime/src/core.ts
  • packages/runtime/src/remote/index.ts
Files Ignored

These files were ignored due to the filter in the squadron.yaml file.

  • .changeset/nervous-tomatoes-marry.md
  • packages/webpack-bundler-runtime/src/remotes.ts

@2heal1 2heal1 changed the title WIP: fix: initializeSharing before load remote while shareStrategy is version first fix: initializeSharing before load remote while shareStrategy is version first Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 12, 2024
@2heal1 2heal1 changed the title fix: initializeSharing before load remote while shareStrategy is version first fix: call initializeSharing before load remote while shareStrategy is version first Nov 12, 2024
@zhoushaw zhoushaw merged commit c2b1efa into main Nov 13, 2024
18 checks passed
@zhoushaw zhoushaw deleted the fix/version-first-shared branch November 13, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants