@modern-js/main-doc 0.0.0-nightly-20240423030424 → 0.0.0-nightly-20240424170740

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.
@@ -0,0 +1,42 @@
1
+ ---
2
+ sidebar_label: client
3
+ ---
4
+
5
+ # dev.client
6
+
7
+ Configure the client code injected by Modern.js during the development process. This can be used to set the WebSocket URL for HMR.
8
+
9
+ - **Type:**
10
+
11
+ ```ts
12
+ type Client = {
13
+ /** Specify the protocol name for the WebSocket request */
14
+ protocol?: 'ws' | 'wss';
15
+ /** Specify the path for the WebSocket request */
16
+ path?: string;
17
+ /** Specify the port number for the WebSocket request */
18
+ port?: string;
19
+ /** Specify the host for the WebSocket request */
20
+ host?: string;
21
+ /**
22
+ * Shows overlay in the browser when there are compiler errors
23
+ * This feature requires the current browser version to support [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
24
+ */
25
+ overlay?: boolean;
26
+ };
27
+ ```
28
+
29
+ - **Default:**
30
+
31
+ ```js
32
+ const defaultConfig = {
33
+ path: '/webpack-hmr',
34
+ // Defaults to the port number of the dev server
35
+ port: '',
36
+ host: location.hostname,
37
+ protocol: location.protocol === 'https:' ? 'wss' : 'ws',
38
+ overlay: false,
39
+ };
40
+ ```
41
+
42
+ For detailed usage, please refer to [Rsbuild - dev.client](https://rsbuild.dev/config/dev/client).
@@ -0,0 +1,42 @@
1
+ ---
2
+ sidebar_label: client
3
+ ---
4
+
5
+ # dev.client
6
+
7
+ 配置 Modern.js 在开发过程中注入的 client 代码,可以用于设置热更新对应的 WebSocket URL。
8
+
9
+ - **类型:**
10
+
11
+ ```ts
12
+ type Client = {
13
+ /** 指定 WebSocket 请求的协议名称 */
14
+ protocol?: 'ws' | 'wss';
15
+ /** 指定 WebSocket 请求的路径 */
16
+ path?: string;
17
+ /** 指定 WebSocket 请求的端口号 */
18
+ port?: string;
19
+ /** 指定 WebSocket 请求的 host */
20
+ host?: string;
21
+ /**
22
+ * 当出现编译错误时,在浏览器中显示遮盖
23
+ * 该功能需要当前浏览器版本支持 [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
24
+ */
25
+ overlay?: boolean;
26
+ };
27
+ ```
28
+
29
+ - **默认值:**
30
+
31
+ ```js
32
+ const defaultConfig = {
33
+ path: '/webpack-hmr',
34
+ // 默认为开发服务器的端口号
35
+ port: '',
36
+ host: location.hostname,
37
+ protocol: location.protocol === 'https:' ? 'wss' : 'ws',
38
+ overlay: true,
39
+ };
40
+ ```
41
+
42
+ 详细用法可参考 [Rsbuild - dev.client](https://rsbuild.dev/zh/config/dev/client)。
package/package.json CHANGED
@@ -15,17 +15,17 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20240423030424",
18
+ "version": "0.0.0-nightly-20240424170740",
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-20240423030424"
25
+ "@modern-js/sandpack-react": "0.0.0-nightly-20240424170740"
26
26
  },
27
27
  "peerDependencies": {
28
- "@modern-js/builder-doc": "0.0.0-nightly-20240423030424"
28
+ "@modern-js/builder-doc": "0.0.0-nightly-20240424170740"
29
29
  },
30
30
  "devDependencies": {
31
31
  "classnames": "^2",
@@ -39,8 +39,8 @@
39
39
  "@rspress/shared": "1.18.2",
40
40
  "@types/node": "^16",
41
41
  "@types/fs-extra": "9.0.13",
42
- "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240423030424",
43
- "@modern-js/builder-doc": "0.0.0-nightly-20240423030424"
42
+ "@modern-js/builder-doc": "0.0.0-nightly-20240424170740",
43
+ "@modern-js/doc-plugin-auto-sidebar": "0.0.0-nightly-20240424170740"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "rspress dev",