@modern-js/main-doc 0.0.0-next-1681884919667 → 0.0.0-next-1681913246323

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,6 +1,6 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1681884919667
3
+ ## 0.0.0-next-1681913246323
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -14,7 +14,8 @@
14
14
  feat: 添加可选动态路由文档
15
15
  - Updated dependencies [fefd1c564]
16
16
  - Updated dependencies [1f34dbae9]
17
- - @modern-js/builder-doc@0.0.0-next-1681884919667
17
+ - Updated dependencies [b965df261]
18
+ - @modern-js/builder-doc@0.0.0-next-1681913246323
18
19
 
19
20
  ## 2.13.4
20
21
 
@@ -49,6 +49,8 @@ import { Html, Body, Root, Head, Scripts } from '@modern-js/runtime/document';
49
49
 
50
50
  - `Scripts`:构建产生的 script 内容,可用于调整构建产物的位置,默认放在 `<Head>` 组件中。
51
51
 
52
+ - `Comment`:将用户编写的 `<!-- gateway -->` 这种注释,保留输出到最新渲染的 html 中。
53
+
52
54
  ### 模板参数
53
55
 
54
56
  因为是 JSX 形式,`Document.[jt]sx` 里,可以比较自由的在组件内使用各种变量去赋值给各种自定义组件。
@@ -69,8 +71,8 @@ import {
69
71
  Root,
70
72
  Head,
71
73
  Body,
72
- Scripts,
73
74
  DocumentContext,
75
+ Comment,
74
76
  } from '@modern-js/runtime/document';
75
77
 
76
78
  export default function Document(): React.ReactElement {
@@ -84,7 +86,8 @@ export default function Document(): React.ReactElement {
84
86
  return (
85
87
  <Html>
86
88
  <Head>
87
- <link href="https://modernjs.dev">Modern.js</link>
89
+ <link href="https://modernjs.dev" />
90
+ <Comment>{'<!-- Need a Comment -->'}</Comment>
88
91
  </Head>
89
92
  <Body>
90
93
  <Root rootId="root">
@@ -105,49 +108,43 @@ export default function Document(): React.ReactElement {
105
108
  ```html
106
109
  <!DOCTYPE html>
107
110
  <html>
108
- <head>
109
- <meta charset="utf-8" />
110
- <meta
111
- name="viewport"
112
- content="width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
113
- />
114
- <meta http-equiv="x-ua-compatible" content="ie=edge" />
115
- <meta name="renderer" content="webkit" />
116
- <meta name="layoutmode" content="standard" />
117
- <meta name="imagemode" content="force" />
118
- <meta name="wap-font-scale" content="no" />
119
- <meta name="format-detection" content="telephone=no" />
120
- <script>
121
- ...
122
- </script>
111
+
112
+ <head>
113
+ <meta charset="utf-8">
114
+ <meta name="viewport"
115
+ content="width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
116
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
117
+ <meta name="renderer" content="webkit">
118
+ <meta name="layoutmode" content="standard">
119
+ <meta name="imagemode" content="force">
120
+ <meta name="wap-font-scale" content="no">
121
+ <meta name="format-detection" content="telephone=no">
122
+ <link rel="icon" href="/a.icon">
123
+ <script defer src="/static/js/builder-runtime.js"></script>
123
124
  <script defer src="/static/js/lib-react.js"></script>
124
125
  <script defer src="/static/js/lib-polyfill.js"></script>
125
126
  <script defer src="/static/js/lib-router.js"></script>
126
- <script
127
- defer
128
- src="/static/js/vendors-node_modules_pnpm_loadable_component_5_15_2_react_18_2_0_node_modules_loadable_compon-3fb0cf.js"
129
- ></script>
130
- <script
131
- defer
132
- src="/static/js/packages_runtime_plugin-router-legacy_dist_js_treeshaking_runtime_index_js-packages_runtime_p-28f4c9.js"
133
- ></script>
127
+ <script xxx>
134
128
  <script defer src="/static/js/sub.js"></script>
135
- <link href="https://www.baidu.com" />
136
- </head>
129
+ <link href="https://modernjs.dev" />
130
+ <!-- Need a Comment -->
131
+ </head>
137
132
 
138
- <body>
133
+ <body>
139
134
  <div id="root">
140
- {/* <?- html ?> */}
141
- <h1 style="color:red">以下为构建时传过来的参数:</h1>
142
- <h2>entryName:sub</h2>
143
- <h2>title:</h2>
144
- <h2>rootId: root</h2>
135
+ <!--<?- html ?>-->
136
+ <h1 style="color:red">以下为构建时传过来的参数:</h1>
137
+ <h2> entryName:sub</h2>
138
+ <h2> title:</h2>
139
+ <h2> rootId: root</h2>
145
140
  </div>
146
141
  <h1>bottom</h1>
147
- {/* <?- chunksMap.js ?> */}
148
- {/* <?- SSRDataScript ?> */}
149
- </body>
142
+ <!--<?- chunksMap.js ?>-->
143
+ <!--<?- SSRDataScript ?>-->
144
+ </body>
145
+
150
146
  </html>
147
+
151
148
  ```
152
149
 
153
150
  ## Html 语法
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-1681884919667",
14
+ "version": "0.0.0-next-1681913246323",
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-1681884919667"
20
+ "@modern-js/builder-doc": "0.0.0-next-1681913246323"
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-1681884919667",
33
- "@modern-js/doc-tools": "0.0.0-next-1681884919667",
34
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1681884919667"
32
+ "@modern-js/builder-doc": "0.0.0-next-1681913246323",
33
+ "@modern-js/doc-tools": "0.0.0-next-1681913246323",
34
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1681913246323"
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "modern dev",