Skip to content

feat: add rspack support#285

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
logonoff:rspackmabe
Jun 11, 2026
Merged

feat: add rspack support#285
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
logonoff:rspackmabe

Conversation

@logonoff

@logonoff logonoff commented Dec 16, 2025

Copy link
Copy Markdown
Member

Turns out rspack was not working for DynamicRemotePlugin due to a bug upstream: web-infra-dev/rspack#14277

The bug is fixed in 2.0.7. The only remaining compatibility mismatch is that webpack's ModuleFederationPlugin is renamed to ModuleFederationPluginV1 in rspack.

This PR adds detection for rspack and changes the ModuleFederationPlugin implementation to use ModuleFederationPluginV1, as expected

@openshift-ci openshift-ci Bot requested review from florkbr and karelhala December 16, 2025 18:19
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 16, 2025
@codecov-commenter

codecov-commenter commented Dec 16, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.70%. Comparing base (cc76e03) to head (8bbc5c4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #285   +/-   ##
=======================================
  Coverage   30.70%   30.70%           
=======================================
  Files          75       75           
  Lines        1964     1964           
  Branches      349      349           
=======================================
  Hits          603      603           
  Misses       1332     1332           
  Partials       29       29           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@logonoff logonoff force-pushed the rspackmabe branch 3 times, most recently from fa0693a to 848e204 Compare January 30, 2026 00:21
@openshift-bot

Copy link
Copy Markdown

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 30, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 12, 2026
@logonoff logonoff force-pushed the rspackmabe branch 2 times, most recently from 0a0240c to d6563bb Compare May 27, 2026 19:25
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2026
@logonoff logonoff force-pushed the rspackmabe branch 4 times, most recently from cb87d63 to 783a99d Compare May 27, 2026 19:31
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2026
@logonoff logonoff changed the title feat: add rspack to sample app feat: add rspack support May 27, 2026
@logonoff logonoff force-pushed the rspackmabe branch 2 times, most recently from 5a7a328 to ee2b5e5 Compare May 27, 2026 20:31
Comment thread packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts
Comment thread packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts Outdated
Comment thread packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts Outdated
Comment thread packages/sample-app/rspack.config.ts Outdated
@logonoff logonoff force-pushed the rspackmabe branch 3 times, most recently from f3d26e8 to 08ac3d0 Compare June 8, 2026 13:39
@logonoff logonoff force-pushed the rspackmabe branch 2 times, most recently from be1c687 to 658cd94 Compare June 10, 2026 14:11
@logonoff logonoff force-pushed the rspackmabe branch 10 times, most recently from 28fc49e to 19b6f81 Compare June 10, 2026 16:55
const {
ModuleFederationPlugin = compiler.webpack.container.ModuleFederationPlugin,
ModuleFederationPlugin = isRspack
? (compiler as any).rspack.container.ModuleFederationPluginV1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsafe cast to any - no guard if rspack structure changes. Use optional chaining or check existence.

const {
    ModuleFederationPlugin = isRspack
      ? compiler.rspack?.container?.ModuleFederationPluginV1
      : compiler.webpack.container.ModuleFederationPlugin,
    ContainerPlugin = compiler.webpack.container.ContainerPlugin,
  } = moduleFederationSettings.pluginOverride ?? {};

  if (!ModuleFederationPlugin) {
    throw new Error(
      `${isRspack ? 'rspack' : 'webpack'}.container.ModuleFederationPlugin${isRspack ? 'V1' : ''} not found`
    );
  }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard is const isRspack = 'rspack' in compiler;. We can be pretty certain that api will be stable: https://rspack.rs/plugins/webpack/module-federation-plugin-v1

Any cast is pragmatic - rspack and webpack types are structurally similar but incompatible.

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@charlesmulder: changing LGTM is restricted to collaborators

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: charlesmulder, logonoff

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@logonoff: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@TheRealJon TheRealJon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this down and ran the test script with no issues, so with the caveat that I'm not very knowledgable when it comes to this repo or rspack...

/lgtm
/verified by @TheRealJon

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@TheRealJon: This PR has been marked as verified by @TheRealJon.

Details

In response to this:

I pulled this down and ran the test script with no issues, so with the caveat that I'm not very knowledgable when it comes to this repo or rspack...

/lgtm
/verified by @TheRealJon

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 317459d into openshift:main Jun 11, 2026
2 checks passed
@logonoff logonoff deleted the rspackmabe branch June 11, 2026 19:01
@logonoff

Copy link
Copy Markdown
Member Author

not needed for merging

/remove-label verified

@openshift-ci openshift-ci Bot removed the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants