@modern-js/main-doc 0.0.0-next-1681926671191 → 0.0.0-next-1681961423707

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,21 +1,21 @@
1
1
  # @modern-js/main-doc
2
2
 
3
- ## 0.0.0-next-1681926671191
3
+ ## 0.0.0-next-1681961423707
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 60a81d05d: feat: add ssr.inlineScript for use inline json instead inline script when ssr
7
+ - 60a81d05db: feat: add ssr.inlineScript for use inline json instead inline script when ssr
8
8
  feat: 添加 ssr.inlineScript 用于在 ssr 模式下使用内联 json 而不是内联脚本
9
- - 432ac8b88: chore(cli): improve commands descriptions
9
+ - 432ac8b884: chore(cli): improve commands descriptions
10
10
 
11
11
  chore(cli): 优化命令的描述文案
12
12
 
13
- - de84d9494: feat: add optional dynamic routes docs
13
+ - de84d94942: feat: add optional dynamic routes docs
14
14
  feat: 添加可选动态路由文档
15
- - Updated dependencies [fefd1c564]
16
- - Updated dependencies [1f34dbae9]
17
- - Updated dependencies [b965df261]
18
- - @modern-js/builder-doc@0.0.0-next-1681926671191
15
+ - Updated dependencies [fefd1c5645]
16
+ - Updated dependencies [1f34dbae90]
17
+ - Updated dependencies [b965df261f]
18
+ - @modern-js/builder-doc@0.0.0-next-1681961423707
19
19
 
20
20
  ## 2.13.4
21
21
 
@@ -48,6 +48,8 @@ These components are rendered:
48
48
 
49
49
  - `Scripts`: The script content generated by the webpack, which can be used to adjust the position of the bundle result, is placed in the `<Head>` component by default.
50
50
 
51
+ - `Comment`: Make the comment like `<!-- gateway -->`, could be stay to the html that final render.
52
+
51
53
  ### Template Params
52
54
 
53
55
  Because it is in the form of JSX, in `Document.[jt]sx`, you can use various variables in the component to assign values to various custom components more freely.
@@ -68,8 +70,8 @@ import {
68
70
  Root,
69
71
  Head,
70
72
  Body,
71
- Scripts,
72
73
  DocumentContext,
74
+ Comment,
73
75
  } from '@modern-js/runtime/document';
74
76
 
75
77
  export default function Document(): React.ReactElement {
@@ -83,13 +85,14 @@ export default function Document(): React.ReactElement {
83
85
  return (
84
86
  <Html>
85
87
  <Head>
86
- <link href="https://modernjs.dev">Modern.js</link>
88
+ <link href="https://modernjs.dev" />
89
+ <Comment>{'<!-- Need a Comment -->'}</Comment>
87
90
  </Head>
88
91
  <Body>
89
92
  <Root rootId="root">
90
93
  <h1 style={{ color: 'red' }}>Some Params: </h1>
91
- <h2> entryName: {entryName}</h2>
92
- <h2> title: {htmlConfig.title}</h2>
94
+ <h2> entryName{entryName}</h2>
95
+ <h2> title{htmlConfig.title}</h2>
93
96
  <h2> rootId: {templateParams.mountId}</h2>
94
97
  </Root>
95
98
  <h1>bottom</h1>
@@ -104,49 +107,46 @@ The above JSX component will generate the following HTML template:
104
107
  ```html
105
108
  <!DOCTYPE html>
106
109
  <html>
107
- <head>
108
- <meta charset="utf-8" />
109
- <meta
110
- name="viewport"
111
- 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"
112
- />
113
- <meta http-equiv="x-ua-compatible" content="ie=edge" />
114
- <meta name="renderer" content="webkit" />
115
- <meta name="layoutmode" content="standard" />
116
- <meta name="imagemode" content="force" />
117
- <meta name="wap-font-scale" content="no" />
118
- <meta name="format-detection" content="telephone=no" />
119
- <script>
120
- ...
121
- </script>
110
+
111
+ <head>
112
+ <meta charset="utf-8">
113
+ <meta name="viewport"
114
+ 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">
115
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
116
+ <meta name="renderer" content="webkit">
117
+ <meta name="layoutmode" content="standard">
118
+ <meta name="imagemode" content="force">
119
+ <meta name="wap-font-scale" content="no">
120
+ <meta name="format-detection" content="telephone=no">
121
+ <link rel="icon" href="/a.icon">
122
+ <script defer src="/static/js/builder-runtime.js"></script>
122
123
  <script defer src="/static/js/lib-react.js"></script>
123
124
  <script defer src="/static/js/lib-polyfill.js"></script>
124
125
  <script defer src="/static/js/lib-router.js"></script>
125
- <script
126
- defer
127
- src="/static/js/vendors-node_modules_pnpm_loadable_component_5_15_2_react_18_2_0_node_modules_loadable_compon-3fb0cf.js"
128
- ></script>
129
- <script
130
- defer
131
- src="/static/js/packages_runtime_plugin-router-legacy_dist_js_treeshaking_runtime_index_js-packages_runtime_p-28f4c9.js"
132
- ></script>
126
+
127
+ <script>
128
+ ...
129
+ </script>
133
130
  <script defer src="/static/js/sub.js"></script>
134
- <link href="https://www.baidu.com" />
135
- </head>
131
+ <link href="https://modernjs.dev" />
132
+ <!-- Need a Comment -->
133
+ </head>
136
134
 
137
- <body>
135
+ <body>
138
136
  <div id="root">
139
- {/* <?- html ?> */}
140
- <h1 style="color:red">Some Params: </h1>
141
- <h2>entryName: sub</h2>
142
- <h2>title: </h2>
143
- <h2>rootId: root</h2>
137
+ <!--<?- html ?>-->
138
+ <h1 style="color:red">Some Params: </h1>
139
+ <h2> entryNamesub</h2>
140
+ <h2> title:</h2>
141
+ <h2> rootId: root</h2>
144
142
  </div>
145
143
  <h1>bottom</h1>
146
- {/* <?- chunksMap.js ?> */}
147
- {/* <?- SSRDataScript ?> */}
148
- </body>
144
+ <!--<?- chunksMap.js ?>-->
145
+ <!--<?- SSRDataScript ?>-->
146
+ </body>
147
+
149
148
  </html>
149
+
150
150
  ```
151
151
 
152
152
  ## Html Synxtax
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-1681926671191",
14
+ "version": "0.0.0-next-1681961423707",
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-1681926671191"
20
+ "@modern-js/builder-doc": "0.0.0-next-1681961423707"
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-1681926671191",
33
- "@modern-js/doc-tools": "0.0.0-next-1681926671191",
34
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1681926671191"
32
+ "@modern-js/builder-doc": "0.0.0-next-1681961423707",
33
+ "@modern-js/doc-tools": "0.0.0-next-1681961423707",
34
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-next-1681961423707"
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "modern dev",