Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support rspack modern ssr #2775

Merged
merged 123 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
862137e
feat: update manifest/snapshot (#2481)
2heal1 Apr 19, 2024
00c0f5a
feat: prevent css flickering (#2502)
2heal1 May 17, 2024
9207337
feat: support hot reload (#2507)
2heal1 May 20, 2024
961227d
fix: add peerDeps
2heal1 May 21, 2024
c49fd3f
chore: upgrade lockfile
2heal1 May 21, 2024
125a920
feat: inject node fetch (#2523)
2heal1 May 21, 2024
07e6efa
chore: update lockfile
2heal1 May 22, 2024
79d8a2e
chore: update demo
2heal1 May 22, 2024
c03898a
feat: support auto reload page
2heal1 May 23, 2024
f753320
chore: use specifc module css assets
2heal1 May 23, 2024
564147e
feat: component add fallback
2heal1 May 28, 2024
9ed6538
fix: compat illegal shared params
2heal1 May 28, 2024
dc2d8b0
feat: support pass react element
2heal1 May 28, 2024
9e19623
chore: catch removeRemote error
2heal1 May 28, 2024
b939a8f
chore: no need to add protocol for style
2heal1 May 29, 2024
fd20c6d
chore: delete loaded remote manifest cache
2heal1 May 29, 2024
a485254
chore: delete loaded remote manifest cache
2heal1 May 29, 2024
d6d09c2
feat: auto inject remote script
2heal1 May 30, 2024
2400480
fix: script should add async attr
2heal1 May 30, 2024
100881c
chore: remove container while hot reload
2heal1 Jun 5, 2024
c797710
feat: add LiveReload component
2heal1 Jun 5, 2024
2b701b2
fix: transform entry to ipv4
2heal1 Jun 6, 2024
7a62057
chore: add demo
2heal1 Jun 6, 2024
f0023e9
chore: merge main
2heal1 Jun 6, 2024
10d15b1
Merge branch 'main' into feat/modernjs-ssr
2heal1 Jun 6, 2024
3c9b19b
chore: add full demo
2heal1 Jun 6, 2024
d8617fb
feat: auto delete splitchunks while set related shared
2heal1 Jun 6, 2024
4ea16e3
fix: don't modify loaded link tag
2heal1 Jun 6, 2024
3909743
fix: add http agent to resolve ipv4
2heal1 Jun 7, 2024
c985f8d
test: add e2e test cases
2heal1 Jun 7, 2024
717cf72
docs: add docs
2heal1 Jun 7, 2024
62c60f3
chore: hide file 404 error
2heal1 Jun 9, 2024
4ab6ff4
chore: fix lint error
2heal1 Jun 11, 2024
c96c477
chore: add ts-ignore
2heal1 Jun 11, 2024
f4506bd
chore: remove cypress custom command login
2heal1 Jun 13, 2024
32c70b4
chore: merge main
2heal1 Jun 20, 2024
2cdfcee
fix: remove support types
2heal1 Jun 20, 2024
1fcd5dd
fix: sdk test
2heal1 Jun 20, 2024
0b84371
feat: support pass alias in collectAsstes
2heal1 Jun 20, 2024
708c6a2
chore: add modernjs plugin test
2heal1 Jun 20, 2024
8c88009
chore: remove useless comment
2heal1 Jun 20, 2024
5c2990b
fix: modernjs demo
2heal1 Jun 20, 2024
ac49838
fix: ci script
2heal1 Jun 20, 2024
3f21554
fix: ci script
2heal1 Jun 20, 2024
2e0f833
fix: catch dts worker error
2heal1 Jun 20, 2024
e16971a
chore: merge main
2heal1 Jun 21, 2024
719ec85
chore: don't kill current process
2heal1 Jun 21, 2024
ad1c799
chore: simplify resolveEntry logic
2heal1 Jun 21, 2024
d1e7768
chore: replace matchedVersion to ipv4
2heal1 Jun 21, 2024
00c96ad
chore: replace matchedVersion to ipv4
2heal1 Jun 21, 2024
a1a4655
chore: update props
2heal1 Jun 23, 2024
d5cf0a1
chore: kill all existed process
2heal1 Jun 23, 2024
e871e12
chore: pid may equal undefined
2heal1 Jun 23, 2024
653f102
chore: add fallback docs
2heal1 Jun 23, 2024
8a7258c
chore: merge main
2heal1 Jun 24, 2024
18349d1
chore: refactor api
2heal1 Jun 24, 2024
0b20697
chore: rename createRemoteSSRComponent to createRemoteSSRReactComponent
2heal1 Jun 24, 2024
b016382
chore: rename function
2heal1 Jun 25, 2024
0a3e180
chore: validate rspack project
2heal1 Jun 25, 2024
3eecab0
chore: merge main
2heal1 Jun 25, 2024
5baa47a
chore: add README
2heal1 Jun 25, 2024
04cc868
chore: bump modernjs version
2heal1 Jun 25, 2024
da1db32
chore: ignore ts error
2heal1 Jun 25, 2024
00de67a
chore: update bundler config
2heal1 Jun 26, 2024
e8fdeec
chore: save originl error stack
2heal1 Jun 26, 2024
f57ae29
chore: merge main
2heal1 Jul 1, 2024
a9a67db
chore: internal SSRLiveReload
2heal1 Jul 1, 2024
5c2ff84
chore: hide collectSSRAssets
2heal1 Jul 1, 2024
e93cfbd
chore: hide injectLink/injectScript
2heal1 Jul 1, 2024
4c59697
fix: only send msg while process connected
2heal1 Jul 1, 2024
b0bb221
chore: catch EPIPE error
2heal1 Jul 1, 2024
8b89c81
chore: test rspack
2heal1 Jul 1, 2024
dcbe137
chore: update lockfile
2heal1 Jul 1, 2024
a4ee732
chore: upgrade modernjs dep
2heal1 Jul 1, 2024
403f78d
Merge branch 'main' into feat/modernjs-ssr
2heal1 Jul 2, 2024
20972b4
chore: merge main
2heal1 Jul 3, 2024
b257e72
docs: add practice part
2heal1 Jul 3, 2024
9767fbc
Merge branch 'main' into feat/modernjs-ssr
zhoushaw Jul 5, 2024
5fd9ed3
chore: merge main
2heal1 Jul 8, 2024
22495ab
chore: merge main
2heal1 Jul 8, 2024
5402070
chore: cr
2heal1 Jul 8, 2024
03ee872
chore: format code
2heal1 Jul 8, 2024
883c4b9
chore: add peerDep
2heal1 Jul 8, 2024
0f210e0
chore: update antd version
2heal1 Jul 8, 2024
c071ea7
chore: merge main
2heal1 Jul 11, 2024
43c6d34
chore: upgrade modernjs
2heal1 Jul 11, 2024
f37d43e
chore: use mfv2 formate entry
2heal1 Jul 12, 2024
74e82af
chore: refactor modernjs plugin
2heal1 Jul 15, 2024
711285e
chore: use existed config first
2heal1 Jul 15, 2024
b0a0fb9
chore: remove useless code
2heal1 Jul 15, 2024
3cb059f
chore: update docs
2heal1 Jul 16, 2024
2465d67
chore: delete outdated manifest
2heal1 Jul 16, 2024
633970d
chore: merge main
2heal1 Jul 16, 2024
00b06cc
chore: add remoteIpStrategy
2heal1 Jul 16, 2024
f966a9c
chore: add react key attr
2heal1 Jul 16, 2024
af2d42b
chore: react key will not pass as props
2heal1 Jul 16, 2024
e39b4ba
chore: rename Ikey to ReactKey
2heal1 Jul 17, 2024
21397e6
chore: remove log
2heal1 Jul 18, 2024
387c26a
chore: upgrade modern@2.56.0
2heal1 Jul 18, 2024
9aa02fd
chore: add demo types
2heal1 Jul 18, 2024
a5a2f73
fix: static resouce mismatch
2heal1 Jul 19, 2024
5b932a4
chore: merge main
2heal1 Jul 22, 2024
4795903
chore: inject node runtime plugin
2heal1 Jul 22, 2024
c65a87f
chore: apply node plugin
2heal1 Jul 22, 2024
b7ae601
chore: upgrade modernjs
2heal1 Jul 23, 2024
c00a609
chore: merge main
2heal1 Jul 23, 2024
ef4a2b5
fix: dts plugin test
2heal1 Jul 23, 2024
669ced5
Merge branch 'feat/modernjs-ssr' into feat/rspack-modern-ssr
2heal1 Jul 23, 2024
6154a5d
chore: merge main
2heal1 Jul 24, 2024
d9cb521
feat: support rspack
2heal1 Jul 24, 2024
1228f25
chore: fix unit test
2heal1 Jul 24, 2024
b5b3933
chore: update docs & remove ueseless code
2heal1 Jul 24, 2024
93f96a3
chore: upgrade modernjs dep
2heal1 Jul 25, 2024
31b6891
chore: no replace ipv4 in runtime
2heal1 Jul 25, 2024
667e6c0
Merge branch 'main' into feat/rspack-modern-ssr
2heal1 Jul 25, 2024
3603475
fix: add temp workaround
2heal1 Jul 25, 2024
ca3641b
fix: correct remoteIpStrategy default value
2heal1 Jul 25, 2024
d4e41a3
chore: add remoteIpStrategy default value
2heal1 Jul 25, 2024
2d16e6d
fix: no collect node internal utils types
2heal1 Jul 25, 2024
435070a
chore: add remoteIpStrategy default value
2heal1 Jul 25, 2024
66c1d37
chore: codereview
2heal1 Jul 26, 2024
af44dfe
chore: optimize code
2heal1 Jul 26, 2024
bce1259
chore: revert change
2heal1 Jul 26, 2024
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
7 changes: 7 additions & 0 deletions .changeset/nervous-otters-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@module-federation/dts-plugin': patch
'@module-federation/enhanced': patch
'@module-federation/modern-js': patch
---

feat: support rspack ssr
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/dynamic-nested-remote/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3054,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
Expand Down
12 changes: 6 additions & 6 deletions 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.13",
"version": "0.1.11",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand All @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/dynamic-remote-new-version/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3056,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
Expand Down
12 changes: 6 additions & 6 deletions 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.13",
"version": "0.1.11",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand All @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/dynamic-remote/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3053,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
Expand Down
12 changes: 6 additions & 6 deletions 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.13",
"version": "0.1.11",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand All @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/host/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3050,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
Expand Down
12 changes: 6 additions & 6 deletions 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.13",
"version": "0.1.11",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand All @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
10 changes: 8 additions & 2 deletions apps/modernjs-ssr/nested-remote/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3052,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
},

server: {
ssr: {
mode: 'stream',
},
port: 3052,
},
plugins: [appTools(), moduleFederationPlugin()],
plugins: [
appTools({
bundler: 'experimental-rspack',
}),
moduleFederationPlugin(),
],
});
12 changes: 6 additions & 6 deletions 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.13",
"version": "0.1.11",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand All @@ -25,18 +25,18 @@
"dist/"
],
"dependencies": {
"@modern-js/runtime": "2.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
17 changes: 17 additions & 0 deletions apps/modernjs-ssr/nested-remote/serverroutebootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const routes = [
{
path: '/',
children: [
{
_component: '@_modern_js_src/routes/page',
index: true,
id: 'page',
type: 'nested',
},
],
isRoot: true,
_component: '@_modern_js_src/routes/layout',
id: 'layout',
type: 'nested',
},
];
1 change: 1 addition & 0 deletions apps/modernjs-ssr/nested-remote/src/routes/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Outlet } from '@modern-js/runtime/router';

export default function Layout() {
console.log('layout');
return (
<div>
<Outlet />
Expand Down
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/nested-remote/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const serverRender = require('/Users/bytedance/outter/universe/apps/modernjs-ssr/nested-remote/dist/bundles/main.js');
console.log(33, serverRender);
2 changes: 2 additions & 0 deletions apps/modernjs-ssr/remote-new-version/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3055,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
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.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
9 changes: 8 additions & 1 deletion apps/modernjs-ssr/remote/modern.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ import { moduleFederationPlugin } from '@module-federation/modern-js';
export default defineConfig({
dev: {
port: 3051,
// FIXME: it should be removed , related issue: https://github.com/web-infra-dev/modern.js/issues/5999
host: '0.0.0.0',
},
runtime: {
router: true,
},

plugins: [appTools(), moduleFederationPlugin()],
plugins: [
appTools({
bundler: 'experimental-rspack',
}),
moduleFederationPlugin(),
],
server: {
ssr: {
mode: 'stream',
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.56.1",
"@modern-js/runtime": "2.56.2",
"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.56.1",
"@modern-js/eslint-config": "2.56.1",
"@modern-js/tsconfig": "2.56.1",
"@modern-js-app/eslint-config": "2.56.1",
"@modern-js/app-tools": "2.56.2",
"@modern-js/eslint-config": "2.56.2",
"@modern-js/tsconfig": "2.56.2",
"@modern-js-app/eslint-config": "2.56.2",
"typescript": "~5.0.4",
"@types/jest": "~29.5.0",
"@types/node": "~16.11.7",
Expand Down
Loading
Loading