Skip to content

Commit

Permalink
chore: upgrade 2.57.1
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Aug 12, 2024
1 parent 4f4332a commit 1ce8b6a
Show file tree
Hide file tree
Showing 13 changed files with 1,889 additions and 600 deletions.
10 changes: 5 additions & 5 deletions apps/modernjs-ssr-data-loader/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "0.0.0-next-20240805095911",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "0.0.0-next-20240805095911",
"@modern-js/eslint-config": "0.0.0-next-20240805095911",
"@modern-js/tsconfig": "0.0.0-next-20240805095911",
"@modern-js-app/eslint-config": "0.0.0-next-20240805095911",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr-data-loader/remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "0.0.0-next-20240805095911",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "0.0.0-next-20240805095911",
"@modern-js/eslint-config": "0.0.0-next-20240805095911",
"@modern-js/tsconfig": "0.0.0-next-20240805095911",
"@modern-js-app/eslint-config": "0.0.0-next-20240805095911",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/dynamic-nested-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/dynamic-remote-new-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/dynamic-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/nested-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/remote-new-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions apps/modernjs-ssr/remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.57.0",
"@modern-js/runtime": "2.57.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"@module-federation/modern-js": "workspace:*",
"@babel/runtime": "7.24.4",
"antd": "4.24.15"
},
"devDependencies": {
"@modern-js/app-tools": "2.57.0",
"@modern-js/eslint-config": "2.57.0",
"@modern-js/tsconfig": "2.57.0",
"@modern-js-app/eslint-config": "2.57.0",
"@modern-js/app-tools": "2.57.1",
"@modern-js/eslint-config": "2.57.1",
"@modern-js/tsconfig": "2.57.1",
"@modern-js-app/eslint-config": "2.57.1",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 5 additions & 5 deletions packages/modernjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
"devDependencies": {
"@types/hoist-non-react-statics": "3.3.2",
"@module-federation/manifest": "workspace:*",
"@modern-js/app-tools": "2.57.0",
"@modern-js/core": "2.57.0",
"@modern-js/runtime": "2.57.0",
"@modern-js/module-tools": "2.57.0",
"@modern-js/tsconfig": "2.57.0"
"@modern-js/app-tools": "0.0.0-next-20240805095911",
"@modern-js/core": "0.0.0-next-20240805095911",
"@modern-js/runtime": "0.0.0-next-20240805095911",
"@modern-js/module-tools": "0.0.0-next-20240805095911",
"@modern-js/tsconfig": "0.0.0-next-20240805095911"
},
"peerDependencies": {
"react": ">=17",
Expand Down
3 changes: 1 addition & 2 deletions packages/modernjs/src/runtime/dataLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const ssrDataLoaderPlugin = (): Plugin => {
post: ['@modern-js/plugin-router'],
setup: () => {
return {
async init({ context }, next) {
async beforeRender({ context }) {
console.log('init');

if (typeof window === 'undefined') {
Expand All @@ -73,7 +73,6 @@ export const ssrDataLoaderPlugin = (): Plugin => {
console.log(location.pathname);
}
await loadRoutes();
return next({ context });
},
modifyRoutes: (routes: RouteObject[]) => {
console.log('modifyRoutes');
Expand Down
9 changes: 5 additions & 4 deletions packages/modernjs/src/ssr-runtime/plugin.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import type { Plugin } from '@modern-js/runtime';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { SSRLiveReload } from './SSRLiveReload';

console.log('mfSSRPlugin trigger');
export const mfSSRPlugin = (): Plugin => ({
name: '@module-federation/modern-js',

setup: () => {
return {
async init({ context }, next) {
async beforeRender() {
console.log(111, 'beforeRender');
if (typeof window !== 'undefined') {
return next({ context });
return;
}
globalThis.shouldUpdate = false;
const nodeUtils = await import('@module-federation/node/utils');
Expand All @@ -19,7 +20,7 @@ export const mfSSRPlugin = (): Plugin => ({
await nodeUtils.flushChunks();
globalThis.shouldUpdate = true;
}
return next({ context });
return;
},
wrapRoot(App) {
const AppWrapper = (props: any) => (
Expand Down
Loading

0 comments on commit 1ce8b6a

Please sign in to comment.