@modern-js/main-doc 0.0.0-next-1680174843477 → 0.0.0-next-1680185243813
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,18 +1,24 @@
|
|
|
1
1
|
# @modern-js/main-doc
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-1680185243813
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- @modern-js/builder-doc@0.0.0-next-1680185243813
|
|
8
|
+
|
|
9
|
+
## 2.11.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a8c08c3: feat: 添加 `source.transformImoprt`
|
|
8
14
|
|
|
9
15
|
feat: add `source.transformImoprt`
|
|
10
16
|
|
|
11
|
-
-
|
|
17
|
+
- 304c950: fix: translate some chinese to english in en docs
|
|
12
18
|
fix: 将部分英文文档中的中文翻译为英文
|
|
13
|
-
- Updated dependencies [
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- @modern-js/builder-doc@
|
|
19
|
+
- Updated dependencies [a8c08c3]
|
|
20
|
+
- Updated dependencies [b71cef1]
|
|
21
|
+
- @modern-js/builder-doc@2.11.0
|
|
16
22
|
|
|
17
23
|
## 2.10.0
|
|
18
24
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
sidebar_position: 3
|
|
3
3
|
title: Use Models
|
|
4
4
|
---
|
|
5
|
-
|
|
6
5
|
# Use Models
|
|
7
6
|
|
|
8
7
|
## Using Models in Components
|
|
@@ -147,7 +146,7 @@ will always get the initial value of Input.
|
|
|
147
146
|
|
|
148
147
|
:::
|
|
149
148
|
|
|
150
|
-
`useStaticModel` is also suitable for use with animation libraries such as [react-three-fiber](https://github.com/pmndrs/react-three-fiber), because binding fast-changing states in animation component UI can easily cause [performance issues](https
|
|
149
|
+
`useStaticModel` is also suitable for use with animation libraries such as [react-three-fiber](https://github.com/pmndrs/react-three-fiber), because binding fast-changing states in animation component UI can easily cause [performance issues](https:/docs.pmnd.rs/react-three-fiber/advanced/pitfalls#never-bind-fast-state-reactive). In this case, you can choose to use `useStaticModel`, which only subscribes to the State but does not cause the view component to re-render. Here is a simplified example:
|
|
151
150
|
|
|
152
151
|
```ts
|
|
153
152
|
function ThreeComponent() {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
sidebar_position: 3
|
|
3
3
|
title: 使用 Model
|
|
4
4
|
---
|
|
5
|
-
|
|
6
5
|
# 使用 Model
|
|
7
6
|
|
|
8
7
|
## 在组件内使用
|
|
@@ -148,7 +147,7 @@ function Search() {
|
|
|
148
147
|
|
|
149
148
|
:::
|
|
150
149
|
|
|
151
|
-
`useStaticModel` 还适合和 [react-three-fiber](https://github.com/pmndrs/react-three-fiber) 等动画库一起使用,因为在动画组件 UI 里绑定会快速变化的状态,容易引起[性能问题](https
|
|
150
|
+
`useStaticModel` 还适合和 [react-three-fiber](https://github.com/pmndrs/react-three-fiber) 等动画库一起使用,因为在动画组件 UI 里绑定会快速变化的状态,容易引起[性能问题](https:/docs.pmnd.rs/react-three-fiber/advanced/pitfalls#never-bind-fast-state-reactive)。这种情况就可以选择使用 `useStaticModel`,它只会订阅状态,但不会引起视图组件的重新渲染。下面是一个简化示例:
|
|
152
151
|
|
|
153
152
|
```ts
|
|
154
153
|
function ThreeComponent() {
|
package/modern.config.ts
CHANGED
|
@@ -78,8 +78,7 @@ export default defineConfig({
|
|
|
78
78
|
lang: 'zh',
|
|
79
79
|
themeDir: path.join(__dirname, 'src'),
|
|
80
80
|
markdown: {
|
|
81
|
-
checkDeadLinks:
|
|
82
|
-
experimentalMdxRs: true,
|
|
81
|
+
checkDeadLinks: process.env.NODE_ENV === 'production',
|
|
83
82
|
},
|
|
84
83
|
head: [
|
|
85
84
|
`
|
|
@@ -134,7 +133,7 @@ export default defineConfig({
|
|
|
134
133
|
dataUriLimit: 0,
|
|
135
134
|
},
|
|
136
135
|
dev: {
|
|
137
|
-
startUrl:
|
|
136
|
+
startUrl: true,
|
|
138
137
|
},
|
|
139
138
|
source: {
|
|
140
139
|
alias: {
|
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-1680185243813",
|
|
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-1680185243813"
|
|
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-1680185243813",
|
|
33
|
+
"@modern-js/doc-tools": "0.0.0-next-1680185243813",
|
|
34
|
+
"@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1680185243813"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "modern dev",
|