@modern-js/types 2.0.0-beta.4 → 2.0.0-beta.6

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,41 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 2.0.0-beta.6
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9c3e: chore: v2
8
+
9
+ ### Patch Changes
10
+
11
+ - 7879e8f711: refactor: remove enableModernMode config
12
+
13
+ refactor: 不再支持 enableModernMode 配置项
14
+
15
+ - 2e6031955e: fix: some optimizations for router and loader
16
+ fix: 一些 router 和 loader 的优化
17
+ q
18
+ - cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
19
+ refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
20
+ - 6bda14ed71: feat: refactor router with react-router@6.4
21
+
22
+ feat: 使用 react-router@6.4 重构路由模块
23
+
24
+ - 40ed5874c6: feat: inject css chunk into html for streaming ssr
25
+ feat: streaming ssr 返回的 html 注入 css chunk
26
+ - 87c1ff86b9: feat(app-tools): attach builder instance to appContext
27
+
28
+ feat(app-tools): 将 builder 实例挂载到 appContext 上
29
+
30
+ - 102d32e4ba: feat(server): add `req` and `res` to SSR context
31
+
32
+ feat(server): 添加 `req` 和 `res` 到 SSR context 中
33
+
34
+ - 8b8e1bb571: feat: support nested routes
35
+ feat: 支持嵌套路由
36
+ - 3bbea92b2a: feat: support Hook、Middleware new API
37
+ feat: 支持 Hook、Middleware 的新 API
38
+
3
39
  ## 2.0.0-beta.4
4
40
 
5
41
  ### Major Changes
package/cli/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export interface Entrypoint {
9
9
  entryName: string;
10
10
  entry: string;
11
11
  nestedRoutesEntry?: string;
12
+ pageRoutesEntry?: string;
12
13
  isAutoMount?: boolean;
13
14
  customBootstrap?: string | false;
14
15
  fileSystemRoutes?: {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.4",
14
+ "version": "2.0.0-beta.6",
15
15
  "types": "./index.d.ts",
16
16
  "exports": {
17
17
  ".": "./index.d.ts",
@@ -38,8 +38,8 @@
38
38
  "http-proxy-middleware": "^2.0.4",
39
39
  "jest": "^27",
40
40
  "type-fest": "2.15.0",
41
- "@scripts/build": "2.0.0-beta.4",
42
- "@scripts/jest-config": "2.0.0-beta.4"
41
+ "@scripts/jest-config": "2.0.0-beta.6",
42
+ "@scripts/build": "2.0.0-beta.6"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "publishConfig": {
package/server/hook.d.ts CHANGED
@@ -10,16 +10,17 @@ export type CookieAPI = {
10
10
 
11
11
  export interface ModernResponse {
12
12
  get: (key: string) => string | number | string[] | undefined;
13
- set: (key: string, value: string) => void;
13
+ set: (key: string, value: string | number) => void;
14
14
  status: (code: number) => void;
15
15
  cookies: CookieAPI;
16
16
  raw: (
17
17
  body: string,
18
- { status, headers }: { status: number; headers: Record<string, any> },
18
+ options?: { status?: number; headers?: Record<string, any> },
19
19
  ) => void;
20
20
  }
21
21
 
22
22
  export interface ModernRequest {
23
+ url: string;
23
24
  host: string;
24
25
  pathname: string;
25
26
  query: Record<string, any>;
@@ -40,7 +41,7 @@ export type AfterMatchContext = HookContext & {
40
41
  readonly current: string;
41
42
  readonly url: string;
42
43
  readonly status: number;
43
- redirect: (url: string, status: number) => void;
44
+ redirect: (url: string, status?: number) => void;
44
45
  rewrite: (entry: string) => void;
45
46
  use: (entry: string) => void;
46
47
  };