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): ProvideSharedPlugin loader layer support #3334

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Dec 9, 2024

Description

This pull request introduces several enhancements to the shared module consumption and provisioning in the packages/enhanced library. The primary changes include adding support for a new layer property and improving the handling of configuration options.

Enhancements to shared module consumption and provisioning:

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 9, 2024

⚠️ No Changeset found

Latest commit: dd18cb2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy ScriptedAlchemy force-pushed the provide-share-layers branch 2 times, most recently from 76d840b to 8c0fb76 Compare December 10, 2024 00:03
@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review December 12, 2024 00:05
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 core changes in this pull request focus on enhancing the shared module consumption and provisioning functionality in the packages/enhanced library. The key improvements include:

  • Adding support for a new layer property in the ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin classes. This allows for better organization and management of shared modules by providing an additional context layer.
  • Updating the handling of configuration options, such as incorporating the layer property into module identifiers and serialization. This ensures that the additional context is properly captured and utilized.
  • Modifying the schema validation for ProvideOptions to include the new layer and request properties, enforcing the enhanced functionality.

These changes aim to improve the overall flexibility and control over the provisioning and consumption of shared dependencies within the packages/enhanced library. The updates to the various sharing-related classes and the schema validation help to provide a more robust and extensible shared module management system.

File Summaries
File Summary
packages/enhanced/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts The code changes in this pull request focus on enhancing the shared module consumption and provisioning functionality in the packages/enhanced library. The primary changes include:
  1. Adding support for a new layer property in the ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin classes, allowing for better organization and management of shared modules.

  2. Improving the handling of configuration options, such as incorporating the layer property into module identifiers and serialization, to ensure that the additional context is properly captured and utilized.

  3. Updating the schema validation for ProvideOptions to include the new layer and request properties, ensuring that the enhanced functionality is properly validated and enforced. |
    | packages/enhanced/src/lib/sharing/ConsumeSharedModule.ts | The code changes introduce several enhancements to the shared module consumption and provisioning in the packages/enhanced library. The primary changes include adding support for a new layer property and improving the handling of configuration options across various classes, such as ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin. These changes ensure that the layer information is properly incorporated into module identifiers, serialization, and the overall plugin logic, enabling more granular control and management of shared module dependencies. |
    | packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts | The code changes in this pull request focus on enhancing the shared module consumption and provisioning functionality in the packages/enhanced library. The primary changes include:

  4. Adding support for a new layer property in the ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin classes, ensuring that the layer information is included in identifiers and serialization.

  5. Updating the ConsumeSharedPlugin class to handle the new layer property in the contextInfo object when creating lookup keys.

  6. Modifying the schema validation for ProvideOptions to include the new layer and request properties.

These changes aim to improve the handling of shared module configurations and provide more flexibility in managing the provisioning and consumption of shared dependencies. |
| packages/enhanced/src/lib/sharing/ProvideSharedDependency.ts | The code changes in this pull request focus on enhancing the shared module consumption and provisioning in the packages/enhanced library. The key modifications include:

  1. Adding support for a new layer property in the ProvideSharedDependency and ProvideSharedModule classes, ensuring that layer information is included in module identifiers and serialization.
  2. Updating the ProvideSharedPlugin class to handle the layer property in ProvideOptions and incorporating it into the plugin's logic for creating lookup keys and resolving module configurations.
  3. Modifying the schema validation in ProviderSharedPlugin.check.ts to include the new layer and request properties for ProvideOptions.

These changes aim to improve the handling of shared module configurations and provide more flexibility in managing module dependencies across different layers or contexts within the application. |
| packages/enhanced/src/lib/sharing/ProvideSharedModule.ts | The code changes in this pull request focus on enhancing the shared module consumption and provisioning functionality in the packages/enhanced library. The key modifications include:

  1. Adding support for a new layer property in the ProvideSharedDependency and ProvideSharedModule classes, which allows for better handling of module identifiers and serialization when dealing with shared dependencies.
  2. Updating the ProvideSharedPlugin class to incorporate the layer property in the ProvideOptions and modifying the plugin logic to handle the layer information when creating lookup keys and resolving module configurations.
  3. Modifying the schema validation in ProviderSharedPlugin.check.ts to include the new layer and request properties for ProvideOptions.

These changes aim to improve the overall functionality and flexibility of the shared module management system in the packages/enhanced library. |
| packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts | The code changes in this pull request introduce several enhancements to the shared module consumption and provisioning in the packages/enhanced library. The primary changes include adding support for a new layer property and improving the handling of configuration options in the ProvideSharedPlugin class.

The key modifications are:

  1. Updating the createLookupKey function to handle the new layer property in contextInfo.

  2. Adding the layer property to the ProvideSharedDependency class and updating its methods to include layer information in identifiers and serialization.

  3. Incorporating the layer property into the ProvideSharedModule class and its methods, ensuring that layer information is included in module identifiers and serialization.

  4. Enhancing the ProvideSharedPlugin class to support the layer property in ProvideOptions and updating the plugin logic to handle the layer information when creating lookup keys and resolving module configurations.

  5. Modifying the schema validation to include the new layer and request properties for ProvideOptions. |
    | packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.check.ts | The code changes in this pull request focus on enhancing the shared module consumption and provisioning in the packages/enhanced library. The key modifications include:

  6. Adding support for a new layer property in the ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin classes, ensuring that layer information is included in identifiers and serialization.

  7. Updating the ProvideSharedPlugin class to handle the layer property in ProvideOptions and incorporate it into the plugin's logic for creating lookup keys and resolving module configurations.

  8. Modifying the schema validation in ProviderSharedPlugin.check.ts to include the new layer and request properties for ProvideOptions.

These changes aim to enhance the shared module consumption and provisioning functionality in the packages/enhanced library, providing more flexibility and control over the handling of shared dependencies. |
| packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.ts | The code changes in this pull request focus on enhancing the shared module consumption and provisioning functionality in the packages/enhanced library. The key modifications include:

  1. Adding support for a new layer property in the ProvideSharedDependency, ProvideSharedModule, and ProvideSharedPlugin classes, ensuring that module identifiers and serialization include the layer information.
  2. Updating the ProvideSharedPlugin class to handle the layer property in ProvideOptions and incorporate it into the plugin's logic for creating lookup keys and resolving module configurations.
  3. Modifying the schema validation in ProviderSharedPlugin.check.ts to include the new layer and request properties for ProvideOptions.

These changes aim to enhance the flexibility and functionality of the shared module provisioning system, allowing for more granular control and organization of shared dependencies within the packages/enhanced library. |
| packages/enhanced/test/configCases/sharing/layers-provides-loader/src/index.js | This pull request introduces several enhancements to the shared module consumption and provisioning in the packages/enhanced library. The primary changes include adding support for a new layer property and improving the handling of configuration options across various classes and modules related to shared module management. |

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: 16

Configuration

Squadron Mode: essential

Commits Reviewed

6f8f45e1449d45512085f9cf1a89fd6ee3662c27...dd18cb225ad4e432e308981e13ce7f7f2f288e00

Files Reviewed
  • packages/enhanced/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts
  • packages/enhanced/src/lib/sharing/ProvideSharedDependency.ts
  • packages/enhanced/src/lib/sharing/ProvideSharedModule.ts
  • packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts
  • packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.check.ts
  • packages/enhanced/src/schemas/sharing/ProviderSharedPlugin.ts
  • packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts
Files Ignored

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

  • .changeset/shy-snails-battle.md
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/.gitignore
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/loaders/different-layer-loader.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/loaders/explicit-layer-loader.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/loaders/multi-pkg-layer-loader.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/loaders/react-layer-loader.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/node_modules/lib2/index.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/node_modules/multi-pkg/thing1.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/node_modules/multi-pkg/thing2.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/node_modules/react/index.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/node_modules/react/index2.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/package.json
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/shared/react-boundary.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/test.config.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/tests/different-layers.test.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/tests/lib-two.test.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/tests/prefixed-share.test.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/tests/unlayered-share.test.js
  • packages/enhanced/test/configCases/sharing/layers-provides-loader/webpack.config.js

@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 12, 2024
@ScriptedAlchemy ScriptedAlchemy merged commit 875f516 into consume-share-layers Dec 12, 2024
9 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the provide-share-layers branch December 12, 2024 21:26
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