Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-01/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {
},
experiments: {
css: true,
mfAsyncStartup: true,
},

module: {
Expand Down
5 changes: 0 additions & 5 deletions comprehensive-demo-react18/app-01/src/bootstrap.jsx

This file was deleted.

6 changes: 5 additions & 1 deletion comprehensive-demo-react18/app-01/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import('./bootstrap');
import App from './App';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(<App />, document.getElementById('root'));
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-01/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = {
new ModuleFederationPlugin({
name: 'app_01',
filename: 'remoteEntry.js',
experiments: { asyncStartup: true },
remotes: {
app_02: 'app_02@http://localhost:3002/remoteEntry.js',
app_03: 'app_03@http://localhost:3003/remoteEntry.js',
Expand Down
4 changes: 4 additions & 0 deletions comprehensive-demo-react18/app-02/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
optimization: {
minimize: false,
},
experiments: {
css: true,
mfAsyncStartup: true,
},
Comment on lines +21 to +24

Check failure

Code scanning / CodeQL

Overwritten property Error

This property is overwritten by
another property
in the same object literal.

Copilot Autofix

AI 4 days ago

To fix this problem, combine the contents of both experiments properties into a single definition, ensuring that no desired fields are lost. Only one experiments property should remain. The fix should be performed in comprehensive-demo-react18/app-02/rspack.config.js, specifically from lines 21–24 and 64–66. Merge the properties so that experiments contains both css: true and mfAsyncStartup: true. Remove the duplicate second definition (experiments at lines 64–66), and ensure only one experiments block remains in the exported configuration object.

No imports or additional definitions are required.


Suggested changeset 1
comprehensive-demo-react18/app-02/rspack.config.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/comprehensive-demo-react18/app-02/rspack.config.js b/comprehensive-demo-react18/app-02/rspack.config.js
--- a/comprehensive-demo-react18/app-02/rspack.config.js
+++ b/comprehensive-demo-react18/app-02/rspack.config.js
@@ -61,9 +61,7 @@
       },
     ],
   },
-  experiments: {
-    css: true,
-  },
+  // Removed duplicate 'experiments' property. See line 21 for the correct, merged definition.
 
   plugins: [
     new ModuleFederationPlugin({
EOF
@@ -61,9 +61,7 @@
},
],
},
experiments: {
css: true,
},
// Removed duplicate 'experiments' property. See line 21 for the correct, merged definition.

plugins: [
new ModuleFederationPlugin({
Copilot is powered by AI and may make mistakes. Always verify output.
devServer: {
port: 3002,
hot: true,
Expand Down
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-02/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module.exports = {
new ModuleFederationPlugin({
name: 'app_02',
filename: 'remoteEntry.js',
experiments: { asyncStartup: true },
remotes: {
app_01: 'app_01@http://localhost:3001/remoteEntry.js',
app_03: 'app_03@http://localhost:3003/remoteEntry.js',
Expand Down
4 changes: 4 additions & 0 deletions comprehensive-demo-react18/app-03/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module.exports = {
publicPath: 'auto',
uniqueName: 'app3',
},
experiments: {
css: true,
mfAsyncStartup: true,
},

module: {
rules: [
Expand Down
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-03/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = {
new ModuleFederationPlugin({
name: 'app_03',
filename: 'remoteEntry.js',
experiments: { asyncStartup: true },
remotes: {
app_01: 'app_01@http://localhost:3001/remoteEntry.js',
},
Expand Down
71 changes: 71 additions & 0 deletions comprehensive-demo-react18/app-04/public/mf-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"id": "app_04",
"name": "app_04",
"metaData": {
"name": "app_04",
"type": "app",
"buildInfo": {
"buildVersion": "1.0.0",
"buildName": "comprehensive-demo-react18_app-04"
},
"remoteEntry": {
"name": "remoteEntry.js",
"path": "",
"type": "global"
},
"types": {
"path": "",
"name": "",
"zip": "",
"api": ""
},
"globalName": "app_04",
"pluginVersion": "0.17.1",
"prefetchInterface": false,
"publicPath": "auto"
},
"shared": [],
"remotes": [],
"exposes": [
{
"id": "app_04:App",
"name": "App",
"assets": {
"js": {
"sync": [
"875.875.js",
"__federation_expose_App.874.js"
],
"async": []
},
"css": {
"sync": [
"__federation_expose_App.874.css"
],
"async": []
}
},
"path": "./App"
},
{
"id": "app_04:loadApp",
"name": "loadApp",
"assets": {
"js": {
"sync": [
"875.875.js",
"__federation_expose_loadApp.474.js"
],
"async": []
},
"css": {
"sync": [
"__federation_expose_loadApp.474.css"
],
"async": []
}
},
"path": "./loadApp"
}
]
}
75 changes: 75 additions & 0 deletions comprehensive-demo-react18/app-04/public/mf-stats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"id": "app_04",
"name": "app_04",
"metaData": {
"name": "app_04",
"type": "app",
"buildInfo": {
"buildVersion": "1.0.0",
"buildName": "comprehensive-demo-react18_app-04"
},
"remoteEntry": {
"name": "remoteEntry.js",
"path": "",
"type": "global"
},
"types": {
"path": "",
"name": "",
"zip": "",
"api": ""
},
"globalName": "app_04",
"pluginVersion": "0.17.1",
"prefetchInterface": false,
"publicPath": "auto"
},
"shared": [],
"remotes": [],
"exposes": [
{
"path": "./App",
"id": "app_04:App",
"name": "App",
"requires": [],
"file": "src/main.js",
"assets": {
"js": {
"sync": [
"875.875.js",
"__federation_expose_App.874.js"
],
"async": []
},
"css": {
"sync": [
"__federation_expose_App.874.css"
],
"async": []
}
}
},
{
"path": "./loadApp",
"id": "app_04:loadApp",
"name": "loadApp",
"requires": [],
"file": "src/loadApp.js",
"assets": {
"js": {
"sync": [
"875.875.js",
"__federation_expose_loadApp.474.js"
],
"async": []
},
"css": {
"sync": [
"__federation_expose_loadApp.474.css"
],
"async": []
}
}
}
]
}
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-04/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ module.exports = {
devtool: prod ? false : 'source-map',
experiments: {
css: true,
mfAsyncStartup: true,
},
};
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-04/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {
new ModuleFederationPlugin({
name: 'app_04',
filename: 'remoteEntry.js',
experiments: { asyncStartup: true },
exposes: {
'./App': './src/main.js',
'./loadApp': './src/loadApp.js',
Expand Down
3 changes: 3 additions & 0 deletions comprehensive-demo-react18/app-05/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ module.exports = {
uniqueName: 'app5',
},
mode,
experiments: {
mfAsyncStartup: true,
},
plugins: [
new ModuleFederationPlugin({
name: 'app_05',
Expand Down
1 change: 1 addition & 0 deletions comprehensive-demo-react18/app-05/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
new ModuleFederationPlugin({
name: 'app_05',
filename: 'remoteEntry.js',
experiments: { asyncStartup: true },
exposes: {
'./ActionButton': './src/components/action-button.ts',
'./AlertBox': './src/components/alert-box.ts',
Expand Down
Loading