Skip to content

Commit

Permalink
chore: merge main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
danpeen committed Sep 19, 2024
2 parents b47ea80 + 5447f80 commit b02d9f0
Show file tree
Hide file tree
Showing 145 changed files with 6,372 additions and 4,859 deletions.
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"@module-federation/bridge-shared",
"@module-federation/bridge-react-webpack-plugin",
"@module-federation/modern-js",
"@module-federation/retry-plugin"
"@module-federation/retry-plugin",
"@module-federation/data-prefetch"
]
],
"ignorePatterns": ["^alpha|^beta"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:

- name: E2E Test for Manifest Demo
if: steps.check-ci.outcome == 'success'
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=manifest-webpack-host --parallel=1 && npx kill-port 3013 3009 3010 3011 3012
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx wait-on http://127.0.0.1:4001/ && npx nx run-many --target=e2e --projects=manifest-webpack-host --parallel=1 && npx kill-port 3013 3009 3010 3011 3012 4001
12 changes: 11 additions & 1 deletion apps/manifest-demo/3009-webpack-provider/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"extends": "./tsconfig.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"outDir": "../../../dist/out-tsc",
"types": [
"node",
Expand Down
31 changes: 24 additions & 7 deletions apps/manifest-demo/3009-webpack-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,29 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"outDir": "../../../dist/out-tsc",
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
"files": [
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"dist/**"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
3 changes: 2 additions & 1 deletion apps/manifest-demo/3010-rspack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@rspack/plugin-react-refresh": "0.5.9"
},
"dependencies": {
"antd": "4.24.15"
"antd": "4.24.15",
"react-router-dom": "^6.23.1"
}
}
1 change: 1 addition & 0 deletions apps/manifest-demo/3010-rspack-provider/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module.exports = composePlugins(
'react-dom': {},
'react-dom/': {},
},
dataPrefetch: true,
}),
);
(config.devServer = {
Expand Down
2 changes: 2 additions & 0 deletions apps/manifest-demo/3010-rspack-provider/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import LocalButton from './Button';
import { Await } from 'react-router-dom';
console.log(Await);

const App = () => (
<div>
Expand Down
3 changes: 3 additions & 0 deletions apps/manifest-demo/webpack-host/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Suspense, lazy } from 'react';
// @ts-ignore
import ReactComponent from 'modern-js-provider/react-component';
import TestRemoteHook from './test-remote-hook';
import { loadRemote } from '@module-federation/runtime';
import LocalBtn from './components/ButtonOldAnt';
Expand Down Expand Up @@ -29,6 +31,7 @@ const WebpackPngRemote = lazy(() => import('remote1/WebpackPng'));

const App = () => (
<div>
<ReactComponent />
<h2>Manifest Basic Usage</h2>
<h3>check static remote</h3>
<table border={1} cellPadding={5}>
Expand Down
1 change: 1 addition & 0 deletions apps/manifest-demo/webpack-host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = composePlugins(withNx(), withReact(), (config, context) => {
'rspack_manifest_provider@http://localhost:3011/mf-manifest.json',
'js-entry-provider':
'rspack_js_entry_provider@http://localhost:3012/remoteEntry.js',
'modern-js-provider': 'app1@http://127.0.0.1:4001/mf-manifest.json',
},
filename: 'remoteEntry.js',
exposes: {
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/dynamic-nested-remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-dynamic-nested-remote

## 0.1.26

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.25

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/dynamic-nested-remote/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-dynamic-nested-remote",
"private": true,
"version": "0.1.24",
"version": "0.1.26",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/dynamic-remote-new-version/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-dynamic-remote-new-version

## 0.1.26

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.25

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/dynamic-remote-new-version/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-dynamic-remote-new-version",
"private": true,
"version": "0.1.24",
"version": "0.1.26",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/dynamic-remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-dynamic-remote

## 0.1.26

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.25

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/dynamic-remote/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-dynamic-remote",
"private": true,
"version": "0.1.24",
"version": "0.1.26",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/host/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-host

## 0.1.26

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.25

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/host/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-host",
"private": true,
"version": "0.1.24",
"version": "0.1.26",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/nested-remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-nested-remote

## 0.1.26

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.25

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/nested-remote/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-nested-remote",
"private": true,
"version": "0.1.24",
"version": "0.1.26",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/remote-new-version/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-remote-new-version

## 0.1.28

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.27

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/remote-new-version/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-remote-new-version",
"private": true,
"version": "0.1.26",
"version": "0.1.28",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs-ssr/remote/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# modernjs-ssr-remote

## 0.1.28

### Patch Changes

- @module-federation/modern-js@0.6.6

## 0.1.27

### Patch Changes

- @module-federation/modern-js@0.6.5

## 0.1.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs-ssr/remote/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "modernjs-ssr-remote",
"private": true,
"version": "0.1.26",
"version": "0.1.28",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
12 changes: 12 additions & 0 deletions apps/modernjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @module-federation/modernjs

## 0.1.52

### Patch Changes

- @module-federation/enhanced@0.6.6

## 0.1.51

### Patch Changes

- @module-federation/enhanced@0.6.5

## 0.1.50

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs/cypress/e2e/app.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('modernjs/', () => {

describe('Welcome message', () => {
it('should display welcome message', () => {
cy.get('.title').contains('Welcome');
cy.get('.container-box').contains('Resend request with parameters');
});
});
});
5 changes: 4 additions & 1 deletion apps/modernjs/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default defineConfig({
},
webpack: (config, { webpack, appendPlugins }) => {
if (config?.output) {
config.output.publicPath = 'http://localhost:4001/';
config.output.publicPath = 'http://127.0.0.1:4001/';
config.output.uniqueName = 'modern-js-app1';
}

appendPlugins([
Expand All @@ -44,12 +45,14 @@ export default defineConfig({
name: 'app1',
exposes: {
'./thing': './src/test.ts',
'./react-component': './src/components/react-component.tsx',
},
runtimePlugins: ['./runtimePlugin.ts'],
shared: {
react: { singleton: true },
'react-dom': { singleton: true },
},
dataPrefetch: true,
}),
]);
},
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@module-federation/modernjs",
"private": true,
"version": "0.1.50",
"version": "0.1.52",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
19 changes: 19 additions & 0 deletions apps/modernjs/src/components/react-component.prefetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defer } from '@modern-js/runtime/router';
import React from 'react';

console.log(React);
const defaultVal = {
data: {
id: 1,
title: 'A Prefetch Title',
},
};

export default (params = defaultVal) =>
defer({
userInfo: new Promise(resolve => {
setTimeout(() => {
resolve(params);
}, 2000);
}),
});
Loading

0 comments on commit b02d9f0

Please sign in to comment.