@modern-js/app-tools 1.16.0 → 1.17.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
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @modern-js/app-tools
|
|
2
2
|
|
|
3
|
+
## 1.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fb30bca: feat: add upgrade tools and command
|
|
8
|
+
|
|
9
|
+
feat: 增加升级工具和升级命令
|
|
10
|
+
|
|
11
|
+
- c3d4a6a: feat: support react 18 ssr
|
|
12
|
+
feat: 支持 React 18 下使用 SSR
|
|
13
|
+
- Updated dependencies [1b9176f]
|
|
14
|
+
- Updated dependencies [77d3a38]
|
|
15
|
+
- Updated dependencies [fb30bca]
|
|
16
|
+
- Updated dependencies [f3fab28]
|
|
17
|
+
- Updated dependencies [151329d]
|
|
18
|
+
- Updated dependencies [367405a]
|
|
19
|
+
- Updated dependencies [5af9472]
|
|
20
|
+
- Updated dependencies [6b6a534]
|
|
21
|
+
- Updated dependencies [6b43a2b]
|
|
22
|
+
- Updated dependencies [9f4e5ce]
|
|
23
|
+
- Updated dependencies [58c53a7]
|
|
24
|
+
- Updated dependencies [a7be124]
|
|
25
|
+
- Updated dependencies [31547b4]
|
|
26
|
+
- @modern-js/utils@1.17.0
|
|
27
|
+
- @modern-js/upgrade@1.17.0
|
|
28
|
+
- @modern-js/new-action@1.17.0
|
|
29
|
+
- @modern-js/webpack@1.17.0
|
|
30
|
+
- @modern-js/server@1.17.0
|
|
31
|
+
- @modern-js/core@1.17.0
|
|
32
|
+
- @modern-js/plugin-i18n@1.17.0
|
|
33
|
+
- @modern-js/plugin-jarvis@1.17.0
|
|
34
|
+
- @modern-js/prod-server@1.17.0
|
|
35
|
+
- @modern-js/node-bundle-require@1.17.0
|
|
36
|
+
- @modern-js/plugin@1.17.0
|
|
37
|
+
- @modern-js/types@1.17.0
|
|
38
|
+
|
|
3
39
|
## 1.16.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
|
@@ -38,12 +38,7 @@ export const renderFunction = ({
|
|
|
38
38
|
})(${fileSystemRoutes ? '' : `App`})
|
|
39
39
|
|
|
40
40
|
if (IS_BROWSER) {
|
|
41
|
-
${customBootstrap ? `customBootstrap(AppWrapper);` : `
|
|
42
|
-
root = ReactDOM.createRoot(document.getElementById(MOUNT_ID || 'root'))
|
|
43
|
-
bootstrap(AppWrapper, MOUNT_ID, root, root.render, ReactDOM.hydrateRoot);
|
|
44
|
-
} else {
|
|
45
|
-
bootstrap(AppWrapper, MOUNT_ID, undefined, ReactDOM.render, ReactDOM.hydrate);
|
|
46
|
-
}`}
|
|
41
|
+
${customBootstrap ? `customBootstrap(AppWrapper);` : `bootstrap(AppWrapper, MOUNT_ID, root, ReactDOM);`}
|
|
47
42
|
}
|
|
48
43
|
|
|
49
44
|
return AppWrapper
|
package/dist/js/modern/index.js
CHANGED
|
@@ -7,12 +7,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { defineConfig, cli } from '@modern-js/core';
|
|
9
9
|
import LintPlugin from '@modern-js/plugin-jarvis';
|
|
10
|
-
import { cleanRequireCache } from '@modern-js/utils';
|
|
10
|
+
import { cleanRequireCache, Import } from '@modern-js/utils';
|
|
11
11
|
import AnalyzePlugin from "./analyze";
|
|
12
12
|
import { hooks } from "./hooks";
|
|
13
13
|
import { i18n, localeKeys } from "./locale";
|
|
14
14
|
import { getLocaleLanguage } from "./utils/language";
|
|
15
15
|
export { defineConfig };
|
|
16
|
+
const upgradeModel = Import.lazy('@modern-js/upgrade', require);
|
|
16
17
|
export default (() => ({
|
|
17
18
|
name: '@modern-js/app-tools',
|
|
18
19
|
post: ['@modern-js/plugin-analyze', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
|
|
@@ -74,6 +75,7 @@ export default (() => ({
|
|
|
74
75
|
} = await import("./commands/inspect");
|
|
75
76
|
inspect(api, options);
|
|
76
77
|
});
|
|
78
|
+
upgradeModel.defineCommand(program.command('upgrade'));
|
|
77
79
|
},
|
|
78
80
|
|
|
79
81
|
// 这里会被 core/initWatcher 监听的文件变动触发,如果是 src 目录下的文件变动,则不做 restart
|
|
@@ -48,12 +48,7 @@ const renderFunction = ({
|
|
|
48
48
|
})(${fileSystemRoutes ? '' : `App`})
|
|
49
49
|
|
|
50
50
|
if (IS_BROWSER) {
|
|
51
|
-
${customBootstrap ? `customBootstrap(AppWrapper);` : `
|
|
52
|
-
root = ReactDOM.createRoot(document.getElementById(MOUNT_ID || 'root'))
|
|
53
|
-
bootstrap(AppWrapper, MOUNT_ID, root, root.render, ReactDOM.hydrateRoot);
|
|
54
|
-
} else {
|
|
55
|
-
bootstrap(AppWrapper, MOUNT_ID, undefined, ReactDOM.render, ReactDOM.hydrate);
|
|
56
|
-
}`}
|
|
51
|
+
${customBootstrap ? `customBootstrap(AppWrapper);` : `bootstrap(AppWrapper, MOUNT_ID, root, ReactDOM);`}
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
return AppWrapper
|
package/dist/js/node/index.js
CHANGED
|
@@ -39,6 +39,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
39
39
|
|
|
40
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
41
|
|
|
42
|
+
const upgradeModel = _utils.Import.lazy('@modern-js/upgrade', require);
|
|
43
|
+
|
|
42
44
|
var _default = () => ({
|
|
43
45
|
name: '@modern-js/app-tools',
|
|
44
46
|
post: ['@modern-js/plugin-analyze', '@modern-js/plugin-ssr', '@modern-js/plugin-state', '@modern-js/plugin-router', '@modern-js/plugin-polyfill'],
|
|
@@ -102,6 +104,7 @@ var _default = () => ({
|
|
|
102
104
|
} = await Promise.resolve().then(() => _interopRequireWildcard(require("./commands/inspect")));
|
|
103
105
|
inspect(api, options);
|
|
104
106
|
});
|
|
107
|
+
upgradeModel.defineCommand(program.command('upgrade'));
|
|
105
108
|
},
|
|
106
109
|
|
|
107
110
|
// 这里会被 core/initWatcher 监听的文件变动触发,如果是 src 目录下的文件变动,则不做 restart
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.17.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -56,26 +56,27 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@babel/runtime": "^7.18.0",
|
|
59
|
-
"@modern-js/core": "1.
|
|
60
|
-
"@modern-js/new-action": "1.
|
|
61
|
-
"@modern-js/
|
|
62
|
-
"@modern-js/
|
|
63
|
-
"@modern-js/plugin
|
|
64
|
-
"@modern-js/plugin-
|
|
65
|
-
"@modern-js/
|
|
66
|
-
"@modern-js/server": "1.
|
|
67
|
-
"@modern-js/
|
|
68
|
-
"@modern-js/
|
|
69
|
-
"@modern-js/
|
|
59
|
+
"@modern-js/core": "1.17.0",
|
|
60
|
+
"@modern-js/new-action": "1.17.0",
|
|
61
|
+
"@modern-js/upgrade": "1.17.0",
|
|
62
|
+
"@modern-js/node-bundle-require": "1.17.0",
|
|
63
|
+
"@modern-js/plugin": "1.17.0",
|
|
64
|
+
"@modern-js/plugin-i18n": "1.17.0",
|
|
65
|
+
"@modern-js/plugin-jarvis": "1.17.0",
|
|
66
|
+
"@modern-js/prod-server": "1.17.0",
|
|
67
|
+
"@modern-js/server": "1.17.0",
|
|
68
|
+
"@modern-js/types": "1.17.0",
|
|
69
|
+
"@modern-js/utils": "1.17.0",
|
|
70
|
+
"@modern-js/webpack": "1.17.0",
|
|
70
71
|
"@babel/parser": "^7.18.0",
|
|
71
72
|
"@babel/traverse": "^7.18.0",
|
|
72
73
|
"@babel/types": "^7.18.0"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
|
-
"@modern-js/server-core": "1.
|
|
76
|
+
"@modern-js/server-core": "1.17.0",
|
|
76
77
|
"@types/babel__traverse": "^7.14.2",
|
|
77
|
-
"@scripts/build": "1.
|
|
78
|
-
"@scripts/jest-config": "1.
|
|
78
|
+
"@scripts/build": "1.17.0",
|
|
79
|
+
"@scripts/jest-config": "1.17.0",
|
|
79
80
|
"@types/jest": "^27",
|
|
80
81
|
"@types/node": "^14",
|
|
81
82
|
"jest": "^27",
|