Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ proceed with caution when making any changes to this codebase.
When making changes that may impact existing functionality, ensure that all changelogs
are up-to-date, and that version bumps are done according to semantic versioning.

When adding new functionality, write Jest unit tests, and Cypress end-to-end
and component tests.
When adding new functionality, write Jest unit tests, and Playwright end-to-end tests.

## Setup commands

Expand Down
4 changes: 0 additions & 4 deletions docker/Dockerfile.ci-operator-buildroot
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ ENV PATH=$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
# Install global npm package dependencies.
RUN npm install -g yarn

# Install Cypress related dependencies.
# https://docs.cypress.io/app/get-started/install-cypress#Linux-Prerequisites
RUN dnf install -y xorg-x11-server-Xvfb gtk3-devel nss alsa-lib

# Clean up temporary files.
RUN dnf clean all

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build-libs": "yarn workspaces foreach -A --include 'packages/lib-*' run build",
"build-samples": "yarn workspaces foreach -A --include 'packages/sample-*' run build",
"build-samples-prod": "yarn workspaces foreach -A --include 'packages/sample-*' run build-prod",
"build-samples-rspack": "yarn workspaces foreach -A --include 'packages/sample-*' run build-rspack",
"run-samples": "yarn workspaces foreach -Api --include 'packages/sample-*' run http-server",
"lint": "yarn eslint packages",
"test": "yarn jest",
Expand Down
6 changes: 6 additions & 0 deletions packages/lib-webpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for `@openshift/dynamic-plugin-sdk-webpack`

## 5.2.0 - 2026-06-07

- Add rspack compatibility: `DynamicRemotePlugin` now works with both webpack and rspack bundlers ([#285])
- Add `@rspack/core` and `webpack` to optional peer dependencies ([#285])

## 5.1.1 - 2026-04-16

- Fix bug in `PatchEntryCallbackPlugin` where compilation fails when using webpack-dev-server ([#314])
Expand Down Expand Up @@ -77,6 +82,7 @@
[#256]: https://github.com/openshift/dynamic-plugin-sdk/pull/256
[#259]: https://github.com/openshift/dynamic-plugin-sdk/pull/259
[#280]: https://github.com/openshift/dynamic-plugin-sdk/pull/280
[#285]: https://github.com/openshift/dynamic-plugin-sdk/pull/285
[#289]: https://github.com/openshift/dynamic-plugin-sdk/pull/289
[#296]: https://github.com/openshift/dynamic-plugin-sdk/pull/296
[#314]: https://github.com/openshift/dynamic-plugin-sdk/pull/314
11 changes: 10 additions & 1 deletion packages/lib-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openshift/dynamic-plugin-sdk-webpack",
"version": "5.1.1",
"version": "5.2.0",
"description": "Allows building dynamic plugin assets with webpack",
"license": "Apache-2.0",
"repository": {
Expand All @@ -26,8 +26,17 @@
"api-extractor-local": "yarn run api-extractor --local"
},
"peerDependencies": {
"@rspack/core": "^2.0.6",
"webpack": "^5.100.0"
},
"peerDependenciesMeta": {
"@rspack/core": {
"optional": true
},
"webpack": {
"optional": true
}
},
"dependencies": {
"lodash": "^4.17.23",
"semver": "^7.7.3",
Expand Down
8 changes: 7 additions & 1 deletion packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,14 @@ export class DynamicRemotePlugin implements WebpackPluginInstance {
const moduleFederationLibraryType = moduleFederationSettings.libraryType ?? 'jsonp';
const moduleFederationSharedScope = moduleFederationSettings.sharedScopeName ?? 'default';

// Rspack's renamed ModuleFederationPlugin to ModuleFederationPluginV1.
// Their ModuleFederationPlugin implements module federation 1.5+
const isRspack = 'rspack' in compiler;

const {
ModuleFederationPlugin = compiler.webpack.container.ModuleFederationPlugin,
ModuleFederationPlugin = isRspack
? (compiler as any).rspack.container.ModuleFederationPluginV1
Comment thread
logonoff marked this conversation as resolved.
: compiler.webpack.container.ModuleFederationPlugin,
ContainerPlugin = compiler.webpack.container.ContainerPlugin,
} = moduleFederationSettings.pluginOverride ?? {};

Expand Down
10 changes: 0 additions & 10 deletions packages/sample-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
module.exports = {
root: true,
extends: ['plugin:@monorepo/eslint-plugin-internal/react-typescript-prettier'],
overrides: [
{
files: ['*.cy.ts', '*.cy.tsx'],
rules: {
// Suppress false positives due to https://docs.cypress.io/api/commands/then
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
},
},
],
};
7 changes: 6 additions & 1 deletion packages/sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"clean": "rm -rf dist",
"build": "yarn clean && yarn webpack",
"build-prod": "yarn clean && NODE_ENV=production yarn webpack",
"build-rspack": "yarn clean && NODE_ENV=production yarn rspack",
"analyze": "yarn clean && NODE_ENV=production ANALYZE_BUNDLES=true yarn webpack",
"lint": "yarn run -T eslint $INIT_CWD",
"webpack": "node -r ts-node/register ./node_modules/.bin/webpack",
"webpack": "WEBPACK=1 node -r ts-node/register ./node_modules/.bin/webpack",
"rspack": "RSPACK=1 node -r ts-node/register ./node_modules/.bin/rspack -c webpack.config.ts",
"http-server": "http-server dist -p 9000 -c-1",
"test-e2e": "yarn run -T playwright test --headed",
"test-e2e-headless": "yarn run -T playwright test"
Expand All @@ -22,6 +24,9 @@
"@patternfly/react-styles": "^6.4.0",
"@patternfly/react-table": "^6.4.0",
"@patternfly/react-tokens": "^6.4.0",
"@rspack/cli": "^2.0.6",
"@rspack/core": "^2.0.6",
"@types/webpack-bundle-analyzer": "~4.7.0",
"copy-webpack-plugin": "^13.0.1",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "7.0.2",
Expand Down
Loading