fix(runtime): use loaded or loading shared if sharedStrategy is loaded-first#3176
fix(runtime): use loaded or loading shared if sharedStrategy is loaded-first#3176
Conversation
🦋 Changeset detectedLatest commit: d390af5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
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 |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Summary
This pull request addresses an issue with the "loaded-first" shared module strategy in the runtime. The key changes are:
- Introduced a new
isLoadingfunction to check if a shared module is in the loading state. - Updated the
findSingletonVersionOrderByLoadedfunction 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. |
3b95870 to
d390af5
Compare
There was a problem hiding this comment.
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
Description
use loaded or loading shared if sharedStrategy is loaded-first
Related Issue
#3170
Types of changes
Checklist