@modern-js/server 2.2.0 → 2.4.0
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 +31 -0
- package/README.md +14 -18
- package/dist/js/modern/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +1 -1
- package/dist/js/modern/dev-tools/dev-middleware/hmr-client/index.js +6 -3
- package/dist/js/node/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +1 -1
- package/dist/js/node/dev-tools/dev-middleware/hmr-client/index.js +6 -3
- package/dist/js/treeshaking/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +1 -1
- package/dist/js/treeshaking/dev-tools/dev-middleware/hmr-client/index.js +6 -1
- package/package.json +9 -9
- package/dist/js/modern/dev-tools/dev-middleware/hmr-client/types.d.js +0 -0
- package/dist/js/modern/dev-tools/https/global.d.js +0 -0
- package/dist/js/node/dev-tools/dev-middleware/hmr-client/types.d.js +0 -0
- package/dist/js/node/dev-tools/https/global.d.js +0 -0
- package/dist/js/treeshaking/dev-tools/dev-middleware/hmr-client/types.d.js +0 -1
- package/dist/js/treeshaking/dev-tools/https/global.d.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @modern-js/server
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d19484c: feat(hmr-client): add HMR connected log
|
|
8
|
+
|
|
9
|
+
feat(hmr-client): add HMR 连接成功的日志
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [98a2733]
|
|
12
|
+
- Updated dependencies [8c2db5f]
|
|
13
|
+
- @modern-js/utils@2.4.0
|
|
14
|
+
- @modern-js/prod-server@2.4.0
|
|
15
|
+
- @modern-js/server-utils@2.4.0
|
|
16
|
+
- @modern-js/types@2.4.0
|
|
17
|
+
|
|
18
|
+
## 2.3.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- ff48fc2: fix(server): hmr protocol set error
|
|
23
|
+
|
|
24
|
+
fix(server): 修复 hmr protocol 配置错误问题
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [fd5a3ed]
|
|
27
|
+
- Updated dependencies [6ca1c0b]
|
|
28
|
+
- Updated dependencies [89b6739]
|
|
29
|
+
- @modern-js/utils@2.3.0
|
|
30
|
+
- @modern-js/prod-server@2.3.0
|
|
31
|
+
- @modern-js/server-utils@2.3.0
|
|
32
|
+
- @modern-js/types@2.3.0
|
|
33
|
+
|
|
3
34
|
## 2.2.0
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
|
|
4
3
|
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Modern.js</h1>
|
|
6
|
+
|
|
5
7
|
<p align="center">
|
|
6
|
-
|
|
7
|
-
<br/>
|
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
|
9
|
-
modernjs.dev
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
|
8
|
+
A Progressive React Framework for modern web development.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
|
11
|
+
## Getting Started
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Documentation
|
|
23
16
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
|
18
|
+
- [中文文档](https://modernjs.dev)
|
|
27
19
|
|
|
28
20
|
## Contributing
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
|
@@ -29,7 +29,7 @@ function formatURL({
|
|
|
29
29
|
function getSocketUrl(urlParts, location) {
|
|
30
30
|
const { host, port, path, protocol } = urlParts;
|
|
31
31
|
return formatURL({
|
|
32
|
-
protocol: protocol || location.protocol === "https:" ? "wss" : "ws",
|
|
32
|
+
protocol: protocol || (location.protocol === "https:" ? "wss" : "ws"),
|
|
33
33
|
hostname: host || location.hostname,
|
|
34
34
|
port: port || location.port,
|
|
35
35
|
pathname: path || HMR_SOCK_PATH
|
|
@@ -10,11 +10,14 @@ var require_hmr_client = __commonJS({
|
|
|
10
10
|
const hadRuntimeError = false;
|
|
11
11
|
const socketUrl = createSocketUrl(__resourceQuery);
|
|
12
12
|
const connection = new WebSocket(socketUrl);
|
|
13
|
+
connection.onopen = function() {
|
|
14
|
+
if (typeof console !== "undefined" && typeof console.debug === "function") {
|
|
15
|
+
console.debug("[HMR] connected.");
|
|
16
|
+
}
|
|
17
|
+
};
|
|
13
18
|
connection.onclose = function() {
|
|
14
19
|
if (typeof console !== "undefined" && typeof console.info === "function") {
|
|
15
|
-
console.
|
|
16
|
-
"The development server has disconnected.\nRefresh the page if necessary."
|
|
17
|
-
);
|
|
20
|
+
console.debug("[HMR] disconnected. Refresh the page if necessary.");
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
23
|
let isFirstCompilation = true;
|
|
@@ -52,7 +52,7 @@ function formatURL({
|
|
|
52
52
|
function getSocketUrl(urlParts, location) {
|
|
53
53
|
const { host, port, path, protocol } = urlParts;
|
|
54
54
|
return formatURL({
|
|
55
|
-
protocol: protocol || location.protocol === "https:" ? "wss" : "ws",
|
|
55
|
+
protocol: protocol || (location.protocol === "https:" ? "wss" : "ws"),
|
|
56
56
|
hostname: host || location.hostname,
|
|
57
57
|
port: port || location.port,
|
|
58
58
|
pathname: path || import_constants.HMR_SOCK_PATH
|
|
@@ -22,11 +22,14 @@ var import_createSocketUrl = require("./createSocketUrl");
|
|
|
22
22
|
const hadRuntimeError = false;
|
|
23
23
|
const socketUrl = (0, import_createSocketUrl.createSocketUrl)(__resourceQuery);
|
|
24
24
|
const connection = new WebSocket(socketUrl);
|
|
25
|
+
connection.onopen = function() {
|
|
26
|
+
if (typeof console !== "undefined" && typeof console.debug === "function") {
|
|
27
|
+
console.debug("[HMR] connected.");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
25
30
|
connection.onclose = function() {
|
|
26
31
|
if (typeof console !== "undefined" && typeof console.info === "function") {
|
|
27
|
-
console.
|
|
28
|
-
"The development server has disconnected.\nRefresh the page if necessary."
|
|
29
|
-
);
|
|
32
|
+
console.debug("[HMR] disconnected. Refresh the page if necessary.");
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
35
|
let isFirstCompilation = true;
|
|
@@ -42,7 +42,7 @@ function formatURL(param) {
|
|
|
42
42
|
function getSocketUrl(urlParts, location) {
|
|
43
43
|
var host = urlParts.host, port = urlParts.port, path = urlParts.path, protocol = urlParts.protocol;
|
|
44
44
|
return formatURL({
|
|
45
|
-
protocol: protocol || location.protocol === "https:" ? "wss" : "ws",
|
|
45
|
+
protocol: protocol || (location.protocol === "https:" ? "wss" : "ws"),
|
|
46
46
|
hostname: host || location.hostname,
|
|
47
47
|
port: port || location.port,
|
|
48
48
|
pathname: path || HMR_SOCK_PATH
|
|
@@ -95,9 +95,14 @@ var require_hmr_client = __commonJS({
|
|
|
95
95
|
var hadRuntimeError = false;
|
|
96
96
|
var socketUrl = createSocketUrl(__resourceQuery);
|
|
97
97
|
var connection = new WebSocket(socketUrl);
|
|
98
|
+
connection.onopen = function() {
|
|
99
|
+
if (typeof console !== "undefined" && typeof console.debug === "function") {
|
|
100
|
+
console.debug("[HMR] connected.");
|
|
101
|
+
}
|
|
102
|
+
};
|
|
98
103
|
connection.onclose = function() {
|
|
99
104
|
if (typeof console !== "undefined" && typeof console.info === "function") {
|
|
100
|
-
console.
|
|
105
|
+
console.debug("[HMR] disconnected. Refresh the page if necessary.");
|
|
101
106
|
}
|
|
102
107
|
};
|
|
103
108
|
var isFirstCompilation = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/server",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.4.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"minimatch": "^3.0.4",
|
|
35
35
|
"path-to-regexp": "^6.2.0",
|
|
36
36
|
"ws": "^8.2.0",
|
|
37
|
-
"@modern-js/prod-server": "2.
|
|
38
|
-
"@modern-js/server-utils": "2.
|
|
39
|
-
"@modern-js/types": "2.
|
|
40
|
-
"@modern-js/utils": "2.
|
|
37
|
+
"@modern-js/prod-server": "2.4.0",
|
|
38
|
+
"@modern-js/server-utils": "2.4.0",
|
|
39
|
+
"@modern-js/types": "2.4.0",
|
|
40
|
+
"@modern-js/utils": "2.4.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/connect-history-api-fallback": "^1.3.5",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"typescript": "^4",
|
|
53
53
|
"webpack": "^5.75.0",
|
|
54
54
|
"websocket": "^1",
|
|
55
|
-
"@modern-js/server-core": "2.
|
|
56
|
-
"@scripts/
|
|
57
|
-
"@scripts/
|
|
55
|
+
"@modern-js/server-core": "2.4.0",
|
|
56
|
+
"@scripts/build": "2.4.0",
|
|
57
|
+
"@scripts/jest-config": "2.4.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"devcert": "^1.0.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|