@modern-js/main-doc 0.0.0-next-1685383616364 → 0.0.0-next-1685436485731

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/docs/en/apis/app/commands.mdx +5 -5
  3. package/docs/en/apis/app/hooks/api/api.mdx +80 -0
  4. package/docs/en/apis/app/hooks/api/app.mdx +12 -0
  5. package/docs/en/apis/app/hooks/api/lambda.mdx +57 -0
  6. package/docs/en/apis/app/hooks/api/test.mdx +1 -1
  7. package/docs/en/apis/app/hooks/config/html.mdx +2 -2
  8. package/docs/en/apis/app/hooks/config/icon.mdx +19 -19
  9. package/docs/en/apis/app/hooks/config/mock.mdx +1 -1
  10. package/docs/en/apis/app/hooks/config/public.mdx +10 -10
  11. package/docs/en/apis/app/hooks/config/storybook.mdx +3 -3
  12. package/docs/en/apis/app/hooks/config/upload.mdx +13 -13
  13. package/docs/en/apis/app/hooks/modern-config.mdx +4 -4
  14. package/docs/en/apis/app/hooks/server/index_.mdx +2 -9
  15. package/docs/en/apis/app/hooks/server/test.mdx +5 -2
  16. package/docs/en/apis/app/hooks/shared.mdx +1 -1
  17. package/docs/en/apis/app/hooks/src/app.mdx +17 -27
  18. package/docs/en/apis/app/hooks/src/index_.mdx +6 -6
  19. package/docs/en/apis/app/hooks/src/pages.mdx +41 -37
  20. package/docs/en/apis/app/hooks/src/routes.mdx +16 -36
  21. package/docs/en/apis/app/hooks/src/server.mdx +1 -1
  22. package/docs/en/apis/app/hooks/src/stories.mdx +6 -3
  23. package/docs/en/apis/app/hooks/src/test.mdx +4 -3
  24. package/docs/en/apis/app/runtime/web-server/hook.mdx +2 -2
  25. package/docs/en/apis/app/runtime/web-server/middleware.mdx +2 -2
  26. package/docs/en/components/init-app.mdx +3 -3
  27. package/docs/en/components/init-rspack-app.mdx +4 -4
  28. package/docs/en/components/ua-polyfill.mdx +2 -2
  29. package/docs/en/configure/app/tools/swc.mdx +2 -2
  30. package/docs/en/guides/advanced-features/bff/frameworks.mdx +2 -2
  31. package/docs/en/guides/advanced-features/bff/function.mdx +4 -4
  32. package/docs/en/guides/advanced-features/bff/type.mdx +5 -5
  33. package/docs/en/guides/advanced-features/rspack-start.mdx +2 -2
  34. package/docs/en/guides/advanced-features/ssg.mdx +2 -2
  35. package/docs/en/guides/advanced-features/testing.mdx +2 -2
  36. package/docs/en/guides/advanced-features/web-server.mdx +2 -2
  37. package/docs/en/guides/basic-features/css.mdx +2 -2
  38. package/docs/en/guides/basic-features/routes.mdx +11 -7
  39. package/docs/en/guides/concept/entries.mdx +3 -3
  40. package/docs/en/guides/topic-detail/generator/codesmith/develop.mdx +3 -3
  41. package/docs/en/guides/topic-detail/generator/plugin/develop.mdx +13 -13
  42. package/docs/en/guides/topic-detail/micro-frontend/c02-development.mdx +8 -8
  43. package/docs/en/tutorials/first-app/c03-css.mdx +2 -2
  44. package/docs/en/tutorials/first-app/c08-entries.mdx +3 -3
  45. package/docs/zh/apis/app/commands.mdx +3 -3
  46. package/docs/zh/apis/app/hooks/api/{functions/api.mdx → api.mdx} +4 -4
  47. package/docs/zh/apis/app/hooks/api/app.mdx +12 -0
  48. package/docs/zh/apis/app/hooks/api/{framework/lambda.mdx → lambda.mdx} +5 -5
  49. package/docs/zh/apis/app/hooks/api/test.mdx +3 -3
  50. package/docs/zh/apis/app/hooks/config/icon.mdx +15 -15
  51. package/docs/zh/apis/app/hooks/config/mock.mdx +1 -1
  52. package/docs/zh/apis/app/hooks/config/public.mdx +3 -3
  53. package/docs/zh/apis/app/hooks/config/upload.mdx +1 -1
  54. package/docs/zh/apis/app/hooks/modern-config.mdx +3 -3
  55. package/docs/zh/apis/app/hooks/server/index_.mdx +1 -6
  56. package/docs/zh/apis/app/hooks/shared.mdx +1 -1
  57. package/docs/zh/apis/app/hooks/src/app.mdx +15 -25
  58. package/docs/zh/apis/app/hooks/src/index_.mdx +6 -6
  59. package/docs/zh/apis/app/hooks/src/pages.mdx +7 -3
  60. package/docs/zh/apis/app/hooks/src/routes.mdx +4 -4
  61. package/docs/zh/apis/app/hooks/src/stories.mdx +1 -1
  62. package/docs/zh/components/ua-polyfill.mdx +1 -1
  63. package/docs/zh/configure/app/tools/swc.mdx +2 -2
  64. package/docs/zh/guides/advanced-features/rspack-start.mdx +2 -2
  65. package/docs/zh/guides/advanced-features/ssg.mdx +1 -1
  66. package/docs/zh/guides/advanced-features/testing.mdx +2 -2
  67. package/docs/zh/guides/advanced-features/web-server.mdx +1 -1
  68. package/docs/zh/guides/basic-features/css.mdx +1 -1
  69. package/docs/zh/guides/basic-features/routes.mdx +7 -4
  70. package/docs/zh/guides/concept/entries.mdx +3 -3
  71. package/docs/zh/guides/topic-detail/generator/plugin/develop.mdx +14 -14
  72. package/docs/zh/guides/topic-detail/micro-frontend/c02-development.mdx +4 -4
  73. package/docs/zh/guides/topic-detail/model/test-model.mdx +1 -1
  74. package/docs/zh/tutorials/first-app/c03-css.mdx +1 -1
  75. package/docs/zh/tutorials/first-app/c08-entries.mdx +1 -1
  76. package/package.json +5 -5
  77. package/docs/en/apis/app/hooks/api/framework/_category_.json +0 -4
  78. package/docs/en/apis/app/hooks/api/framework/lambda.mdx +0 -57
  79. package/docs/en/apis/app/hooks/api/functions/_category_.json +0 -4
  80. package/docs/en/apis/app/hooks/api/functions/api.mdx +0 -81
  81. package/docs/en/apis/app/hooks/api/functions/app.mdx +0 -12
  82. package/docs/en/apis/app/hooks/api/functions/common.mdx +0 -9
  83. package/docs/zh/apis/app/hooks/api/framework/_category_.json +0 -4
  84. package/docs/zh/apis/app/hooks/api/functions/_category_.json +0 -4
  85. package/docs/zh/apis/app/hooks/api/functions/app.mdx +0 -12
  86. package/docs/zh/apis/app/hooks/api/functions/common.mdx +0 -9
@@ -449,7 +449,7 @@ export const init = (context: RuntimeContext) => {
449
449
  在约定式路由下, Modern.js 会根据路由,自动地对路由进行分片,当用户访问具体的路由时,会自动加载对应的分片,这样可以有效地减少首屏加载的时间。但这也带来了一个问题,当用户访问一个路由时,如果该路由对应的分片还未加载完成,就会出现白屏的情况。
450
450
  这种情况下你可以通过定义 `Loading` 组件,在静态资源加载完成前,展示一个自定义的 `Loading` 组件。
451
451
 
452
- 为了进一步提升用户体验,减少 loading 的时间,Modern.js 支持在 Link 组件上定义 `prefetch` 属性,可以提前对静态资源和数据进行加载, `prefetch` 属性有三个可选值:
452
+ 为了进一步提升用户体验,减少 loading 的时间,Modern.js 支持在 Link 组件上定义 `prefetch` 属性,可以提前对静态资源和数据进行加载:
453
453
 
454
454
  ```tsx
455
455
  <Link prefetch="intent" to="page">
@@ -461,6 +461,8 @@ export const init = (context: RuntimeContext) => {
461
461
 
462
462
  :::
463
463
 
464
+ `prefetch` 属性有三个可选值:
465
+
464
466
  - `none`, 默认值,不会做 prefetch,没有任何额外的行为。
465
467
  - `intent`,这是我们推荐大多数场景下使用的值,当你把鼠标放在 Link 上时,会自动开始加载对应的分片和 Data Loader 中定义的数据,当鼠标移开时,会自动取消加载。在我们的测试中,即使是快速点击,也能减少大约 200ms 的加载时间。
466
468
  - `render`,当 Link 组件渲染时,就会加载对应的分片和 Data Loader 中定义的数据。
@@ -505,8 +507,6 @@ export default () => {
505
507
  Modern.js 默认对约定式路由做了一系列资源加载及渲染上的优化,并且提供了开箱即用的 SSR 能力,而这些能力,在使用自控路由时,都需要开发者自行封装,推荐开发者使用约定式路由。
506
508
  :::
507
509
 
508
- 使用自控式路由时,如果开发者关闭了 [`runtime.router`](/configure/app/runtime/router) 配置,并直接使用 `react-router-dom`,那还需要根据 React Router 文档自行包裹 `Provider`。
509
-
510
510
  ## 其他路由方案
511
511
 
512
512
  默认情况下,Modern.js 会开启内置的路由方案,即 React Router。
@@ -519,7 +519,9 @@ export default defineConfig({
519
519
  });
520
520
  ```
521
521
 
522
- Modern.js `@modern-js/runtime/router` 命名空间暴露了 React Router 的 API 供开发者使用,保证开发者和 Modern.js 中使用同一份代码。另外,这种情况下,React Router 的代码会被打包到 JS 产物中。如果项目已经有自己的路由方案,或者不需要使用客户端路由,可以关闭这个功能。
522
+ 如上述配置,当开启 [`runtime.router`](/configure/app/runtime/router) 配置时,Modern.js 会从 `@modern-js/runtime/router` 命名空间导出 React Router 的 API 供开发者使用,保证开发者和 Modern.js 中使用同一份代码,并自动根据 router 配置包裹 `Provider` 组件。另外,这种情况下,React Router 的代码会被打包到 JS 产物中。
523
+
524
+ 如果项目已经有自己的路由方案,或者不需要使用客户端路由,可以关闭这个功能。
523
525
 
524
526
  ```js
525
527
  export default defineConfig({
@@ -529,5 +531,6 @@ export default defineConfig({
529
531
  });
530
532
  ```
531
533
 
534
+ 如上述配置, 如果关闭了 [`runtime.router`](/configure/app/runtime/router) 配置,并直接使用 `react-router-dom` 进行项目路由管理时,还需要根据 React Router 文档自行包裹 `Provider`。
532
535
 
533
536
 
@@ -33,9 +33,9 @@ Modern.js 初始化的项目是单入口的(SPA),项目结构如下:
33
33
  在 Modern.js 项目中,你可以很方便的将单入口切换成多入口,直接在项目下执行 `pnpm run new`,通过生成器创建入口即可:
34
34
 
35
35
  ```bash
36
- ? 请选择你想要的操作:创建工程元素
37
- ? 创建工程元素:新建「应用入口」
38
- ? 请填写入口名称:new-entry
36
+ ? 请选择你想要的操作 创建工程元素
37
+ ? 请选择创建元素类型 新建「应用入口」
38
+ ? 请填写入口名称 new-entry
39
39
  ```
40
40
 
41
41
  执行后,Modern.js 会自动生成一个新的入口目录,此时可以看到 `src/` 目录变成如下结构:
@@ -17,13 +17,13 @@ npx @modern-js/create@latest plugin --plugin @modern-js/generator-plugin-plugin
17
17
  ### 扩展工程方案
18
18
 
19
19
  ```
20
- ? 请选择你想创建的工程类型:Npm 模块
21
- ? 请选择项目场景:生成器插件
22
- ? 插件包名:plugin
23
- ? 请选择开发语言:TS
24
- ? 请选择包管理工具:pnpm
25
- ? 插件类型:扩展
26
- ? 插件基础类型:应用
20
+ ? 请选择你想创建的工程类型 Npm 模块
21
+ ? 请选择项目场景 生成器插件
22
+ ? 请输入生成器插件插件包名 plugin
23
+ ? 请选择开发语言 TS
24
+ ? 请选择包管理工具 pnpm
25
+ ? 请选择插件类型 扩展
26
+ ? 请选择插件基础类型 应用
27
27
  ```
28
28
 
29
29
  ### 创建工程方案场景
@@ -31,13 +31,13 @@ npx @modern-js/create@latest plugin --plugin @modern-js/generator-plugin-plugin
31
31
  ```
32
32
  ? 请选择你想创建的工程类型:Npm 模块
33
33
  ? 请选择项目场景:生成器插件
34
- ? 插件包名:plugin
35
- ? 请选择开发语言:TS
36
- ? 请选择包管理工具:pnpm
37
- ? 插件类型:自定义
38
- ? 插件关键字:mobile-app
39
- ? 插件展示名称:移动应用
40
- ? 插件基础类型:应用
34
+ ? 请输入生成器插件插件包名 plugin
35
+ ? 请选择开发语言 TS
36
+ ? 请选择包管理工具 pnpm
37
+ ? 请选择插件类型 自定义
38
+ ? 请输入插件关键字 mobile-app
39
+ ? 请输入插件展示名称 移动应用
40
+ ? 请选择插件基础类型 应用
41
41
  ```
42
42
 
43
43
  创建项目命令执行完成后,会对应的生成一个开发生成器插件的项目,`package.json` 中也会根据你的选择对应的生成 `meta` 信息。
@@ -35,7 +35,7 @@ import DefaultMWAGenerate from "@site-docs/components/default-mwa-generate";
35
35
 
36
36
  ```bash
37
37
  ? 请选择你想要的操作 启用可选功能
38
- ? 启用可选功能 启用「微前端」模式
38
+ ? 请选择功能名称 启用「微前端」模式
39
39
  ```
40
40
 
41
41
  接下来,让我们注册微前端插件并添加开启微前端主应用,并增加子应用列表:
@@ -115,7 +115,7 @@ npx @modern-js/create@latest
115
115
 
116
116
  ```bash
117
117
  ? 请选择你想要的操作 启用可选功能
118
- ? 启用可选功能 启用「微前端」模式
118
+ ? 请选择功能名称 启用「微前端」模式
119
119
  ```
120
120
 
121
121
  接下来,让我们注册微前端插件并添加开启微前端主应用,并增加子应用列表:
@@ -145,7 +145,7 @@ npx @modern-js/create@latest
145
145
 
146
146
  ```bash
147
147
  ? 请选择你想要的操作 启用可选功能
148
- ? 启用可选功能 启用「微前端」模式
148
+ ? 请选择功能名称 启用「微前端」模式
149
149
  ```
150
150
 
151
151
  接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
@@ -197,7 +197,7 @@ npx @modern-js/create@latest
197
197
 
198
198
  ```bash
199
199
  ? 请选择你想要的操作 启用可选功能
200
- ? 启用可选功能 启用「微前端」模式
200
+ ? 请选择功能名称 启用「微前端」模式
201
201
  ```
202
202
 
203
203
  接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
@@ -10,7 +10,7 @@ title: 测试 Model
10
10
 
11
11
  ```bash
12
12
  ? 请选择你想要的操作 启用可选功能
13
- ? 启用可选功能 启用「单元测试 / 集成测试」功能
13
+ ? 请选择功能名称 启用「单元测试 / 集成测试」功能
14
14
  ```
15
15
 
16
16
  即可开启测试功能支持。
@@ -115,7 +115,7 @@ Modern.js 集成了主流、轻量、通用的 Utility Class 工具库 [Tailwind
115
115
 
116
116
  ```bash
117
117
  ? 请选择你想要的操作 启用可选功能
118
- ? 启用可选功能 启用 Tailwind CSS 支持
118
+ ? 请选择功能名称 启用 Tailwind CSS 支持
119
119
  ```
120
120
 
121
121
  在 `modern.config.ts` 中注册 Tailwind 插件:
@@ -15,7 +15,7 @@ title: 添加应用入口
15
15
 
16
16
  ```bash
17
17
  ? 请选择你想要的操作 创建工程元素
18
- ? 创建工程元素 新建「应用入口」
18
+ ? 请选择创建元素类型 新建「应用入口」
19
19
  ? 请填写入口名称 (entry) landing-page
20
20
  ```
21
21
 
package/package.json CHANGED
@@ -15,13 +15,13 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1685383616364",
18
+ "version": "0.0.0-next-1685436485731",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public"
22
22
  },
23
23
  "peerDependencies": {
24
- "@modern-js/builder-doc": "0.0.0-next-1685383616364"
24
+ "@modern-js/builder-doc": "0.0.0-next-1685436485731"
25
25
  },
26
26
  "devDependencies": {
27
27
  "classnames": "^2",
@@ -33,9 +33,9 @@
33
33
  "fs-extra": "^10",
34
34
  "@types/node": "^16",
35
35
  "@types/fs-extra": "^9",
36
- "@modern-js/builder-doc": "0.0.0-next-1685383616364",
37
- "@modern-js/doc-tools": "0.0.0-next-1685383616364",
38
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1685383616364"
36
+ "@modern-js/doc-tools": "0.0.0-next-1685436485731",
37
+ "@modern-js/builder-doc": "0.0.0-next-1685436485731",
38
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1685436485731"
39
39
  },
40
40
  "scripts": {
41
41
  "dev": "modern dev",
@@ -1,4 +0,0 @@
1
- {
2
- "label": "框架写法",
3
- "position": 2
4
- }
@@ -1,57 +0,0 @@
1
- ---
2
- title: lambda/*.[tj]s
3
- sidebar_position: 1
4
- ---
5
- # lambda/*.[tj]s
6
-
7
- Declaring API routing in BFF framework mode. Except [some files](/apis/app/hooks/api/framework/lambda#allow-list), files in `api/` are registered as routes.
8
-
9
- :::info
10
- use `api/` need execute new command to enable the 「BFF」 feature.
11
-
12
- :::
13
-
14
- :::tip
15
- this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
16
-
17
- :::
18
-
19
- ## Routing Rule
20
-
21
- ### Default Route
22
-
23
- The files named `index` will be upper level routing:
24
-
25
- - `api/lambda/index.ts` -> `$BASENAME/`
26
- - `api/lambda/user/index.ts` -> `$BASENAME/user`
27
-
28
- ### Multi Level Route
29
-
30
- The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
31
-
32
- - `api/lambda/hello.ts` -> `$BASENAME/hello`
33
- - `api/lambda/user/list.ts` -> `$BASENAME/user/list`
34
-
35
- ### Dynamic Route
36
-
37
- Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
38
-
39
- - `api/lambda/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
40
- - `api/lambda/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
41
- - `api/lambda/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
42
-
43
- the `$BASENAME` can be configured in `modern.config.js`, the default value is `/api`.
44
-
45
- ### Allow List
46
-
47
- By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
48
-
49
- - file name start with `_`, for example: `_utils.ts`.
50
- - files in directory that name start with `_`, for example: `_utils/index.ts`、`_utils/cp.ts`.
51
- - test files, for example: `foo.test.ts`.
52
- - TypeScript define files, for example: `hello.d.ts`.
53
- - files in `node_module`.
54
-
55
- ## Define Function
56
-
57
- the same as [Define Function](/apis/app/hooks/api/functions/api#define-function).
@@ -1,4 +0,0 @@
1
- {
2
- "label": "函数写法",
3
- "position": 1
4
- }
@@ -1,81 +0,0 @@
1
- ---
2
- title: '**/*.[tj]s'
3
- sidebar_position: 1
4
- ---
5
- # **/*.[tj]s
6
-
7
- Declaring API routing in BFF function mode. Except [some files](/apis/app/hooks/api/functions/api#allow-list), files in `api/` are registered as routes.
8
-
9
- :::info
10
- use `api/` need execute new command to enable the 「BFF」 feature.
11
-
12
- :::
13
-
14
- :::tip
15
- this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
16
-
17
- :::
18
-
19
- ## Routing Rule
20
-
21
- ### Default Route
22
-
23
- The files named `index` will be upper level routing:
24
-
25
- - `api/index.ts` -> `$BASENAME/`
26
- - `api/user/index.ts` -> `$BASENAME/user`
27
-
28
- ### Multi Level Route
29
-
30
- The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
31
-
32
- - `api/hello.ts` -> `$BASENAME/hello`
33
- - `api/user/list.ts` -> `$BASENAME/user/list`
34
-
35
- ### Dynamic Route
36
-
37
- Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
38
-
39
- - `api/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
40
- - `api/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
41
- - `api/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
42
-
43
- the `$BASENAME` can be configured in `modern.config.js`, the default value is `/api`.
44
-
45
- ### Allow List
46
-
47
- By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
48
-
49
- - file name start with `_`, for example: `_utils.ts`.
50
- - files in directory that name start with `_`, for example: `_utils/index.ts`、`_utils/cp.ts`.
51
- - test files, for example: `foo.test.ts`.
52
- - TypeScript define files, for example: `hello.d.ts`.
53
- - files in `node_module`.
54
-
55
- ## Define Function
56
-
57
- In addition to the above routing rules, the function definition and export in the code also have conventions.
58
-
59
- function need named exports, and the name of the exported function is the HTTP Method:
60
-
61
- ```ts
62
- export const get = async () => {
63
- return {
64
- name: 'Modern.js',
65
- desc: 'Modern web Solutions',
66
- };
67
- };
68
- ```
69
-
70
- Export the function like above will generate a `POST` interface.
71
-
72
- App support 9 Method definitions: `GET`、`POST`、`PUT`、`DELETE`、`CONNECT`、`TRACE`、`PATCH`、`OPTION`、`HEAD`. so App can use these name as function export nane.
73
-
74
- The name is insensitive, whaterver `get`、`Get`、`GEt`、`GET`, can be accurately identified. And default export, `export default xxx` will be `Get` method.
75
-
76
- because `delete` is a keyword in JavaScript, use `del` or `DELETE` instead.
77
-
78
- Multiple functions of different Methods can be defined in one file, but if multiple functions of the same Method are defined, only the first can work.
79
-
80
- :::info
81
- It should be noted that the defined functions should be asynchronous, which is related to the type when the function is called.
@@ -1,12 +0,0 @@
1
- ---
2
- title: _app.[tj]s
3
- sidebar_position: 3
4
- ---
5
- # _app.[tj]s
6
-
7
- in BFF function mode, this file can add middleware before [BFF 函数](/apis/app/hooks/api/functions/api).
8
-
9
- :::note
10
- For detail, see [hook](/apis/app/runtime/bff/hook)
11
-
12
- :::
@@ -1,9 +0,0 @@
1
- ---
2
- title: '**/_*.[tj]s, _*/**'
3
- sidebar_position: 2
4
- ---
5
- # **/_*.[tj]s, _*/**
6
-
7
- under BFF function mode, these files are not registered as routes.
8
-
9
- Any files that not routes, but required in the project can be named in this way.
@@ -1,4 +0,0 @@
1
- {
2
- "label": "Framework Mode",
3
- "position": 2
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "label": "Function Mode",
3
- "position": 1
4
- }
@@ -1,12 +0,0 @@
1
- ---
2
- title: _app.[tj]s
3
- sidebar_position: 3
4
- ---
5
- # _app.[tj]s
6
-
7
- 在函数写法下,该文件可以为 [BFF 函数](/apis/app/hooks/api/functions/api)添加前置中间件。
8
-
9
- :::note
10
- 具体示例请参考 [hook](/apis/app/runtime/bff/hook)
11
-
12
- :::
@@ -1,9 +0,0 @@
1
- ---
2
- title: '**/_*.[tj]s, _*/**'
3
- sidebar_position: 2
4
- ---
5
- # **/_*.[tj]s, _*/**
6
-
7
- 在 BFF 函数写法下,这些文件不会注册为路由。
8
-
9
- 你可以在这种目录或文件下放任意项目中需要的代码,文件等。