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): Layer via composite shareKey #3415

Merged
merged 37 commits into from
Dec 31, 2024

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Dec 27, 2024

Description

Code Enhancements:

  • ContainerReferencePlugin.ts: Added handling for issuerLayer and context to improve module federation capabilities.
  • RemoteModule.ts: Enhanced the constructor and methods to support optional layer and context parameters, improving modularity and context handling. [1] [2] [3] [4]

Test Cases and Examples:

  • Added new test cases and configurations for layers in the packages/enhanced/test/configCases/layers/ directory, including components and webpack configurations to validate the layer functionality. [1] [2] [3] [4] [5] [6] [7] [8] [9]

These changes collectively enhance the project's modularity, configuration management, and testing capabilities, particularly in the context of module federation and layer handling.

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

⚠️ No Changeset found

Latest commit: 8dc6ff0

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 changed the title Second attempt runtime layer Layer via composite shareKey Dec 28, 2024
…tion

- Consolidated common configuration for module federation across multiple layers.
- Introduced separate configurations for commonjs and module outputs.
- Updated shared dependencies and remotes for improved modularity and compatibility.
- Enhanced support for React with layer-specific configurations.
- Fixed missing semicolon in emptyComponent.js.
- Updated App.js to remove unnecessary blank line.
- Enhanced index.js test case formatting for better readability.
- Adjusted spacing in layered-react-loader.js for consistency.
@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review December 28, 2024 04:15
Base automatically changed from federation-layers to consume-share-layers December 29, 2024 08:08
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 several enhancements to improve the modularity, configuration management, and testing capabilities of the project, particularly in the context of module federation and layer handling. The key changes include:

  • Added handling for issuerLayer and context in the ContainerReferencePlugin to improve module federation capabilities.
  • Enhanced the constructor and methods of the RemoteModule class to support optional layer and context parameters, improving modularity and context handling.
  • Added new test cases and configurations for layers in the packages/enhanced/test/configCases/layers/ directory, including components and webpack configurations to validate the layer functionality.

These changes collectively aim to enhance the project's overall flexibility, maintainability, and robustness in handling module federation and layering scenarios, enabling more advanced use cases and better configuration management.

File Summaries
File Summary
packages/enhanced/src/lib/sharing/ProvideSharedModule.ts The code changes enhance the ProvideSharedModule class by adding support for a layer property, which improves the module federation capabilities of the application. This change allows for better modularity and context handling, enabling more flexible and configurable module sharing across different parts of the application.
packages/enhanced/src/lib/sharing/ProvideSharedModuleFactory.ts The code changes enhance the project's modularity and configuration management capabilities, particularly in the context of module federation and layer handling. Key modifications include adding support for issuerLayer and context parameters in the ContainerReferencePlugin, and expanding the constructor and methods of the RemoteModule class to handle optional layer and context parameters, improving modularity and context handling.
packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts The code changes enhance the ProvideSharedPlugin class by adding support for an optional layer parameter in the ShareConfig object. This improvement allows for better modularity and context handling in the module federation capabilities of the project.
packages/enhanced/src/lib/sharing/SharePlugin.ts These changes enhance the SharePlugin to support optional "layer" and "context" parameters, improving modularity and context handling in the module federation capabilities of the project. The key modifications include:
  1. Added handling for issuerLayer and context in the ContainerReferencePlugin.ts file to improve module federation capabilities.
  2. Enhanced the constructor and methods in the RemoteModule.ts file to support optional layer and context parameters, improving modularity and context handling.
  3. Added new test cases and configurations for layers in the packages/enhanced/test/configCases/layers/ directory, including components and webpack configurations to validate the layer functionality.

These changes collectively enhance the project's modularity, configuration management, and testing capabilities, particularly in the context of module federation and layer handling. |
| packages/enhanced/src/lib/sharing/ShareRuntimeModule.ts | These changes enhance the project's modularity, configuration management, and testing capabilities, particularly in the context of module federation and layer handling. The key modifications include:

  1. Improved handling of issuerLayer and context in the ContainerReferencePlugin to enhance module federation capabilities.
  2. Enhanced the constructor and methods of the RemoteModule class to support optional layer and context parameters, improving modularity and context handling.
  3. Added new test cases and configurations for layers in the packages/enhanced/test/configCases/layers/ directory, including components and webpack configurations to validate the layer functionality.

The changes collectively improve the project's ability to manage and configure module layers, which is crucial for advanced module federation use cases. |
| packages/enhanced/src/lib/sharing/utils.ts | These changes enhance the project's modularity, configuration management, and testing capabilities, particularly in the context of module federation and layer handling. The key modifications include:

  1. Added handling for issuerLayer and context in the ContainerReferencePlugin.ts file to improve module federation capabilities.
  2. Enhanced the constructor and methods in the RemoteModule.ts file to support optional layer and context parameters, improving modularity and context handling.
  3. Added new test cases and configurations for layers in the packages/enhanced/test/configCases/layers/ directory, including components and webpack configurations to validate the layer functionality.

These changes collectively aim to enhance the project's overall flexibility, maintainability, and robustness in handling module federation and layering scenarios. |
| packages/runtime/src/type/config.ts | The changes in this pull request enhance the project's modularity, configuration management, and testing capabilities, particularly in the context of module federation and layer handling. The key modifications include adding support for issuerLayer and context in the ContainerReferencePlugin, and expanding the constructor and methods of the RemoteModule class to handle optional layer and context parameters. Additionally, new test cases and configurations for layers have been added to validate the layer functionality. |

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

Configuration

Squadron Mode: essential

Commits Reviewed

8f94b549274a8dd4943b53e2833f05137a7125d4...868c5d5af1ba8046b003cb3441beaa34280fa95b

Files Reviewed
  • packages/enhanced/src/lib/sharing/ProvideSharedModule.ts
  • packages/enhanced/src/lib/sharing/ProvideSharedModuleFactory.ts
  • packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts
  • packages/runtime/src/type/config.ts
  • packages/enhanced/src/lib/sharing/SharePlugin.ts
Files Ignored

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

  • .cursorignore
  • .cursorrules
  • NOTES.txt
  • packages/enhanced/test/ConfigTestCases.template.js
  • packages/enhanced/test/configCases/layers/1-layers-full/App.js
  • packages/enhanced/test/configCases/layers/1-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/1-layers-full/ComponentALayers.js
  • packages/enhanced/test/configCases/layers/1-layers-full/index.js
  • packages/enhanced/test/configCases/layers/1-layers-full/layered-react-loader.js
  • packages/enhanced/test/configCases/layers/1-layers-full/layered-upgrade-react.js
  • packages/enhanced/test/configCases/layers/1-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/1-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/1-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/2-layers-full/App.js
  • packages/enhanced/test/configCases/layers/2-layers-full/ComponentALayers.js
  • packages/enhanced/test/configCases/layers/2-layers-full/ComponentB.js
  • packages/enhanced/test/configCases/layers/2-layers-full/ComponentC.js
  • packages/enhanced/test/configCases/layers/2-layers-full/index.js
  • packages/enhanced/test/configCases/layers/2-layers-full/layered-react-loader.js
  • packages/enhanced/test/configCases/layers/2-layers-full/layered-upgrade-react.js
  • packages/enhanced/test/configCases/layers/2-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/2-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/2-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/3-layers-full/App.js
  • packages/enhanced/test/configCases/layers/3-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/3-layers-full/index.js
  • packages/enhanced/test/configCases/layers/3-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/3-layers-full/package.json
  • packages/enhanced/test/configCases/layers/3-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/3-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/4-layers-full/App.js
  • packages/enhanced/test/configCases/layers/4-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/4-layers-full/index.js
  • packages/enhanced/test/configCases/layers/4-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/4-layers-full/package.json
  • packages/enhanced/test/configCases/layers/4-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/4-layers-full/upgrade-react.js
  • packages/enhanced/test/configCases/layers/4-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/5-layers-full/App.js
  • packages/enhanced/test/configCases/layers/5-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/5-layers-full/index.js
  • packages/enhanced/test/configCases/layers/5-layers-full/layered-react-loader.js
  • packages/enhanced/test/configCases/layers/5-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/5-layers-full/package.json
  • packages/enhanced/test/configCases/layers/5-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/5-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/6-layers-full/App.js
  • packages/enhanced/test/configCases/layers/6-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/6-layers-full/index.js
  • packages/enhanced/test/configCases/layers/6-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/6-layers-full/package.json
  • packages/enhanced/test/configCases/layers/6-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/6-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/7-layers-full/App.js
  • packages/enhanced/test/configCases/layers/7-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/7-layers-full/emptyComponent.js
  • packages/enhanced/test/configCases/layers/7-layers-full/index.js
  • packages/enhanced/test/configCases/layers/7-layers-full/layered-react-loader.js
  • packages/enhanced/test/configCases/layers/7-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/7-layers-full/package.json
  • packages/enhanced/test/configCases/layers/7-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/7-layers-full/webpack.config.js
  • packages/enhanced/test/configCases/layers/8-layers-full/App.js
  • packages/enhanced/test/configCases/layers/8-layers-full/ComponentA.js
  • packages/enhanced/test/configCases/layers/8-layers-full/index.js
  • packages/enhanced/test/configCases/layers/8-layers-full/layerImport.js
  • packages/enhanced/test/configCases/layers/8-layers-full/node_modules/package.json
  • packages/enhanced/test/configCases/layers/8-layers-full/node_modules/react.js
  • packages/enhanced/test/configCases/layers/8-layers-full/package.json
  • packages/enhanced/test/configCases/layers/8-layers-full/test.config.js
  • packages/enhanced/test/configCases/layers/8-layers-full/webpack.config.js

@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
@module-federation module-federation deleted a comment from squadronai bot Dec 31, 2024
# Conflicts:
#	packages/enhanced/src/lib/sharing/ProvideSharedModule.ts
#	packages/enhanced/src/lib/sharing/ProvideSharedModuleFactory.ts
#	packages/enhanced/src/lib/sharing/ProvideSharedPlugin.ts
@ScriptedAlchemy ScriptedAlchemy changed the title Layer via composite shareKey feat(enhanced): Layer via composite shareKey Dec 31, 2024
@ScriptedAlchemy ScriptedAlchemy force-pushed the second-attempt-runtime-layer branch from 1376c4a to 8dc6ff0 Compare December 31, 2024 02:57
@ScriptedAlchemy ScriptedAlchemy merged commit 687365f into consume-share-layers Dec 31, 2024
9 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the second-attempt-runtime-layer branch December 31, 2024 03:34
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