Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-package-deps-to-allow-to-use-new-api
Browse files Browse the repository at this point in the history
  • Loading branch information
fyodorovandrei authored Dec 13, 2024
2 parents 0114756 + 5ea7aea commit a78e151
Show file tree
Hide file tree
Showing 18 changed files with 1,253 additions and 75 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-yaks-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/rspack': patch
---

fix(rspack): import plugin from sub path
5 changes: 5 additions & 0 deletions .changeset/twelve-dingos-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/dts-plugin': patch
---

Lazy emit DTS files on hmr rebuilds, do not block compiler pipeline
15 changes: 9 additions & 6 deletions .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
./tmp
./scripts
./.git
./packages/storybook-addon
./packages/core
./packages/utilities
./packages/typescript
./packages/native-*
./apps
packages/storybook-addon
packages/core
packages/utilities
packages/typescript
packages/native-*
apps
**/configCases
**/dist
apps/**
*.snap
*.js

21 changes: 17 additions & 4 deletions apps/manifest-demo/3010-rspack-provider/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = composePlugins(
transform: {
react: {
runtime: 'automatic',
refresh: true,
},
},
},
Expand All @@ -60,6 +61,18 @@ module.exports = composePlugins(
// publicPath must be specific url
config.output.publicPath = 'http://localhost:3010/';

const rspackPlugin = config.plugins.find((plugin) => {
return plugin.name === 'HtmlRspackPlugin';
});

if (rspackPlugin && rspackPlugin._args && rspackPlugin._args[0]) {
rspackPlugin._args[0].excludeChunks = ['rspack_provider'];
} else {
console.warn(
'HtmlRspackPlugin not found or has unexpected structure. Skipping excludeChunks configuration.',
);
}

config.plugins.push(
new ModuleFederationPlugin({
name: 'rspack_provider',
Expand All @@ -70,10 +83,10 @@ module.exports = composePlugins(
shared: {
lodash: {},
antd: {},
'react/': {
singleton: true,
requiredVersion: '^18.3.1',
},
// 'react/': {
// singleton: true,
// requiredVersion: '^18.3.1',
// },
react: {
singleton: true,
requiredVersion: '^18.3.1',
Expand Down
2 changes: 2 additions & 0 deletions apps/react-ts-host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
config.devServer = config.devServer || {};
config.devServer.host = '127.0.0.1';
// prevent cyclic updates
config.watchOptions = {
ignored: ['**/node_modules/**', '**/@mf-types/**'],
Expand Down
4 changes: 4 additions & 0 deletions apps/react-ts-nested-remote/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
if (!config.devServer) {
config.devServer = {};
}
config.devServer.host = '127.0.0.1';
config.output.publicPath = 'http://localhost:3005/';
// prevent cyclic updates
config.watchOptions = {
Expand Down
1 change: 1 addition & 0 deletions apps/react-ts-remote/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module.exports = composePlugins(
client: {
overlay: false,
},
host: '127.0.0.1',
port: 3004,
devMiddleware: {
writeToDisk: true,
Expand Down
4 changes: 4 additions & 0 deletions apps/react-ts-remote/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
if (!config.devServer) {
config.devServer = {};
}
config.devServer.host = '127.0.0.1';
const baseConfig = {
name: 'react_ts_remote',
filename: 'remoteEntry.js',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"prepare": "husky install",
"changeset": "changeset",
"build:packages": "npx nx affected -t build --parallel=10 --exclude='*,!tag:type:pkg'",
"changegen": "./changeset-gen.js --path ./packages/enhanced --staged &&./changeset-gen.js --path ./packages/node --staged && ./changeset-gen.js --path ./packages/runtime --staged && ./changeset-gen.js --path ./packages/data-prefetch --staged && ./changeset-gen.js --path ./packages/nextjs-mf --staged",
"changegen": "./changeset-gen.js --path ./packages/enhanced --staged && ./changeset-gen.js --path ./packages/node --staged && ./changeset-gen.js --path ./packages/runtime --staged && ./changeset-gen.js --path ./packages/data-prefetch --staged && ./changeset-gen.js --path ./packages/nextjs-mf --staged && ./changeset-gen.js --path ./packages/dts-plugin --staged",
"commitgen:staged": "./commit-gen.js --path ./packages --staged",
"commitgen:main": "./commit-gen.js --path ./packages",
"changeset:status": "changeset status"
Expand Down
Loading

0 comments on commit a78e151

Please sign in to comment.