@modern-js/server 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/cjs/dev-tools/mock/index.js +2 -4
- package/dist/cjs/server/devServer.js +6 -2
- package/dist/esm/dev-tools/mock/index.js +2 -1
- package/dist/esm/server/devServer.js +6 -2
- package/dist/esm-node/dev-tools/mock/index.js +2 -4
- package/dist/esm-node/server/devServer.js +6 -2
- package/dist/types/types.d.ts +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @modern-js/server
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3e0bd50: feat: when enable bff handle render, support use `useContext` to get framework plugin context in data loader.
|
|
8
|
+
feat: 当开启 BFF 托管渲染时,支持在 data loader 中使用 `useContext` 获取框架插件提供的上下文。
|
|
9
|
+
- 92d247f: fix: support tools.devServer.header include string[] type, remove get & delete & apply api in hook or middleware api
|
|
10
|
+
fix: 支持 tools.devServer.header 包含字符串数组类型,移除 Hook 和 Middleware 中对 响应 Cookie 的获取、删除操作
|
|
11
|
+
- 0da32d0: chore: upgrade jest and puppeteer
|
|
12
|
+
chore: 升级 jest 和 puppeteer 到 latest
|
|
13
|
+
- fbefa7e: chore(deps): bump webpack from 5.75.0 to 5.76.2
|
|
14
|
+
|
|
15
|
+
chore(deps): 将 webpack 从 5.75.0 升级至 5.76.2
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [d8bbf28]
|
|
18
|
+
- Updated dependencies [3e0bd50]
|
|
19
|
+
- Updated dependencies [92d247f]
|
|
20
|
+
- Updated dependencies [0da32d0]
|
|
21
|
+
- Updated dependencies [0d9962b]
|
|
22
|
+
- Updated dependencies [fbefa7e]
|
|
23
|
+
- Updated dependencies [4d54233]
|
|
24
|
+
- Updated dependencies [6db4864]
|
|
25
|
+
- @modern-js/prod-server@2.10.0
|
|
26
|
+
- @modern-js/types@2.10.0
|
|
27
|
+
- @modern-js/utils@2.10.0
|
|
28
|
+
- @modern-js/server-utils@2.10.0
|
|
29
|
+
|
|
30
|
+
## 2.9.0
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 49bb8cd0ef: fix: move chunkmap.css comment to bottom of head
|
|
35
|
+
fix: 将 chunkmap.css 标记移动到 head 底部
|
|
36
|
+
- Updated dependencies [49bb8cd0ef]
|
|
37
|
+
- @modern-js/prod-server@2.9.0
|
|
38
|
+
- @modern-js/server-utils@2.9.0
|
|
39
|
+
- @modern-js/types@2.9.0
|
|
40
|
+
- @modern-js/utils@2.9.0
|
|
41
|
+
|
|
3
42
|
## 2.8.0
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -47,10 +47,8 @@ const createMockHandler = ({ pwd }) => {
|
|
|
47
47
|
if (!filepath) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
config
|
|
53
|
-
} = (0, import_utils.compatRequire)(filepath, false);
|
|
50
|
+
const mod = (0, import_utils.compatRequire)(filepath, false);
|
|
51
|
+
const { default: mockModule = mod, config } = mod;
|
|
54
52
|
if ((config == null ? void 0 : config.enable) === false) {
|
|
55
53
|
return null;
|
|
56
54
|
}
|
|
@@ -264,8 +264,12 @@ class ModernDevServer extends import_prod_server.ModernServer {
|
|
|
264
264
|
const watcher = new import_watcher.default();
|
|
265
265
|
watcher.createDepTree();
|
|
266
266
|
watcher.listen(defaultWatchedPaths, watchOptions, (filepath, event) => {
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
if (filepath.includes("-server-loaders.js")) {
|
|
268
|
+
delete require.cache[filepath];
|
|
269
|
+
} else {
|
|
270
|
+
watcher.updateDepTree();
|
|
271
|
+
watcher.cleanDepCache(filepath);
|
|
272
|
+
}
|
|
269
273
|
this.onServerChange({
|
|
270
274
|
filepath,
|
|
271
275
|
event
|
|
@@ -160,7 +160,8 @@ var createMockHandler = function(param) {
|
|
|
160
160
|
if (!filepath) {
|
|
161
161
|
return null;
|
|
162
162
|
}
|
|
163
|
-
var
|
|
163
|
+
var mod = compatRequire(filepath, false);
|
|
164
|
+
var tmp = mod.default, mockModule = tmp === void 0 ? mod : tmp, config = mod.config;
|
|
164
165
|
if ((config === null || config === void 0 ? void 0 : config.enable) === false) {
|
|
165
166
|
return null;
|
|
166
167
|
}
|
|
@@ -807,8 +807,12 @@ var ModernDevServer = /*#__PURE__*/ function(ModernServer) {
|
|
|
807
807
|
var watcher = new Watcher();
|
|
808
808
|
watcher.createDepTree();
|
|
809
809
|
watcher.listen(defaultWatchedPaths, watchOptions, function(filepath, event) {
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
if (filepath.includes("-server-loaders.js")) {
|
|
811
|
+
delete require.cache[filepath];
|
|
812
|
+
} else {
|
|
813
|
+
watcher.updateDepTree();
|
|
814
|
+
watcher.cleanDepCache(filepath);
|
|
815
|
+
}
|
|
812
816
|
_this.onServerChange({
|
|
813
817
|
filepath: filepath,
|
|
814
818
|
event: event
|
|
@@ -15,10 +15,8 @@ const createMockHandler = ({ pwd }) => {
|
|
|
15
15
|
if (!filepath) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
config
|
|
21
|
-
} = compatRequire(filepath, false);
|
|
18
|
+
const mod = compatRequire(filepath, false);
|
|
19
|
+
const { default: mockModule = mod, config } = mod;
|
|
22
20
|
if ((config == null ? void 0 : config.enable) === false) {
|
|
23
21
|
return null;
|
|
24
22
|
}
|
|
@@ -241,8 +241,12 @@ class ModernDevServer extends ModernServer {
|
|
|
241
241
|
const watcher = new Watcher();
|
|
242
242
|
watcher.createDepTree();
|
|
243
243
|
watcher.listen(defaultWatchedPaths, watchOptions, (filepath, event) => {
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
if (filepath.includes("-server-loaders.js")) {
|
|
245
|
+
delete require.cache[filepath];
|
|
246
|
+
} else {
|
|
247
|
+
watcher.updateDepTree();
|
|
248
|
+
watcher.cleanDepCache(filepath);
|
|
249
|
+
}
|
|
246
250
|
this.onServerChange({
|
|
247
251
|
filepath,
|
|
248
252
|
event
|
package/dist/types/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type DevMiddlewareOptions = {
|
|
|
16
16
|
hmrClientPath?: string;
|
|
17
17
|
/** The options need by compiler middleware (like webpackMiddleware) */
|
|
18
18
|
|
|
19
|
-
headers?: Record<string, string>;
|
|
19
|
+
headers?: Record<string, string | string[]>;
|
|
20
20
|
writeToDisk?: boolean | ((filename: string) => boolean);
|
|
21
21
|
stats?: boolean;
|
|
22
22
|
/** should trigger when compiler hook called */
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.10.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,27 +33,27 @@
|
|
|
33
33
|
"minimatch": "^3.0.4",
|
|
34
34
|
"path-to-regexp": "^6.2.0",
|
|
35
35
|
"ws": "^8.2.0",
|
|
36
|
-
"@modern-js/prod-server": "2.
|
|
37
|
-
"@modern-js/server-utils": "2.
|
|
38
|
-
"@modern-js/types": "2.
|
|
39
|
-
"@modern-js/utils": "2.
|
|
36
|
+
"@modern-js/prod-server": "2.10.0",
|
|
37
|
+
"@modern-js/server-utils": "2.10.0",
|
|
38
|
+
"@modern-js/types": "2.10.0",
|
|
39
|
+
"@modern-js/utils": "2.10.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/connect-history-api-fallback": "^1.3.5",
|
|
43
|
-
"@types/jest": "^
|
|
43
|
+
"@types/jest": "^29",
|
|
44
44
|
"@types/minimatch": "^3.0.5",
|
|
45
45
|
"@types/node": "^14",
|
|
46
46
|
"@types/ws": "^7.4.7",
|
|
47
|
-
"jest": "^
|
|
47
|
+
"jest": "^29",
|
|
48
48
|
"node-mocks-http": "^1.11.0",
|
|
49
49
|
"ts-node": "^10.1.0",
|
|
50
50
|
"tsconfig-paths": "4.1.1",
|
|
51
51
|
"typescript": "^4",
|
|
52
|
-
"webpack": "^5.
|
|
52
|
+
"webpack": "^5.76.2",
|
|
53
53
|
"websocket": "^1",
|
|
54
|
-
"@modern-js/server-core": "2.
|
|
55
|
-
"@scripts/
|
|
56
|
-
"@scripts/
|
|
54
|
+
"@modern-js/server-core": "2.10.0",
|
|
55
|
+
"@scripts/jest-config": "2.10.0",
|
|
56
|
+
"@scripts/build": "2.10.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"devcert": "^1.0.0",
|