@modern-js/main-doc 0.0.0-nightly-20250101160310 → 0.0.0-nightly-20250102160316

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.
@@ -135,9 +135,10 @@ Files and directories named with `[]` are turned into dynamic routes. For instan
135
135
  ```bash
136
136
  .
137
137
  └── routes
138
+ ├── [id]
139
+ │ └── page.tsx
138
140
  ├── blog
139
- │ └── [id]
140
- │ └── page.tsx
141
+ │ └── page.tsx
141
142
  └── page.tsx
142
143
  ```
143
144
 
@@ -168,7 +169,7 @@ Files and directories named with `[$]` are turned into optional dynamic routes.
168
169
  └── page.tsx
169
170
  ```
170
171
 
171
- The `routes/user/[id$]/page.tsx` file will be converted to the `/user/:id?` route. All routes under `/user` will match this route, and the `id` parameter is optional. This route can be used to distinguish between **create** and **edit** actions.
172
+ The `routes/blog/[id$]/page.tsx` file will be converted to the `/blog/:id?` route. All routes under `/blog` will match this route, and the `id` parameter is optional. This route can be used to distinguish between **create** and **edit** actions.
172
173
 
173
174
  ```tsx
174
175
  import { useParams } from '@modern-js/runtime/router';
@@ -136,9 +136,10 @@ export default () => {
136
136
  ```bash
137
137
  .
138
138
  └── routes
139
+ ├── [id]
140
+ │ └── page.tsx
139
141
  ├── blog
140
-    └── [id]
141
- │   └── page.tsx
142
+ └── page.tsx
142
143
  └── page.tsx
143
144
  ```
144
145
 
@@ -169,7 +170,7 @@ export default Blog;
169
170
  └── page.tsx
170
171
  ```
171
172
 
172
- `routes/user/[id$]/page.tsx` 文件会转为 `/user/:id?` 路由。`/user` 下的所有路由都会匹配到该路由,并且 `id` 参数可选存在。通常在区分**创建**与**编辑**时,可以使用该路由。
173
+ `routes/blog/[id$]/page.tsx` 文件会转为 `/blog/:id?` 路由。`/blog` 下的所有路由都会匹配到该路由,并且 `id` 参数可选存在。通常在区分**创建**与**编辑**时,可以使用该路由。
173
174
 
174
175
  ```tsx
175
176
  import { useParams } from '@modern-js/runtime/router';
package/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20250101160310",
18
+ "version": "0.0.0-nightly-20250102160316",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public",
22
22
  "provenance": true
23
23
  },
24
24
  "dependencies": {
25
- "@modern-js/sandpack-react": "0.0.0-nightly-20250101160310"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20250102160316"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rspress/shared": "1.39.3",