@bleedingdev/modern-js-runtime 3.2.0-ultramodern.6 → 3.2.0-ultramodern.62
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/dist/cjs/boundary-debugger/index.js +221 -0
- package/dist/cjs/cli/ssr/index.js +3 -2
- package/dist/cjs/cli/template.server.js +1 -0
- package/dist/cjs/core/plugin/index.js +3 -2
- package/dist/cjs/core/server/helmet.js +2 -2
- package/dist/cjs/core/server/stream/afterTemplate.js +9 -6
- package/dist/cjs/core/server/stream/beforeTemplate.js +6 -7
- package/dist/cjs/core/server/stream/beforeTemplate.worker.js +104 -0
- package/dist/cjs/core/server/stream/createReadableStream.worker.js +2 -1
- package/dist/cjs/core/server/stream/shared.js +1 -0
- package/dist/cjs/core/server/string/index.js +1 -0
- package/dist/cjs/core/server/string/loadable.js +16 -1
- package/dist/cjs/router/cli/code/tanstackTypes.js +20 -6
- package/dist/cjs/router/cli/code/templates.js +1 -8
- package/dist/cjs/router/runtime/tanstack/plugin.js +2 -0
- package/dist/cjs/router/runtime/tanstack/routeTree.js +38 -2
- package/dist/cjs/rsc/server.worker.js +58 -0
- package/dist/esm/boundary-debugger/index.mjs +185 -0
- package/dist/esm/cli/ssr/index.mjs +3 -2
- package/dist/esm/cli/template.server.mjs +1 -0
- package/dist/esm/core/plugin/index.mjs +3 -2
- package/dist/esm/core/server/helmet.mjs +1 -1
- package/dist/esm/core/server/stream/afterTemplate.mjs +10 -7
- package/dist/esm/core/server/stream/beforeTemplate.mjs +6 -7
- package/dist/esm/core/server/stream/beforeTemplate.worker.mjs +60 -0
- package/dist/esm/core/server/stream/createReadableStream.worker.mjs +2 -1
- package/dist/esm/core/server/stream/shared.mjs +1 -0
- package/dist/esm/core/server/string/index.mjs +1 -0
- package/dist/esm/core/server/string/loadable.mjs +16 -1
- package/dist/esm/router/cli/code/tanstackTypes.mjs +20 -6
- package/dist/esm/router/cli/code/templates.mjs +1 -8
- package/dist/esm/router/runtime/tanstack/plugin.mjs +2 -0
- package/dist/esm/router/runtime/tanstack/routeTree.mjs +38 -2
- package/dist/esm/rsc/server.worker.mjs +1 -0
- package/dist/esm-node/boundary-debugger/index.mjs +186 -0
- package/dist/esm-node/cli/ssr/index.mjs +3 -2
- package/dist/esm-node/cli/template.server.mjs +1 -0
- package/dist/esm-node/core/plugin/index.mjs +3 -2
- package/dist/esm-node/core/server/helmet.mjs +1 -1
- package/dist/esm-node/core/server/stream/afterTemplate.mjs +10 -7
- package/dist/esm-node/core/server/stream/beforeTemplate.mjs +6 -7
- package/dist/esm-node/core/server/stream/beforeTemplate.worker.mjs +61 -0
- package/dist/esm-node/core/server/stream/createReadableStream.worker.mjs +2 -1
- package/dist/esm-node/core/server/stream/shared.mjs +1 -0
- package/dist/esm-node/core/server/string/index.mjs +1 -0
- package/dist/esm-node/core/server/string/loadable.mjs +16 -1
- package/dist/esm-node/router/cli/code/tanstackTypes.mjs +20 -6
- package/dist/esm-node/router/cli/code/templates.mjs +1 -8
- package/dist/esm-node/router/runtime/tanstack/plugin.mjs +2 -0
- package/dist/esm-node/router/runtime/tanstack/routeTree.mjs +38 -2
- package/dist/esm-node/rsc/server.worker.mjs +2 -0
- package/dist/types/boundary-debugger/index.d.ts +25 -0
- package/dist/types/cache/index.d.ts +1 -0
- package/dist/types/cli/alias.d.ts +7 -0
- package/dist/types/cli/code.d.ts +3 -0
- package/dist/types/cli/constants.d.ts +9 -0
- package/dist/types/cli/entry.d.ts +2 -0
- package/dist/types/cli/index.d.ts +11 -0
- package/dist/types/cli/ssr/index.d.ts +6 -0
- package/dist/types/cli/ssr/loadable-bundler-plugin.d.ts +31 -0
- package/dist/types/cli/ssr/mode.d.ts +15 -0
- package/dist/types/cli/template.d.ts +50 -0
- package/dist/types/cli/template.server.d.ts +20 -0
- package/dist/types/common.d.ts +8 -0
- package/dist/types/core/browser/hydrate.d.ts +5 -0
- package/dist/types/core/browser/index.d.ts +9 -0
- package/dist/types/core/browser/withCallback.d.ts +5 -0
- package/dist/types/core/compat/hooks.d.ts +4 -0
- package/dist/types/core/compat/index.d.ts +2 -0
- package/dist/types/core/compat/requestContext.d.ts +5 -0
- package/dist/types/core/config.d.ts +6 -0
- package/dist/types/core/constants.d.ts +6 -0
- package/dist/types/core/context/index.d.ts +50 -0
- package/dist/types/core/context/monitors/default.d.ts +2 -0
- package/dist/types/core/context/monitors/index.d.ts +1 -0
- package/dist/types/core/context/monitors/index.server.d.ts +2 -0
- package/dist/types/core/context/request/index.d.ts +1 -0
- package/dist/types/core/context/request/index.server.d.ts +1 -0
- package/dist/types/core/context/response/index.d.ts +4 -0
- package/dist/types/core/context/response/index.server.d.ts +4 -0
- package/dist/types/core/context/runtime.d.ts +42 -0
- package/dist/types/core/context/serverPayload/index.d.ts +4 -0
- package/dist/types/core/context/serverPayload/index.server.d.ts +31 -0
- package/dist/types/core/index.d.ts +5 -0
- package/dist/types/core/plugin/index.d.ts +5 -0
- package/dist/types/core/plugin/types.d.ts +10 -0
- package/dist/types/core/react/index.d.ts +2 -0
- package/dist/types/core/react/wrapper.d.ts +3 -0
- package/dist/types/core/server/constants.d.ts +4 -0
- package/dist/types/core/server/helmet.d.ts +3 -0
- package/dist/types/core/server/index.d.ts +4 -0
- package/dist/types/core/server/react/index.d.ts +2 -0
- package/dist/types/core/server/react/no-ssr-cache/index.d.ts +2 -0
- package/dist/types/core/server/react/nossr/index.d.ts +4 -0
- package/dist/types/core/server/requestHandler.d.ts +13 -0
- package/dist/types/core/server/server.d.ts +4 -0
- package/dist/types/core/server/shared.d.ts +8 -0
- package/dist/types/core/server/stream/afterTemplate.d.ts +13 -0
- package/dist/types/core/server/stream/beforeTemplate.d.ts +9 -0
- package/dist/types/core/server/stream/beforeTemplate.worker.d.ts +9 -0
- package/dist/types/core/server/stream/createReadableStream.d.ts +2 -0
- package/dist/types/core/server/stream/createReadableStream.worker.d.ts +2 -0
- package/dist/types/core/server/stream/deferredScript.d.ts +15 -0
- package/dist/types/core/server/stream/index.d.ts +1 -0
- package/dist/types/core/server/stream/shared.d.ts +40 -0
- package/dist/types/core/server/stream/template.d.ts +9 -0
- package/dist/types/core/server/string/index.d.ts +2 -0
- package/dist/types/core/server/string/loadable.d.ts +39 -0
- package/dist/types/core/server/string/ssrData.d.ts +20 -0
- package/dist/types/core/server/string/types.d.ts +12 -0
- package/dist/types/core/server/tracer.d.ts +17 -0
- package/dist/types/core/server/utils.d.ts +19 -0
- package/dist/types/core/types.d.ts +49 -0
- package/dist/types/document/Body.d.ts +2 -0
- package/dist/types/document/Comment.d.ts +5 -0
- package/dist/types/document/DocumentContext.d.ts +13 -0
- package/dist/types/document/DocumentStructureContext.d.ts +12 -0
- package/dist/types/document/Head.d.ts +5 -0
- package/dist/types/document/Html.d.ts +4 -0
- package/dist/types/document/Links.d.ts +2 -0
- package/dist/types/document/Root.d.ts +7 -0
- package/dist/types/document/Script.d.ts +4 -0
- package/dist/types/document/Scripts.d.ts +2 -0
- package/dist/types/document/Style.d.ts +5 -0
- package/dist/types/document/Title.d.ts +1 -0
- package/dist/types/document/cli/index.d.ts +5 -0
- package/dist/types/document/constants.d.ts +25 -0
- package/dist/types/document/index.d.ts +12 -0
- package/dist/types/exports/config-routes.d.ts +9 -0
- package/dist/types/exports/head.d.ts +4 -0
- package/dist/types/exports/loadable.d.ts +3 -0
- package/dist/types/exports/tanstack-router.d.ts +5 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/internal.d.ts +2 -0
- package/dist/types/react-server.d.ts +3 -0
- package/dist/types/router/cli/code/getClientRoutes/getRoutes.d.ts +8 -0
- package/dist/types/router/cli/code/getClientRoutes/index.d.ts +1 -0
- package/dist/types/router/cli/code/getClientRoutes/utils.d.ts +4 -0
- package/dist/types/router/cli/code/index.d.ts +12 -0
- package/dist/types/router/cli/code/inspect.d.ts +22 -0
- package/dist/types/router/cli/code/makeLegalIdentifier.d.ts +1 -0
- package/dist/types/router/cli/code/nestedRoutes.d.ts +13 -0
- package/dist/types/router/cli/code/tanstackTypes.d.ts +10 -0
- package/dist/types/router/cli/code/templates.d.ts +28 -0
- package/dist/types/router/cli/code/utils.d.ts +12 -0
- package/dist/types/router/cli/config-routes/converter.d.ts +15 -0
- package/dist/types/router/cli/config-routes/parseRouteConfig.d.ts +32 -0
- package/dist/types/router/cli/constants.d.ts +31 -0
- package/dist/types/router/cli/entry.d.ts +18 -0
- package/dist/types/router/cli/handler.d.ts +28 -0
- package/dist/types/router/cli/index.d.ts +5 -0
- package/dist/types/router/index.d.ts +1 -0
- package/dist/types/router/internal.d.ts +2 -0
- package/dist/types/router/runtime/CSSLinks.d.ts +9 -0
- package/dist/types/router/runtime/DefaultNotFound.d.ts +2 -0
- package/dist/types/router/runtime/DeferredDataScripts.d.ts +2 -0
- package/dist/types/router/runtime/DeferredDataScripts.node.d.ts +11 -0
- package/dist/types/router/runtime/PrefetchLink.d.ts +27 -0
- package/dist/types/router/runtime/constants.d.ts +146 -0
- package/dist/types/router/runtime/hooks.d.ts +18 -0
- package/dist/types/router/runtime/index.d.ts +7 -0
- package/dist/types/router/runtime/internal.d.ts +11 -0
- package/dist/types/router/runtime/lifecycle.d.ts +25 -0
- package/dist/types/router/runtime/plugin.d.ts +9 -0
- package/dist/types/router/runtime/plugin.node.d.ts +7 -0
- package/dist/types/router/runtime/routerHelper.d.ts +5 -0
- package/dist/types/router/runtime/rsc-router.d.ts +20 -0
- package/dist/types/router/runtime/rsc.d.ts +1 -0
- package/dist/types/router/runtime/server.d.ts +1 -0
- package/dist/types/router/runtime/tanstack/basepathRewrite.d.ts +8 -0
- package/dist/types/router/runtime/tanstack/dataMutation.d.ts +29 -0
- package/dist/types/router/runtime/tanstack/plugin.d.ts +6 -0
- package/dist/types/router/runtime/tanstack/plugin.node.d.ts +6 -0
- package/dist/types/router/runtime/tanstack/prefetchLink.d.ts +11 -0
- package/dist/types/router/runtime/tanstack/routeTree.d.ts +8 -0
- package/dist/types/router/runtime/tanstack/rsc/ClientSlot.d.ts +5 -0
- package/dist/types/router/runtime/tanstack/rsc/CompositeComponent.d.ts +3 -0
- package/dist/types/router/runtime/tanstack/rsc/ReplayableStream.d.ts +24 -0
- package/dist/types/router/runtime/tanstack/rsc/RscNodeRenderer.d.ts +5 -0
- package/dist/types/router/runtime/tanstack/rsc/SlotContext.d.ts +11 -0
- package/dist/types/router/runtime/tanstack/rsc/client.d.ts +11 -0
- package/dist/types/router/runtime/tanstack/rsc/createRscProxy.d.ts +7 -0
- package/dist/types/router/runtime/tanstack/rsc/index.d.ts +2 -0
- package/dist/types/router/runtime/tanstack/rsc/server.d.ts +14 -0
- package/dist/types/router/runtime/tanstack/rsc/slotUsageSanitizer.d.ts +2 -0
- package/dist/types/router/runtime/tanstack/rsc/symbols.d.ts +46 -0
- package/dist/types/router/runtime/types.d.ts +119 -0
- package/dist/types/router/runtime/utils.d.ts +48 -0
- package/dist/types/router/runtime/withRouter.d.ts +10 -0
- package/dist/types/rsc/client.d.ts +2 -0
- package/dist/types/rsc/server.d.ts +1 -0
- package/dist/types/rsc/server.worker.d.ts +1 -0
- package/package.json +22 -15
|
@@ -9,6 +9,7 @@ import { onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBefo
|
|
|
9
9
|
import { applyRouterRuntimeState } from "../lifecycle.mjs";
|
|
10
10
|
import { createRouteObjectsFromConfig, urlJoin } from "../utils.mjs";
|
|
11
11
|
import { createModernBasepathRewrite } from "./basepathRewrite.mjs";
|
|
12
|
+
import { Link } from "./prefetchLink.mjs";
|
|
12
13
|
import { createRouteTreeFromRouteObjects } from "./routeTree.mjs";
|
|
13
14
|
import { getTanstackRscSerializationAdapters } from "./rsc/client.mjs";
|
|
14
15
|
import * as __rspack_external_react from "react";
|
|
@@ -71,6 +72,7 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
context.router = {
|
|
75
|
+
Link: Link,
|
|
74
76
|
useMatches: useMatches,
|
|
75
77
|
useLocation: useLocation,
|
|
76
78
|
useNavigate: useNavigate,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { createRootRoute, createRoute, notFound, redirect } from "@tanstack/react-router";
|
|
3
|
+
import { createElement } from "react";
|
|
3
4
|
import { DefaultNotFound } from "../DefaultNotFound.mjs";
|
|
4
5
|
function createTanstackRoute(options) {
|
|
5
6
|
return createRoute(options);
|
|
@@ -44,6 +45,33 @@ function isModernDeferredData(value) {
|
|
|
44
45
|
function normalizeModernLoaderResult(result) {
|
|
45
46
|
return isModernDeferredData(result) ? result.data : result;
|
|
46
47
|
}
|
|
48
|
+
function pickRouteModuleComponent(routeModule) {
|
|
49
|
+
if ('function' == typeof routeModule || routeModule && 'object' == typeof routeModule && '$$typeof' in routeModule) return routeModule;
|
|
50
|
+
if (!routeModule || 'object' != typeof routeModule) return;
|
|
51
|
+
const module = routeModule;
|
|
52
|
+
const component = module.default || module.Component;
|
|
53
|
+
if ('function' == typeof component || component && 'object' == typeof component && '$$typeof' in component) return component;
|
|
54
|
+
}
|
|
55
|
+
function createServerLazyImportComponent(lazyImport, fallbackComponent) {
|
|
56
|
+
if ("u" > typeof document) return fallbackComponent;
|
|
57
|
+
let resolvedComponent;
|
|
58
|
+
let pendingLoad;
|
|
59
|
+
const load = async ()=>{
|
|
60
|
+
if (resolvedComponent) return resolvedComponent;
|
|
61
|
+
const routeModule = await lazyImport();
|
|
62
|
+
const component = pickRouteModuleComponent(routeModule);
|
|
63
|
+
if (component) resolvedComponent = component;
|
|
64
|
+
return resolvedComponent;
|
|
65
|
+
};
|
|
66
|
+
const Component = (props)=>{
|
|
67
|
+
if (resolvedComponent) return createElement(resolvedComponent, props);
|
|
68
|
+
pendingLoad ||= load();
|
|
69
|
+
throw pendingLoad;
|
|
70
|
+
};
|
|
71
|
+
Component.load = load;
|
|
72
|
+
Component.preload = load;
|
|
73
|
+
return Component;
|
|
74
|
+
}
|
|
47
75
|
function throwTanstackRedirect(location) {
|
|
48
76
|
const target = location || '/';
|
|
49
77
|
try {
|
|
@@ -210,10 +238,18 @@ function wrapRouteObjectLoader(route, revalidationState) {
|
|
|
210
238
|
}
|
|
211
239
|
function toRouteComponent(routeObject) {
|
|
212
240
|
const route = routeObject;
|
|
241
|
+
const lazyImport = 'function' == typeof route.lazyImport ? route.lazyImport : void 0;
|
|
242
|
+
const fallbackComponent = route.Component ? route.Component : route.element ? ()=>route.element : void 0;
|
|
243
|
+
if (lazyImport && fallbackComponent) return createServerLazyImportComponent(lazyImport, fallbackComponent);
|
|
213
244
|
if (route.Component) return route.Component;
|
|
214
245
|
const element = route.element;
|
|
215
246
|
if (element) return ()=>element;
|
|
216
247
|
}
|
|
248
|
+
function toModernRouteComponent(route) {
|
|
249
|
+
const component = route.component || void 0;
|
|
250
|
+
if ('function' == typeof route.lazyImport && component) return createServerLazyImportComponent(route.lazyImport, component);
|
|
251
|
+
return component;
|
|
252
|
+
}
|
|
217
253
|
function toErrorComponent(routeObject) {
|
|
218
254
|
const route = routeObject;
|
|
219
255
|
if (route.ErrorBoundary) return route.ErrorBoundary;
|
|
@@ -293,7 +329,7 @@ function createRouteFromModernRoute(opts) {
|
|
|
293
329
|
const stableFallbackId = modernId || route._component || route.filename || route.data || ('function' == typeof route.loader ? route.id : void 0);
|
|
294
330
|
const pendingComponent = route.loading || route.pendingComponent;
|
|
295
331
|
const errorComponent = route.error || route.errorComponent;
|
|
296
|
-
const component = route
|
|
332
|
+
const component = toModernRouteComponent(route);
|
|
297
333
|
const modernLoader = route.loader;
|
|
298
334
|
const modernAction = route.action;
|
|
299
335
|
const modernShouldRevalidate = route.shouldRevalidate;
|
|
@@ -339,7 +375,7 @@ function createRouteFromModernRoute(opts) {
|
|
|
339
375
|
}
|
|
340
376
|
function createRouteTreeFromModernRoutes(routes) {
|
|
341
377
|
const rootModern = routes.find((r)=>r && 'nested' === r.type && r.isRoot);
|
|
342
|
-
const rootComponent = rootModern
|
|
378
|
+
const rootComponent = rootModern ? toModernRouteComponent(rootModern) : void 0;
|
|
343
379
|
const pendingComponent = rootModern?.loading;
|
|
344
380
|
const errorComponent = rootModern?.error;
|
|
345
381
|
const rootLoader = rootModern?.loader;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RuntimePlugin } from '../core';
|
|
2
|
+
export type BoundaryDebugEntry = {
|
|
3
|
+
appId: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
mfName: string;
|
|
7
|
+
ownerTeam?: string;
|
|
8
|
+
packageName?: string;
|
|
9
|
+
role?: 'host' | 'vertical';
|
|
10
|
+
};
|
|
11
|
+
export type BoundaryDebugMetadata = {
|
|
12
|
+
appId: string;
|
|
13
|
+
boundaries: BoundaryDebugEntry[];
|
|
14
|
+
schemaVersion: 1;
|
|
15
|
+
};
|
|
16
|
+
export type BoundaryDebuggerPluginOptions = {
|
|
17
|
+
enabledByDefault?: boolean;
|
|
18
|
+
labels?: Record<string, {
|
|
19
|
+
toggle: string;
|
|
20
|
+
}>;
|
|
21
|
+
metadata: BoundaryDebugMetadata;
|
|
22
|
+
storageKey?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const ultramodernBoundaryDebuggerPlugin: (options: BoundaryDebuggerPluginOptions) => RuntimePlugin;
|
|
25
|
+
export default ultramodernBoundaryDebuggerPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@modern-js/runtime-utils/cache';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Entrypoint } from '@modern-js/types';
|
|
2
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
3
|
+
export declare const builderPluginAlias: ({ entrypoints, internalDirectory, metaName, }: {
|
|
4
|
+
entrypoints: Entrypoint[];
|
|
5
|
+
internalDirectory: string;
|
|
6
|
+
metaName: string;
|
|
7
|
+
}) => RsbuildPlugin;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AppToolsContext, AppToolsFeatureHooks, AppToolsNormalizedConfig } from '@modern-js/app-tools';
|
|
2
|
+
import type { Entrypoint } from '@modern-js/types';
|
|
3
|
+
export declare const generateCode: (entrypoints: Entrypoint[], appContext: AppToolsContext, config: AppToolsNormalizedConfig, hooks: AppToolsFeatureHooks) => Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const APP_FILE_NAME = "App";
|
|
2
|
+
export declare const ENTRY_POINT_FILE_NAME = "index.jsx";
|
|
3
|
+
export declare const SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
|
|
4
|
+
export declare const INDEX_FILE_NAME = "index";
|
|
5
|
+
export declare const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
|
6
|
+
export declare const ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
|
|
7
|
+
export declare const ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
|
|
8
|
+
export declare const ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context";
|
|
9
|
+
export declare const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
+
import { documentPlugin } from '../document/cli';
|
|
3
|
+
import { routerPlugin } from '../router/cli';
|
|
4
|
+
import { ssrPlugin } from './ssr';
|
|
5
|
+
export { getEntrypointRoutesDir, handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, isRouteEntry, } from '../router/cli';
|
|
6
|
+
export { isRuntimeEntry } from './entry';
|
|
7
|
+
export { documentPlugin, routerPlugin, ssrPlugin };
|
|
8
|
+
export declare const runtimePlugin: (params?: {
|
|
9
|
+
plugins?: CliPlugin<AppTools>[];
|
|
10
|
+
}) => CliPlugin<AppTools>;
|
|
11
|
+
export default runtimePlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
+
import type { MergedEnvironmentConfig } from '@rsbuild/core';
|
|
3
|
+
type EnvironmentConfigLike = Partial<Pick<MergedEnvironmentConfig, 'output' | 'source' | 'tools'>>;
|
|
4
|
+
export declare const shouldUseModuleFederationNodeOutput: (config: EnvironmentConfigLike) => boolean;
|
|
5
|
+
export declare const ssrPlugin: () => CliPlugin<AppTools>;
|
|
6
|
+
export default ssrPlugin;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/gregberge/loadable-components
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Greg Bergé
|
|
7
|
+
* Copyright 2019 Greg Bergé
|
|
8
|
+
* https://github.com/gregberge/loadable-components/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Rspack } from '@modern-js/app-tools';
|
|
11
|
+
interface LoadablePluginOptions {
|
|
12
|
+
filename: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
writeToDisk?: any;
|
|
15
|
+
outputAsset?: boolean;
|
|
16
|
+
chunkLoadingGlobal?: string;
|
|
17
|
+
}
|
|
18
|
+
type Compiler = Rspack.Compiler;
|
|
19
|
+
type Compilation = Rspack.Compilation;
|
|
20
|
+
declare class LoadablePlugin {
|
|
21
|
+
opts: LoadablePluginOptions;
|
|
22
|
+
compiler: Compiler | null;
|
|
23
|
+
constructor({ filename, path, writeToDisk, outputAsset, chunkLoadingGlobal, }?: LoadablePluginOptions);
|
|
24
|
+
apply(compiler: Compiler): void;
|
|
25
|
+
handleEmit(compilation: Compilation): {
|
|
26
|
+
source(): string;
|
|
27
|
+
size(): number;
|
|
28
|
+
} | null;
|
|
29
|
+
writeAssetsFile(manifest: string): void;
|
|
30
|
+
}
|
|
31
|
+
export default LoadablePlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AppToolsNormalizedConfig } from '@modern-js/app-tools';
|
|
2
|
+
export type SSRMode = 'string' | 'stream' | false;
|
|
3
|
+
/**
|
|
4
|
+
* Unified SSR mode resolution function.
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. If SSG is enabled, use SSG configuration (SSG takes precedence over SSR when both are configured)
|
|
7
|
+
* 2. User's explicit server.ssr/server.ssrByEntries config
|
|
8
|
+
* 3. Otherwise return false (no SSR)
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveSSRMode(params: {
|
|
11
|
+
entry?: string;
|
|
12
|
+
config: AppToolsNormalizedConfig;
|
|
13
|
+
appDirectory?: string;
|
|
14
|
+
nestedRoutesEntry?: string;
|
|
15
|
+
}): SSRMode;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { RuntimePluginConfig } from '@modern-js/app-tools';
|
|
2
|
+
export declare const entryForCSRWithRSC: ({ metaName, entryName, urlPath, mountId, isNestedRouter, }: {
|
|
3
|
+
metaName: string;
|
|
4
|
+
entryName: string;
|
|
5
|
+
urlPath?: string;
|
|
6
|
+
mountId?: string;
|
|
7
|
+
isNestedRouter?: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare const index: ({ srcDirectory, internalSrcAlias, metaName, entry, entryName, customEntry, mountId, enableRsc, isNestedRouter, }: {
|
|
10
|
+
srcDirectory: string;
|
|
11
|
+
internalSrcAlias: string;
|
|
12
|
+
metaName: string;
|
|
13
|
+
entry: string;
|
|
14
|
+
entryName: string;
|
|
15
|
+
customEntry?: boolean;
|
|
16
|
+
mountId?: string;
|
|
17
|
+
enableRsc?: boolean;
|
|
18
|
+
isNestedRouter?: boolean;
|
|
19
|
+
}) => string;
|
|
20
|
+
export declare const register: () => string;
|
|
21
|
+
export declare const runtimeRegister: ({ entryName, srcDirectory, internalSrcAlias, metaName, runtimeConfigFile, runtimePlugins, }: {
|
|
22
|
+
entryName: string;
|
|
23
|
+
srcDirectory: string;
|
|
24
|
+
internalSrcAlias: string;
|
|
25
|
+
metaName: string;
|
|
26
|
+
runtimeConfigFile: string | false;
|
|
27
|
+
runtimePlugins: RuntimePluginConfig[];
|
|
28
|
+
}) => string;
|
|
29
|
+
export declare const runtimeGlobalContext: ({ entryName, srcDirectory, internalSrcAlias, metaName, entry, customEntry, basename, }: {
|
|
30
|
+
entryName: string;
|
|
31
|
+
srcDirectory: string;
|
|
32
|
+
internalSrcAlias: string;
|
|
33
|
+
metaName: string;
|
|
34
|
+
entry: string;
|
|
35
|
+
customEntry?: boolean;
|
|
36
|
+
basename?: string;
|
|
37
|
+
}) => string;
|
|
38
|
+
export declare const runtimeGlobalContextForRSCServer: ({ metaName, }: {
|
|
39
|
+
metaName: string;
|
|
40
|
+
}) => string;
|
|
41
|
+
export declare const runtimeGlobalContextForRSCClient: ({ metaName, customEntry, }: {
|
|
42
|
+
metaName: string;
|
|
43
|
+
customEntry?: boolean;
|
|
44
|
+
}) => string;
|
|
45
|
+
export declare const AppProxyForRSC: ({ srcDirectory, internalSrcAlias, entry, customEntry, }: {
|
|
46
|
+
srcDirectory: string;
|
|
47
|
+
internalSrcAlias: string;
|
|
48
|
+
entry: string;
|
|
49
|
+
customEntry?: boolean;
|
|
50
|
+
}) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type ServerIndexOptinos = GenHandlerCodeOptions & {
|
|
2
|
+
entryName: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const serverIndex: (options: ServerIndexOptinos) => string;
|
|
5
|
+
export declare const entryForCSRWithRSC: ({ metaName, entryName, }: {
|
|
6
|
+
metaName: string;
|
|
7
|
+
entryName: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
type GenHandlerCodeOptions = {
|
|
10
|
+
customServerEntry?: string | false;
|
|
11
|
+
srcDirectory: string;
|
|
12
|
+
internalSrcAlias: string;
|
|
13
|
+
entry: string;
|
|
14
|
+
enableRsc?: boolean;
|
|
15
|
+
} & TransformServerEntryOptions;
|
|
16
|
+
type TransformServerEntryOptions = {
|
|
17
|
+
metaName?: string;
|
|
18
|
+
mode: 'string' | 'stream';
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RuntimePlugin } from './core/plugin';
|
|
2
|
+
export declare const isBrowser: () => boolean;
|
|
3
|
+
export interface RuntimeConfig {
|
|
4
|
+
plugins?: RuntimePlugin[];
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export declare const JSX_SHELL_STREAM_END_MARK = "<!--<?- SHELL_STREAM_END ?>-->";
|
|
8
|
+
export declare const ESCAPED_SHELL_STREAM_END_MARK = "<!--<?- SHELL_STREAM_END ?>-->";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
import type { TRuntimeContext } from '../context/runtime';
|
|
4
|
+
export declare const isReact18: () => boolean;
|
|
5
|
+
export declare function hydrateRoot(App: React.ReactElement, context: TRuntimeContext, ModernRender: (App: React.ReactElement) => Promise<HTMLElement | Root>, ModernHydrate: (App: React.ReactElement, callback?: () => void) => Promise<HTMLElement | Root>): Promise<HTMLElement | Root>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type RenderFunc = typeof render;
|
|
3
|
+
export declare function render(App: React.ReactElement<{
|
|
4
|
+
basename: string;
|
|
5
|
+
}>, id?: HTMLElement | string): Promise<HTMLElement | import("react-dom/client").Root>;
|
|
6
|
+
export declare function renderWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
|
|
7
|
+
export declare function renderWithReact17(App: React.ReactElement, rootElement: HTMLElement): Promise<HTMLElement>;
|
|
8
|
+
export declare function hydrateWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
|
|
9
|
+
export declare function hydrateWithReact17(App: React.ReactElement, rootElement: HTMLElement, callback?: () => void): Promise<any>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TInternalRuntimeContext } from '../context';
|
|
2
|
+
export declare function transformHookRunner(hookRunnerName: string): string;
|
|
3
|
+
export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
|
|
4
|
+
export declare function getHookRunners(runtimeContext: TInternalRuntimeContext): Record<string, any>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TInternalRuntimeContext } from '../context';
|
|
2
|
+
import type { RuntimePlugin } from '../plugin/types';
|
|
3
|
+
import type { RequestContext } from '../types';
|
|
4
|
+
export declare const makeRequestContext: (context: TInternalRuntimeContext) => RequestContext;
|
|
5
|
+
export declare const requestContextPlugin: () => RuntimePlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RuntimeConfig } from '../common';
|
|
2
|
+
/**
|
|
3
|
+
* This function helps you to autocomplete configuration types.
|
|
4
|
+
* It accepts a direct config object, or a function that returns a config.
|
|
5
|
+
*/
|
|
6
|
+
export declare const defineRuntimeConfig: (config: RuntimeConfig | ((entryName: string) => RuntimeConfig)) => RuntimeConfig | ((entryName: string) => RuntimeConfig);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { InternalRuntimeContext } from '@modern-js/plugin';
|
|
2
|
+
import type { NestedRoute, PageRoute } from '@modern-js/types';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { RuntimeExtends } from '../plugin/types';
|
|
5
|
+
import type { ServerPayload } from './serverPayload/index';
|
|
6
|
+
export { getInitialContext, InternalRuntimeContext, RuntimeContext, type TInternalRuntimeContext, type TRuntimeContext, } from './runtime';
|
|
7
|
+
export type { PayloadRoute, ServerPayload } from './serverPayload/index';
|
|
8
|
+
interface GlobalContext {
|
|
9
|
+
entryName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* App.tsx export default component
|
|
12
|
+
*/
|
|
13
|
+
App?: React.ComponentType;
|
|
14
|
+
/**
|
|
15
|
+
* nest router and page router config
|
|
16
|
+
*/
|
|
17
|
+
routes?: (NestedRoute | PageRoute)[];
|
|
18
|
+
/**
|
|
19
|
+
* nest router init function
|
|
20
|
+
*/
|
|
21
|
+
appInit?: () => Promise<unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* page router _app.tsx export layout app
|
|
24
|
+
*/
|
|
25
|
+
layoutApp?: React.ComponentType;
|
|
26
|
+
/**
|
|
27
|
+
* Entry basename for routing
|
|
28
|
+
*/
|
|
29
|
+
basename?: string;
|
|
30
|
+
internalRuntimeContext?: InternalRuntimeContext<RuntimeExtends>;
|
|
31
|
+
/**
|
|
32
|
+
* RSCRoot
|
|
33
|
+
*/
|
|
34
|
+
RSCRoot?: React.ComponentType;
|
|
35
|
+
isRscClient?: boolean;
|
|
36
|
+
serverPayload?: ServerPayload;
|
|
37
|
+
enableRsc?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export { getServerPayload, setServerPayload, } from './serverPayload/index';
|
|
40
|
+
export declare function getGlobalIsRscClient(): boolean | undefined;
|
|
41
|
+
export declare function getGlobalEnableRsc(): boolean | undefined;
|
|
42
|
+
export declare function setGlobalContext(context: Omit<GlobalContext, 'internalRuntimeContext'>): void;
|
|
43
|
+
export declare function getCurrentEntryName(): string | undefined;
|
|
44
|
+
export declare function getGlobalRSCRoot(): React.ComponentType<{}> | undefined;
|
|
45
|
+
export declare function setGlobalInternalRuntimeContext(context: InternalRuntimeContext<RuntimeExtends>): void;
|
|
46
|
+
export declare function getGlobalInternalRuntimeContext(): InternalRuntimeContext<Required<import("@modern-js/plugin").RuntimePluginExtends<import("../plugin/types").RuntimeConfig, import("./runtime").TInternalRuntimeContext, {}, {}>>>;
|
|
47
|
+
export declare function getGlobalApp(): React.ComponentType<{}> | undefined;
|
|
48
|
+
export declare function getGlobalRoutes(): undefined | (NestedRoute | PageRoute)[];
|
|
49
|
+
export declare function getGlobalLayoutApp(): React.ComponentType<{}> | undefined;
|
|
50
|
+
export declare function getGlobalBasename(): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMonitors: () => Omit<import("@modern-js/types").Monitors, "push">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRequest: () => Request;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRequest: () => Request;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getResponseProxy: () => null;
|
|
2
|
+
export declare const setHeaders: (headers: Record<string, string>) => void;
|
|
3
|
+
export declare const setStatus: (status: number) => void;
|
|
4
|
+
export declare const redirect: (url: string, init?: number | ResponseInit) => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RouteObject, StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
2
|
+
import type { InternalRouterRuntimeState, InternalRouterServerSnapshot, RouteManifest, RouterFramework } from '../../router/runtime/types';
|
|
3
|
+
import type { RequestContext, SSRServerContext } from '../types';
|
|
4
|
+
export interface TRuntimeContext {
|
|
5
|
+
initialData?: Record<string, unknown>;
|
|
6
|
+
isBrowser: boolean;
|
|
7
|
+
routes?: RouteObject[];
|
|
8
|
+
routerFramework?: RouterFramework;
|
|
9
|
+
requestContext: RequestContext;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `requestContext` instead
|
|
12
|
+
*/
|
|
13
|
+
context: RequestContext;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* InternalRuntimeContext used internally and by plugins
|
|
18
|
+
*/
|
|
19
|
+
export interface TInternalRuntimeContext extends TRuntimeContext {
|
|
20
|
+
routeManifest?: RouteManifest;
|
|
21
|
+
routerRuntime?: InternalRouterRuntimeState;
|
|
22
|
+
routerInstance?: unknown;
|
|
23
|
+
routerHydrationScript?: string;
|
|
24
|
+
routerMatchedRouteIds?: string[];
|
|
25
|
+
routerServerSnapshot?: InternalRouterServerSnapshot;
|
|
26
|
+
routerContext?: StaticHandlerContext;
|
|
27
|
+
unstable_getBlockNavState?: () => boolean;
|
|
28
|
+
ssrContext?: SSRServerContext;
|
|
29
|
+
_internalContext?: any;
|
|
30
|
+
_internalRouterBaseName?: any;
|
|
31
|
+
}
|
|
32
|
+
export declare const InternalRuntimeContext: import("react").Context<TInternalRuntimeContext>;
|
|
33
|
+
export declare const RuntimeContext: import("react").Context<TRuntimeContext>;
|
|
34
|
+
/**
|
|
35
|
+
* deprecated, use RuntimeContext instead
|
|
36
|
+
*/
|
|
37
|
+
export declare const ReactRuntimeContext: import("react").Context<TRuntimeContext>;
|
|
38
|
+
export declare const getInitialContext: (isBrowser?: boolean, routeManifest?: RouteManifest) => TInternalRuntimeContext;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use use(RuntimeContext) instead
|
|
41
|
+
*/
|
|
42
|
+
export declare const useRuntimeContext: () => TRuntimeContext;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RouterState, ShouldRevalidateFunction } from '@modern-js/runtime-utils/router';
|
|
2
|
+
export type PayloadRoute = {
|
|
3
|
+
clientAction?: (...args: unknown[]) => unknown;
|
|
4
|
+
clientLoader?: (...args: unknown[]) => unknown;
|
|
5
|
+
element?: React.ReactNode;
|
|
6
|
+
errorElement?: React.ReactNode;
|
|
7
|
+
handle?: unknown;
|
|
8
|
+
hasAction: boolean;
|
|
9
|
+
hasErrorBoundary: boolean;
|
|
10
|
+
hasLoader: boolean;
|
|
11
|
+
hasClientLoader?: boolean;
|
|
12
|
+
id: string;
|
|
13
|
+
index?: boolean;
|
|
14
|
+
params: Record<string, string>;
|
|
15
|
+
parentId?: string;
|
|
16
|
+
path?: string;
|
|
17
|
+
pathname: string;
|
|
18
|
+
pathnameBase: string;
|
|
19
|
+
shouldRevalidate?: ShouldRevalidateFunction;
|
|
20
|
+
};
|
|
21
|
+
export type ServerPayload = {
|
|
22
|
+
type: 'render';
|
|
23
|
+
actionData: RouterState['actionData'];
|
|
24
|
+
errors: RouterState['errors'];
|
|
25
|
+
loaderData: RouterState['loaderData'];
|
|
26
|
+
location: RouterState['location'];
|
|
27
|
+
routes: PayloadRoute[];
|
|
28
|
+
originalRoutes?: PayloadRoute[];
|
|
29
|
+
};
|
|
30
|
+
export declare const getServerPayload: () => ServerPayload | undefined;
|
|
31
|
+
export declare const setServerPayload: (payload: ServerPayload) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { defineRuntimeConfig } from './config';
|
|
2
|
+
export type { TRuntimeContext } from './context/runtime';
|
|
3
|
+
export { RuntimeContext, useRuntimeContext, } from './context/runtime';
|
|
4
|
+
export type { RuntimePlugin } from './plugin';
|
|
5
|
+
export type { SSRContainer, SSRData } from './types';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalRuntimeContext } from '@modern-js/plugin/runtime';
|
|
2
|
+
import type { RuntimeConfig, RuntimeExtends, RuntimePlugin } from './types';
|
|
3
|
+
export type { RuntimePlugin };
|
|
4
|
+
export declare function registerPlugin(internalPlugins: RuntimePlugin[], runtimeConfig?: RuntimeConfig): InternalRuntimeContext<RuntimeExtends>;
|
|
5
|
+
export declare function mergeConfig(config: Record<string, any>, ...otherConfig: Record<string, any>[]): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RuntimePlugin as BaseRuntimePlugin, RuntimePluginExtends } from '@modern-js/plugin';
|
|
2
|
+
import type { Hooks } from '@modern-js/plugin/runtime';
|
|
3
|
+
import type { RuntimeConfig as BaseRuntimeConfig } from '../../common';
|
|
4
|
+
import type { TInternalRuntimeContext } from '../context/runtime';
|
|
5
|
+
export type RuntimeHooks = Hooks<RuntimeConfig, TInternalRuntimeContext>;
|
|
6
|
+
export type RuntimeExtends = Required<RuntimePluginExtends<RuntimeConfig, TInternalRuntimeContext, {}, {}>>;
|
|
7
|
+
export type RuntimePlugin<Extends extends RuntimePluginExtends = {}> = BaseRuntimePlugin<RuntimeExtends & Extends>;
|
|
8
|
+
export interface RuntimeConfig extends BaseRuntimeConfig {
|
|
9
|
+
plugins?: RuntimePlugin[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const HTML_PLACEHOLDER = "<!--<?- html ?>-->";
|
|
2
|
+
export declare const SSR_DATA_PLACEHOLDER = "<!--<?- SSRDataScript ?>-->";
|
|
3
|
+
export declare const CHUNK_JS_PLACEHOLDER = "<!--<?- chunksMap.js ?>-->";
|
|
4
|
+
export declare const CHUNK_CSS_PLACEHOLDER = "<!--<?- chunksMap.css ?>-->";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RequestHandler, RequestHandlerOptions } from '@modern-js/app-tools';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type TInternalRuntimeContext } from '../context';
|
|
4
|
+
export type { RequestHandlerConfig as HandleRequestConfig } from '@modern-js/app-tools';
|
|
5
|
+
export type HandleRequestOptions = Exclude<RequestHandlerOptions, 'staticGenerate'> & {
|
|
6
|
+
runtimeContext: TInternalRuntimeContext;
|
|
7
|
+
};
|
|
8
|
+
export type HandleRequest = (request: Request, ServerRoot: React.ComponentType, // App, routes,
|
|
9
|
+
options: HandleRequestOptions) => Promise<Response>;
|
|
10
|
+
export type CreateRequestHandler = (handleRequest: HandleRequest, options?: {
|
|
11
|
+
enableRsc?: boolean;
|
|
12
|
+
}) => Promise<RequestHandler>;
|
|
13
|
+
export declare const createRequestHandler: CreateRequestHandler;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type CreateRequestHandler, createRequestHandler, type HandleRequest, type HandleRequestConfig, type HandleRequestOptions, } from './requestHandler';
|
|
2
|
+
export type { RenderOptions, RenderStreaming, RenderString } from './shared';
|
|
3
|
+
export { renderStreaming } from './stream';
|
|
4
|
+
export { renderString } from './string';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ServerUserConfig } from '@modern-js/app-tools';
|
|
2
|
+
import type { HandleRequestOptions } from './requestHandler';
|
|
3
|
+
export type RenderOptions = HandleRequestOptions;
|
|
4
|
+
export type SSRConfig = NonNullable<ServerUserConfig['ssr']>;
|
|
5
|
+
export type RenderStreaming = (request: Request, serverRoot: React.ReactElement, optinos: RenderOptions) => Promise<ReadableStream>;
|
|
6
|
+
export type RenderString = (request: Request, serverRoot: React.ReactElement, optinos: RenderOptions) => Promise<string>;
|
|
7
|
+
export type BuildHtmlCb = (template: string) => string | Promise<string>;
|
|
8
|
+
export declare function buildHtml(template: string, callbacks: BuildHtmlCb[]): Promise<string>;
|