@modern-js/runtime 2.0.0-beta.5 → 2.0.0-beta.6

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/dist/js/modern/document/DocumentStructrueContext.js +2 -1
  3. package/dist/js/modern/document/Head.js +3 -1
  4. package/dist/js/modern/document/Html.js +2 -0
  5. package/dist/js/modern/document/Links.js +10 -0
  6. package/dist/js/modern/document/cli/index.js +8 -2
  7. package/dist/js/modern/document/constants.js +4 -0
  8. package/dist/js/modern/document/index.js +1 -0
  9. package/dist/js/modern/router/runtime/index.js +1 -0
  10. package/dist/js/modern/router/runtime/plugin.js +1 -10
  11. package/dist/js/modern/router/runtime/plugin.node.js +3 -3
  12. package/dist/js/node/document/DocumentStructrueContext.js +2 -1
  13. package/dist/js/node/document/Head.js +3 -1
  14. package/dist/js/node/document/Html.js +2 -0
  15. package/dist/js/node/document/Links.js +33 -0
  16. package/dist/js/node/document/cli/index.js +7 -2
  17. package/dist/js/node/document/constants.js +5 -0
  18. package/dist/js/node/document/index.js +1 -0
  19. package/dist/js/node/router/runtime/index.js +1 -0
  20. package/dist/js/node/router/runtime/plugin.js +0 -7
  21. package/dist/js/node/router/runtime/plugin.node.js +3 -3
  22. package/dist/js/treeshaking/document/DocumentStructrueContext.js +2 -1
  23. package/dist/js/treeshaking/document/Head.js +3 -1
  24. package/dist/js/treeshaking/document/Html.js +2 -0
  25. package/dist/js/treeshaking/document/Links.js +8 -0
  26. package/dist/js/treeshaking/document/cli/index.js +9 -4
  27. package/dist/js/treeshaking/document/constants.js +2 -1
  28. package/dist/js/treeshaking/document/index.js +1 -0
  29. package/dist/js/treeshaking/router/runtime/index.js +1 -0
  30. package/dist/js/treeshaking/router/runtime/plugin.js +1 -11
  31. package/dist/js/treeshaking/router/runtime/plugin.node.js +2 -2
  32. package/dist/types/document/DocumentStructrueContext.d.ts +1 -0
  33. package/dist/types/document/Links.d.ts +2 -0
  34. package/dist/types/document/constants.d.ts +1 -0
  35. package/dist/types/document/index.d.ts +1 -0
  36. package/dist/types/router/runtime/index.d.ts +1 -0
  37. package/dist/types/router/runtime/plugin.d.ts +1 -1
  38. package/package.json +17 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,138 @@
1
1
  # @modern-js/runtime
2
2
 
3
+ ## 2.0.0-beta.6
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9c3e: chore: v2
8
+
9
+ ### Minor Changes
10
+
11
+ - c9e800d39a: feat: support React18 streaming SSR
12
+ feat: 支持 React18 流式 SSR
13
+ - df7ee2d: feat: runtime user config types extends
14
+ feat: runtime 用户配置类型扩展
15
+ - 543be9558e: feat: compile server loader and support handle loader request
16
+ feat: 编译 server loader 并支持处理 loader 的请求
17
+
18
+ ### Patch Changes
19
+
20
+ - 2344eb26ed: fix: bootstrap function params type define
21
+
22
+ fix: 修复 bootstrap 函数参数类型定义
23
+
24
+ - a11fcf8b50: feat: fallback logic of streaming ssr
25
+ feat: streaming ssr 降级逻辑
26
+ - a93159440e: feat: support modify routes for csr app
27
+ feat: 支持 modifyRoutes API
28
+ - e7ce0636d1: fix: root layout css chunks should't be loaded
29
+ fix: 不应该加载 root layout 的 css chunks
30
+ - b18fa8f3ed: feat: remove @loadable/component in streaming ssr
31
+ feat: 移除 streaming ssr 中的 @loadable/component 逻辑
32
+ - 50d4675e5b: fix: add document cli export
33
+
34
+ fix: 增加 document cli 插件的导出
35
+
36
+ - 6604f1b8b3: feat: support router basename
37
+ feat: router 插件支持设置 basename
38
+ - fda836fe8a: feat: support `models`,`initialState` config for state plugin
39
+ feat: state 插件支持`model`,`initialState` 配置
40
+ - d6bc321747: fix: the Document.tsx missed hmr
41
+
42
+ fix: Document.tsx 未能引发 hmr
43
+
44
+ - 3e57f2bd58: feat: add document feature with plugin
45
+
46
+ feat: 增加 document 功能插件
47
+
48
+ - 2e6031955e: fix: some optimizations for router and loader
49
+ fix: 一些 router 和 loader 的优化
50
+ q
51
+ - c5798d284f: fix(runtime): apply babel-plugin-ssr-loader-id when SSR is not used
52
+
53
+ fix(runtime): 在未启动 SSR 时需要注册 babel-plugin-ssr-loader-id
54
+
55
+ - fbf5eed5aa: fix: fix ssg failure due to lack of Web Response API
56
+ fix: 修复因为缺少 Web Response API 而导致 ssg 失败
57
+ - a2509bfbdb: feat: bump esbuild from 0.14.38 to 0.15.7
58
+
59
+ feat: 将 esbuild 从 0.14.38 版本升级至 0.15.7 版本
60
+
61
+ - a7c68832b3: fix: only register babel-plugin-ssr-loader-id when SSR is enabled
62
+
63
+ fix: 仅在开启 SSR 的场景下注册 babel-plugin-ssr-loader-id
64
+
65
+ - 425e57092d: feat: export react-router-dom/server staticRouter
66
+ feat: 导出 react-router-dom/server 的 staticRouter 组件
67
+ - e4357f1856: fix: change default document file and name
68
+
69
+ fix: 重置默认的 document 文件和文件名
70
+
71
+ - 4369648ae2: fix: fix html template of streaming ssr
72
+ fix: 修复流式渲染的 html 模版
73
+ - 92c0994468: chore: remove `registerPrefetch`
74
+ chore: 移除 `registerPrefetch`
75
+ - 2cc2eb35ba: fix: fix state plugin config
76
+ fix: 修复 state 插件 config 参数
77
+ - 6bda14ed71: feat: refactor router with react-router@6.4
78
+
79
+ feat: 使用 react-router@6.4 重构路由模块
80
+
81
+ - 92004d1906: feat: support load chunks parallelly
82
+ feat: 支持并行加载 chunks
83
+ - 40ed5874c6: feat: inject css chunk into html for streaming ssr
84
+ feat: streaming ssr 返回的 html 注入 css chunk
85
+ - 60d5378632: fix: function extname should not return array
86
+ fix: 函数 extname 不应该返回一个数组
87
+ - 8b8e1bb571: feat: support nested routes
88
+ feat: 支持嵌套路由
89
+ - 3bbea92b2a: feat: support Hook、Middleware new API
90
+ feat: 支持 Hook、Middleware 的新 API
91
+ - 21d7521: fix: the Body not use Root jsx
92
+
93
+ fix: 修复 Body 里的 Root 引用格式
94
+
95
+ - 9144c21d27: fix: esbuild config use file
96
+
97
+ fix: 更改 esbuild 读取指定 ts 配置
98
+
99
+ - 18aaf42249: fix: fix server loader redirects
100
+ fix: 修复 server loader 重定向错误
101
+ - 34702d5d47: feat: support internal env vars: metaName_TARGET
102
+ feat: 支持内置环境变量 metaName_TARGET
103
+ - fcace5b5b9: fix: remove overmuch `@modernjs/utils` dependency import in ssr runtime & SSR hydrate error
104
+ fix: 去除 ssr 运行时过多的 `@modernjs/utils` 依赖引入 & SSR hydrate 错误
105
+ - Updated dependencies [7879e8f711]
106
+ - Updated dependencies [6aca875011]
107
+ - Updated dependencies [2e6031955e]
108
+ - Updated dependencies [7b7d12cf8f]
109
+ - Updated dependencies [7efeed4]
110
+ - Updated dependencies [92f0eade39]
111
+ - Updated dependencies [edd1cfb1af]
112
+ - Updated dependencies [cc971eabfc]
113
+ - Updated dependencies [5b9049f2e9]
114
+ - Updated dependencies [6bda14ed71]
115
+ - Updated dependencies [92004d1906]
116
+ - Updated dependencies [b8bbe036c7]
117
+ - Updated dependencies [40ed5874c6]
118
+ - Updated dependencies [87c1ff86b9]
119
+ - Updated dependencies [d5a31df781]
120
+ - Updated dependencies [dda38c9c3e]
121
+ - Updated dependencies [102d32e4ba]
122
+ - Updated dependencies [8b8e1bb571]
123
+ - Updated dependencies [3bbea92b2a]
124
+ - Updated dependencies [b710adb843]
125
+ - Updated dependencies [f179749375]
126
+ - Updated dependencies [ea7cf06257]
127
+ - Updated dependencies [bbe4c4ab64]
128
+ - Updated dependencies [e4558a0bc4]
129
+ - Updated dependencies [abf3421a75]
130
+ - Updated dependencies [543be9558e]
131
+ - Updated dependencies [14b712da84]
132
+ - @modern-js/types@2.0.0-beta.6
133
+ - @modern-js/utils@2.0.0-beta.6
134
+ - @modern-js/plugin@2.0.0-beta.6
135
+
3
136
  ## 2.0.0-beta.4
4
137
 
5
138
  ### Major Changes
@@ -3,7 +3,8 @@ const DocumentStructrueContext = React.createContext({
3
3
  hasSetHead: false,
4
4
  hasSetScripts: false,
5
5
  hasSetBody: false,
6
- hasSetRoot: false
6
+ hasSetRoot: false,
7
+ hasSetLinks: false
7
8
  });
8
9
  export {
9
10
  DocumentStructrueContext
@@ -2,13 +2,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { DocumentStructrueContext } from "./DocumentStructrueContext";
4
4
  import { Scripts } from "./Scripts";
5
+ import { Links } from "./Links";
5
6
  import { DOCUMENT_META_PLACEHOLDER } from "./constants";
6
7
  function Head(props) {
7
- const { hasSetScripts } = useContext(DocumentStructrueContext);
8
+ const { hasSetScripts, hasSetLinks } = useContext(DocumentStructrueContext);
8
9
  const { children } = props;
9
10
  return /* @__PURE__ */ jsxs("head", {
10
11
  children: [
11
12
  `${DOCUMENT_META_PLACEHOLDER}`,
13
+ !hasSetLinks && /* @__PURE__ */ jsx(Links, {}),
12
14
  !hasSetScripts && /* @__PURE__ */ jsx(Scripts, {}),
13
15
  children
14
16
  ]
@@ -28,6 +28,7 @@ function Html(props) {
28
28
  const { children } = props;
29
29
  const hasSetHead = Boolean(findTargetChild("Head", children));
30
30
  const hasSetScripts = Boolean(findTargetElement("Scripts", children));
31
+ const hasSetLinks = Boolean(findTargetElement("Links", children));
31
32
  const hasSetBody = Boolean(findTargetChild("Body", children));
32
33
  const hasSetRoot = Boolean(findTargetElement("Root", children));
33
34
  const notMissMustChild = [
@@ -59,6 +60,7 @@ function Html(props) {
59
60
  value: {
60
61
  hasSetHead,
61
62
  hasSetScripts,
63
+ hasSetLinks,
62
64
  hasSetRoot,
63
65
  hasSetBody,
64
66
  docChild: children
@@ -0,0 +1,10 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { DOCUMENT_LINKS_PLACEHOLDER } from "./constants";
3
+ function Links() {
4
+ return /* @__PURE__ */ jsx(Fragment, {
5
+ children: DOCUMENT_LINKS_PLACEHOLDER
6
+ });
7
+ }
8
+ export {
9
+ Links
10
+ };
@@ -42,6 +42,7 @@ import { createDebugger, findExists, fs } from "@modern-js/utils";
42
42
  import { DocumentContext } from "../DocumentContext";
43
43
  import {
44
44
  DOCUMENT_SCRIPTS_PLACEHOLDER,
45
+ DOCUMENT_LINKS_PLACEHOLDER,
45
46
  DOCUMENT_FILE_NAME,
46
47
  DOCUMENT_META_PLACEHOLDER,
47
48
  PLACEHOLDER_REPLACER_MAP,
@@ -167,9 +168,14 @@ var cli_default = () => ({
167
168
  htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName === "script").join(""),
168
169
  htmlWebpackPlugin.tags.bodyTags.toString()
169
170
  ].join("");
171
+ const links = [
172
+ htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName === "link").join("")
173
+ ].join("");
170
174
  const metas = [
171
175
  templateParameters.meta,
172
- htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName !== "script").join("")
176
+ htmlWebpackPlugin.tags.headTags.filter(
177
+ (item) => item.tagName !== "script" && item.tagName !== "link"
178
+ ).join("")
173
179
  ].join("");
174
180
  if (html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
175
181
  html = html.replaceAll(
@@ -180,7 +186,7 @@ var cli_default = () => ({
180
186
  (_scriptStr, $1) => `<script>${decodeURIComponent($1)}<\/script>`
181
187
  );
182
188
  }
183
- const finalHtml = `<!DOCTYPE html>${html}`.replace(DOCUMENT_META_PLACEHOLDER, metas).replace(DOCUMENT_SSR_PLACEHOLDER, HTML_SEPARATOR).replace(DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(
189
+ const finalHtml = `<!DOCTYPE html>${html}`.replace(DOCUMENT_META_PLACEHOLDER, metas).replace(DOCUMENT_SSR_PLACEHOLDER, HTML_SEPARATOR).replace(DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(DOCUMENT_LINKS_PLACEHOLDER, links).replace(
184
190
  DOCUMENT_CHUNKSMAP_PLACEHOLDER,
185
191
  PLACEHOLDER_REPLACER_MAP[DOCUMENT_CHUNKSMAP_PLACEHOLDER]
186
192
  ).replace(
@@ -14,6 +14,9 @@ const DOCUMENT_FILE_NAME = "Document";
14
14
  const DOCUMENT_SCRIPTS_PLACEHOLDER = encodeURIComponent(
15
15
  "<!-- chunk scripts placeholder -->"
16
16
  );
17
+ const DOCUMENT_LINKS_PLACEHOLDER = encodeURIComponent(
18
+ "<!-- chunk links placeholder -->"
19
+ );
17
20
  const DOCUMENT_NO_SCRIPTE_PLACEHOLDER = encodeURIComponent("<!-- no-script -->");
18
21
  const DOCUMENT_SCRIPT_PLACEHOLDER_START = encodeURIComponent(
19
22
  "<!-- script-start -->"
@@ -30,6 +33,7 @@ const PLACEHOLDER_REPLACER_MAP = {
30
33
  export {
31
34
  DOCUMENT_CHUNKSMAP_PLACEHOLDER,
32
35
  DOCUMENT_FILE_NAME,
36
+ DOCUMENT_LINKS_PLACEHOLDER,
33
37
  DOCUMENT_META_PLACEHOLDER,
34
38
  DOCUMENT_NO_SCRIPTE_PLACEHOLDER,
35
39
  DOCUMENT_SCRIPTS_PLACEHOLDER,
@@ -4,6 +4,7 @@ export * from "./DocumentStructrueContext";
4
4
  export * from "./Head";
5
5
  export * from "./Body";
6
6
  export * from "./Root";
7
+ export * from "./Links";
7
8
  export * from "./Scripts";
8
9
  export * from "./Script";
9
10
  export * from "./constants";
@@ -2,6 +2,7 @@ import { routerPlugin } from "./plugin";
2
2
  var runtime_default = routerPlugin;
3
3
  import { modifyRoutes } from "./plugin";
4
4
  export * from "react-router-dom";
5
+ export * from "react-router-dom/server";
5
6
  export * from "./withRouter";
6
7
  export {
7
8
  runtime_default as default,
@@ -22,9 +22,7 @@ import {
22
22
  createBrowserRouter,
23
23
  createHashRouter,
24
24
  RouterProvider,
25
- createRoutesFromElements,
26
- useMatches,
27
- useLocation
25
+ createRoutesFromElements
28
26
  } from "react-router-dom";
29
27
  import hoistNonReactStatics from "hoist-non-react-statics";
30
28
  import { renderRoutes, urlJoin } from "./utils";
@@ -56,13 +54,6 @@ const routerPlugin = ({
56
54
  name: "@modern-js/plugin-router",
57
55
  setup: () => {
58
56
  return {
59
- init({ context }, next) {
60
- context.router = {
61
- useMatches,
62
- useLocation
63
- };
64
- return next({ context });
65
- },
66
57
  hoc: ({ App }, next) => {
67
58
  if (!finalRouteConfig && !createRoutes) {
68
59
  return next({ App });
@@ -39,10 +39,10 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
  import { jsx } from "react/jsx-runtime";
41
41
  import { useContext } from "react";
42
- import { unstable_createStaticHandler as createStaticHandler } from "@remix-run/router";
42
+ import { createStaticHandler } from "@remix-run/router";
43
43
  import {
44
- unstable_createStaticRouter as createStaticRouter,
45
- unstable_StaticRouterProvider as StaticRouterProvider
44
+ createStaticRouter,
45
+ StaticRouterProvider
46
46
  } from "react-router-dom/server";
47
47
  import hoistNonReactStatics from "hoist-non-react-statics";
48
48
  import { installGlobals } from "@remix-run/node";
@@ -31,7 +31,8 @@ const DocumentStructrueContext = import_react.default.createContext({
31
31
  hasSetHead: false,
32
32
  hasSetScripts: false,
33
33
  hasSetBody: false,
34
- hasSetRoot: false
34
+ hasSetRoot: false,
35
+ hasSetLinks: false
35
36
  });
36
37
  // Annotate the CommonJS export names for ESM import in node:
37
38
  0 && (module.exports = {
@@ -25,13 +25,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
26
  var import_DocumentStructrueContext = require("./DocumentStructrueContext");
27
27
  var import_Scripts = require("./Scripts");
28
+ var import_Links = require("./Links");
28
29
  var import_constants = require("./constants");
29
30
  function Head(props) {
30
- const { hasSetScripts } = (0, import_react.useContext)(import_DocumentStructrueContext.DocumentStructrueContext);
31
+ const { hasSetScripts, hasSetLinks } = (0, import_react.useContext)(import_DocumentStructrueContext.DocumentStructrueContext);
31
32
  const { children } = props;
32
33
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("head", {
33
34
  children: [
34
35
  `${import_constants.DOCUMENT_META_PLACEHOLDER}`,
36
+ !hasSetLinks && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Links.Links, {}),
35
37
  !hasSetScripts && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Scripts.Scripts, {}),
36
38
  children
37
39
  ]
@@ -50,6 +50,7 @@ function Html(props) {
50
50
  const { children } = props;
51
51
  const hasSetHead = Boolean(findTargetChild("Head", children));
52
52
  const hasSetScripts = Boolean(findTargetElement("Scripts", children));
53
+ const hasSetLinks = Boolean(findTargetElement("Links", children));
53
54
  const hasSetBody = Boolean(findTargetChild("Body", children));
54
55
  const hasSetRoot = Boolean(findTargetElement("Root", children));
55
56
  const notMissMustChild = [
@@ -81,6 +82,7 @@ function Html(props) {
81
82
  value: {
82
83
  hasSetHead,
83
84
  hasSetScripts,
85
+ hasSetLinks,
84
86
  hasSetRoot,
85
87
  hasSetBody,
86
88
  docChild: children
@@ -0,0 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Links_exports = {};
19
+ __export(Links_exports, {
20
+ Links: () => Links
21
+ });
22
+ module.exports = __toCommonJS(Links_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
24
+ var import_constants = require("./constants");
25
+ function Links() {
26
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
27
+ children: import_constants.DOCUMENT_LINKS_PLACEHOLDER
28
+ });
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ Links
33
+ });
@@ -181,9 +181,14 @@ var cli_default = () => ({
181
181
  htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName === "script").join(""),
182
182
  htmlWebpackPlugin.tags.bodyTags.toString()
183
183
  ].join("");
184
+ const links = [
185
+ htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName === "link").join("")
186
+ ].join("");
184
187
  const metas = [
185
188
  templateParameters.meta,
186
- htmlWebpackPlugin.tags.headTags.filter((item) => item.tagName !== "script").join("")
189
+ htmlWebpackPlugin.tags.headTags.filter(
190
+ (item) => item.tagName !== "script" && item.tagName !== "link"
191
+ ).join("")
187
192
  ].join("");
188
193
  if (html.includes(import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
189
194
  html = html.replaceAll(
@@ -194,7 +199,7 @@ var cli_default = () => ({
194
199
  (_scriptStr, $1) => `<script>${decodeURIComponent($1)}<\/script>`
195
200
  );
196
201
  }
197
- const finalHtml = `<!DOCTYPE html>${html}`.replace(import_constants.DOCUMENT_META_PLACEHOLDER, metas).replace(import_constants.DOCUMENT_SSR_PLACEHOLDER, import_constants.HTML_SEPARATOR).replace(import_constants.DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(
202
+ const finalHtml = `<!DOCTYPE html>${html}`.replace(import_constants.DOCUMENT_META_PLACEHOLDER, metas).replace(import_constants.DOCUMENT_SSR_PLACEHOLDER, import_constants.HTML_SEPARATOR).replace(import_constants.DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(import_constants.DOCUMENT_LINKS_PLACEHOLDER, links).replace(
198
203
  import_constants.DOCUMENT_CHUNKSMAP_PLACEHOLDER,
199
204
  import_constants.PLACEHOLDER_REPLACER_MAP[import_constants.DOCUMENT_CHUNKSMAP_PLACEHOLDER]
200
205
  ).replace(
@@ -19,6 +19,7 @@ var constants_exports = {};
19
19
  __export(constants_exports, {
20
20
  DOCUMENT_CHUNKSMAP_PLACEHOLDER: () => DOCUMENT_CHUNKSMAP_PLACEHOLDER,
21
21
  DOCUMENT_FILE_NAME: () => DOCUMENT_FILE_NAME,
22
+ DOCUMENT_LINKS_PLACEHOLDER: () => DOCUMENT_LINKS_PLACEHOLDER,
22
23
  DOCUMENT_META_PLACEHOLDER: () => DOCUMENT_META_PLACEHOLDER,
23
24
  DOCUMENT_NO_SCRIPTE_PLACEHOLDER: () => DOCUMENT_NO_SCRIPTE_PLACEHOLDER,
24
25
  DOCUMENT_SCRIPTS_PLACEHOLDER: () => DOCUMENT_SCRIPTS_PLACEHOLDER,
@@ -49,6 +50,9 @@ const DOCUMENT_FILE_NAME = "Document";
49
50
  const DOCUMENT_SCRIPTS_PLACEHOLDER = encodeURIComponent(
50
51
  "<!-- chunk scripts placeholder -->"
51
52
  );
53
+ const DOCUMENT_LINKS_PLACEHOLDER = encodeURIComponent(
54
+ "<!-- chunk links placeholder -->"
55
+ );
52
56
  const DOCUMENT_NO_SCRIPTE_PLACEHOLDER = encodeURIComponent("<!-- no-script -->");
53
57
  const DOCUMENT_SCRIPT_PLACEHOLDER_START = encodeURIComponent(
54
58
  "<!-- script-start -->"
@@ -66,6 +70,7 @@ const PLACEHOLDER_REPLACER_MAP = {
66
70
  0 && (module.exports = {
67
71
  DOCUMENT_CHUNKSMAP_PLACEHOLDER,
68
72
  DOCUMENT_FILE_NAME,
73
+ DOCUMENT_LINKS_PLACEHOLDER,
69
74
  DOCUMENT_META_PLACEHOLDER,
70
75
  DOCUMENT_NO_SCRIPTE_PLACEHOLDER,
71
76
  DOCUMENT_SCRIPTS_PLACEHOLDER,
@@ -20,6 +20,7 @@ __reExport(document_exports, require("./DocumentStructrueContext"), module.expor
20
20
  __reExport(document_exports, require("./Head"), module.exports);
21
21
  __reExport(document_exports, require("./Body"), module.exports);
22
22
  __reExport(document_exports, require("./Root"), module.exports);
23
+ __reExport(document_exports, require("./Links"), module.exports);
23
24
  __reExport(document_exports, require("./Scripts"), module.exports);
24
25
  __reExport(document_exports, require("./Script"), module.exports);
25
26
  __reExport(document_exports, require("./constants"), module.exports);
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(runtime_exports);
25
25
  var import_plugin = require("./plugin");
26
26
  var import_plugin2 = require("./plugin");
27
27
  __reExport(runtime_exports, require("react-router-dom"), module.exports);
28
+ __reExport(runtime_exports, require("react-router-dom/server"), module.exports);
28
29
  __reExport(runtime_exports, require("./withRouter"), module.exports);
29
30
  var runtime_default = import_plugin.routerPlugin;
30
31
  // Annotate the CommonJS export names for ESM import in node:
@@ -78,13 +78,6 @@ const routerPlugin = ({
78
78
  name: "@modern-js/plugin-router",
79
79
  setup: () => {
80
80
  return {
81
- init({ context }, next) {
82
- context.router = {
83
- useMatches: import_react_router_dom.useMatches,
84
- useLocation: import_react_router_dom.useLocation
85
- };
86
- return next({ context });
87
- },
88
81
  hoc: ({ App }, next) => {
89
82
  if (!finalRouteConfig && !createRoutes) {
90
83
  return next({ App });
@@ -118,7 +118,7 @@ const routerPlugin = ({
118
118
  const baseUrl = request.baseUrl;
119
119
  const _basename = baseUrl === "/" ? (0, import_utils.urlJoin)(baseUrl, basename) : baseUrl;
120
120
  const routes = createRoutes ? createRoutes() : (0, import_react_router_dom.createRoutesFromElements)((0, import_utils.renderRoutes)(routesConfig));
121
- const { query } = (0, import_router.unstable_createStaticHandler)(routes, {
121
+ const { query } = (0, import_router.createStaticHandler)(routes, {
122
122
  basename: _basename
123
123
  });
124
124
  const remixRequest = createFetchRequest(request);
@@ -126,7 +126,7 @@ const routerPlugin = ({
126
126
  if (routerContext instanceof Response) {
127
127
  return routerContext;
128
128
  }
129
- const router = (0, import_server.unstable_createStaticRouter)(routes, routerContext);
129
+ const router = (0, import_server.createStaticRouter)(routes, routerContext);
130
130
  context.router = router;
131
131
  context.routerContext = routerContext;
132
132
  context.routes = routes;
@@ -142,7 +142,7 @@ const routerPlugin = ({
142
142
  return (props) => {
143
143
  const { router, routerContext } = (0, import_react.useContext)(import_core.RuntimeReactContext);
144
144
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, __spreadProps(__spreadValues({}, props), {
145
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_server.unstable_StaticRouterProvider, {
145
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_server.StaticRouterProvider, {
146
146
  router,
147
147
  context: routerContext,
148
148
  nonce: "the-nonce"
@@ -3,6 +3,7 @@ var DocumentStructrueContext = React.createContext({
3
3
  hasSetHead: false,
4
4
  hasSetScripts: false,
5
5
  hasSetBody: false,
6
- hasSetRoot: false
6
+ hasSetRoot: false,
7
+ hasSetLinks: false
7
8
  });
8
9
  export { DocumentStructrueContext };
@@ -2,13 +2,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { DocumentStructrueContext } from "./DocumentStructrueContext";
4
4
  import { Scripts } from "./Scripts";
5
+ import { Links } from "./Links";
5
6
  import { DOCUMENT_META_PLACEHOLDER } from "./constants";
6
7
  function Head(props) {
7
- var hasSetScripts = useContext(DocumentStructrueContext).hasSetScripts;
8
+ var ref = useContext(DocumentStructrueContext), hasSetScripts = ref.hasSetScripts, hasSetLinks = ref.hasSetLinks;
8
9
  var children = props.children;
9
10
  return /* @__PURE__ */ jsxs("head", {
10
11
  children: [
11
12
  "".concat(DOCUMENT_META_PLACEHOLDER),
13
+ !hasSetLinks && /* @__PURE__ */ jsx(Links, {}),
12
14
  !hasSetScripts && /* @__PURE__ */ jsx(Scripts, {}),
13
15
  children
14
16
  ]
@@ -47,6 +47,7 @@ function Html(props) {
47
47
  var children = props.children;
48
48
  var hasSetHead = Boolean(findTargetChild("Head", children));
49
49
  var hasSetScripts = Boolean(findTargetElement("Scripts", children));
50
+ var hasSetLinks = Boolean(findTargetElement("Links", children));
50
51
  var hasSetBody = Boolean(findTargetChild("Body", children));
51
52
  var hasSetRoot = Boolean(findTargetElement("Root", children));
52
53
  var notMissMustChild = [
@@ -82,6 +83,7 @@ function Html(props) {
82
83
  value: {
83
84
  hasSetHead: hasSetHead,
84
85
  hasSetScripts: hasSetScripts,
86
+ hasSetLinks: hasSetLinks,
85
87
  hasSetRoot: hasSetRoot,
86
88
  hasSetBody: hasSetBody,
87
89
  docChild: children
@@ -0,0 +1,8 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { DOCUMENT_LINKS_PLACEHOLDER } from "./constants";
3
+ function Links() {
4
+ return /* @__PURE__ */ jsx(Fragment, {
5
+ children: DOCUMENT_LINKS_PLACEHOLDER
6
+ });
7
+ }
8
+ export { Links };
@@ -181,7 +181,7 @@ import ReactDomServer from "react-dom/server";
181
181
  import { build } from "esbuild";
182
182
  import { createDebugger, findExists, fs } from "@modern-js/utils";
183
183
  import { DocumentContext } from "../DocumentContext";
184
- import { DOCUMENT_SCRIPTS_PLACEHOLDER, DOCUMENT_FILE_NAME, DOCUMENT_META_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP, DOC_EXT, DOCUMENT_SSR_PLACEHOLDER, DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SCRIPT_PLACEHOLDER_END, HTML_SEPARATOR } from "../constants";
184
+ import { DOCUMENT_SCRIPTS_PLACEHOLDER, DOCUMENT_LINKS_PLACEHOLDER, DOCUMENT_FILE_NAME, DOCUMENT_META_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP, DOC_EXT, DOCUMENT_SSR_PLACEHOLDER, DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SCRIPT_PLACEHOLDER_END, HTML_SEPARATOR } from "../constants";
185
185
  var debug = createDebugger("html_genarate");
186
186
  var getDocumenByEntryName = function getDocumenByEntryName(entrypoints, entryName, fallbackDir) {
187
187
  var ref;
@@ -230,7 +230,7 @@ var cli_default = function() {
230
230
  }
231
231
  return function() {
232
232
  var _ref = _asyncToGenerator(function(param) {
233
- var htmlWebpackPlugin, documentParams, tempTsConfigFile, userTsConfigFilePath, tsConfig, err, htmlOutputFile, Document, HTMLElement, html, scripts, metas, finalHtml;
233
+ var htmlWebpackPlugin, documentParams, tempTsConfigFile, userTsConfigFilePath, tsConfig, err, htmlOutputFile, Document, HTMLElement, html, scripts, links, metas, finalHtml;
234
234
  return __generator(this, function(_state) {
235
235
  switch(_state.label){
236
236
  case 0:
@@ -333,10 +333,15 @@ var cli_default = function() {
333
333
  }).join(""),
334
334
  htmlWebpackPlugin.tags.bodyTags.toString()
335
335
  ].join("");
336
+ links = [
337
+ htmlWebpackPlugin.tags.headTags.filter(function(item) {
338
+ return item.tagName === "link";
339
+ }).join("")
340
+ ].join("");
336
341
  metas = [
337
342
  templateParameters.meta,
338
343
  htmlWebpackPlugin.tags.headTags.filter(function(item) {
339
- return item.tagName !== "script";
344
+ return item.tagName !== "script" && item.tagName !== "link";
340
345
  }).join("")
341
346
  ].join("");
342
347
  if (html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
@@ -344,7 +349,7 @@ var cli_default = function() {
344
349
  return "<script>".concat(decodeURIComponent($1), "</script>");
345
350
  });
346
351
  }
347
- finalHtml = "<!DOCTYPE html>".concat(html).replace(DOCUMENT_META_PLACEHOLDER, metas).replace(DOCUMENT_SSR_PLACEHOLDER, HTML_SEPARATOR).replace(DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(DOCUMENT_CHUNKSMAP_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP[DOCUMENT_CHUNKSMAP_PLACEHOLDER]).replace(DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP[DOCUMENT_SSRDATASCRIPT_PLACEHOLDER]);
352
+ finalHtml = "<!DOCTYPE html>".concat(html).replace(DOCUMENT_META_PLACEHOLDER, metas).replace(DOCUMENT_SSR_PLACEHOLDER, HTML_SEPARATOR).replace(DOCUMENT_SCRIPTS_PLACEHOLDER, scripts).replace(DOCUMENT_LINKS_PLACEHOLDER, links).replace(DOCUMENT_CHUNKSMAP_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP[DOCUMENT_CHUNKSMAP_PLACEHOLDER]).replace(DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, PLACEHOLDER_REPLACER_MAP[DOCUMENT_SSRDATASCRIPT_PLACEHOLDER]);
348
353
  return [
349
354
  2,
350
355
  finalHtml
@@ -26,9 +26,10 @@ var DOCUMENT_CHUNKSMAP_PLACEHOLDER = encodeURIComponent(HTML_CHUNKSMAP_SEPARATOR
26
26
  var DOCUMENT_SSRDATASCRIPT_PLACEHOLDER = encodeURIComponent(HTML_SSRDATASCRIPT_SEPARATOR);
27
27
  var DOCUMENT_FILE_NAME = "Document";
28
28
  var DOCUMENT_SCRIPTS_PLACEHOLDER = encodeURIComponent("<!-- chunk scripts placeholder -->");
29
+ var DOCUMENT_LINKS_PLACEHOLDER = encodeURIComponent("<!-- chunk links placeholder -->");
29
30
  var DOCUMENT_NO_SCRIPTE_PLACEHOLDER = encodeURIComponent("<!-- no-script -->");
30
31
  var DOCUMENT_SCRIPT_PLACEHOLDER_START = encodeURIComponent("<!-- script-start -->");
31
32
  var DOCUMENT_SCRIPT_PLACEHOLDER_END = encodeURIComponent("<!-- script-end -->");
32
33
  var _obj;
33
34
  var PLACEHOLDER_REPLACER_MAP = (_obj = {}, _defineProperty(_obj, DOCUMENT_NO_SCRIPTE_PLACEHOLDER, "We're sorry but react app doesn't work properly without JavaScript enabled. Please enable it to continue."), _defineProperty(_obj, DOCUMENT_SSR_PLACEHOLDER, HTML_SEPARATOR), _defineProperty(_obj, DOCUMENT_CHUNKSMAP_PLACEHOLDER, HTML_CHUNKSMAP_SEPARATOR), _defineProperty(_obj, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, HTML_SSRDATASCRIPT_SEPARATOR), _obj);
34
- export { DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_FILE_NAME, DOCUMENT_META_PLACEHOLDER, DOCUMENT_NO_SCRIPTE_PLACEHOLDER, DOCUMENT_SCRIPTS_PLACEHOLDER, DOCUMENT_SCRIPT_PLACEHOLDER_END, DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, DOCUMENT_SSR_PLACEHOLDER, DOC_EXT, HTML_CHUNKSMAP_SEPARATOR, HTML_SEPARATOR, HTML_SSRDATASCRIPT_SEPARATOR, PLACEHOLDER_REPLACER_MAP };
35
+ export { DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_FILE_NAME, DOCUMENT_LINKS_PLACEHOLDER, DOCUMENT_META_PLACEHOLDER, DOCUMENT_NO_SCRIPTE_PLACEHOLDER, DOCUMENT_SCRIPTS_PLACEHOLDER, DOCUMENT_SCRIPT_PLACEHOLDER_END, DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, DOCUMENT_SSR_PLACEHOLDER, DOC_EXT, HTML_CHUNKSMAP_SEPARATOR, HTML_SEPARATOR, HTML_SSRDATASCRIPT_SEPARATOR, PLACEHOLDER_REPLACER_MAP };
@@ -4,6 +4,7 @@ export * from "./DocumentStructrueContext";
4
4
  export * from "./Head";
5
5
  export * from "./Body";
6
6
  export * from "./Root";
7
+ export * from "./Links";
7
8
  export * from "./Scripts";
8
9
  export * from "./Script";
9
10
  export * from "./constants";
@@ -2,5 +2,6 @@ import { routerPlugin } from "./plugin";
2
2
  var runtime_default = routerPlugin;
3
3
  import { modifyRoutes } from "./plugin";
4
4
  export * from "react-router-dom";
5
+ export * from "react-router-dom/server";
5
6
  export * from "./withRouter";
6
7
  export { runtime_default as default, modifyRoutes };
@@ -51,7 +51,7 @@ function _objectSpreadProps(target, source) {
51
51
  return target;
52
52
  }
53
53
  import { jsx } from "react/jsx-runtime";
54
- import { createBrowserRouter, createHashRouter, RouterProvider, createRoutesFromElements, useMatches, useLocation } from "react-router-dom";
54
+ import { createBrowserRouter, createHashRouter, RouterProvider, createRoutesFromElements } from "react-router-dom";
55
55
  import hoistNonReactStatics from "hoist-non-react-statics";
56
56
  import { renderRoutes, urlJoin } from "./utils";
57
57
  var finalRouteConfig = {
@@ -79,16 +79,6 @@ var routerPlugin = function(param) {
79
79
  name: "@modern-js/plugin-router",
80
80
  setup: function() {
81
81
  return {
82
- init: function init(param, next) {
83
- var context = param.context;
84
- context.router = {
85
- useMatches: useMatches,
86
- useLocation: useLocation
87
- };
88
- return next({
89
- context: context
90
- });
91
- },
92
82
  hoc: function(param, next) {
93
83
  var App = param.App;
94
84
  if (!finalRouteConfig && !createRoutes) {
@@ -229,8 +229,8 @@ var __generator = this && this.__generator || function(thisArg, body) {
229
229
  };
230
230
  import { jsx } from "react/jsx-runtime";
231
231
  import { useContext } from "react";
232
- import { unstable_createStaticHandler as createStaticHandler } from "@remix-run/router";
233
- import { unstable_createStaticRouter as createStaticRouter, unstable_StaticRouterProvider as StaticRouterProvider } from "react-router-dom/server";
232
+ import { createStaticHandler } from "@remix-run/router";
233
+ import { createStaticRouter, StaticRouterProvider } from "react-router-dom/server";
234
234
  import hoistNonReactStatics from "hoist-non-react-statics";
235
235
  import { installGlobals } from "@remix-run/node";
236
236
  import { createRoutesFromElements } from "react-router-dom";
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
2
2
  declare type DocumentStructrueContextProps = {
3
3
  hasSetHead?: boolean;
4
4
  hasSetScripts?: boolean;
5
+ hasSetLinks?: boolean;
5
6
  hasSetBody?: boolean;
6
7
  hasSetRoot?: boolean;
7
8
  docChild?: ReactNode;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function Links(): JSX.Element;
@@ -8,6 +8,7 @@ export declare const DOCUMENT_CHUNKSMAP_PLACEHOLDER: string;
8
8
  export declare const DOCUMENT_SSRDATASCRIPT_PLACEHOLDER: string;
9
9
  export declare const DOCUMENT_FILE_NAME = "Document";
10
10
  export declare const DOCUMENT_SCRIPTS_PLACEHOLDER: string;
11
+ export declare const DOCUMENT_LINKS_PLACEHOLDER: string;
11
12
  export declare const DOCUMENT_NO_SCRIPTE_PLACEHOLDER: string;
12
13
  export declare const DOCUMENT_SCRIPT_PLACEHOLDER_START: string;
13
14
  export declare const DOCUMENT_SCRIPT_PLACEHOLDER_END: string;
@@ -4,6 +4,7 @@ export * from './DocumentStructrueContext';
4
4
  export * from './Head';
5
5
  export * from './Body';
6
6
  export * from './Root';
7
+ export * from './Links';
7
8
  export * from './Scripts';
8
9
  export * from './Script';
9
10
  export * from './constants';
@@ -4,4 +4,5 @@ export type { SingleRouteConfig, RouterConfig };
4
4
  export default routerPlugin;
5
5
  export { modifyRoutes } from './plugin';
6
6
  export * from 'react-router-dom';
7
+ export * from 'react-router-dom/server';
7
8
  export * from './withRouter';
@@ -1,4 +1,4 @@
1
- import { Plugin } from '../../core';
1
+ import type { Plugin } from '../../core';
2
2
  import type { RouterConfig, Routes } from './types';
3
3
  export declare let finalRouteConfig: RouterConfig['routesConfig'];
4
4
  export declare let beforeCreateRouter: boolean;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.5",
14
+ "version": "2.0.0-beta.6",
15
15
  "engines": {
16
16
  "node": ">=14.17.6"
17
17
  },
@@ -128,21 +128,20 @@
128
128
  },
129
129
  "dependencies": {
130
130
  "@babel/core": "^7.18.0",
131
- "@babel/types": "^7.18.0",
132
131
  "@babel/runtime": "^7.18.0",
132
+ "@babel/types": "^7.18.0",
133
133
  "@loadable/babel-plugin": "^5.13.2",
134
- "@loadable/webpack-plugin": "5.15.2",
135
134
  "@loadable/component": "^5.15.0",
136
135
  "@loadable/server": "^5.15.1",
136
+ "@loadable/webpack-plugin": "5.15.2",
137
137
  "@modern-js-reduck/plugin-auto-actions": "^1.1.4",
138
138
  "@modern-js-reduck/plugin-devtools": "^1.1.4",
139
139
  "@modern-js-reduck/plugin-effects": "^1.1.4",
140
140
  "@modern-js-reduck/plugin-immutable": "^1.1.4",
141
141
  "@modern-js-reduck/react": "^1.1.4",
142
142
  "@modern-js-reduck/store": "^1.1.4",
143
- "@modern-js/plugin": "2.0.0-beta.4",
144
- "@modern-js/types": "2.0.0-beta.4",
145
- "@modern-js/utils": "2.0.0-beta.4",
143
+ "@remix-run/node": "^1.9.0",
144
+ "@remix-run/router": "^1.2.0",
146
145
  "@types/loadable__component": "^5.13.4",
147
146
  "@types/react-helmet": "^6.1.2",
148
147
  "@types/redux-logger": "^3.0.9",
@@ -150,28 +149,24 @@
150
149
  "hoist-non-react-statics": "^3.3.2",
151
150
  "invariant": "^2.2.4",
152
151
  "react-helmet": "^6.1.0",
153
- "@remix-run/node": "^1.7.0",
154
- "@remix-run/router": "^1.0.4",
155
152
  "react-is": "^18",
156
- "react-router-dom": "^6.4.4",
153
+ "react-router-dom": "^6.6.0",
157
154
  "react-side-effect": "^2.1.1",
158
155
  "redux-logger": "^3.0.6",
159
156
  "serialize-javascript": "^6.0.0",
160
- "styled-components": "^5.3.1"
157
+ "styled-components": "^5.3.1",
158
+ "@modern-js/plugin": "2.0.0-beta.6",
159
+ "@modern-js/types": "2.0.0-beta.6",
160
+ "@modern-js/utils": "2.0.0-beta.6"
161
161
  },
162
162
  "peerDependencies": {
163
163
  "react": ">=17",
164
164
  "react-dom": ">=17"
165
165
  },
166
166
  "devDependencies": {
167
- "@modern-js/core": "2.0.0-beta.4",
168
- "@modern-js/server-core": "2.0.0-beta.4",
169
- "@scripts/build": "2.0.0-beta.4",
170
- "@modern-js/app-tools": "2.0.0-beta.4",
171
- "@scripts/jest-config": "2.0.0-beta.4",
167
+ "@remix-run/web-fetch": "^4.1.3",
172
168
  "@testing-library/react": "^13.4.0",
173
169
  "@testing-library/react-hooks": "^8.0.1",
174
- "@remix-run/web-fetch": "^4.1.3",
175
170
  "@types/invariant": "^2.2.30",
176
171
  "@types/jest": "^27",
177
172
  "@types/loadable__webpack-plugin": "^5.7.3",
@@ -182,7 +177,12 @@
182
177
  "react": "^18",
183
178
  "react-dom": "^18",
184
179
  "ts-jest": "^27.0.4",
185
- "typescript": "^4"
180
+ "typescript": "^4",
181
+ "@modern-js/app-tools": "2.0.0-beta.6",
182
+ "@modern-js/core": "2.0.0-beta.6",
183
+ "@modern-js/server-core": "2.0.0-beta.6",
184
+ "@scripts/build": "2.0.0-beta.6",
185
+ "@scripts/jest-config": "2.0.0-beta.6"
186
186
  },
187
187
  "sideEffects": false,
188
188
  "modernConfig": {},