@modern-js/main-doc 0.0.0-next-1680185243813 → 0.0.0-next-1680201218318
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,10 +1,12 @@
|
|
|
1
1
|
# @modern-js/main-doc
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-1680201218318
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 9e5044d41: doc: 修正文档中使用@edenx/runtime 的部分
|
|
8
|
+
doc: Correct the sections in the document that use @edenx/runtime.
|
|
9
|
+
- @modern-js/builder-doc@0.0.0-next-1680201218318
|
|
8
10
|
|
|
9
11
|
## 2.11.0
|
|
10
12
|
|
|
@@ -223,7 +223,7 @@ Currently, only CSR is supported, so stay tuned for Streaming SSR.
|
|
|
223
223
|
Add the following code to `user/layout.loader.ts`:
|
|
224
224
|
|
|
225
225
|
```ts title="routes/user/layout.loader.ts"
|
|
226
|
-
import { defer } from "@
|
|
226
|
+
import { defer } from "@modern-js/runtime/router"
|
|
227
227
|
|
|
228
228
|
const loader = () =>
|
|
229
229
|
defer({
|
|
@@ -230,7 +230,7 @@ When a route jumps from `/` to `/blog`, if the JS Chunk of the `<Blog>` componen
|
|
|
230
230
|
You can redirect routes by creating a [`data loader`](/guides/basic-features/data-fetch) file, Suppose you have the file `routes/user/page.tsx` and you want to redirect the route corresponding to this file, you can create the file `routes/user/page.loader.ts`:
|
|
231
231
|
|
|
232
232
|
```ts title="routes/user/page.loader.ts"
|
|
233
|
-
import { redirect } from
|
|
233
|
+
import { redirect } from '@modern-js/runtime/router'
|
|
234
234
|
|
|
235
235
|
export default () => {
|
|
236
236
|
const user = await getUser();
|
|
@@ -224,7 +224,7 @@ export default function UserLayout() {
|
|
|
224
224
|
创建 `user/layout.loader.ts`,并添加以下代码:
|
|
225
225
|
|
|
226
226
|
```ts title="routes/user/layout.loader.ts"
|
|
227
|
-
import { defer } from "@
|
|
227
|
+
import { defer } from "@modern-js/runtime/router"
|
|
228
228
|
|
|
229
229
|
const loader = () =>
|
|
230
230
|
defer({
|
|
@@ -297,7 +297,7 @@ Modern.js 建议必须有根 layout 和根 loading。
|
|
|
297
297
|
可以通过创建 [`data loader`](/guides/basic-features/data-fetch) 文件做路由的重定向,如有文件 `routes/user/page.tsx`,想对这个文件对应的路由做重定向,可以创建 `routes/user/page.loader.ts` 文件:
|
|
298
298
|
|
|
299
299
|
```ts title="routes/user/page.loader.ts"
|
|
300
|
-
import { redirect } from
|
|
300
|
+
import { redirect } from '@modern-js/runtime/router'
|
|
301
301
|
|
|
302
302
|
export default () => {
|
|
303
303
|
const user = await getUser();
|
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-1680201218318",
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"registry": "https://registry.npmjs.org/",
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@modern-js/builder-doc": "0.0.0-next-
|
|
20
|
+
"@modern-js/builder-doc": "0.0.0-next-1680201218318"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"classnames": "^2",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"fs-extra": "^10",
|
|
30
30
|
"@types/node": "^16",
|
|
31
31
|
"@types/fs-extra": "^9",
|
|
32
|
-
"@modern-js/builder-doc": "0.0.0-next-
|
|
33
|
-
"@modern-js/doc-tools": "0.0.0-next-
|
|
34
|
-
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-
|
|
32
|
+
"@modern-js/builder-doc": "0.0.0-next-1680201218318",
|
|
33
|
+
"@modern-js/doc-tools": "0.0.0-next-1680201218318",
|
|
34
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1680201218318"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "modern dev",
|