Skip to content

feat(enhanced): Shared module include / exclude / nodeModulesReconstructedLookup #3736

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

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Apr 29, 2025

This pull request includes various changes across documentation, configuration, and code enhancements for the Module Federation plugin. The key updates include the addition of new experimental features, enhancements to shared module configurations, and improvements to testing and dependency management.

Documentation Updates:

  • Added a new section for the nodeModulesReconstructedLookup experiment in apps/website-new/docs/en/configure/experiments.mdx, explaining its purpose and usage for resolving relative imports in node_modules.
  • Documented new properties (packageName, shareKey, strictVersion, and version) for shared configurations in apps/website-new/docs/en/configure/shared.mdx. These properties enhance control over shared module behavior.

Experimental Features:

  • Introduced the nodeModulesReconstructedLookup experiment in apps/website-new/docs/en/configure/experiments.mdx and packages/enhanced/src/lib/container/ModuleFederationPlugin.ts to improve module resolution for shared dependencies. [1] [2]

Code Enhancements:

  • Added support for exclude and include options in the ProvideSharedPlugin to allow filtering shared modules by version or request. [1] [2]
  • Refactored ProvideSharedPlugin to encapsulate the logic for providing shared modules, improving maintainability. [1] [2]

Testing Improvements:

  • Expanded test coverage by including test/compiler-unit/**/*.test.ts in packages/enhanced/jest.config.ts and package.json. This ensures the new features and configurations are thoroughly tested. [1] [2]

Dependency Management:

  • Added @module-federation/cli as a dependency in packages/enhanced/package.json to support CLI operations for the enhanced package. [1] [2]

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 Apr 29, 2025

🦋 Changeset detected

Latest commit: c0c1e00

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@module-federation/sdk Major
@module-federation/enhanced Major
@module-federation/devtools Major
@module-federation/cli Major
@module-federation/data-prefetch Major
@module-federation/dts-plugin Major
@module-federation/esbuild Patch
@module-federation/managers Major
@module-federation/manifest Major
@module-federation/modern-js Major
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Major
@module-federation/rsbuild-plugin Major
@module-federation/rspack Major
@module-federation/runtime-core Major
@module-federation/runtime Major
@module-federation/storybook-addon Major
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Major
@module-federation/bridge-react-webpack-plugin Major
@module-federation/bridge-react Major
@module-federation/bridge-vue3 Major
@module-federation/modernjsapp Patch
remote5 Patch
@module-federation/runtime-tools Major
@module-federation/inject-external-runtime-core-plugin Major
@module-federation/third-party-dts-extractor Major
@module-federation/bridge-shared Major
@module-federation/error-codes Major
create-module-federation Major
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 Apr 29, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit c0c1e00
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/682bf14774820e000893d871
😎 Deploy Preview https://deploy-preview-3736--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 project configuration.

@ScriptedAlchemy ScriptedAlchemy changed the title feat(enhanced): prefix share exclusion feat(enhanced): Shared module include / exclude May 11, 2025
@ScriptedAlchemy ScriptedAlchemy changed the title feat(enhanced): Shared module include / exclude feat(enhanced): Shared module include / exclude / nodeModulesReconstructedLookup May 12, 2025
# Conflicts:
#	apps/website-new/docs/en/configure/experiments.mdx
#	package.json
#	packages/modernjs/project.json
#	packages/sdk/src/types/plugins/ModuleFederationPlugin.ts
#	pnpm-lock.yaml
@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review May 15, 2025 23:33
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