Skip to content

Commit d6dda15

Browse files
committed
chore: add demo
1 parent 121af12 commit d6dda15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1486
-173
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
strict-peer-dependencies=false
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# modernjs-ssr-nested-remote
2+
3+
## 0.1.34
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [ad605d2]
8+
- @module-federation/modern-js@0.6.14
9+
10+
## 0.1.33
11+
12+
### Patch Changes
13+
14+
- @module-federation/modern-js@0.6.13
15+
16+
## 0.1.32
17+
18+
### Patch Changes
19+
20+
- @module-federation/modern-js@0.6.12
21+
22+
## 0.1.31
23+
24+
### Patch Changes
25+
26+
- @module-federation/modern-js@0.6.11
27+
28+
## 0.1.30
29+
30+
### Patch Changes
31+
32+
- @module-federation/modern-js@0.6.10
33+
34+
## 0.1.29
35+
36+
### Patch Changes
37+
38+
- @module-federation/modern-js@0.6.9
39+
40+
## 0.1.28
41+
42+
### Patch Changes
43+
44+
- @module-federation/modern-js@0.6.8
45+
46+
## 0.1.27
47+
48+
### Patch Changes
49+
50+
- @module-federation/modern-js@0.6.7
51+
52+
## 0.1.26
53+
54+
### Patch Changes
55+
56+
- @module-federation/modern-js@0.6.6
57+
58+
## 0.1.25
59+
60+
### Patch Changes
61+
62+
- @module-federation/modern-js@0.6.5
63+
64+
## 0.1.24
65+
66+
### Patch Changes
67+
68+
- @module-federation/modern-js@0.6.4
69+
70+
## 0.1.23
71+
72+
### Patch Changes
73+
74+
- Updated dependencies [81201b8]
75+
- @module-federation/modern-js@0.6.3
76+
77+
## 0.1.22
78+
79+
### Patch Changes
80+
81+
- Updated dependencies [541494d]
82+
- Updated dependencies [2394e38]
83+
- @module-federation/modern-js@0.6.2
84+
85+
## 0.1.21
86+
87+
### Patch Changes
88+
89+
- @module-federation/modern-js@0.6.1
90+
91+
## 0.1.20
92+
93+
### Patch Changes
94+
95+
- @module-federation/modern-js@0.6.0
96+
97+
## 0.1.19
98+
99+
### Patch Changes
100+
101+
- @module-federation/modern-js@0.5.2
102+
103+
## 0.1.18
104+
105+
### Patch Changes
106+
107+
- @module-federation/modern-js@0.5.1
108+
109+
## 0.1.17
110+
111+
### Patch Changes
112+
113+
- @module-federation/modern-js@0.5.0
114+
115+
## 0.1.16
116+
117+
### Patch Changes
118+
119+
- Updated dependencies [88dec4e]
120+
- @module-federation/modern-js@0.4.0
121+
122+
## 0.1.15
123+
124+
### Patch Changes
125+
126+
- @module-federation/modern-js@0.3.5
127+
128+
## 0.1.14
129+
130+
### Patch Changes
131+
132+
- Updated dependencies [951d705]
133+
- @module-federation/modern-js@0.3.4
134+
135+
## 0.1.13
136+
137+
### Patch Changes
138+
139+
- @module-federation/modern-js@0.3.3
140+
141+
## 0.1.12
142+
143+
### Patch Changes
144+
145+
- Updated dependencies [85ae159]
146+
- @module-federation/modern-js@0.3.2
147+
148+
## 0.1.13
149+
150+
### Patch Changes
151+
152+
- @module-federation/modern-js@0.3.1
153+
154+
## 0.1.12
155+
156+
### Patch Changes
157+
158+
- Updated dependencies [fa37cc4]
159+
- @module-federation/modern-js@0.2.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { appTools, defineConfig } from '@modern-js/app-tools';
2+
import { moduleFederationPlugin } from '@module-federation/modern-js';
3+
4+
// https://modernjs.dev/en/configure/app/usage
5+
export default defineConfig({
6+
runtime: {
7+
router: true,
8+
},
9+
server: {
10+
ssr: {
11+
mode: 'stream',
12+
},
13+
port: 5001,
14+
},
15+
plugins: [
16+
appTools({
17+
bundler: 'rspack',
18+
}),
19+
moduleFederationPlugin(),
20+
],
21+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { createModuleFederationConfig } from '@module-federation/modern-js';
2+
export default createModuleFederationConfig({
3+
name: 'host',
4+
remotes: {
5+
remote: 'provider@http://localhost:5002/mf-manifest.json',
6+
},
7+
shared: {
8+
react: { singleton: true },
9+
'react-dom': { singleton: true },
10+
},
11+
});
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "modernjs-ssr-data-fetch-host",
3+
"private": true,
4+
"version": "0.1.34",
5+
"scripts": {
6+
"reset": "npx rimraf ./**/node_modules",
7+
"dev": "modern dev",
8+
"build": "modern build",
9+
"start": "modern start",
10+
"serve": "modern serve",
11+
"new": "modern new",
12+
"lint": "modern lint",
13+
"upgrade": "modern upgrade"
14+
},
15+
"engines": {
16+
"node": ">=16.18.1"
17+
},
18+
"lint-staged": {
19+
"*.{js,jsx,ts,tsx,mjs,cjs}": [
20+
"node --max_old_space_size=8192 ./node_modules/eslint/bin/eslint.js --fix --color --cache --quiet"
21+
]
22+
},
23+
"eslintIgnore": [
24+
"node_modules/",
25+
"dist/"
26+
],
27+
"dependencies": {
28+
"@babel/runtime": "7.26.0",
29+
"@modern-js/runtime": "2.65.1",
30+
"@module-federation/modern-js": "workspace:*",
31+
"antd": "4.24.15",
32+
"react": "~18.3.1",
33+
"react-dom": "~18.3.1"
34+
},
35+
"devDependencies": {
36+
"@modern-js-app/eslint-config": "2.59.0",
37+
"@modern-js/app-tools": "2.65.1",
38+
"@modern-js/eslint-config": "2.59.0",
39+
"@modern-js/tsconfig": "2.65.1",
40+
"@types/jest": "~29.5.0",
41+
"@types/node": "~16.11.7",
42+
"@types/react": "~18.2.0",
43+
"@types/react-dom": "~18.3.0",
44+
"lint-staged": "~13.1.0",
45+
"prettier": "~3.3.3",
46+
"rimraf": "~3.0.2",
47+
"typescript": "~5.0.4"
48+
}
49+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"name": "modernjs-ssr-data-fetch-host",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/modern-component-data-fetch/host/src",
5+
"projectType": "application",
6+
"tags": [],
7+
"implicitDependencies": ["typescript"],
8+
"targets": {
9+
"build": {
10+
"executor": "nx:run-commands",
11+
"options": {
12+
"dependsOn": [
13+
{
14+
"target": "build",
15+
"dependencies": true
16+
}
17+
],
18+
"commands": [
19+
{
20+
"command": "cd apps/host; pnpm run build",
21+
"forwardAllArgs": true
22+
}
23+
]
24+
}
25+
},
26+
"serve": {
27+
"executor": "nx:run-commands",
28+
"options": {
29+
"dependsOn": [
30+
{
31+
"target": "build",
32+
"dependencies": true
33+
}
34+
],
35+
"commands": [
36+
{
37+
"command": "cd apps/modern-component-data-fetch/host; pnpm run dev",
38+
"forwardAllArgs": false
39+
}
40+
]
41+
}
42+
},
43+
"e2e": {
44+
"executor": "@nx/cypress:cypress",
45+
"options": {
46+
"cypressConfig": "apps/modern-component-data-fetch/host/cypress.config.ts",
47+
"testingType": "e2e",
48+
"baseUrl": "http://localhost:4001",
49+
"browser": "chrome"
50+
},
51+
"configurations": {
52+
"development": {
53+
"runnerUi": true,
54+
"browser": "electron",
55+
"exit": false,
56+
"watch": true
57+
}
58+
}
59+
},
60+
"test:e2e": {
61+
"executor": "nx:run-commands",
62+
"options": {
63+
"parallel": true,
64+
"commands": [
65+
{
66+
"command": "lsof -i :8080 || nx run modernjs-ssr-data-fetch-host:serve & echo 'done'",
67+
"forwardAllArgs": false
68+
},
69+
{
70+
"command": "sleep 20 && nx run modernjs-ssr-data-fetch-host:e2e",
71+
"forwardAllArgs": true
72+
}
73+
]
74+
}
75+
}
76+
}
77+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const routes = [
2+
{
3+
path: '/',
4+
children: [
5+
{
6+
_component: '@_modern_js_src/routes/page',
7+
index: true,
8+
id: 'page',
9+
type: 'nested',
10+
},
11+
],
12+
isRoot: true,
13+
_component: '@_modern_js_src/routes/layout',
14+
id: 'layout',
15+
type: 'nested',
16+
},
17+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// eslint-disable-next-line import/no-commonjs
2+
module.exports = {
3+
root: true,
4+
extends: ['@modern-js-app'],
5+
parserOptions: {
6+
tsconfigRootDir: __dirname,
7+
project: ['../tsconfig.json'],
8+
},
9+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// <reference types='@modern-js/app-tools/types' />
2+
/// <reference types='@modern-js/runtime/types' />
3+
/// <reference types='@modern-js/runtime/types/router' />
4+
/// <reference types='@module-federation/modern-js/types' />

0 commit comments

Comments
 (0)