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

feat(enhanced): layers support in module code generation #3371

Merged
merged 2 commits into from
Dec 29, 2024

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Dec 18, 2024

Description

This pull request includes several changes to the packages/enhanced module, focusing on adding support for layers in shared modules and updating test cases to verify the new functionality. The most important changes include modifications to various classes to handle the layer property, updates to utility functions, and the addition of new test cases.

Enhancements to shared module handling:

Updates to utility functions:

New test cases:

  • Added a comprehensive set of test cases in packages/enhanced/test/configCases/container/3-layers-full and packages/enhanced/test/configCases/container/4-layers-full to verify the correct handling of layers in shared modules. These test cases include new components, configuration files, and scripts to simulate different scenarios. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Related Issue

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 Dec 18, 2024

🦋 Changeset detected

Latest commit: 8f94b54

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/enhanced Major
@module-federation/modern-js Major
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Major
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/runtime Major
@module-federation/rspack Major
@module-federation/webpack-bundler-runtime Major
@module-federation/sdk Major
@module-federation/runtime-tools Major
@module-federation/managers Major
@module-federation/manifest Major
@module-federation/dts-plugin Major
@module-federation/third-party-dts-extractor Major
@module-federation/devtools Major
@module-federation/bridge-react Major
@module-federation/bridge-vue3 Major
@module-federation/bridge-shared Major
@module-federation/bridge-react-webpack-plugin Major
@module-federation/retry-plugin Major
@module-federation/data-prefetch Major
@module-federation/error-codes Major
@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

@ScriptedAlchemy ScriptedAlchemy changed the base branch from main to consume-share-layers December 18, 2024 06:50
Copy link

netlify bot commented Dec 18, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 8f94b54
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/676270c2e6029100083fe39a
😎 Deploy Preview https://deploy-preview-3371--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 introduces several enhancements to the @module-federation/enhanced package, focusing on adding support for layers and improving the handling of shared modules. The key changes include:

  • Addition of layer support in various plugins and modules, such as ConsumeSharedModule, ConsumeSharedPlugin, and ProvideSharedDependency. This allows for better control and management of shared module dependencies across different layers.
  • Refactoring of type definitions and serialization methods to accommodate the new layer functionality, ensuring seamless integration with the existing codebase.
  • Updates to the package.json file, including the addition of a new script for running Jest tests with experimental VM modules and an upgrade to the webpack-cli dependency.

These enhancements improve the overall flexibility and functionality of the @module-federation/enhanced package, allowing for more robust and layer-aware module sharing capabilities in module federation-based applications.

File Summaries
File Summary
packages/enhanced/src/lib/sharing/ProvideSharedModule.ts This pull request introduces several enhancements to the @module-federation/enhanced package, focusing on adding support for layers and improving the handling of shared modules. The key changes include the addition of layer support in various plugins and modules, updates to the package.json file, and refactoring of type definitions and serialization methods to accommodate the new layer functionality.
packages/enhanced/src/lib/sharing/ProvideSharedModuleFactory.ts This pull request introduces several enhancements to the @module-federation/enhanced package, primarily focused on adding support for layers and improving the handling of shared modules. The key changes include updates to the ConsumeSharedModule, ConsumeSharedPlugin, and ProvideSharedDependency classes to incorporate layer options, as well as refactoring of serialization methods and type definitions to accommodate the new layer functionality. Additionally, the package.json file has been updated with a new script for running Jest tests with experimental VM modules and an updated webpack-cli dependency.
packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts The code changes in this pull request focus on adding support for layers in the @module-federation/enhanced package, particularly in the ConsumeSharedModule, ConsumeSharedPlugin, and ProvideSharedDependency components. The updates include refactoring the serialization methods, enhancing the handling of shared modules, and introducing layer support in various plugins and modules to improve the overall functionality and flexibility of the package.
packages/enhanced/src/lib/sharing/ShareRuntimeModule.ts The code changes in this pull request focus on adding support for layers and improving the handling of shared modules in the @module-federation/enhanced package. The key modifications include:
  1. Refactoring the ConsumeSharedModule to include layer options and updating the module's serialization methods to handle layers.

  2. Updating the ConsumeSharedPlugin to use the new layer options and improving the handling of composite keys for module resolution.

  3. Enhancing the ProvideSharedDependency to include layer information and updating its serialization methods accordingly.

  4. Introducing layer support for the ProvideSharePlugin.

  5. Updating the package.json file with a new script for running Jest tests with experimental VM modules and upgrading the webpack-cli dependency. |
    | packages/enhanced/src/lib/sharing/utils.ts | The code changes in this pull request focus on enhancing the @module-federation/enhanced package by adding support for layers and improving the handling of shared modules. The key modifications include:

  6. Introducing layer support for the ProvideSharePlugin and refactoring the ConsumeSharedModule to include layer options and update the module's serialization methods to handle layers.

  7. Updating the ConsumeSharedPlugin to use the new layer options and improve the handling of composite keys for module resolution.

  8. Enhancing the ProvideSharedDependency to include layer information and updating its serialization methods accordingly.

  9. Updating the package.json file with a new script for running Jest tests with experimental VM modules and upgrading the webpack-cli dependency. |

@ScriptedAlchemy ScriptedAlchemy merged commit 0c665be into consume-share-layers Dec 29, 2024
20 of 21 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the federation-layers branch December 29, 2024 08:08
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.

1 participant