Skip to content

Commit

Permalink
Merge branch 'main' into feat/bridge-enable-custom-createRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
danpeen authored Mar 3, 2025
2 parents 8d65052 + 5b391b5 commit efb0442
Show file tree
Hide file tree
Showing 40 changed files with 2,308 additions and 1,570 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-rings-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/rsbuild-plugin': patch
---

chore(rsbuild-plugin): update mf format judgment conditions
7 changes: 7 additions & 0 deletions .changeset/poor-mails-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@module-federation/rsbuild-plugin': patch
'@module-federation/modern-js': patch
'@module-federation/modernjsapp': patch
---

chore(modern-js-plugin): use bundlerChain instead of tools.webpack or tools.rspack
6 changes: 6 additions & 0 deletions .changeset/seven-geckos-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@module-federation/dts-plugin': patch
'@module-federation/sdk': patch
---

perf(dts-plugin): add fetch timeout and add log
5 changes: 5 additions & 0 deletions .changeset/sharp-pans-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/rsbuild-plugin': patch
---

fix(rsbuild-plugin): add more MF packages to `source.include`
14 changes: 7 additions & 7 deletions .github/workflows/e2e-modern-ssr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:
lsof -ti tcp:3050,3051,3052,3053,3054,3055,3056 | xargs -r kill &&
pnpm run app:modern:dev &
sleep 30 &&
npx wait-on http://127.0.0.1:3050/ &&
npx wait-on http://127.0.0.1:3051/ &&
npx wait-on http://127.0.0.1:3052/ &&
npx wait-on http://127.0.0.1:3053/ &&
npx wait-on http://127.0.0.1:3054/ &&
npx wait-on http://127.0.0.1:3055/ &&
npx wait-on http://127.0.0.1:3056/ &&
npx wait-on http://127.0.0.1:3050/mf-manifest.json &&
npx wait-on http://127.0.0.1:3051/mf-manifest.json &&
npx wait-on http://127.0.0.1:3052/mf-manifest.json &&
npx wait-on http://127.0.0.1:3053/mf-manifest.json &&
npx wait-on http://127.0.0.1:3054/mf-manifest.json &&
npx wait-on http://127.0.0.1:3055/mf-manifest.json &&
npx wait-on http://127.0.0.1:3056/mf-manifest.json &&
npx nx run modernjs-ssr-host:e2e &&
lsof -ti tcp:3050,3051,3052,3053,3054,3055,3056 | xargs kill
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/dynamic-nested-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/dynamic-remote-new-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/dynamic-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/nested-remote/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
},
plugins: [
appTools({
bundler: 'experimental-rspack',
bundler: 'rspack',
}),
moduleFederationPlugin(),
],
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/nested-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/remote-new-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs-ssr/remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/modern-js": "workspace:*",
"antd": "4.24.15",
"react": "~18.3.1",
"react-dom": "~18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
"@types/react": "~18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions apps/modernjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
],
"dependencies": {
"@babel/runtime": "7.26.0",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/enhanced": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.59.0",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/tsconfig": "2.65.1",
"@types/jest": "~29.5.0",
"@types/node": "~20.12.12",
"@types/react": "~18.2.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/chrome-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@arco-design/web-react": "^2.64.1",
"@modern-js/runtime": "2.64.0",
"@modern-js/runtime": "2.65.1",
"@module-federation/sdk": "workspace:*",
"ahooks": "^3.7.10",
"dagre": "^0.8.5",
Expand All @@ -67,12 +67,12 @@
},
"devDependencies": {
"@modern-js-app/eslint-config": "2.54.6",
"@modern-js/app-tools": "2.64.0",
"@modern-js/app-tools": "2.65.1",
"@modern-js/builder-webpack-provider": "2.46.1",
"@modern-js/eslint-config": "2.59.0",
"@modern-js/module-tools": "2.64.0",
"@modern-js/storybook": "2.64.0",
"@modern-js/tsconfig": "2.64.0",
"@modern-js/module-tools": "2.65.1",
"@modern-js/storybook": "2.65.1",
"@modern-js/tsconfig": "2.65.1",
"@module-federation/runtime": "workspace:*",
"@playwright/test": "1.49.1",
"@storybook/addon-essentials": "^8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('hostPlugin', () => {
consumeAPITypes: false,
runtimePkgs: [],
remoteTypeUrls: {},
timeout: 60000,
});

expect(mapRemotesToDownload).toStrictEqual({
Expand All @@ -68,6 +69,7 @@ describe('hostPlugin', () => {
consumeAPITypes: false,
runtimePkgs: [],
remoteTypeUrls: {},
timeout: 60000,
};

const { hostOptions, mapRemotesToDownload } =
Expand Down
1 change: 1 addition & 0 deletions packages/dts-plugin/src/core/configurations/hostPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const defaultOptions = {
consumeAPITypes: false,
runtimePkgs: [],
remoteTypeUrls: {},
timeout: 60000,
} satisfies Partial<HostOptions>;

const buildZipUrl = (hostOptions: Required<HostOptions>, url: string) => {
Expand Down
17 changes: 11 additions & 6 deletions packages/dts-plugin/src/core/lib/DTSManager.general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ describe('DTSManager General Tests', () => {
url: 'http://example.com/remote.manifest.json',
alias: 'test-alias',
};

const result = await dtsManager.requestRemoteManifest(remoteInfo);
// @ts-expect-error only need timeout, which is not required
const result = await dtsManager.requestRemoteManifest(remoteInfo, {});
expect(result.zipUrl).toBeDefined();
expect(result.apiTypeUrl).toBeDefined();
expect(result.zipUrl).toContain('http://example.com/types.zip');
Expand All @@ -181,7 +181,8 @@ describe('DTSManager General Tests', () => {
alias: 'test-alias',
};

const result = await dtsManager.requestRemoteManifest(remoteInfo);
// @ts-expect-error only need timeout, which is not required
const result = await dtsManager.requestRemoteManifest(remoteInfo, {});
expect(result.zipUrl).toBeDefined();
expect(result.apiTypeUrl).toBe('');
});
Expand All @@ -195,7 +196,8 @@ describe('DTSManager General Tests', () => {
alias: 'test-alias',
};

const result = await dtsManager.requestRemoteManifest(remoteInfo);
// @ts-expect-error only need timeout, which is not required
const result = await dtsManager.requestRemoteManifest(remoteInfo, {});
expect(result).toEqual(remoteInfo);
});

Expand All @@ -220,7 +222,8 @@ describe('DTSManager General Tests', () => {
alias: 'test-alias',
};

const result = await dtsManager.requestRemoteManifest(remoteInfo);
// @ts-expect-error only need timeout, which is not required
const result = await dtsManager.requestRemoteManifest(remoteInfo, {});
expect(result.zipUrl).toContain('http://example.com/custom/types.zip');
expect(result.apiTypeUrl).toContain('http://example.com/custom/api.d.ts');
});
Expand All @@ -242,6 +245,7 @@ describe('DTSManager General Tests', () => {
abortOnError: false,
consumeAPITypes: true,
maxRetries: 3,
timeout: 60000,
};

it('should successfully download types archive', async () => {
Expand Down Expand Up @@ -347,7 +351,8 @@ describe('DTSManager General Tests', () => {
vi.mocked(axios.get).mockResolvedValueOnce({ data: apiTypeContent });
vi.spyOn(fs, 'writeFileSync');

await dtsManager.downloadAPITypes(remoteInfo, '/tmp/types');
// @ts-expect-error only need timeout, which is not required
await dtsManager.downloadAPITypes(remoteInfo, '/tmp/types', {});

expect(fs.writeFileSync).toHaveBeenCalled();
const writeCall = vi.mocked(fs.writeFileSync).mock.calls[0];
Expand Down
Loading

0 comments on commit efb0442

Please sign in to comment.