@modern-js/runtime 2.58.2 → 2.58.4-alpha.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.
Files changed (159) hide show
  1. package/dist/cjs/cli/index.js +11 -14
  2. package/dist/cjs/cli/ssr/babel-plugin-ssr-loader-id.js +1 -1
  3. package/dist/cjs/cli/template.js +1 -1
  4. package/dist/cjs/core/browser/hydrate.js +1 -1
  5. package/dist/cjs/core/browser/index.js +2 -2
  6. package/dist/cjs/core/compatible.js +4 -4
  7. package/dist/cjs/core/context/runtime.js +1 -1
  8. package/dist/cjs/core/loader/useLoader.js +1 -1
  9. package/dist/cjs/core/server/react/prerender/index.js +1 -1
  10. package/dist/cjs/core/server/requestHandler.js +8 -3
  11. package/dist/cjs/core/server/stream/afterTemplate.js +1 -1
  12. package/dist/cjs/core/server/stream/beforeTemplate.js +3 -3
  13. package/dist/cjs/core/server/stream/createReadableStream.js +2 -2
  14. package/dist/cjs/core/server/stream/createReadableStream.worker.js +2 -2
  15. package/dist/cjs/core/server/stream/shared.js +1 -1
  16. package/dist/cjs/core/server/stream/template.js +1 -1
  17. package/dist/cjs/core/server/string/index.js +18 -18
  18. package/dist/cjs/core/server/string/prefetch.js +5 -5
  19. package/dist/cjs/core/server/string/ssrData.js +1 -1
  20. package/dist/cjs/document/Body.js +1 -1
  21. package/dist/cjs/document/Head.js +1 -1
  22. package/dist/cjs/document/Root.js +1 -1
  23. package/dist/cjs/document/cli/index.js +2 -2
  24. package/dist/cjs/router/cli/code/getClientRoutes/getRoutes.js +1 -1
  25. package/dist/cjs/router/cli/code/getClientRoutes/getRoutesLegacy.js +1 -1
  26. package/dist/cjs/router/cli/code/index.js +18 -27
  27. package/dist/cjs/router/cli/code/templates.js +15 -8
  28. package/dist/cjs/router/cli/code/utils.js +1 -1
  29. package/dist/cjs/router/cli/handler.js +2 -2
  30. package/dist/cjs/router/runtime/DeferredDataScripts.node.js +2 -2
  31. package/dist/cjs/router/runtime/PrefetchLink.js +1 -1
  32. package/dist/cjs/router/runtime/plugin.js +4 -4
  33. package/dist/cjs/router/runtime/plugin.node.js +6 -6
  34. package/dist/cjs/router/runtime/utils.js +2 -2
  35. package/dist/cjs/state/plugins.js +1 -1
  36. package/dist/cjs/state/runtime/plugin.js +6 -6
  37. package/dist/esm/cli/code.js +1 -1
  38. package/dist/esm/cli/index.js +7 -10
  39. package/dist/esm/cli/ssr/babel-plugin-ssr-loader-id.js +1 -1
  40. package/dist/esm/cli/template.js +1 -1
  41. package/dist/esm/core/browser/hydrate.js +1 -1
  42. package/dist/esm/core/browser/index.js +2 -2
  43. package/dist/esm/core/browser/withCallback.js +1 -1
  44. package/dist/esm/core/compatible.js +4 -4
  45. package/dist/esm/core/context/runtime.js +1 -1
  46. package/dist/esm/core/loader/useLoader.js +1 -1
  47. package/dist/esm/core/plugin/base.js +1 -1
  48. package/dist/esm/core/plugin/index.js +1 -1
  49. package/dist/esm/core/server/react/prerender/index.js +2 -2
  50. package/dist/esm/core/server/requestHandler.js +8 -4
  51. package/dist/esm/core/server/stream/afterTemplate.js +1 -1
  52. package/dist/esm/core/server/stream/beforeTemplate.js +3 -3
  53. package/dist/esm/core/server/stream/createReadableStream.js +2 -2
  54. package/dist/esm/core/server/stream/createReadableStream.worker.js +2 -2
  55. package/dist/esm/core/server/stream/shared.js +1 -1
  56. package/dist/esm/core/server/stream/template.js +1 -1
  57. package/dist/esm/core/server/string/index.js +8 -8
  58. package/dist/esm/core/server/string/prefetch.js +2 -2
  59. package/dist/esm/core/server/string/ssrData.js +1 -1
  60. package/dist/esm/document/Body.js +1 -1
  61. package/dist/esm/document/Comment.js +1 -1
  62. package/dist/esm/document/Head.js +1 -1
  63. package/dist/esm/document/Root.js +1 -1
  64. package/dist/esm/document/Script.js +1 -1
  65. package/dist/esm/document/Style.js +1 -1
  66. package/dist/esm/document/cli/index.js +3 -3
  67. package/dist/esm/router/cli/code/getClientRoutes/getRoutes.js +2 -2
  68. package/dist/esm/router/cli/code/getClientRoutes/getRoutesLegacy.js +2 -2
  69. package/dist/esm/router/cli/code/getClientRoutes/utils.js +2 -2
  70. package/dist/esm/router/cli/code/index.js +36 -35
  71. package/dist/esm/router/cli/code/nestedRoutes.js +1 -1
  72. package/dist/esm/router/cli/code/templates.js +2 -2
  73. package/dist/esm/router/cli/code/utils.js +2 -2
  74. package/dist/esm/router/cli/entry.js +1 -1
  75. package/dist/esm/router/cli/handler.js +2 -2
  76. package/dist/esm/router/cli/index.js +1 -1
  77. package/dist/esm/router/runtime/DeferredDataScripts.node.js +2 -2
  78. package/dist/esm/router/runtime/PrefetchLink.js +1 -1
  79. package/dist/esm/router/runtime/plugin.js +4 -4
  80. package/dist/esm/router/runtime/plugin.node.js +6 -6
  81. package/dist/esm/router/runtime/utils.js +2 -2
  82. package/dist/esm/state/plugins.js +1 -1
  83. package/dist/esm/state/runtime/plugin.js +4 -4
  84. package/dist/esm-node/cli/code.js +1 -1
  85. package/dist/esm-node/cli/index.js +7 -10
  86. package/dist/esm-node/cli/ssr/babel-plugin-ssr-loader-id.js +1 -1
  87. package/dist/esm-node/cli/template.js +1 -1
  88. package/dist/esm-node/core/browser/hydrate.js +1 -1
  89. package/dist/esm-node/core/browser/index.js +2 -2
  90. package/dist/esm-node/core/browser/withCallback.js +1 -1
  91. package/dist/esm-node/core/compatible.js +4 -4
  92. package/dist/esm-node/core/context/runtime.js +1 -1
  93. package/dist/esm-node/core/loader/useLoader.js +1 -1
  94. package/dist/esm-node/core/plugin/base.js +1 -1
  95. package/dist/esm-node/core/plugin/index.js +1 -1
  96. package/dist/esm-node/core/server/react/prerender/index.js +2 -2
  97. package/dist/esm-node/core/server/requestHandler.js +8 -3
  98. package/dist/esm-node/core/server/stream/afterTemplate.js +1 -1
  99. package/dist/esm-node/core/server/stream/beforeTemplate.js +3 -3
  100. package/dist/esm-node/core/server/stream/createReadableStream.js +2 -2
  101. package/dist/esm-node/core/server/stream/createReadableStream.worker.js +2 -2
  102. package/dist/esm-node/core/server/stream/shared.js +1 -1
  103. package/dist/esm-node/core/server/stream/template.js +1 -1
  104. package/dist/esm-node/core/server/string/index.js +8 -8
  105. package/dist/esm-node/core/server/string/prefetch.js +2 -2
  106. package/dist/esm-node/core/server/string/ssrData.js +1 -1
  107. package/dist/esm-node/document/Body.js +1 -1
  108. package/dist/esm-node/document/Comment.js +1 -1
  109. package/dist/esm-node/document/Head.js +1 -1
  110. package/dist/esm-node/document/Root.js +1 -1
  111. package/dist/esm-node/document/Script.js +1 -1
  112. package/dist/esm-node/document/Style.js +1 -1
  113. package/dist/esm-node/document/cli/index.js +3 -3
  114. package/dist/esm-node/router/cli/code/getClientRoutes/getRoutes.js +2 -2
  115. package/dist/esm-node/router/cli/code/getClientRoutes/getRoutesLegacy.js +2 -2
  116. package/dist/esm-node/router/cli/code/getClientRoutes/utils.js +2 -2
  117. package/dist/esm-node/router/cli/code/index.js +15 -24
  118. package/dist/esm-node/router/cli/code/nestedRoutes.js +1 -1
  119. package/dist/esm-node/router/cli/code/templates.js +16 -9
  120. package/dist/esm-node/router/cli/code/utils.js +2 -2
  121. package/dist/esm-node/router/cli/entry.js +1 -1
  122. package/dist/esm-node/router/cli/handler.js +2 -2
  123. package/dist/esm-node/router/cli/index.js +1 -1
  124. package/dist/esm-node/router/runtime/DeferredDataScripts.node.js +2 -2
  125. package/dist/esm-node/router/runtime/PrefetchLink.js +1 -1
  126. package/dist/esm-node/router/runtime/plugin.js +4 -4
  127. package/dist/esm-node/router/runtime/plugin.node.js +6 -6
  128. package/dist/esm-node/router/runtime/utils.js +2 -2
  129. package/dist/esm-node/state/plugins.js +1 -1
  130. package/dist/esm-node/state/runtime/plugin.js +4 -4
  131. package/dist/types/cli/code.d.ts +1 -1
  132. package/dist/types/cli/index.d.ts +3 -3
  133. package/dist/types/cli/ssr/index.d.ts +1 -1
  134. package/dist/types/common.d.ts +1 -1
  135. package/dist/types/config.d.ts +1 -1
  136. package/dist/types/core/compatible.d.ts +1 -1
  137. package/dist/types/core/context/runtime.d.ts +2 -2
  138. package/dist/types/core/plugin/index.d.ts +1 -1
  139. package/dist/types/core/server/stream/afterTemplate.d.ts +2 -2
  140. package/dist/types/core/server/stream/template.d.ts +1 -1
  141. package/dist/types/core/server/string/loadable.d.ts +1 -1
  142. package/dist/types/core/server/string/prefetch.d.ts +1 -1
  143. package/dist/types/core/server/string/ssrData.d.ts +2 -2
  144. package/dist/types/core/server/string/styledComponent.d.ts +1 -1
  145. package/dist/types/core/server/utils.d.ts +1 -1
  146. package/dist/types/core/types.d.ts +1 -1
  147. package/dist/types/document/cli/index.d.ts +1 -1
  148. package/dist/types/index.d.ts +1 -1
  149. package/dist/types/router/cli/code/index.d.ts +1 -1
  150. package/dist/types/router/cli/code/templates.d.ts +1 -1
  151. package/dist/types/router/cli/handler.d.ts +2 -2
  152. package/dist/types/router/cli/index.d.ts +1 -1
  153. package/dist/types/router/runtime/PrefetchLink.d.ts +1 -1
  154. package/dist/types/router/runtime/index.d.ts +1 -1
  155. package/dist/types/router/runtime/types.d.ts +2 -2
  156. package/dist/types/router/runtime/utils.d.ts +2 -2
  157. package/dist/types/router/runtime/withRouter.d.ts +1 -1
  158. package/dist/types/state/cli/index.d.ts +1 -1
  159. package/package.json +10 -10
@@ -1,8 +1,8 @@
1
- import { renderToStaticMarkup } from "react-dom/server";
2
- import { run } from "@modern-js/runtime-utils/node";
3
1
  import { ChunkExtractor } from "@loadable/server";
2
+ import { run } from "@modern-js/runtime-utils/node";
4
3
  import { time } from "@modern-js/runtime-utils/time";
5
4
  import { parseHeaders } from "@modern-js/runtime-utils/universal/request";
5
+ import { renderToStaticMarkup } from "react-dom/server";
6
6
  import { wrapRuntimeContextProvider } from "../../react/wrapper";
7
7
  import { SSRErrors, SSRTimings } from "../tracer";
8
8
  const prefetch = async (App, request, options, ssrConfig, { onError, onTiming }) => {
@@ -4,8 +4,8 @@ import { _ as _class_private_field_set } from "@swc/helpers/_/_class_private_fie
4
4
  import { _ as _class_private_method_get } from "@swc/helpers/_/_class_private_method_get";
5
5
  import { _ as _class_private_method_init } from "@swc/helpers/_/_class_private_method_init";
6
6
  import { serializeJson } from "@modern-js/runtime-utils/node";
7
- import { attributesToString, serializeErrors } from "../utils";
8
7
  import { ROUTER_DATA_JSON_ID, SSR_DATA_JSON_ID } from "../../constants";
8
+ import { attributesToString, serializeErrors } from "../utils";
9
9
  var _options = /* @__PURE__ */ new WeakMap(), _getSSRData = /* @__PURE__ */ new WeakSet(), _getSSRDataScripts = /* @__PURE__ */ new WeakSet();
10
10
  class SSRDataCollector {
11
11
  effect() {
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
- import { BODY_PARTICALS_SEPARATOR, DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER } from "./constants";
4
3
  import { DocumentStructureContext } from "./DocumentStructureContext";
5
4
  import { DefaultRoot } from "./Root";
5
+ import { BODY_PARTICALS_SEPARATOR, DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER } from "./constants";
6
6
  function Body(props) {
7
7
  const { hasSetRoot } = useContext(DocumentStructureContext);
8
8
  const { children, ...rest } = props;
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { DOCUMENT_COMMENT_PLACEHOLDER_START, DOCUMENT_COMMENT_PLACEHOLDER_END } from "./constants";
2
+ import { DOCUMENT_COMMENT_PLACEHOLDER_END, DOCUMENT_COMMENT_PLACEHOLDER_START } from "./constants";
3
3
  function Comment(props) {
4
4
  const { comment, children } = props;
5
5
  const commentStr = encodeURIComponent(children || comment || "");
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { DocumentStructureContext } from "./DocumentStructureContext";
4
- import { Scripts } from "./Scripts";
5
4
  import { Links } from "./Links";
5
+ import { Scripts } from "./Scripts";
6
6
  import { Title } from "./Title";
7
7
  import { DOCUMENT_META_PLACEHOLDER, HEAD_PARTICALS_SEPARATOR, TOP_PARTICALS_SEPARATOR } from "./constants";
8
8
  function Head(props) {
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useContext } from "react";
3
2
  import { omit } from "@modern-js/utils/lodash";
3
+ import { useContext } from "react";
4
4
  import { DocumentContext } from "./DocumentContext";
5
5
  import { DOCUMENT_SSR_PLACEHOLDER } from "./constants";
6
6
  function Root(props) {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SCRIPT_PLACEHOLDER_END } from "./constants";
2
+ import { DOCUMENT_SCRIPT_PLACEHOLDER_END, DOCUMENT_SCRIPT_PLACEHOLDER_START } from "./constants";
3
3
  function Script(props) {
4
4
  const { content } = props;
5
5
  const contentStr = content.toString();
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { DOCUMENT_STYLE_PLACEHOLDER_START, DOCUMENT_STYLE_PLACEHOLDER_END } from "./constants";
2
+ import { DOCUMENT_STYLE_PLACEHOLDER_END, DOCUMENT_STYLE_PLACEHOLDER_START } from "./constants";
3
3
  function Style(props) {
4
4
  const { content, children } = props;
5
5
  const contentStr = children || content;
@@ -1,10 +1,10 @@
1
1
  import path from "path";
2
+ import { fs, createDebugger, findExists } from "@modern-js/utils";
3
+ import { build } from "esbuild";
2
4
  import React from "react";
3
5
  import ReactDomServer from "react-dom/server";
4
- import { build } from "esbuild";
5
- import { createDebugger, findExists, fs } from "@modern-js/utils";
6
6
  import { DocumentContext } from "../DocumentContext";
7
- 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, DOCUMENT_COMMENT_PLACEHOLDER_START, DOCUMENT_COMMENT_PLACEHOLDER_END, DOCUMENT_STYLE_PLACEHOLDER_START, DOCUMENT_STYLE_PLACEHOLDER_END, DOCUMENT_TITLE_PLACEHOLDER, TOP_PARTICALS_SEPARATOR, HEAD_PARTICALS_SEPARATOR, BODY_PARTICALS_SEPARATOR } from "../constants";
7
+ import { BODY_PARTICALS_SEPARATOR, DOCUMENT_CHUNKSMAP_PLACEHOLDER, DOCUMENT_COMMENT_PLACEHOLDER_END, DOCUMENT_COMMENT_PLACEHOLDER_START, DOCUMENT_FILE_NAME, DOCUMENT_LINKS_PLACEHOLDER, DOCUMENT_META_PLACEHOLDER, DOCUMENT_SCRIPTS_PLACEHOLDER, DOCUMENT_SCRIPT_PLACEHOLDER_END, DOCUMENT_SCRIPT_PLACEHOLDER_START, DOCUMENT_SSRDATASCRIPT_PLACEHOLDER, DOCUMENT_SSR_PLACEHOLDER, DOCUMENT_STYLE_PLACEHOLDER_END, DOCUMENT_STYLE_PLACEHOLDER_START, DOCUMENT_TITLE_PLACEHOLDER, DOC_EXT, HEAD_PARTICALS_SEPARATOR, HTML_SEPARATOR, PLACEHOLDER_REPLACER_MAP, TOP_PARTICALS_SEPARATOR } from "../constants";
8
8
  const debug = createDebugger("html_genarate");
9
9
  const getDocumenByEntryName = function(entrypoints, entryName, fallbackDir) {
10
10
  var _entrypoints_find;
@@ -1,9 +1,9 @@
1
1
  import path from "path";
2
2
  import { fs } from "@modern-js/utils";
3
- import { makeLegalIdentifier } from "../makeLegalIdentifier";
4
3
  import { FILE_SYSTEM_ROUTES_COMPONENTS_DIR, FILE_SYSTEM_ROUTES_DYNAMIC_REGEXP, FILE_SYSTEM_ROUTES_INDEX, FILE_SYSTEM_ROUTES_LAYOUT } from "../../constants";
4
+ import { makeLegalIdentifier } from "../makeLegalIdentifier";
5
5
  import { replaceWithAlias } from "../utils";
6
- import { debug, findLayout, shouldSkip, getRouteWeight } from "./utils";
6
+ import { debug, findLayout, getRouteWeight, shouldSkip } from "./utils";
7
7
  const compName = (srcDirectory, filePath) => {
8
8
  const legalCompName = makeLegalIdentifier(path.relative(srcDirectory, filePath));
9
9
  return `Comp_${legalCompName}`;
@@ -1,9 +1,9 @@
1
1
  import path from "path";
2
2
  import { fs } from "@modern-js/utils";
3
3
  import { FILE_SYSTEM_ROUTES_COMPONENTS_DIR, FILE_SYSTEM_ROUTES_DYNAMIC_REGEXP, FILE_SYSTEM_ROUTES_INDEX, FILE_SYSTEM_ROUTES_LAYOUT } from "../../constants";
4
- import { replaceWithAlias } from "../utils";
5
4
  import { makeLegalIdentifier } from "../makeLegalIdentifier";
6
- import { debug, findLayout, shouldSkip, getRouteWeight } from "./utils";
5
+ import { replaceWithAlias } from "../utils";
6
+ import { debug, findLayout, getRouteWeight, shouldSkip } from "./utils";
7
7
  const compName = (srcDirectory, filePath) => {
8
8
  const legalCompName = makeLegalIdentifier(path.relative(srcDirectory, filePath));
9
9
  return `Comp_${legalCompName}`;
@@ -1,6 +1,6 @@
1
1
  import path from "path";
2
- import { JS_EXTENSIONS, createDebugger, findExists, fs } from "@modern-js/utils";
3
- import { FILE_SYSTEM_ROUTES_LAYOUT, FILE_SYSTEM_ROUTES_GLOBAL_LAYOUT, FILE_SYSTEM_ROUTES_IGNORED_REGEX } from "../../constants";
2
+ import { fs, JS_EXTENSIONS, createDebugger, findExists } from "@modern-js/utils";
3
+ import { FILE_SYSTEM_ROUTES_GLOBAL_LAYOUT, FILE_SYSTEM_ROUTES_IGNORED_REGEX, FILE_SYSTEM_ROUTES_LAYOUT } from "../../constants";
4
4
  const debug = createDebugger("get-client-routes");
5
5
  const findLayout = (dir) => findExists(JS_EXTENSIONS.map((ext) => path.resolve(dir, `${FILE_SYSTEM_ROUTES_LAYOUT}${ext}`)));
6
6
  const getRouteWeight = (route) => route === "*" ? 999 : route.split(":").length - 1;
@@ -1,12 +1,12 @@
1
1
  import path from "path";
2
- import { fs, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger, filterRoutesForServer, filterRoutesLoader } from "@modern-js/utils";
2
+ import { fs, filterRoutesForServer, filterRoutesLoader, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger, markRoutes } from "@modern-js/utils";
3
3
  import { cloneDeep } from "@modern-js/utils/lodash";
4
- import { FILE_SYSTEM_ROUTES_FILE_NAME } from "../constants";
5
4
  import { ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME } from "../../../cli/constants";
6
- import * as templates from "./templates";
5
+ import { FILE_SYSTEM_ROUTES_FILE_NAME } from "../constants";
7
6
  import { getClientRoutes, getClientRoutesLegacy } from "./getClientRoutes";
8
- import { getServerLoadersFile, getServerCombinedModueFile } from "./utils";
9
7
  import { walk } from "./nestedRoutes";
8
+ import * as templates from "./templates";
9
+ import { getServerCombinedModueFile, getServerLoadersFile } from "./utils";
10
10
  const generateCode = async (appContext, config, entrypoints, api) => {
11
11
  const { internalDirectory, srcDirectory, internalDirAlias, internalSrcAlias, packageName } = appContext;
12
12
  const hookRunners = api.useHookRunners();
@@ -81,7 +81,7 @@ const generateCode = async (appContext, config, entrypoints, api) => {
81
81
  })
82
82
  });
83
83
  if (entrypoint.nestedRoutesEntry && isUseSSRBundle(config2)) {
84
- var _config_output1;
84
+ var _config_output1, _config_output2;
85
85
  const routesServerFile = getServerLoadersFile(internalDirectory, entryName);
86
86
  const filtedRoutesForServer = filterRoutesForServer(routes);
87
87
  const routesForServerLoaderMatches = filterRoutesLoader(routes);
@@ -100,6 +100,16 @@ const generateCode = async (appContext, config, entrypoints, api) => {
100
100
  splitRouteChunks: config2 === null || config2 === void 0 ? void 0 : (_config_output1 = config2.output) === null || _config_output1 === void 0 ? void 0 : _config_output1.splitRouteChunks
101
101
  });
102
102
  await fs.outputFile(path.resolve(internalDirectory, `./${entryName}/routes.server.js`), serverRoutesCode, "utf8");
103
+ const mfServerRoutesCode = await templates.fileSystemRoutes({
104
+ metaName,
105
+ routes,
106
+ ssrMode: useSSG ? "string" : mode,
107
+ nestedRoutesEntry: entrypoint.nestedRoutesEntry,
108
+ entryName: entrypoint.entryName,
109
+ internalDirectory,
110
+ splitRouteChunks: config2 === null || config2 === void 0 ? void 0 : (_config_output2 = config2.output) === null || _config_output2 === void 0 ? void 0 : _config_output2.splitRouteChunks
111
+ });
112
+ await fs.outputFile(path.resolve(internalDirectory, `./${entryName}/mf-routes.js`), mfServerRoutesCode, "utf8");
103
113
  }
104
114
  const serverLoaderCombined = templates.ssrLoaderCombinedModule(entrypoints, entrypoint, config2, appContext);
105
115
  if (serverLoaderCombined) {
@@ -111,25 +121,6 @@ const generateCode = async (appContext, config, entrypoints, api) => {
111
121
  }
112
122
  }
113
123
  };
114
- function markRoutes(routes, routeIds) {
115
- return routes.map((route) => {
116
- if (route.type !== "nested") {
117
- return route;
118
- }
119
- if (route.children && route.children.length > 0) {
120
- route.children = markRoutes(route.children, routeIds);
121
- }
122
- if (route.children && route.children.length > 0) {
123
- route.inValidSSRRoute = route.children.every((child) => {
124
- var _child_inValidSSRRoute;
125
- return (_child_inValidSSRRoute = child.inValidSSRRoute) !== null && _child_inValidSSRRoute !== void 0 ? _child_inValidSSRRoute : false;
126
- });
127
- } else if (route.id) {
128
- route.inValidSSRRoute = !routeIds.includes(route.id);
129
- }
130
- return route;
131
- });
132
- }
133
124
  function generatorRegisterCode(internalDirectory, entryName, code) {
134
125
  fs.outputFileSync(path.resolve(internalDirectory, `./${entryName}/${ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME}`), code, "utf8");
135
126
  }
@@ -1,5 +1,5 @@
1
1
  import * as path from "path";
2
- import { JS_EXTENSIONS, fs, normalizeToPosixPath } from "@modern-js/utils";
2
+ import { fs, JS_EXTENSIONS, normalizeToPosixPath } from "@modern-js/utils";
3
3
  import { NESTED_ROUTE } from "../constants";
4
4
  import { getPathWithoutExt, hasAction, replaceWithAlias } from "./utils";
5
5
  const conventionNames = Object.values(NESTED_ROUTE);
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { findExists, formatImportPath, fs, getEntryOptions, isSSGEntry, slash } from "@modern-js/utils";
2
+ import { fs, findExists, formatImportPath, getEntryOptions, isSSGEntry, slash } from "@modern-js/utils";
3
3
  import { ROUTE_MODULES } from "@modern-js/utils/universal/constants";
4
4
  import { APP_CONFIG_NAME, APP_INIT_EXPORTED, TEMP_LOADERS_DIR } from "../constants";
5
5
  import { getPathWithoutExt, getServerLoadersFile, parseModule, replaceWithAlias } from "./utils";
@@ -332,14 +332,21 @@ function ssrLoaderCombinedModule(entrypoints, entrypoint, config, appContext) {
332
332
  if (!config.source.enableAsyncEntry) {
333
333
  return combinedModule;
334
334
  }
335
- return `export default Promise.all([import("${slash(serverLoaderRuntime)}"),import("${slash(serverLoadersFile)}")]).then(res=>{
336
- return res.reduce((sum,cur)=>{
337
- return {
338
- ...sum,
339
- ...cur
340
- }
341
- },{})
342
- })`;
335
+ return `
336
+ async function loadModules() {
337
+ const [moduleA, moduleB] = await Promise.all([
338
+ import("${slash(serverLoaderRuntime)}"),
339
+ import("${slash(serverLoadersFile)}")
340
+ ]);
341
+
342
+ return {
343
+ ...moduleA,
344
+ ...moduleB
345
+ };
346
+ }
347
+
348
+ export { loadModules };
349
+ `;
343
350
  }
344
351
  return null;
345
352
  }
@@ -1,8 +1,8 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { normalizeToPosixPath, fs as fse, JS_EXTENSIONS } from "@modern-js/utils";
4
- import { transform } from "esbuild";
3
+ import { JS_EXTENSIONS, fs as fse, normalizeToPosixPath } from "@modern-js/utils";
5
4
  import { parse } from "es-module-lexer";
5
+ import { transform } from "esbuild";
6
6
  import { ACTION_EXPORT_NAME, LOADER_EXPORT_NAME } from "../constants";
7
7
  const walkDirectory = (dir) => fs.readdirSync(dir).reduce((previous, filename) => {
8
8
  const filePath = path.join(dir, filename);
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { JS_EXTENSIONS, findExists, fs, isRouterV5 } from "@modern-js/utils";
2
+ import { fs, JS_EXTENSIONS, findExists, isRouterV5 } from "@modern-js/utils";
3
3
  import { hasApp } from "../../cli/entry";
4
4
  import { FILE_SYSTEM_ROUTES_GLOBAL_LAYOUT, NESTED_ROUTES_DIR, PAGES_DIR_NAME } from "./constants";
5
5
  const hasPages = (dir) => fs.existsSync(path.join(dir, PAGES_DIR_NAME));
@@ -1,8 +1,8 @@
1
1
  import path from "path";
2
2
  import { cloneDeep } from "@modern-js/utils/lodash";
3
- import { modifyEntrypoints } from "./entry";
4
- import { isPageComponentFile } from "./code/utils";
5
3
  import * as templates from "./code/templates";
4
+ import { isPageComponentFile } from "./code/utils";
5
+ import { modifyEntrypoints } from "./entry";
6
6
  let originEntrypoints = [];
7
7
  async function handleModifyEntrypoints(api, entrypoints) {
8
8
  const config = api.useResolvedConfigContext();
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { createRuntimeExportsUtils, filterRoutesForServer, fs, getEntryOptions, isRouterV5 as isV5, NESTED_ROUTE_SPEC_FILE } from "@modern-js/utils";
2
+ import { fs, NESTED_ROUTE_SPEC_FILE, createRuntimeExportsUtils, filterRoutesForServer, getEntryOptions, isRouterV5 as isV5 } from "@modern-js/utils";
3
3
  import { isRouteEntry } from "./entry";
4
4
  import { handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints } from "./handler";
5
5
  import { isRouteEntry as isRouteEntry2 } from "./entry";
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Suspense, useEffect, useRef, useMemo } from "react";
3
- import { Await, useAsyncError } from "@modern-js/runtime-utils/router";
4
2
  import { serializeJson } from "@modern-js/runtime-utils/node";
3
+ import { Await, useAsyncError } from "@modern-js/runtime-utils/router";
4
+ import { Suspense, useEffect, useMemo, useRef } from "react";
5
5
  import { serializeErrors } from "./utils";
6
6
  const setupFnStr = `function s(r,e){_ROUTER_DATA.r=_ROUTER_DATA.r||{},_ROUTER_DATA.r[r]=_ROUTER_DATA.r[r]||{};return new Promise((function(A,R){_ROUTER_DATA.r[r][e]={resolve:A,reject:R}}))};`;
7
7
  const resolveFnStr = `function r(e,r,o,A){A?_ROUTER_DATA.r[e][r].reject(A):_ROUTER_DATA.r[e][r].resolve(o)};`;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Link as RouterLink, NavLink as RouterNavLink, matchRoutes, useHref, useMatches, useResolvedPath } from "@modern-js/runtime-utils/router";
2
3
  import React, { useContext, useMemo } from "react";
3
- import { Link as RouterLink, matchRoutes, useResolvedPath, useHref, useMatches, NavLink as RouterNavLink } from "@modern-js/runtime-utils/router";
4
4
  import { RuntimeReactContext } from "../../core";
5
5
  function composeEventHandlers(theirHandler, ourHandler) {
6
6
  return (event) => {
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useContext, useMemo } from "react";
3
- import { createBrowserRouter, createHashRouter, RouterProvider, createRoutesFromElements, useMatches, useLocation, useHref } from "@modern-js/runtime-utils/router";
4
- import { parsedJSONFromElement } from "@modern-js/runtime-utils/parsed";
5
2
  import { merge } from "@modern-js/runtime-utils/merge";
6
- import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
3
+ import { parsedJSONFromElement } from "@modern-js/runtime-utils/parsed";
4
+ import { RouterProvider, createBrowserRouter, createHashRouter, createRoutesFromElements, useHref, useLocation, useMatches } from "@modern-js/runtime-utils/router";
5
+ import { useContext, useMemo } from "react";
7
6
  import { RuntimeReactContext } from "../../core";
7
+ import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
8
8
  import { modifyRoutes as modifyRoutesHook } from "./hooks";
9
9
  import { deserializeErrors, renderRoutes, urlJoin } from "./utils";
10
10
  let finalRouteConfig = {
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useContext } from "react";
2
+ import { merge } from "@modern-js/runtime-utils/merge";
3
+ import { createRequestContext, reporterCtx } from "@modern-js/runtime-utils/node";
4
+ import { StaticRouterProvider, createStaticRouter } from "@modern-js/runtime-utils/node/router";
3
5
  import { createStaticHandler } from "@modern-js/runtime-utils/remix-router";
4
- import { createStaticRouter, StaticRouterProvider } from "@modern-js/runtime-utils/node/router";
5
6
  import { createRoutesFromElements } from "@modern-js/runtime-utils/router";
6
- import { reporterCtx, createRequestContext } from "@modern-js/runtime-utils/node";
7
7
  import { time } from "@modern-js/runtime-utils/time";
8
8
  import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
9
- import { merge } from "@modern-js/runtime-utils/merge";
9
+ import { useContext } from "react";
10
10
  import { JSX_SHELL_STREAM_END_MARK } from "../../common";
11
11
  import { RuntimeReactContext } from "../../core";
12
12
  import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
13
- import { renderRoutes, urlJoin } from "./utils";
14
- import { modifyRoutes as modifyRoutesHook } from "./hooks";
15
13
  import DeferredDataScripts from "./DeferredDataScripts.node";
14
+ import { modifyRoutes as modifyRoutesHook } from "./hooks";
15
+ import { renderRoutes, urlJoin } from "./utils";
16
16
  function createRemixReuqest(request) {
17
17
  const method = "GET";
18
18
  const { headers } = request;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Route, isRouteErrorResponse } from "@modern-js/runtime-utils/router";
3
- import { UNSAFE_ErrorResponseImpl as ErrorResponseImpl } from "@modern-js/runtime-utils/remix-router";
4
2
  import { renderNestedRoute } from "@modern-js/runtime-utils/browser";
3
+ import { UNSAFE_ErrorResponseImpl as ErrorResponseImpl } from "@modern-js/runtime-utils/remix-router";
4
+ import { Route, isRouteErrorResponse } from "@modern-js/runtime-utils/router";
5
5
  import { DefaultNotFound } from "./DefaultNotFound";
6
6
  import DeferredDataScripts from "./DeferredDataScripts";
7
7
  function getRouteComponents(routes, { globalApp, ssrMode, props, reporter }) {
@@ -1,5 +1,5 @@
1
- import { plugin as effectsPlugin } from "@modern-js-reduck/plugin-effects";
2
1
  import autoActionsPlugin from "@modern-js-reduck/plugin-auto-actions";
2
+ import { plugin as effectsPlugin } from "@modern-js-reduck/plugin-effects";
3
3
  import immerPlugin from "@modern-js-reduck/plugin-immutable";
4
4
  import { default as default2 } from "@modern-js-reduck/plugin-devtools";
5
5
  const effects = () => effectsPlugin;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useContext } from "react";
3
- import { createStore } from "@modern-js-reduck/store";
4
2
  import { Provider } from "@modern-js-reduck/react";
3
+ import { createStore } from "@modern-js-reduck/store";
5
4
  import { merge } from "@modern-js/runtime-utils/merge";
6
- import { immer, effects, autoActions, devtools } from "../plugins";
7
- import { RuntimeReactContext } from "../../core";
5
+ import { useContext } from "react";
8
6
  import { isBrowser } from "../../common";
7
+ import { RuntimeReactContext } from "../../core";
8
+ import { autoActions, devtools, effects, immer } from "../plugins";
9
9
  const StatePluginHandleMap = {
10
10
  immer,
11
11
  effects,
@@ -1,6 +1,6 @@
1
1
  import type { AppTools, IAppContext, NormalizedConfig, RuntimePlugin } from '@modern-js/app-tools';
2
- import type { Entrypoint } from '@modern-js/types';
3
2
  import type { MaybeAsync } from '@modern-js/plugin';
3
+ import type { Entrypoint } from '@modern-js/types';
4
4
  export declare const generateCode: (entrypoints: Entrypoint[], appContext: IAppContext, config: NormalizedConfig<AppTools>, onCollectRuntimePlugins: (params: {
5
5
  entrypoint: Entrypoint;
6
6
  plugins: RuntimePlugin[];
@@ -1,7 +1,7 @@
1
- import type { CliPlugin, AppTools } from '@modern-js/app-tools';
2
- import { statePlugin } from '../state/cli';
3
- import { routerPlugin } from '../router/cli';
1
+ import type { AppTools, CliPlugin } from '@modern-js/app-tools';
4
2
  import { documentPlugin } from '../document/cli';
3
+ import { routerPlugin } from '../router/cli';
4
+ import { statePlugin } from '../state/cli';
5
5
  import { ssrPlugin } from './ssr';
6
6
  export { isRuntimeEntry } from './entry';
7
7
  export { statePlugin, ssrPlugin, routerPlugin, documentPlugin };
@@ -1,3 +1,3 @@
1
- import type { CliPlugin, AppTools } from '@modern-js/app-tools';
1
+ import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
2
  export declare const ssrPlugin: () => CliPlugin<AppTools>;
3
3
  export default ssrPlugin;
@@ -1,5 +1,5 @@
1
- import type { StateConfig } from './state';
2
1
  import type { Plugin } from './core/plugin';
2
+ import type { StateConfig } from './state';
3
3
  export declare const isBrowser: () => boolean;
4
4
  export interface AppConfig {
5
5
  state?: StateConfig | boolean;
@@ -1,5 +1,5 @@
1
- import type { StateConfig } from './state';
2
1
  import type { RouterConfig } from './router';
2
+ import type { StateConfig } from './state';
3
3
  export interface RuntimeUserConfig {
4
4
  runtime?: {
5
5
  state?: boolean | StateConfig;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Renderer } from 'react-dom';
3
- import type { hydrateRoot, createRoot } from 'react-dom/client';
3
+ import type { createRoot, hydrateRoot } from 'react-dom/client';
4
4
  import { type RuntimeContext, type TRuntimeContext } from './context/runtime';
5
5
  import { type Plugin, type runtime } from './plugin';
6
6
  export type CreateAppOptions = {
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { Store } from '@modern-js-reduck/store';
3
- import type { StaticHandlerContext, Router, RouterState } from '@modern-js/runtime-utils/remix-router';
3
+ import type { Router, RouterState, StaticHandlerContext } from '@modern-js/runtime-utils/remix-router';
4
+ import type { RouteManifest } from '../../router/runtime/types';
4
5
  import { createLoaderManager } from '../loader/loaderManager';
5
6
  import type { PluginRunner, runtime } from '../plugin';
6
- import type { RouteManifest } from '../../router/runtime/types';
7
7
  import type { SSRServerContext } from '../types';
8
8
  export interface BaseRuntimeContext {
9
9
  initialData?: Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { runtime, type Plugin } from './base';
2
+ import { type Plugin, runtime } from './base';
3
3
  export * from './base';
4
4
  export interface RuntimeConfig {
5
5
  plugins?: Plugin[];
@@ -1,7 +1,7 @@
1
- import { type SSRConfig } from '../shared';
2
1
  import type { RenderLevel } from '../../constants';
3
- import type { HandleRequestConfig } from '../requestHandler';
4
2
  import type { RuntimeContext } from '../../context';
3
+ import type { HandleRequestConfig } from '../requestHandler';
4
+ import { type SSRConfig } from '../shared';
5
5
  export type BuildShellAfterTemplateOptions = {
6
6
  runtimeContext: RuntimeContext;
7
7
  renderLevel: RenderLevel;
@@ -1,5 +1,5 @@
1
- import { type BuildShellBeforeTemplateOptions } from './beforeTemplate';
2
1
  import { type BuildShellAfterTemplateOptions } from './afterTemplate';
2
+ import { type BuildShellBeforeTemplateOptions } from './beforeTemplate';
3
3
  export type InjectTemplate = {
4
4
  shellBefore: string;
5
5
  shellAfter: string;
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import type { Collector, ChunkSet } from './types';
2
+ import type { ChunkSet, Collector } from './types';
3
3
  declare module '@loadable/server' {
4
4
  interface ChunkExtractor {
5
5
  chunks: Chunk;
@@ -1,8 +1,8 @@
1
1
  import type React from 'react';
2
2
  import type { LoaderResult } from '../../loader/loaderManager';
3
3
  import type { HandleRequestOptions } from '../requestHandler';
4
- import { type Tracer } from '../tracer';
5
4
  import type { SSRConfig } from '../shared';
5
+ import { type Tracer } from '../tracer';
6
6
  export declare const prefetch: (App: React.ReactElement, request: Request, options: HandleRequestOptions, ssrConfig: SSRConfig, { onError, onTiming }: Tracer) => Promise<{
7
7
  initialData: Record<string, unknown> | undefined;
8
8
  i18nData: any;
@@ -1,7 +1,7 @@
1
1
  import type { StaticHandlerContext } from '@modern-js/runtime-utils/remix-router';
2
- import type { SSRConfig } from '../shared';
3
2
  import type { SSRServerContext } from '../../types';
4
- import type { Collector, ChunkSet } from './types';
3
+ import type { SSRConfig } from '../shared';
4
+ import type { ChunkSet, Collector } from './types';
5
5
  export interface SSRDataCreatorOptions {
6
6
  request: Request;
7
7
  prefetchData: Record<string, any>;
@@ -1,5 +1,5 @@
1
- import { ServerStyleSheet } from 'styled-components';
2
1
  import type { ReactElement } from 'react';
2
+ import { ServerStyleSheet } from 'styled-components';
3
3
  import type { ChunkSet, Collector } from './types';
4
4
  export declare class StyledCollector implements Collector {
5
5
  #private;
@@ -1,5 +1,5 @@
1
- import { type StaticHandlerContext } from '@modern-js/runtime-utils/remix-router';
2
1
  import type { ServerUserConfig } from '@modern-js/app-tools';
2
+ import { type StaticHandlerContext } from '@modern-js/runtime-utils/remix-router';
3
3
  import type { SSRConfig } from './shared';
4
4
  export declare function attributesToString(attributes: Record<string, any>): string;
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import type { BaseSSRServerContext } from '@modern-js/types';
2
- import type { LoaderResult } from './loader/loaderManager';
3
2
  import type { RenderLevel } from './constants';
3
+ import type { LoaderResult } from './loader/loaderManager';
4
4
  declare global {
5
5
  interface Window {
6
6
  _SSR_DATA?: SSRContainer;
@@ -1,4 +1,4 @@
1
- import type { CliPlugin, AppTools } from '@modern-js/app-tools';
1
+ import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
2
  import type { Entrypoint } from '@modern-js/types/cli';
3
3
  export declare const getDocumenByEntryName: (entrypoints: Entrypoint[], entryName: string, fallbackDir?: string) => string | undefined;
4
4
  export declare const documentPlugin: () => CliPlugin<AppTools>;
@@ -1,5 +1,5 @@
1
- import type { StateConfig } from './state';
2
1
  import type { RouterConfig } from './router';
2
+ import type { StateConfig } from './state';
3
3
  export type { Plugin } from './core';
4
4
  export type { AppConfig, RuntimeConfig } from './common';
5
5
  export { isBrowser } from './common';
@@ -1,5 +1,5 @@
1
+ import type { AppNormalizedConfig, AppTools } from '@modern-js/app-tools';
1
2
  import type { IAppContext, PluginAPI } from '@modern-js/core';
2
3
  import type { Entrypoint } from '@modern-js/types';
3
- import type { AppNormalizedConfig, AppTools } from '@modern-js/app-tools';
4
4
  export declare const generateCode: (appContext: IAppContext, config: AppNormalizedConfig<'shared'>, entrypoints: Entrypoint[], api: PluginAPI<AppTools<'shared'>>) => Promise<void>;
5
5
  export declare function generatorRegisterCode(internalDirectory: string, entryName: string, code: string): void;
@@ -1,5 +1,5 @@
1
- import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, SSRMode } from '@modern-js/types';
2
1
  import type { AppNormalizedConfig, IAppContext } from '@modern-js/app-tools';
2
+ import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, SSRMode } from '@modern-js/types';
3
3
  export declare const routesForServer: ({ routesForServerLoaderMatches, }: {
4
4
  routesForServerLoaderMatches: (NestedRouteForCli | PageRoute)[];
5
5
  }) => string;
@@ -1,6 +1,6 @@
1
- import type { Entrypoint } from '@modern-js/types';
2
- import type { PluginAPI } from '@modern-js/core';
3
1
  import type { AppTools } from '@modern-js/app-tools';
2
+ import type { PluginAPI } from '@modern-js/core';
3
+ import type { Entrypoint } from '@modern-js/types';
4
4
  export declare function handleModifyEntrypoints(api: PluginAPI<AppTools<'shared'>>, entrypoints: Entrypoint[]): Promise<Entrypoint[]>;
5
5
  export declare function handleGeneratorEntryCode(api: PluginAPI<AppTools<'shared'>>, entrypoints: Entrypoint[]): Promise<Entrypoint[]>;
6
6
  export declare function handleFileChange(api: PluginAPI<AppTools<'shared'>>, e: any): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { CliPlugin, AppTools } from '@modern-js/app-tools';
1
+ import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
2
  export { isRouteEntry } from './entry';
3
3
  export { handleFileChange, handleModifyEntrypoints } from './handler';
4
4
  export declare const routerPlugin: () => CliPlugin<AppTools<'shared'>>;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { type LinkProps as RouterLinkProps, type NavLinkProps as RouterNavLinkProps } from '@modern-js/runtime-utils/router';
2
+ import React from 'react';
3
3
  export declare function composeEventHandlers<EventType extends React.SyntheticEvent | Event>(theirHandler: ((event: EventType) => any) | undefined, ourHandler: (event: EventType) => any): (event: EventType) => any;
4
4
  /**
5
5
  * Modified from https://github.com/remix-run/remix/blob/9a0601bd704d2f3ee622e0ddacab9b611eb0c5bc/packages/remix-react/components.tsx#L218
@@ -1,6 +1,6 @@
1
1
  import { useRouteLoaderData as useRouteData } from '@modern-js/runtime-utils/router';
2
2
  import { routerPlugin } from './plugin';
3
- import type { SingleRouteConfig, RouterConfig } from './types';
3
+ import type { RouterConfig, SingleRouteConfig } from './types';
4
4
  export * from '@modern-js/runtime-utils/router';
5
5
  export type { SingleRouteConfig, RouterConfig };
6
6
  export { renderRoutes } from './utils';