Skip to content
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

fix(runtime): use loaded or loading shared if sharedStrategy is loaded-first #3176

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

2heal1
Copy link
Member

@2heal1 2heal1 commented Nov 5, 2024

Description

use loaded or loading shared if sharedStrategy is loaded-first

Related Issue

#3170

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.

Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: d390af5

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/runtime Patch
@module-federation/devtools Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/runtime-tools Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/enhanced Patch
@module-federation/modern-js Patch
@module-federation/rspack 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

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit d390af5
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/6729e01e619cba0008533b82
😎 Deploy Preview https://deploy-preview-3176--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

This pull request addresses an issue with the "loaded-first" shared module strategy in the runtime. The key changes are:

  • Introduced a new isLoading function to check if a shared module is in the loading state.
  • Updated the findSingletonVersionOrderByLoaded function to consider both loaded and loading states when determining the order of shared module versions.

These changes ensure that the "loaded-first" strategy correctly handles cases where a shared module is in the loading state, improving the overall reliability and robustness of the runtime's shared module management.

The pull request includes comprehensive test coverage to validate the new functionality and ensure no regressions. Additionally, the documentation has been updated to reflect these changes.

File Summaries
File Summary
packages/runtime/src/utils/share.ts The code changes introduce a new function isLoading to check if a shared module is in the loading state. Additionally, the findSingletonVersionOrderByLoaded function has been updated to consider both loaded and loading states when determining the order of shared module versions.

@2heal1 2heal1 force-pushed the fix/loaded-first-strategy branch from 3b95870 to d390af5 Compare November 5, 2024 09:06
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: 3

Configuration

Squadron Mode: essential

Commits Reviewed

849ef9c32fe97ff45b7dceba68903fce5c5326cd...d390af5c0de09bc8c038857be1671d9026ad1819

Files Reviewed
  • packages/runtime/src/utils/share.ts
Files Ignored

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

  • .changeset/bright-guests-sip.md
  • packages/runtime/tests/get-registered-share.spec.ts

packages/runtime/src/utils/share.ts Show resolved Hide resolved
packages/runtime/src/utils/share.ts Show resolved Hide resolved
packages/runtime/src/utils/share.ts Show resolved Hide resolved
@2heal1 2heal1 merged commit 752537b into main Nov 5, 2024
20 checks passed
@2heal1 2heal1 deleted the fix/loaded-first-strategy branch November 5, 2024 10:43
@2heal1 2heal1 mentioned this pull request Nov 5, 2024
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.

2 participants