@bleedingdev/modern-js-runtime 3.8.3-ultramodern.5 → 3.9.0-ultramodern.1
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/document/cli/index.js +1 -2
- package/dist/esm/document/cli/index.mjs +2 -3
- package/dist/esm/router/runtime/PrefetchLink.mjs +1 -1
- package/dist/esm-node/document/cli/index.mjs +2 -3
- package/dist/esm-node/router/runtime/PrefetchLink.mjs +1 -1
- package/dist/types/boundary-debugger/index.d.ts +1 -1
- package/dist/types/cli/index.d.ts +7 -7
- package/dist/types/core/browser/hydrate.d.ts +1 -1
- package/dist/types/core/browser/index.d.ts +1 -1
- package/dist/types/core/compat/hooks.d.ts +1 -1
- package/dist/types/core/compat/index.d.ts +1 -1
- package/dist/types/core/compat/requestContext.d.ts +3 -3
- package/dist/types/core/config.d.ts +1 -1
- package/dist/types/core/context/index.d.ts +10 -10
- package/dist/types/core/context/monitors/index.d.ts +1 -1
- package/dist/types/core/context/monitors/index.server.d.ts +1 -1
- package/dist/types/core/context/public.d.ts +1 -1
- package/dist/types/core/context/runtime.d.ts +3 -3
- package/dist/types/core/context/serverPayload/index.d.ts +1 -1
- package/dist/types/core/index.d.ts +5 -5
- package/dist/types/core/plugin/index.d.ts +1 -1
- package/dist/types/core/plugin/types.d.ts +2 -2
- package/dist/types/core/react/wrapper.d.ts +1 -1
- package/dist/types/core/server/helmet.d.ts +1 -1
- package/dist/types/core/server/index.d.ts +2 -2
- package/dist/types/core/server/react/index.d.ts +2 -2
- package/dist/types/core/server/requestHandler.d.ts +1 -1
- package/dist/types/core/server/requestResponse.d.ts +2 -2
- package/dist/types/core/server/routerCleanup.d.ts +1 -1
- package/dist/types/core/server/scriptOrder.d.ts +1 -1
- package/dist/types/core/server/server.d.ts +4 -4
- package/dist/types/core/server/shared.d.ts +1 -1
- package/dist/types/core/server/stream/afterTemplate.d.ts +4 -4
- package/dist/types/core/server/stream/beforeTemplate.d.ts +2 -2
- package/dist/types/core/server/stream/beforeTemplate.worker.d.ts +2 -2
- package/dist/types/core/server/stream/createReadableStream.d.ts +1 -1
- package/dist/types/core/server/stream/createReadableStream.worker.d.ts +1 -1
- package/dist/types/core/server/stream/index.d.ts +1 -1
- package/dist/types/core/server/stream/shared.d.ts +3 -3
- package/dist/types/core/server/stream/template.d.ts +2 -2
- package/dist/types/core/server/string/index.d.ts +1 -1
- package/dist/types/core/server/string/loadable.d.ts +2 -2
- package/dist/types/core/server/string/ssrData.d.ts +4 -4
- package/dist/types/core/server/string/types.d.ts +1 -1
- package/dist/types/core/server/utils.d.ts +1 -1
- package/dist/types/core/types.d.ts +1 -1
- package/dist/types/document/index.d.ts +12 -12
- package/dist/types/exports/config-routes.d.ts +1 -1
- package/dist/types/index.d.ts +9 -9
- package/dist/types/internal.d.ts +1 -1
- package/dist/types/module-federation/consume-surface.d.ts +2 -2
- package/dist/types/module-federation/index.d.ts +6 -6
- package/dist/types/module-federation/last-known-good.d.ts +1 -1
- package/dist/types/react-server.d.ts +3 -3
- package/dist/types/router/cli/code/getClientRoutes/index.d.ts +1 -1
- package/dist/types/router/cli/handler.d.ts +1 -1
- package/dist/types/router/cli/index.d.ts +3 -3
- package/dist/types/router/index.d.ts +1 -1
- package/dist/types/router/internal.d.ts +2 -2
- package/dist/types/router/runtime/hooks.d.ts +2 -2
- package/dist/types/router/runtime/index.d.ts +4 -4
- package/dist/types/router/runtime/internal.d.ts +8 -8
- package/dist/types/router/runtime/lifecycle.d.ts +2 -2
- package/dist/types/router/runtime/plugin.d.ts +3 -3
- package/dist/types/router/runtime/plugin.node.d.ts +3 -3
- package/dist/types/router/runtime/provider.d.ts +3 -3
- package/dist/types/router/runtime/rsc-router.d.ts +3 -3
- package/dist/types/router/runtime/utils.d.ts +1 -1
- package/package.json +10 -10
- /package/dist/esm/{rslib-runtime.mjs → rslib-runtime~1.mjs} +0 -0
- /package/dist/esm-node/{rslib-runtime.mjs → rslib-runtime~0.mjs} +0 -0
|
@@ -147,8 +147,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
147
147
|
]).apply(child);
|
|
148
148
|
};
|
|
149
149
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
150
|
-
const
|
|
151
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
150
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
152
151
|
return `import React from 'react';
|
|
153
152
|
import ReactDomServer from 'react-dom/server';
|
|
154
153
|
import Document from ${JSON.stringify(docPath)};
|
|
@@ -48,7 +48,7 @@ const processCommentPlaceholders = (html)=>{
|
|
|
48
48
|
return html.replace(new RegExp(`${DOCUMENT_COMMENT_PLACEHOLDER_START}([\\s\\S]*?)${DOCUMENT_COMMENT_PLACEHOLDER_END}`, 'g'), (_scriptStr, $1)=>`${decodeHtmlEntities(decodeURIComponent($1))}`);
|
|
49
49
|
};
|
|
50
50
|
const requireFromString = (code, filename)=>{
|
|
51
|
-
const m = new module_0.Module(filename,
|
|
51
|
+
const m = new module_0.Module(filename, void 0);
|
|
52
52
|
m.filename = filename;
|
|
53
53
|
m.paths = module_0.Module._nodeModulePaths(path.dirname(filename));
|
|
54
54
|
m._compile(code, filename);
|
|
@@ -101,8 +101,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
101
101
|
]).apply(child);
|
|
102
102
|
};
|
|
103
103
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
104
|
-
const
|
|
105
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
104
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
106
105
|
return `import React from 'react';
|
|
107
106
|
import ReactDomServer from 'react-dom/server';
|
|
108
107
|
import Document from ${JSON.stringify(docPath)};
|
|
@@ -4,7 +4,7 @@ import { getNavigationWarmupCacheKey } from "@modern-js/runtime-extensions";
|
|
|
4
4
|
import { Link as router_Link, NavLink, matchRoutes, useHref, useMatches, useResolvedPath } from "@modern-js/runtime-utils/router";
|
|
5
5
|
import react, { useContext, useMemo } from "react";
|
|
6
6
|
import { InternalRuntimeContext } from "../../core/context/index.mjs";
|
|
7
|
-
import { __webpack_require__ } from "../../rslib-runtime.mjs";
|
|
7
|
+
import { __webpack_require__ } from "../../rslib-runtime~1.mjs";
|
|
8
8
|
const getWebpackChunkLoader = ()=>__webpack_chunk_load__;
|
|
9
9
|
const getWebpackPublicPath = ()=>{
|
|
10
10
|
try {
|
|
@@ -50,7 +50,7 @@ const processCommentPlaceholders = (html)=>{
|
|
|
50
50
|
return html.replace(new RegExp(`${DOCUMENT_COMMENT_PLACEHOLDER_START}([\\s\\S]*?)${DOCUMENT_COMMENT_PLACEHOLDER_END}`, 'g'), (_scriptStr, $1)=>`${decodeHtmlEntities(decodeURIComponent($1))}`);
|
|
51
51
|
};
|
|
52
52
|
const requireFromString = (code, filename)=>{
|
|
53
|
-
const m = new module_0.Module(filename,
|
|
53
|
+
const m = new module_0.Module(filename, void 0);
|
|
54
54
|
m.filename = filename;
|
|
55
55
|
m.paths = module_0.Module._nodeModulePaths(path.dirname(filename));
|
|
56
56
|
m._compile(code, filename);
|
|
@@ -103,8 +103,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
103
103
|
]).apply(child);
|
|
104
104
|
};
|
|
105
105
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
106
|
-
const
|
|
107
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
106
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
108
107
|
return `import React from 'react';
|
|
109
108
|
import ReactDomServer from 'react-dom/server';
|
|
110
109
|
import Document from ${JSON.stringify(docPath)};
|
|
@@ -5,7 +5,7 @@ import { getNavigationWarmupCacheKey } from "@modern-js/runtime-extensions";
|
|
|
5
5
|
import { Link as router_Link, NavLink, matchRoutes, useHref, useMatches, useResolvedPath } from "@modern-js/runtime-utils/router";
|
|
6
6
|
import react, { useContext, useMemo } from "react";
|
|
7
7
|
import { InternalRuntimeContext } from "../../core/context/index.mjs";
|
|
8
|
-
import { __webpack_require__ } from "../../rslib-runtime.mjs";
|
|
8
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.mjs";
|
|
9
9
|
const getWebpackChunkLoader = ()=>__webpack_chunk_load__;
|
|
10
10
|
const getWebpackPublicPath = ()=>{
|
|
11
11
|
try {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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, getEntrypointRoutesOwner, handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, isRouteEntry, updateNestedRoutesSpec, } from '../router/cli';
|
|
6
|
-
export { makeLegalIdentifier } from '../router/cli/code/makeLegalIdentifier';
|
|
7
|
-
export { getPathWithoutExt } from '../router/cli/code/utils';
|
|
8
|
-
export { isRuntimeEntry } from './entry';
|
|
2
|
+
import { documentPlugin } from '../document/cli/index.js';
|
|
3
|
+
import { routerPlugin } from '../router/cli/index.js';
|
|
4
|
+
import { ssrPlugin } from './ssr/index.js';
|
|
5
|
+
export { getEntrypointRoutesDir, getEntrypointRoutesOwner, handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, isRouteEntry, updateNestedRoutesSpec, } from '../router/cli/index.js';
|
|
6
|
+
export { makeLegalIdentifier } from '../router/cli/code/makeLegalIdentifier.js';
|
|
7
|
+
export { getPathWithoutExt } from '../router/cli/code/utils.js';
|
|
8
|
+
export { isRuntimeEntry } from './entry.js';
|
|
9
9
|
export { documentPlugin, routerPlugin, ssrPlugin };
|
|
10
10
|
export declare const runtimePlugin: (params?: {
|
|
11
11
|
plugins?: CliPlugin<AppTools>[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type Root } from 'react-dom/client';
|
|
3
|
-
import type { TRuntimeContext } from '../context/runtime';
|
|
3
|
+
import type { TRuntimeContext } from '../context/runtime.js';
|
|
4
4
|
export declare function hydrateWithReact(App: React.ReactElement, rootElement: HTMLElement): Promise<Root>;
|
|
5
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>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TInternalRuntimeContext } from '../context';
|
|
1
|
+
import type { TInternalRuntimeContext } from '../context/index.js';
|
|
2
2
|
export declare function transformHookRunner(hookRunnerName: string): string;
|
|
3
3
|
export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
|
|
4
4
|
export declare function getHookRunners(runtimeContext: TInternalRuntimeContext): Record<string, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '../plugin/types';
|
|
1
|
+
import type { RuntimePlugin } from '../plugin/types.js';
|
|
2
2
|
export declare const compatPlugin: () => RuntimePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TInternalRuntimeContext } from '../context';
|
|
2
|
-
import type { RuntimePlugin } from '../plugin/types';
|
|
3
|
-
import type { RequestContext } from '../types';
|
|
1
|
+
import type { TInternalRuntimeContext } from '../context/index.js';
|
|
2
|
+
import type { RuntimePlugin } from '../plugin/types.js';
|
|
3
|
+
import type { RequestContext } from '../types.js';
|
|
4
4
|
export declare const makeRequestContext: (context: TInternalRuntimeContext) => RequestContext;
|
|
5
5
|
export declare const requestContextPlugin: () => RuntimePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { ServerPayload } from './serverPayload/index';
|
|
2
|
+
import type { ServerPayload } from './serverPayload/index.js';
|
|
3
3
|
export type RuntimeRoute = {
|
|
4
4
|
children?: RuntimeRoute[];
|
|
5
5
|
routes?: RuntimeRoute[];
|
|
@@ -19,14 +19,14 @@ type InternalRuntimeContextLike = {
|
|
|
19
19
|
pluginAPI?: RuntimePluginAPI;
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
};
|
|
22
|
-
export { DefaultNotFound } from '../../router/runtime/DefaultNotFound';
|
|
23
|
-
export { modifyRoutes, onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeCreateRoutes, onBeforeHydrateRouter, type RouterExtendsHooks, } from '../../router/runtime/hooks';
|
|
24
|
-
export { applyRouterRuntimeState, applyRouterServerPrepareResult, cleanupRouterRuntimeState, createRouterRuntimeState, createRouterServerSnapshot, getRouterHydrationScripts, getRouterMatchedRouteIds, getRouterRuntimeState, getRouterServerSnapshot, type RouterLifecycleContext, type RouterLifecyclePhase, } from '../../router/runtime/lifecycle';
|
|
25
|
-
export { createRouterProviderRealm, type RouterProviderFactory, type RouterProviderPlugin, type RouterProviderRealm, type RouterProviderRegistration, registerRouterProvider, resolveRouterProvider, routerProviderRegistryHooks, } from '../../router/runtime/provider';
|
|
26
|
-
export type { BuiltInRouterFramework, InternalRouterRuntimeState, InternalRouterServerSnapshot, LoaderFunction, LoaderFunctionArgs, ModernRoute, RouterFramework, RouterRouteMatchSnapshot, RouterServerPrepareResult, } from '../../router/runtime/types';
|
|
27
|
-
export { createRuntimeContextExtension, type RuntimeContextExtension, } from './extensions';
|
|
28
|
-
export { getInitialContext, InternalRuntimeContext, RuntimeContext, type TInternalRuntimeContext, type TRuntimeContext, } from './runtime';
|
|
29
|
-
export type { PayloadRoute, ServerPayload } from './serverPayload/index';
|
|
22
|
+
export { DefaultNotFound } from '../../router/runtime/DefaultNotFound.js';
|
|
23
|
+
export { modifyRoutes, onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeCreateRoutes, onBeforeHydrateRouter, type RouterExtendsHooks, } from '../../router/runtime/hooks.js';
|
|
24
|
+
export { applyRouterRuntimeState, applyRouterServerPrepareResult, cleanupRouterRuntimeState, createRouterRuntimeState, createRouterServerSnapshot, getRouterHydrationScripts, getRouterMatchedRouteIds, getRouterRuntimeState, getRouterServerSnapshot, type RouterLifecycleContext, type RouterLifecyclePhase, } from '../../router/runtime/lifecycle.js';
|
|
25
|
+
export { createRouterProviderRealm, type RouterProviderFactory, type RouterProviderPlugin, type RouterProviderRealm, type RouterProviderRegistration, registerRouterProvider, resolveRouterProvider, routerProviderRegistryHooks, } from '../../router/runtime/provider.js';
|
|
26
|
+
export type { BuiltInRouterFramework, InternalRouterRuntimeState, InternalRouterServerSnapshot, LoaderFunction, LoaderFunctionArgs, ModernRoute, RouterFramework, RouterRouteMatchSnapshot, RouterServerPrepareResult, } from '../../router/runtime/types.js';
|
|
27
|
+
export { createRuntimeContextExtension, type RuntimeContextExtension, } from './extensions.js';
|
|
28
|
+
export { getInitialContext, InternalRuntimeContext, RuntimeContext, type TInternalRuntimeContext, type TRuntimeContext, } from './runtime.js';
|
|
29
|
+
export type { PayloadRoute, ServerPayload } from './serverPayload/index.js';
|
|
30
30
|
interface GlobalContext {
|
|
31
31
|
entryName?: string;
|
|
32
32
|
/**
|
|
@@ -58,7 +58,7 @@ interface GlobalContext {
|
|
|
58
58
|
serverPayload?: ServerPayload;
|
|
59
59
|
enableRsc?: boolean;
|
|
60
60
|
}
|
|
61
|
-
export { getServerPayload, setServerPayload, } from './serverPayload/index';
|
|
61
|
+
export { getServerPayload, setServerPayload, } from './serverPayload/index.js';
|
|
62
62
|
export declare function getGlobalIsRscClient(): boolean | undefined;
|
|
63
63
|
export declare function getGlobalEnableRsc(): boolean | undefined;
|
|
64
64
|
export declare function setGlobalContext(context: Omit<GlobalContext, 'internalRuntimeContext'>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getMonitors: () => import("./default").RuntimeMonitors;
|
|
1
|
+
export declare const getMonitors: () => import("./default.js").RuntimeMonitors;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type RuntimeMonitors } from './default';
|
|
1
|
+
import { type RuntimeMonitors } from './default.js';
|
|
2
2
|
export declare const getMonitors: () => RuntimeMonitors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { RequestContext } from '../types';
|
|
2
|
+
import type { RequestContext } from '../types.js';
|
|
3
3
|
export type { RequestContext };
|
|
4
4
|
export interface TRuntimeContext {
|
|
5
5
|
initialData?: Record<string, unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RouteObject, StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
2
2
|
import type { BaseSSRServerContext } from '@modern-js/types';
|
|
3
|
-
import type { RouteManifest } from '../../router/runtime/types';
|
|
4
|
-
import { type TRuntimeContext } from './public';
|
|
3
|
+
import type { RouteManifest } from '../../router/runtime/types.js';
|
|
4
|
+
import { type TRuntimeContext } from './public.js';
|
|
5
5
|
export type InternalSSRContext = {
|
|
6
6
|
request: BaseSSRServerContext['request'] & {
|
|
7
7
|
raw?: Request;
|
|
@@ -9,7 +9,7 @@ export type InternalSSRContext = {
|
|
|
9
9
|
response: BaseSSRServerContext['response'];
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
};
|
|
12
|
-
export { ReactRuntimeContext, RuntimeContext, type TRuntimeContext, useRuntimeContext, } from './public';
|
|
12
|
+
export { ReactRuntimeContext, RuntimeContext, type TRuntimeContext, useRuntimeContext, } from './public.js';
|
|
13
13
|
/**
|
|
14
14
|
* InternalRuntimeContext used internally and by plugins
|
|
15
15
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PayloadRoute, ServerPayload } from './index.server';
|
|
1
|
+
import type { PayloadRoute, ServerPayload } from './index.server.js';
|
|
2
2
|
export type { PayloadRoute, ServerPayload };
|
|
3
3
|
export declare const getServerPayload: () => ServerPayload | undefined;
|
|
4
4
|
export declare const setServerPayload: (payload: ServerPayload) => void;
|
|
@@ -1,5 +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';
|
|
1
|
+
export { defineRuntimeConfig } from './config.js';
|
|
2
|
+
export type { TRuntimeContext } from './context/runtime.js';
|
|
3
|
+
export { RuntimeContext, useRuntimeContext, } from './context/runtime.js';
|
|
4
|
+
export type { RuntimePlugin } from './plugin/index.js';
|
|
5
|
+
export type { SSRContainer, SSRData } from './types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InternalRuntimeContext } from '@modern-js/plugin/runtime';
|
|
2
|
-
import type { RuntimeConfig, RuntimeExtends, RuntimePlugin } from './types';
|
|
2
|
+
import type { RuntimeConfig, RuntimeExtends, RuntimePlugin } from './types.js';
|
|
3
3
|
export type { RuntimePlugin };
|
|
4
4
|
export declare function registerPlugin(internalPlugins: RuntimePlugin[], runtimeConfig?: RuntimeConfig): InternalRuntimeContext<RuntimeExtends>;
|
|
5
5
|
export declare function mergeConfig(config: Record<string, any>, ...otherConfig: Record<string, any>[]): Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RuntimePlugin as BaseRuntimePlugin, RuntimePluginExtends } from '@modern-js/plugin';
|
|
2
2
|
import type { Hooks } from '@modern-js/plugin/runtime';
|
|
3
|
-
import type { RuntimeConfig as BaseRuntimeConfig } from '../../common';
|
|
4
|
-
import type { TInternalRuntimeContext } from '../context/runtime';
|
|
3
|
+
import type { RuntimeConfig as BaseRuntimeConfig } from '../../common.js';
|
|
4
|
+
import type { TInternalRuntimeContext } from '../context/runtime.js';
|
|
5
5
|
export type RuntimeHooks = Hooks<RuntimeConfig, TInternalRuntimeContext>;
|
|
6
6
|
export type RuntimeExtends = Required<RuntimePluginExtends<RuntimeConfig, TInternalRuntimeContext, {}, {}>>;
|
|
7
7
|
export type RuntimePlugin<Extends extends RuntimePluginExtends = {}> = BaseRuntimePlugin<RuntimeExtends & Extends>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type TRuntimeContext } from '../context';
|
|
2
|
+
import { type TRuntimeContext } from '../context/index.js';
|
|
3
3
|
export declare function wrapRuntimeContextProvider(App: React.ReactElement, contextValue: TRuntimeContext): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HelmetServerState } from 'react-helmet-async';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../context';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../context/index.js';
|
|
3
3
|
export declare function getHelmetData(runtimeContext: TInternalRuntimeContext): HelmetServerState | undefined;
|
|
4
4
|
export declare function createReplaceHelemt(helmetData?: HelmetServerState): (template: string) => string;
|
|
5
5
|
export declare function helmetReplace(content: string, helmetData: HelmetServerState): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '../plugin';
|
|
2
|
-
export { NoSSR, NoSSRCache } from './react';
|
|
1
|
+
import type { RuntimePlugin } from '../plugin/index.js';
|
|
2
|
+
export { NoSSR, NoSSRCache } from './react/index.js';
|
|
3
3
|
export declare const ssr: (_config: any) => RuntimePlugin;
|
|
4
4
|
export default ssr;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NoSSRCache } from './no-ssr-cache';
|
|
2
|
-
export { NoSSR } from './nossr';
|
|
1
|
+
export { NoSSRCache } from './no-ssr-cache/index.js';
|
|
2
|
+
export { NoSSR } from './nossr/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestHandler, RequestHandlerOptions } from '@modern-js/app-tools';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type TInternalRuntimeContext } from '../context';
|
|
3
|
+
import { type TInternalRuntimeContext } from '../context/index.js';
|
|
4
4
|
export type { RequestHandlerConfig as HandleRequestConfig } from '@modern-js/app-tools';
|
|
5
5
|
export type HandleRequestOptions = Exclude<RequestHandlerOptions, 'staticGenerate'> & {
|
|
6
6
|
runtimeContext: TInternalRuntimeContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OnError } from '@modern-js/app-tools';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../context';
|
|
3
|
-
import type { RouterCleanup } from './routerCleanup';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../context/index.js';
|
|
3
|
+
import type { RouterCleanup } from './routerCleanup.js';
|
|
4
4
|
export type ResponseProxy = {
|
|
5
5
|
headers: Record<string, string>;
|
|
6
6
|
status: number;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* swallowed.
|
|
11
11
|
*/
|
|
12
12
|
import type { OnError } from '@modern-js/app-tools';
|
|
13
|
-
import type { TInternalRuntimeContext } from '../context';
|
|
13
|
+
import type { TInternalRuntimeContext } from '../context/index.js';
|
|
14
14
|
export declare const ROUTER_CLEANUP_ERROR = "An error occurs during router runtime cleanup";
|
|
15
15
|
export type RouterCleanup = {
|
|
16
16
|
/** True once the cleanup has been tied to a streamed response body. */
|
|
@@ -1,4 +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';
|
|
1
|
+
export { type CreateRequestHandler, createRequestHandler, type HandleRequest, type HandleRequestConfig, type HandleRequestOptions, } from './requestHandler.js';
|
|
2
|
+
export type { RenderOptions, RenderStreaming, RenderString } from './shared.js';
|
|
3
|
+
export { renderStreaming } from './stream/index.js';
|
|
4
|
+
export { renderString } from './string/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServerUserConfig } from '@modern-js/app-tools';
|
|
2
|
-
import type { HandleRequestOptions } from './requestHandler';
|
|
2
|
+
import type { HandleRequestOptions } from './requestHandler.js';
|
|
3
3
|
export type RenderOptions = HandleRequestOptions;
|
|
4
4
|
export type SSRConfig = NonNullable<ServerUserConfig['ssr']>;
|
|
5
5
|
export type RenderStreaming = (request: Request, serverRoot: React.ReactElement, optinos: RenderOptions) => Promise<ReadableStream>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type RenderLevel } from '../../constants';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
3
|
-
import type { HandleRequestConfig } from '../requestHandler';
|
|
4
|
-
import { type SSRConfig } from '../shared';
|
|
1
|
+
import { type RenderLevel } from '../../constants.js';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
3
|
+
import type { HandleRequestConfig } from '../requestHandler.js';
|
|
4
|
+
import { type SSRConfig } from '../shared.js';
|
|
5
5
|
export type BuildShellAfterTemplateOptions = {
|
|
6
6
|
runtimeContext: TInternalRuntimeContext;
|
|
7
7
|
renderLevel: RenderLevel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
2
|
-
import type { HandleRequestConfig } from '../requestHandler';
|
|
1
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
2
|
+
import type { HandleRequestConfig } from '../requestHandler.js';
|
|
3
3
|
export interface BuildShellBeforeTemplateOptions {
|
|
4
4
|
runtimeContext: TInternalRuntimeContext;
|
|
5
5
|
entryName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
2
|
-
import type { HandleRequestConfig } from '../requestHandler';
|
|
1
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
2
|
+
import type { HandleRequestConfig } from '../requestHandler.js';
|
|
3
3
|
export interface BuildShellBeforeTemplateOptions {
|
|
4
4
|
runtimeContext: TInternalRuntimeContext;
|
|
5
5
|
entryName: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CreateReadableStreamFromElement } from './shared';
|
|
1
|
+
import { type CreateReadableStreamFromElement } from './shared.js';
|
|
2
2
|
export declare const createReadableStreamFromElement: CreateReadableStreamFromElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CreateReadableStreamFromElement } from './shared';
|
|
1
|
+
import { type CreateReadableStreamFromElement } from './shared.js';
|
|
2
2
|
export declare const createReadableStreamFromElement: CreateReadableStreamFromElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const renderStreaming: import("../shared").RenderStreaming;
|
|
1
|
+
export declare const renderStreaming: import("../shared.js").RenderStreaming;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OnError } from '@modern-js/app-tools';
|
|
2
2
|
import type { ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
3
|
import type React from 'react';
|
|
4
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
5
|
-
import type { HandleRequestConfig } from '../requestHandler';
|
|
6
|
-
import type { RenderStreaming, SSRConfig } from '../shared';
|
|
4
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
5
|
+
import type { HandleRequestConfig } from '../requestHandler.js';
|
|
6
|
+
import type { RenderStreaming, SSRConfig } from '../shared.js';
|
|
7
7
|
export type RscManifest = {
|
|
8
8
|
clientManifest?: RscClientManifest;
|
|
9
9
|
serverConsumerModuleMap?: unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type BuildShellAfterTemplateOptions } from './afterTemplate';
|
|
2
|
-
import { type BuildShellBeforeTemplateOptions } from './beforeTemplate';
|
|
1
|
+
import { type BuildShellAfterTemplateOptions } from './afterTemplate.js';
|
|
2
|
+
import { type BuildShellBeforeTemplateOptions } from './beforeTemplate.js';
|
|
3
3
|
export type InjectTemplate = {
|
|
4
4
|
shellBefore: string;
|
|
5
5
|
shellAfter: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type RenderString } from '../shared';
|
|
1
|
+
import { type RenderString } from '../shared.js';
|
|
2
2
|
export declare const renderString: RenderString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
3
|
-
import type { ChunkSet, Collector } from './types';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
3
|
+
import type { ChunkSet, Collector } from './types.js';
|
|
4
4
|
declare module '@loadable/server' {
|
|
5
5
|
interface ChunkExtractor {
|
|
6
6
|
chunks: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
3
|
-
import type { SSRServerContext } from '../../types';
|
|
4
|
-
import type { SSRConfig } from '../shared';
|
|
5
|
-
import type { ChunkSet, Collector } from './types';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../../context/index.js';
|
|
3
|
+
import type { SSRServerContext } from '../../types.js';
|
|
4
|
+
import type { SSRConfig } from '../shared.js';
|
|
5
|
+
import type { ChunkSet, Collector } from './types.js';
|
|
6
6
|
export interface SSRDataCreatorOptions {
|
|
7
7
|
runtimeContext: TInternalRuntimeContext;
|
|
8
8
|
request: Request;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type { RenderLevel } from '../../constants';
|
|
2
|
+
import type { RenderLevel } from '../../constants.js';
|
|
3
3
|
export interface Collector {
|
|
4
4
|
collect?: (comopnent: ReactElement) => ReactElement;
|
|
5
5
|
effect: () => void | Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ServerUserConfig } from '@modern-js/app-tools';
|
|
2
2
|
import type { StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
3
|
-
import type { SSRConfig } from './shared';
|
|
3
|
+
import type { SSRConfig } from './shared.js';
|
|
4
4
|
export declare function attributesToString(attributes: Record<string, any>): string;
|
|
5
5
|
/**
|
|
6
6
|
* @param source
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OnError, OnTiming } from '@modern-js/app-tools';
|
|
2
2
|
import type { BaseSSRServerContext } from '@modern-js/types';
|
|
3
|
-
import type { RenderLevel } from './constants';
|
|
3
|
+
import type { RenderLevel } from './constants.js';
|
|
4
4
|
declare global {
|
|
5
5
|
interface Window {
|
|
6
6
|
_SSR_DATA?: SSRContainer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './Body';
|
|
2
|
-
export * from './Comment';
|
|
3
|
-
export * from './constants';
|
|
4
|
-
export * from './DocumentContext';
|
|
5
|
-
export * from './DocumentStructureContext';
|
|
6
|
-
export * from './Head';
|
|
7
|
-
export * from './Html';
|
|
8
|
-
export * from './Links';
|
|
9
|
-
export * from './Root';
|
|
10
|
-
export * from './Script';
|
|
11
|
-
export * from './Scripts';
|
|
12
|
-
export * from './Style';
|
|
1
|
+
export * from './Body.js';
|
|
2
|
+
export * from './Comment.js';
|
|
3
|
+
export * from './constants.js';
|
|
4
|
+
export * from './DocumentContext.js';
|
|
5
|
+
export * from './DocumentStructureContext.js';
|
|
6
|
+
export * from './Head.js';
|
|
7
|
+
export * from './Html.js';
|
|
8
|
+
export * from './Links.js';
|
|
9
|
+
export * from './Root.js';
|
|
10
|
+
export * from './Script.js';
|
|
11
|
+
export * from './Scripts.js';
|
|
12
|
+
export * from './Style.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for config-based routing
|
|
3
3
|
*/
|
|
4
|
-
import type { DefineRoutesFunction, LayoutFunction, PageFunction, RouteConfig, RouteFunction, RouteFunctions, WildcardFunction } from '../router/cli/config-routes/parseRouteConfig';
|
|
4
|
+
import type { DefineRoutesFunction, LayoutFunction, PageFunction, RouteConfig, RouteFunction, RouteFunctions, WildcardFunction } from '../router/cli/config-routes/parseRouteConfig.js';
|
|
5
5
|
export type { DefineRoutesFunction, LayoutFunction, PageFunction, RouteConfig, RouteFunction, RouteFunctions, WildcardFunction, };
|
|
6
6
|
/**
|
|
7
7
|
* defineRoutes - main function to define route configurations
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { RouterConfig } from './router/runtime/types';
|
|
2
|
-
export type { RuntimeConfig, RuntimePlugin } from './common';
|
|
3
|
-
export { isBrowser } from './common';
|
|
4
|
-
export { defineRuntimeConfig } from './core/config';
|
|
5
|
-
export { getMonitors } from './core/context/monitors';
|
|
6
|
-
export type { TRuntimeContext } from './core/context/public';
|
|
7
|
-
export { RuntimeContext, useRuntimeContext, } from './core/context/public';
|
|
8
|
-
export { getRequest } from './core/context/request';
|
|
9
|
-
export { redirect, setHeaders, setStatus } from './core/context/response';
|
|
1
|
+
import type { RouterConfig } from './router/runtime/types.js';
|
|
2
|
+
export type { RuntimeConfig, RuntimePlugin } from './common.js';
|
|
3
|
+
export { isBrowser } from './common.js';
|
|
4
|
+
export { defineRuntimeConfig } from './core/config.js';
|
|
5
|
+
export { getMonitors } from './core/context/monitors/index.js';
|
|
6
|
+
export type { TRuntimeContext } from './core/context/public.js';
|
|
7
|
+
export { RuntimeContext, useRuntimeContext, } from './core/context/public.js';
|
|
8
|
+
export { getRequest } from './core/context/request/index.js';
|
|
9
|
+
export { redirect, setHeaders, setStatus } from './core/context/response/index.js';
|
|
10
10
|
export type { RouterConfig };
|
package/dist/types/internal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { InternalRuntimeContext, type TInternalRuntimeContext, } from './core/context/runtime';
|
|
1
|
+
export { InternalRuntimeContext, type TInternalRuntimeContext, } from './core/context/runtime.js';
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* consumption during a rollout window should be driven by expand/contract, not
|
|
23
23
|
* by silent degrade.
|
|
24
24
|
*/
|
|
25
|
-
import { type ModuleFederationFallbackClassification, type ModuleFederationFallbackTelemetryEmitOptions, type ModuleFederationFallbackTelemetryPayload } from './index';
|
|
26
|
-
import { type DiscoveryError, type EnvironmentId, type ParsedSurfaceRef, type ResolvedDeliveryUnit, type SurfaceResolutionProvider } from './surface-resolution-types';
|
|
25
|
+
import { type ModuleFederationFallbackClassification, type ModuleFederationFallbackTelemetryEmitOptions, type ModuleFederationFallbackTelemetryPayload } from './index.js';
|
|
26
|
+
import { type DiscoveryError, type EnvironmentId, type ParsedSurfaceRef, type ResolvedDeliveryUnit, type SurfaceResolutionProvider } from './surface-resolution-types.js';
|
|
27
27
|
/** Where in the consumption lifecycle a failure was raised. */
|
|
28
28
|
export type SurfaceConsumptionPhase = 'discovery' | 'load' | 'mount';
|
|
29
29
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './consume-surface';
|
|
2
|
-
export * from './distributed-ssr';
|
|
3
|
-
export { DISTRIBUTED_SSR_FRAGMENT_REQUEST_LOCALS_KEY, useDistributedSsrFragmentProps, } from './distributed-ssr';
|
|
4
|
-
export * from './last-known-good';
|
|
5
|
-
export * from './manifest-recovery-runtime-plugin';
|
|
6
|
-
export * from './surface-resolution-types';
|
|
1
|
+
export * from './consume-surface.js';
|
|
2
|
+
export * from './distributed-ssr.js';
|
|
3
|
+
export { DISTRIBUTED_SSR_FRAGMENT_REQUEST_LOCALS_KEY, useDistributedSsrFragmentProps, } from './distributed-ssr.js';
|
|
4
|
+
export * from './last-known-good.js';
|
|
5
|
+
export * from './manifest-recovery-runtime-plugin.js';
|
|
6
|
+
export * from './surface-resolution-types.js';
|
|
7
7
|
export declare const MODULE_FEDERATION_FALLBACK_SIGNAL_EVENT = "modernjs:mf-runtime-fallback";
|
|
8
8
|
export declare const MODULE_FEDERATION_RECOVERY_SIGNAL_EVENT = "modernjs:mf-runtime-recovery";
|
|
9
9
|
export declare const DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT = "/_modern/contract-gates/runtime-fallback";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ResolvedDeliveryUnit, type SurfaceResolutionProvider } from './surface-resolution-types';
|
|
1
|
+
import { type ResolvedDeliveryUnit, type SurfaceResolutionProvider } from './surface-resolution-types.js';
|
|
2
2
|
export declare const LAST_KNOWN_GOOD_PROVIDER_NAME = "last-known-good";
|
|
3
3
|
/** One cached complete record plus the time it was stored. */
|
|
4
4
|
export type LkgRecord = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getMonitors } from './core/context/monitors';
|
|
2
|
-
export { getRequest } from './core/context/request';
|
|
3
|
-
export { redirect, setHeaders, setStatus } from './core/context/response';
|
|
1
|
+
export { getMonitors } from './core/context/monitors/index.js';
|
|
2
|
+
export { getRequest } from './core/context/request/index.js';
|
|
3
|
+
export { redirect, setHeaders, setStatus } from './core/context/response/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getClientRoutes } from './getRoutes';
|
|
1
|
+
export { getClientRoutes } from './getRoutes.js';
|
|
@@ -23,7 +23,7 @@ type HandleFileChangeOptions = {
|
|
|
23
23
|
type HandleModifyEntrypointsOptions = {
|
|
24
24
|
routesOwner?: string;
|
|
25
25
|
};
|
|
26
|
-
export declare function handleModifyEntrypoints(entrypoints: Entrypoint[], routesDir?: string, options?: HandleModifyEntrypointsOptions): Promise<import("./entry").EntrypointWithRoutesMeta[]>;
|
|
26
|
+
export declare function handleModifyEntrypoints(entrypoints: Entrypoint[], routesDir?: string, options?: HandleModifyEntrypointsOptions): Promise<import("./entry.js").EntrypointWithRoutesMeta[]>;
|
|
27
27
|
export declare function handleGeneratorEntryCode(api: CLIPluginAPI<AppTools>, entrypoints: Entrypoint[], options?: HandleGeneratorEntryCodeOptions | string): Promise<GeneratedRoutesByEntry>;
|
|
28
28
|
export declare function handleFileChange(api: CLIPluginAPI<AppTools>, e: any, options?: HandleFileChangeOptions): Promise<void>;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
-
export { BUILT_IN_ROUTES_OWNER, getEntrypointRoutesDir, getEntrypointRoutesOwner, isRouteEntry, } from './entry';
|
|
3
|
-
export { handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, } from './handler';
|
|
4
|
-
export { updateNestedRoutesSpec } from './nestedRoutesSpec';
|
|
2
|
+
export { BUILT_IN_ROUTES_OWNER, getEntrypointRoutesDir, getEntrypointRoutesOwner, isRouteEntry, } from './entry.js';
|
|
3
|
+
export { handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, } from './handler.js';
|
|
4
|
+
export { updateNestedRoutesSpec } from './nestedRoutesSpec.js';
|
|
5
5
|
export declare const routerPlugin: () => CliPlugin<AppTools>;
|
|
6
6
|
export default routerPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './runtime';
|
|
1
|
+
export * from './runtime/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './runtime/internal';
|
|
2
|
-
export { routerPlugin as default } from './runtime/internal';
|
|
1
|
+
export * from './runtime/internal.js';
|
|
2
|
+
export { routerPlugin as default } from './runtime/internal.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { TRuntimeContext } from '../../core/context/runtime';
|
|
3
|
-
import type { RouterLifecycleContext } from './lifecycle';
|
|
2
|
+
import type { TRuntimeContext } from '../../core/context/runtime.js';
|
|
3
|
+
import type { RouterLifecycleContext } from './lifecycle.js';
|
|
4
4
|
export type RouterSyncHook<Handler extends (...args: any[]) => any> = {
|
|
5
5
|
call: (...args: Parameters<Handler>) => ReturnType<Handler>;
|
|
6
6
|
[key: string]: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRouteLoaderData as useRouteData } from '@modern-js/runtime-utils/router';
|
|
2
2
|
export * from '@modern-js/runtime-utils/router';
|
|
3
|
-
export type { LinkProps, NavLinkProps } from './PrefetchLink';
|
|
4
|
-
export { Link, NavLink } from './PrefetchLink';
|
|
3
|
+
export type { LinkProps, NavLinkProps } from './PrefetchLink.js';
|
|
4
|
+
export { Link, NavLink } from './PrefetchLink.js';
|
|
5
5
|
export declare const useRouteLoaderData: typeof useRouteData;
|
|
6
|
-
export type { LoaderFunction, LoaderFunctionArgs } from './types';
|
|
7
|
-
export * from './withRouter';
|
|
6
|
+
export type { LoaderFunction, LoaderFunctionArgs } from './types.js';
|
|
7
|
+
export * from './withRouter.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '../../common';
|
|
2
|
-
import type { RouterExtendsHooks } from './hooks';
|
|
3
|
-
import type { RouterProviderRegistration } from './provider';
|
|
4
|
-
import type { RouterConfig, SingleRouteConfig } from './types';
|
|
1
|
+
import type { RuntimePlugin } from '../../common.js';
|
|
2
|
+
import type { RouterExtendsHooks } from './hooks.js';
|
|
3
|
+
import type { RouterProviderRegistration } from './provider.js';
|
|
4
|
+
import type { RouterConfig, SingleRouteConfig } from './types.js';
|
|
5
5
|
type LocalRouterProvider = Omit<RouterProviderRegistration, 'isDefault'>;
|
|
6
6
|
export type RouterPluginFactory = (userConfig?: Partial<RouterConfig>) => RuntimePlugin<{
|
|
7
7
|
extendHooks: RouterExtendsHooks;
|
|
@@ -15,8 +15,8 @@ export type RouterPluginFactory = (userConfig?: Partial<RouterConfig>) => Runtim
|
|
|
15
15
|
export declare const createRouterPlugin: (localProviders?: readonly LocalRouterProvider[]) => RouterPluginFactory;
|
|
16
16
|
export declare const routerPlugin: RouterPluginFactory;
|
|
17
17
|
export default routerPlugin;
|
|
18
|
-
export type { RouterExtendsHooks } from './hooks';
|
|
19
|
-
export { modifyRoutes } from './plugin';
|
|
20
|
-
export { createRouterProviderRealm, type RouterProviderFactory, type RouterProviderPlugin, type RouterProviderRealm, type RouterProviderRegistration, registerRouterProvider, resolveRouterProvider, } from './provider';
|
|
21
|
-
export { renderRoutes } from './utils';
|
|
18
|
+
export type { RouterExtendsHooks } from './hooks.js';
|
|
19
|
+
export { modifyRoutes } from './plugin.js';
|
|
20
|
+
export { createRouterProviderRealm, type RouterProviderFactory, type RouterProviderPlugin, type RouterProviderRealm, type RouterProviderRegistration, registerRouterProvider, resolveRouterProvider, } from './provider.js';
|
|
21
|
+
export { renderRoutes } from './utils.js';
|
|
22
22
|
export type { RouterConfig, SingleRouteConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../../core/context/runtime';
|
|
3
|
-
import type { InternalRouterRuntimeState, InternalRouterServerSnapshot, RouterFramework, RouterRouteMatchSnapshot, RouterServerPrepareResult } from './types';
|
|
2
|
+
import type { TInternalRuntimeContext } from '../../core/context/runtime.js';
|
|
3
|
+
import type { InternalRouterRuntimeState, InternalRouterServerSnapshot, RouterFramework, RouterRouteMatchSnapshot, RouterServerPrepareResult } from './types.js';
|
|
4
4
|
export declare function getRouterRuntimeState(runtimeContext: object): InternalRouterRuntimeState | undefined;
|
|
5
5
|
export declare function getRouterServerSnapshot(runtimeContext: object): InternalRouterServerSnapshot | undefined;
|
|
6
6
|
export type RouterLifecyclePhase = 'ssr-prepare' | 'client-create' | 'hydrate';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '../../common';
|
|
2
|
-
import type { RouterExtendsHooks } from './hooks';
|
|
3
|
-
import type { RouterConfig, Routes } from './types';
|
|
1
|
+
import type { RuntimePlugin } from '../../common.js';
|
|
2
|
+
import type { RouterExtendsHooks } from './hooks.js';
|
|
3
|
+
import type { RouterConfig, Routes } from './types.js';
|
|
4
4
|
export declare let finalRouteConfig: RouterConfig['routesConfig'];
|
|
5
5
|
export declare let beforeCreateRouter: boolean;
|
|
6
6
|
export declare function modifyRoutes(modifyFunction: (routes: Routes) => Routes): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '../../common';
|
|
2
|
-
import type { RouterExtendsHooks } from './hooks';
|
|
3
|
-
import type { RouterConfig } from './types';
|
|
1
|
+
import type { RuntimePlugin } from '../../common.js';
|
|
2
|
+
import type { RouterExtendsHooks } from './hooks.js';
|
|
3
|
+
import type { RouterConfig } from './types.js';
|
|
4
4
|
export declare const routerPlugin: (userConfig?: Partial<RouterConfig>) => RuntimePlugin<{
|
|
5
5
|
extendHooks: RouterExtendsHooks;
|
|
6
6
|
}>;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* - `@modern-js/plugin-tanstack` registers the `tanstack` provider when its
|
|
12
12
|
* runtime entry is imported.
|
|
13
13
|
*/
|
|
14
|
-
import type { RuntimePlugin } from '../../common';
|
|
15
|
-
import type { RouterExtendsHooks } from './hooks';
|
|
16
|
-
import type { RouterConfig } from './types';
|
|
14
|
+
import type { RuntimePlugin } from '../../common.js';
|
|
15
|
+
import type { RouterExtendsHooks } from './hooks.js';
|
|
16
|
+
import type { RouterConfig } from './types.js';
|
|
17
17
|
/**
|
|
18
18
|
* The single declaration source for the router hook registry. Every router
|
|
19
19
|
* provider (built-in react-router, @modern-js/plugin-tanstack, ...) and the
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type RouteObject, type StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { ServerPayload } from '../../core/context';
|
|
4
|
-
import type { RouteManifest } from './types';
|
|
5
|
-
export { handleRSCRedirect } from './redirect';
|
|
3
|
+
import type { ServerPayload } from '../../core/context/index.js';
|
|
4
|
+
import type { RouteManifest } from './types.js';
|
|
5
|
+
export { handleRSCRedirect } from './redirect.js';
|
|
6
6
|
declare global {
|
|
7
7
|
interface Window {
|
|
8
8
|
_MODERNJS_ROUTE_MANIFEST?: RouteManifest;
|
|
@@ -2,7 +2,7 @@ import type { DataRouter } from '@modern-js/runtime-utils/router';
|
|
|
2
2
|
import { type RouteObject, type StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
3
3
|
import type { NestedRoute, PageRoute, SSRMode } from '@modern-js/types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import type { RouterConfig } from './types';
|
|
5
|
+
import type { RouterConfig } from './types.js';
|
|
6
6
|
export declare function getRouteComponents(routes: (NestedRoute | PageRoute)[], { globalApp, ssrMode, props, }: {
|
|
7
7
|
globalApp?: React.ComponentType<GlobalAppProps>;
|
|
8
8
|
ssrMode?: SSRMode;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.
|
|
20
|
+
"version": "3.9.0-ultramodern.1",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -246,13 +246,13 @@
|
|
|
246
246
|
"dependencies": {
|
|
247
247
|
"@loadable/component": "5.16.7",
|
|
248
248
|
"@loadable/server": "5.16.7",
|
|
249
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.
|
|
250
|
-
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.
|
|
251
|
-
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.
|
|
252
|
-
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.
|
|
253
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.
|
|
254
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.
|
|
255
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.
|
|
249
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.1",
|
|
250
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.1",
|
|
251
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.1",
|
|
252
|
+
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.1",
|
|
253
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.1",
|
|
254
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.1",
|
|
255
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.1",
|
|
256
256
|
"@swc/core": "1.15.43",
|
|
257
257
|
"@swc/helpers": "^0.5.23",
|
|
258
258
|
"@swc/plugin-loadable-components": "^12.0.0",
|
|
@@ -273,10 +273,10 @@
|
|
|
273
273
|
"react-dom": "^19.2.8"
|
|
274
274
|
},
|
|
275
275
|
"devDependencies": {
|
|
276
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.
|
|
276
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.0-ultramodern.1",
|
|
277
277
|
"@remix-run/web-fetch": "^4.4.2",
|
|
278
278
|
"@rsbuild/core": "2.2.0",
|
|
279
|
-
"@rslib/core": "0.
|
|
279
|
+
"@rslib/core": "1.0.0",
|
|
280
280
|
"@scripts/rstest-config": "2.66.0",
|
|
281
281
|
"@testing-library/dom": "^10.4.1",
|
|
282
282
|
"@testing-library/react": "^16.3.2",
|
|
File without changes
|
|
File without changes
|