@modern-js/types 2.19.1 → 2.21.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 2.21.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 1ef03dc: feat(dev-server): enable gzip compression, add devServer.compress config
8
+
9
+ feat(dev-server): 默认启用 gzip 压缩,新增 devServer.compress 配置项
10
+
11
+ - 43b4e83: feat: support security.nonce for add nonce attribute on script tag
12
+ feat: 支持 security.nonce 配置,为 script 标签添加 nonce 属性
13
+ - ad78387: chore(deps): bump babel-related dependencies to latest version
14
+
15
+ chore(deps): 升级 babel 相关依赖到最新版本
16
+
17
+ ## 2.20.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 5f055ab: feat(app-tools): route.json add `isStream` field.
22
+ feat(app-tools): route.json 添加 `isStream` 字段.
23
+
3
24
  ## 2.19.1
4
25
 
5
26
  ## 2.19.0
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.19.1",
18
+ "version": "2.21.0",
19
19
  "types": "./index.d.ts",
20
20
  "exports": {
21
21
  ".": {
@@ -39,14 +39,14 @@
39
39
  }
40
40
  },
41
41
  "devDependencies": {
42
- "@types/babel__core": "^7.1.19",
42
+ "@types/babel__core": "^7.20.0",
43
43
  "@types/jest": "^29",
44
44
  "@types/node": "^14",
45
45
  "http-proxy-middleware": "^2.0.4",
46
46
  "jest": "^29",
47
47
  "type-fest": "2.15.0",
48
- "@scripts/build": "2.19.1",
49
- "@scripts/jest-config": "2.19.1"
48
+ "@scripts/build": "2.21.0",
49
+ "@scripts/jest-config": "2.21.0"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "publishConfig": {
@@ -89,6 +89,8 @@ export type BaseSSRServerContext = {
89
89
 
90
90
  enableUnsafeCtx?: boolean;
91
91
 
92
+ nonce?: string;
93
+
92
94
  req: ModernServerContext['req'];
93
95
 
94
96
  res: ModernServerContext['res'];
@@ -24,6 +24,8 @@ export type DevServerOptions = {
24
24
  host?: string;
25
25
  protocol?: string;
26
26
  };
27
+ /** Whether to enable gzip compression */
28
+ compress?: boolean;
27
29
  devMiddleware?: {
28
30
  writeToDisk?: boolean | ((filename: string) => boolean);
29
31
  outputFileSystem?: Record<string, any>;
package/server/route.d.ts CHANGED
@@ -9,6 +9,8 @@ export interface ServerRoute {
9
9
  isSPA?: boolean;
10
10
  // if route is ssr page
11
11
  isSSR?: boolean;
12
+ // if route is stream response
13
+ isStream?: boolean;
12
14
  // if route is api service
13
15
  isApi?: boolean;
14
16
  // worker js bundle for ssr page