-
-
Notifications
You must be signed in to change notification settings - Fork 319
feat: support mf rsbuild plugin #3062
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
Conversation
🦋 Changeset detectedLatest commit: 0843d4e The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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. |
can you help add rslib demo ? |
https://github.com/web-infra-dev/rslib/pull/240/files |
There was a problem hiding this 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 a new feature to support the Rsbuild plugin for the module federation bundler. The key changes include:
- Adding the
isRequiredVersion
function from the@module-federation/sdk
package to various modules, includingConsumeSharedPlugin
,SharePlugin
,SharedManager
, andutils
. This function is used to validate version strings. - Removing the
isRequiredVersion
function and associated regular expression from theutils
module, as the functionality is now centralized in the SDK. - Introducing a new
getBuildName()
utility function in themanagers
module to retrieve the build name from an environment variable. - Updating the
ConsumeSharedPluginOptions
andSharePlugin
interfaces to accommodate the new plugin functionality.
These changes aim to improve the overall functionality and maintainability of the module federation bundler by centralizing version validation logic and adding support for the Rsbuild plugin.
File Summaries
File | Summary |
---|---|
packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts | The code changes introduce a new feature to support the Rsbuild plugin for the module federation bundler. The key modifications include adding a new import for the isRequiredVersion function from the @module-federation/sdk package, and updating the ConsumeSharedPluginOptions interface to accommodate the new plugin functionality. |
packages/enhanced/src/lib/sharing/SharePlugin.ts | The code changes introduce a new feature to support the Rsbuild plugin in the module federation bundler. The key modifications include adding a new import for the isRequiredVersion function from the @module-federation/sdk package and removing the import of the same function from the local utils module. This change likely aims to centralize the version checking logic and leverage the functionality provided by the SDK. |
packages/enhanced/src/lib/sharing/utils.ts | The code changes introduce a new utility function isRequiredVersion that checks if a given string looks like a valid version. This function is imported from the @module-federation/sdk package and used in the getGitUrlVersion function to determine if the version part of a Git URL is a valid version string. Additionally, the RE_VERSION_PATTERN_REGEXP regular expression has been removed, as the isRequiredVersion function now handles this logic. |
packages/managers/src/SharedManager.ts | The code changes introduce a new feature to support the Rsbuild plugin in the module federation bundler. The key modifications include adding the isRequiredVersion function from the @module-federation/sdk package and removing the import of the same function from the ./utils module. This change likely improves the overall functionality and maintainability of the SharedManager module. |
packages/managers/src/utils.ts | The code changes introduce a new utility function getBuildName() that retrieves the build name from the environment variable MF_BUILD_NAME . Additionally, the changes remove the isRequiredVersion() function and the associated VERSION_PATTERN_REGEXP regular expression, which were likely used for version string validation. |
packages/sdk/src/utils.ts | The code changes introduce a new utility function isRequiredVersion that checks if a given string matches a specific version pattern using a regular expression. This function is likely used to validate version strings in the context of the project's dependency management or versioning requirements. |
There was a problem hiding this 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: 3
Configuration
Squadron Mode: essential
Commits Reviewed
21ea5d897a60a0f1ed83f818484eb7af0ce9818a...6fe6ae41633a17f2fdf13b3c19dbb7e2b78b39b5
Files Reviewed
- packages/enhanced/src/lib/sharing/ConsumeSharedPlugin.ts
- packages/enhanced/src/lib/sharing/SharePlugin.ts
- packages/enhanced/src/lib/sharing/utils.ts
- packages/managers/src/SharedManager.ts
- packages/sdk/src/utils.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .changeset/fuzzy-brooms-dance.md
- apps/router-demo/router-host-2000/package.json
- apps/router-demo/router-host-2000/rsbuild.config.ts
- apps/router-demo/router-host-2000/src/index.module.less
- apps/router-demo/router-host-v5-2200/package.json
- apps/router-demo/router-host-v5-2200/rsbuild.config.ts
- apps/router-demo/router-host-vue3-2100/package.json
- apps/router-demo/router-host-vue3-2100/rsbuild.config.ts
- apps/router-demo/router-remote1-2001/package.json
- apps/router-demo/router-remote1-2001/rsbuild.config.ts
- apps/router-demo/router-remote2-2002/package.json
- apps/router-demo/router-remote2-2002/rsbuild.config.ts
- apps/router-demo/router-remote3-2003/package.json
- apps/router-demo/router-remote3-2003/rsbuild.config.ts
- apps/router-demo/router-remote4-2004/package.json
- apps/router-demo/router-remote4-2004/rsbuild.config.ts
- packages/rsbuild-plugin/LICENSE
- packages/rsbuild-plugin/README.md
- packages/rsbuild-plugin/package.json
- packages/rsbuild-plugin/project.json
- packages/rsbuild-plugin/rollup.config.js
- packages/rsbuild-plugin/src/cli/index.ts
- packages/rsbuild-plugin/src/utils/index.ts
- packages/rsbuild-plugin/tsconfig.json
- pnpm-lock.yaml
Description
A plugin support bundler use Rsbuild, whatever Rsbuild App or Rslib package
Related Issue
Types of changes
Checklist