@bleedingdev/modern-js-runtime 3.2.0-ultramodern.102 → 3.2.0-ultramodern.104
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 +15 -11
- package/dist/cjs/cache/index.js +9 -5
- package/dist/cjs/cli/alias.js +9 -5
- package/dist/cjs/cli/code.js +9 -5
- package/dist/cjs/cli/constants.js +20 -16
- package/dist/cjs/cli/entry.js +9 -5
- package/dist/cjs/cli/index.js +9 -5
- package/dist/cjs/cli/ssr/index.js +9 -5
- package/dist/cjs/cli/ssr/loadable-bundler-plugin.js +9 -5
- package/dist/cjs/cli/ssr/mode.js +12 -8
- package/dist/cjs/cli/template.js +9 -5
- package/dist/cjs/cli/template.server.js +9 -5
- package/dist/cjs/common.js +14 -10
- package/dist/cjs/core/browser/hydrate.js +9 -5
- package/dist/cjs/core/browser/index.js +9 -5
- package/dist/cjs/core/browser/withCallback.js +9 -5
- package/dist/cjs/core/compat/hooks.js +14 -10
- package/dist/cjs/core/compat/index.js +9 -5
- package/dist/cjs/core/compat/requestContext.js +13 -9
- package/dist/cjs/core/config.js +12 -8
- package/dist/cjs/core/constants.js +15 -10
- package/dist/cjs/core/context/index.js +9 -5
- package/dist/cjs/core/context/monitors/default.js +12 -8
- package/dist/cjs/core/context/monitors/index.js +9 -5
- package/dist/cjs/core/context/monitors/index.server.js +9 -5
- package/dist/cjs/core/context/request/index.js +12 -8
- package/dist/cjs/core/context/request/index.server.js +9 -5
- package/dist/cjs/core/context/response/index.js +15 -11
- package/dist/cjs/core/context/response/index.server.js +9 -5
- package/dist/cjs/core/context/runtime.js +9 -5
- package/dist/cjs/core/context/serverPayload/index.js +13 -9
- package/dist/cjs/core/context/serverPayload/index.server.js +9 -5
- package/dist/cjs/core/index.js +9 -5
- package/dist/cjs/core/plugin/index.js +9 -5
- package/dist/cjs/core/react/index.js +9 -5
- package/dist/cjs/core/react/wrapper.js +9 -5
- package/dist/cjs/core/server/constants.js +15 -11
- package/dist/cjs/core/server/federatedCss.js +11 -7
- package/dist/cjs/core/server/helmet.js +9 -5
- package/dist/cjs/core/server/index.js +9 -5
- package/dist/cjs/core/server/react/index.js +9 -5
- package/dist/cjs/core/server/react/no-ssr-cache/index.js +9 -5
- package/dist/cjs/core/server/react/nossr/index.js +9 -5
- package/dist/cjs/core/server/requestHandler.js +9 -5
- package/dist/cjs/core/server/scriptOrder.js +14 -10
- package/dist/cjs/core/server/server.js +9 -5
- package/dist/cjs/core/server/shared.js +12 -8
- package/dist/cjs/core/server/stream/afterTemplate.js +9 -5
- package/dist/cjs/core/server/stream/beforeTemplate.js +10 -6
- package/dist/cjs/core/server/stream/beforeTemplate.worker.js +10 -6
- package/dist/cjs/core/server/stream/createReadableStream.js +9 -5
- package/dist/cjs/core/server/stream/createReadableStream.worker.js +9 -5
- package/dist/cjs/core/server/stream/deferredScript.js +9 -5
- package/dist/cjs/core/server/stream/index.js +9 -5
- package/dist/cjs/core/server/stream/shared.js +9 -5
- package/dist/cjs/core/server/stream/template.js +9 -5
- package/dist/cjs/core/server/string/index.js +9 -5
- package/dist/cjs/core/server/string/loadable.js +9 -5
- package/dist/cjs/core/server/string/ssrData.js +9 -5
- package/dist/cjs/core/server/tracer.js +13 -9
- package/dist/cjs/core/server/utils.js +9 -5
- package/dist/cjs/document/Body.js +9 -5
- package/dist/cjs/document/Comment.js +9 -5
- package/dist/cjs/document/DocumentContext.js +9 -5
- package/dist/cjs/document/DocumentStructureContext.js +9 -5
- package/dist/cjs/document/Head.js +9 -5
- package/dist/cjs/document/Html.js +9 -5
- package/dist/cjs/document/Links.js +9 -5
- package/dist/cjs/document/Root.js +9 -5
- package/dist/cjs/document/Script.js +9 -5
- package/dist/cjs/document/Scripts.js +9 -5
- package/dist/cjs/document/Style.js +9 -5
- package/dist/cjs/document/Title.js +9 -5
- package/dist/cjs/document/cli/index.js +12 -6
- package/dist/cjs/document/constants.js +9 -5
- package/dist/cjs/document/index.js +9 -5
- package/dist/cjs/exports/config-routes.js +12 -8
- package/dist/cjs/exports/head.js +18 -10
- package/dist/cjs/exports/loadable.js +27 -18
- package/dist/cjs/exports/tanstack-router.js +9 -5
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/internal.js +9 -5
- package/dist/cjs/react-server.js +9 -5
- package/dist/cjs/router/cli/code/getClientRoutes/getRoutes.js +9 -5
- package/dist/cjs/router/cli/code/getClientRoutes/index.js +9 -5
- package/dist/cjs/router/cli/code/getClientRoutes/utils.js +9 -5
- package/dist/cjs/router/cli/code/index.js +9 -5
- package/dist/cjs/router/cli/code/inspect.js +9 -5
- package/dist/cjs/router/cli/code/makeLegalIdentifier.js +12 -8
- package/dist/cjs/router/cli/code/nestedRoutes.js +9 -5
- package/dist/cjs/router/cli/code/tanstackTypes.js +9 -5
- package/dist/cjs/router/cli/code/templates.js +9 -5
- package/dist/cjs/router/cli/code/utils.js +9 -5
- package/dist/cjs/router/cli/config-routes/converter.js +9 -5
- package/dist/cjs/router/cli/config-routes/parseRouteConfig.js +9 -5
- package/dist/cjs/router/cli/constants.js +23 -19
- package/dist/cjs/router/cli/entry.js +9 -5
- package/dist/cjs/router/cli/handler.js +9 -5
- package/dist/cjs/router/cli/index.js +9 -5
- package/dist/cjs/router/index.js +9 -5
- package/dist/cjs/router/internal.js +12 -8
- package/dist/cjs/router/runtime/CSSLinks.js +9 -5
- package/dist/cjs/router/runtime/DefaultNotFound.js +9 -5
- package/dist/cjs/router/runtime/DeferredDataScripts.js +12 -8
- package/dist/cjs/router/runtime/DeferredDataScripts.node.js +9 -5
- package/dist/cjs/router/runtime/PrefetchLink.js +162 -26
- package/dist/cjs/router/runtime/constants.js +9 -5
- package/dist/cjs/router/runtime/hooks.js +9 -5
- package/dist/cjs/router/runtime/index.js +15 -10
- package/dist/cjs/router/runtime/internal.js +9 -5
- package/dist/cjs/router/runtime/lifecycle.js +18 -14
- package/dist/cjs/router/runtime/plugin.js +9 -5
- package/dist/cjs/router/runtime/plugin.node.js +9 -5
- package/dist/cjs/router/runtime/routerHelper.js +9 -5
- package/dist/cjs/router/runtime/rsc-router.js +9 -5
- package/dist/cjs/router/runtime/rsc.js +9 -5
- package/dist/cjs/router/runtime/server.js +9 -5
- package/dist/cjs/router/runtime/tanstack/basepathRewrite.js +12 -8
- package/dist/cjs/router/runtime/tanstack/dataMutation.js +9 -5
- package/dist/cjs/router/runtime/tanstack/hydrationBoundary.js +9 -5
- package/dist/cjs/router/runtime/tanstack/outlet.js +10 -6
- package/dist/cjs/router/runtime/tanstack/plugin.js +42 -41
- package/dist/cjs/router/runtime/tanstack/plugin.node.js +9 -5
- package/dist/cjs/router/runtime/tanstack/prefetchLink.js +10 -6
- package/dist/cjs/router/runtime/tanstack/routeTree.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/ClientSlot.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/CompositeComponent.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/ReplayableStream.js +14 -9
- package/dist/cjs/router/runtime/tanstack/rsc/RscNodeRenderer.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/SlotContext.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/client.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/createRscProxy.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/index.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/server.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/slotUsageSanitizer.js +9 -5
- package/dist/cjs/router/runtime/tanstack/rsc/symbols.js +20 -15
- package/dist/cjs/router/runtime/utils.js +9 -5
- package/dist/cjs/router/runtime/withRouter.js +9 -5
- package/dist/cjs/rsc/client.js +12 -8
- package/dist/cjs/rsc/server.js +9 -5
- package/dist/cjs/rsc/server.worker.js +9 -5
- package/dist/cjs/ssr/index.node.js +13 -9
- package/dist/cjs/ssr/serverRender/renderToStream/buildTemplate.after.js +9 -5
- package/dist/cjs/ssr/serverRender/renderToString/entry.js +9 -5
- package/dist/cjs/ssr/serverRender/types.js +9 -5
- package/dist/esm/boundary-debugger/index.mjs +6 -6
- package/dist/esm/core/server/federatedCss.mjs +2 -2
- package/dist/esm/core/server/scriptOrder.mjs +2 -2
- package/dist/esm/core/server/stream/beforeTemplate.mjs +1 -1
- package/dist/esm/core/server/stream/beforeTemplate.worker.mjs +1 -1
- package/dist/esm/document/cli/index.mjs +3 -1
- package/dist/esm/exports/head.mjs +9 -5
- package/dist/esm/exports/loadable.mjs +12 -6
- package/dist/esm/router/runtime/PrefetchLink.mjs +153 -21
- package/dist/esm/router/runtime/tanstack/outlet.mjs +1 -1
- package/dist/esm/router/runtime/tanstack/plugin.mjs +33 -36
- package/dist/esm/router/runtime/tanstack/prefetchLink.mjs +1 -1
- package/dist/esm-node/boundary-debugger/index.mjs +6 -6
- package/dist/esm-node/core/server/federatedCss.mjs +2 -2
- package/dist/esm-node/core/server/scriptOrder.mjs +2 -2
- package/dist/esm-node/core/server/stream/beforeTemplate.mjs +1 -1
- package/dist/esm-node/core/server/stream/beforeTemplate.worker.mjs +1 -1
- package/dist/esm-node/document/cli/index.mjs +3 -1
- package/dist/esm-node/exports/head.mjs +9 -5
- package/dist/esm-node/exports/loadable.mjs +12 -6
- package/dist/esm-node/router/runtime/PrefetchLink.mjs +153 -21
- package/dist/esm-node/router/runtime/tanstack/outlet.mjs +1 -1
- package/dist/esm-node/router/runtime/tanstack/plugin.mjs +33 -36
- package/dist/esm-node/router/runtime/tanstack/prefetchLink.mjs +1 -1
- package/dist/types/cli/entry.d.ts +2 -2
- package/dist/types/core/context/response/index.server.d.ts +4 -1
- package/dist/types/core/plugin/index.d.ts +1 -1
- package/dist/types/core/server/utils.d.ts +11 -1
- package/dist/types/exports/head.d.ts +4 -4
- package/dist/types/exports/loadable.d.ts +1 -1
- package/dist/types/router/cli/code/utils.d.ts +1 -1
- package/dist/types/router/cli/entry.d.ts +1 -1
- package/dist/types/router/runtime/PrefetchLink.d.ts +5 -1
- package/package.json +10 -10
|
@@ -62,49 +62,46 @@ function getCachedRouteModule(routeId) {
|
|
|
62
62
|
if ("u" < typeof window) return;
|
|
63
63
|
return window[routeModulesKey]?.[routeId];
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
function preloadHydratedRouteComponents(router) {
|
|
66
66
|
const preloadableRouter = router;
|
|
67
67
|
const routesById = preloadableRouter.routesById || {};
|
|
68
68
|
const matches = preloadableRouter.stores.matches.get();
|
|
69
|
-
|
|
70
|
-
if (
|
|
69
|
+
return Promise.all(matches.map((match)=>{
|
|
70
|
+
if (void 0 === match.routeId || '' === match.routeId) return;
|
|
71
71
|
const route = routesById[match.routeId];
|
|
72
72
|
const component = route?.options?.component;
|
|
73
73
|
const preload = component?.load || component?.preload;
|
|
74
74
|
if ('function' != typeof preload) return;
|
|
75
75
|
return Promise.resolve(preload.call(component)).then((routeModule)=>{
|
|
76
76
|
const modernRouteId = route?.options?.staticData?.modernRouteId;
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const cachedRouteModule = 'string' == typeof modernRouteId && '' !== modernRouteId ? getCachedRouteModule(modernRouteId) : void 0;
|
|
78
|
+
const resolvedComponent = pickRouteModuleComponent(cachedRouteModule ?? routeModule);
|
|
79
|
+
if (void 0 !== resolvedComponent && 'string' == typeof modernRouteId && '' !== modernRouteId) route.options.component = withModernRouteMatchContext(resolvedComponent, modernRouteId);
|
|
79
80
|
});
|
|
80
|
-
}));
|
|
81
|
+
})).then(()=>void 0);
|
|
81
82
|
}
|
|
82
83
|
function getTanstackSsrHydrationRecord(router) {
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
hydrationRecord.status = 'fulfilled';
|
|
96
|
-
return value;
|
|
97
|
-
}, (error)=>{
|
|
98
|
-
hydrationRecord.status = 'rejected';
|
|
99
|
-
hydrationRecord.error = error;
|
|
100
|
-
throw error;
|
|
101
|
-
});
|
|
102
|
-
} catch (error) {
|
|
84
|
+
const existingHydrationRecord = routerHydrationRecords.get(router);
|
|
85
|
+
if (void 0 !== existingHydrationRecord) return existingHydrationRecord;
|
|
86
|
+
const hydrationRecord = {
|
|
87
|
+
promise: Promise.resolve(),
|
|
88
|
+
status: 'pending'
|
|
89
|
+
};
|
|
90
|
+
routerHydrationRecords.set(router, hydrationRecord);
|
|
91
|
+
try {
|
|
92
|
+
hydrationRecord.promise = hydrate(router).then((value)=>preloadHydratedRouteComponents(router).then(()=>value)).then((value)=>{
|
|
93
|
+
hydrationRecord.status = 'fulfilled';
|
|
94
|
+
return value;
|
|
95
|
+
}, (error)=>{
|
|
103
96
|
hydrationRecord.status = 'rejected';
|
|
104
97
|
hydrationRecord.error = error;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
throw error;
|
|
99
|
+
});
|
|
100
|
+
} catch (error) {
|
|
101
|
+
hydrationRecord.status = 'rejected';
|
|
102
|
+
hydrationRecord.error = error;
|
|
103
|
+
hydrationRecord.promise = Promise.reject(error);
|
|
104
|
+
hydrationRecord.promise.catch(()=>{});
|
|
108
105
|
}
|
|
109
106
|
return hydrationRecord;
|
|
110
107
|
}
|
|
@@ -225,13 +222,13 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
225
222
|
});
|
|
226
223
|
return cachedRouter;
|
|
227
224
|
};
|
|
228
|
-
api.onBeforeRender(
|
|
225
|
+
api.onBeforeRender((context)=>{
|
|
229
226
|
const mergedConfig = getMergedConfig();
|
|
230
|
-
if ("u" > typeof window && window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
227
|
+
if ("u" > typeof window && void 0 !== window._SSR_DATA && mergedConfig.unstable_reloadOnURLMismatch) {
|
|
231
228
|
const { ssrContext } = context;
|
|
232
229
|
const currentPathname = normalizePathname(window.location.pathname);
|
|
233
|
-
const initialPathname = ssrContext?.request?.pathname
|
|
234
|
-
if (initialPathname && initialPathname !== currentPathname) {
|
|
230
|
+
const initialPathname = 'string' == typeof ssrContext?.request?.pathname ? normalizePathname(ssrContext.request.pathname) : void 0;
|
|
231
|
+
if (void 0 !== initialPathname && '' !== initialPathname && initialPathname !== currentPathname) {
|
|
235
232
|
const errorMsg = `The initial URL ${initialPathname} and the URL ${currentPathname} to be hydrated do not match, reload.`;
|
|
236
233
|
console.error(errorMsg);
|
|
237
234
|
window.location.reload();
|
|
@@ -245,14 +242,14 @@ const tanstackRouterPlugin = (userConfig = {})=>({
|
|
|
245
242
|
useRouter: useRouter
|
|
246
243
|
};
|
|
247
244
|
const hasSSRBootstrap = "u" > typeof window && Boolean(window.$_TSR);
|
|
248
|
-
if (hasSSRBootstrap && getRouteObjects().length) {
|
|
245
|
+
if (hasSSRBootstrap && getRouteObjects().length > 0) {
|
|
249
246
|
const runtimeContext = context;
|
|
250
247
|
const router = getRouter(runtimeContext, getClientBasename(runtimeContext));
|
|
251
|
-
if (router)
|
|
248
|
+
if (null != router) return getTanstackSsrHydrationPromise(router).then(()=>void 0);
|
|
252
249
|
}
|
|
253
250
|
});
|
|
254
251
|
api.wrapRoot((App)=>{
|
|
255
|
-
if (
|
|
252
|
+
if (0 === getRouteObjects().length) return App;
|
|
256
253
|
const RouterWrapper = ()=>{
|
|
257
254
|
const runtimeContext = useContext(InternalRuntimeContext);
|
|
258
255
|
const _basename = getClientBasename(runtimeContext);
|
|
@@ -5,7 +5,7 @@ function resolvePreloadFromPrefetch(prefetch, preload) {
|
|
|
5
5
|
if (void 0 !== preload) return preload;
|
|
6
6
|
if ('none' === prefetch) return false;
|
|
7
7
|
if ('intent' === prefetch || 'render' === prefetch || 'viewport' === prefetch) return prefetch;
|
|
8
|
-
return
|
|
8
|
+
return 'viewport';
|
|
9
9
|
}
|
|
10
10
|
const LinkComponentImpl = (props)=>{
|
|
11
11
|
const { prefetch, preload, ...rest } = props;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const hasApp: (dir: string) =>
|
|
2
|
-
export declare const isRuntimeEntry: (dir: string) =>
|
|
1
|
+
export declare const hasApp: (dir: string) => string | false;
|
|
2
|
+
export declare const isRuntimeEntry: (dir: string) => string | false;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const getResponseProxy: () =>
|
|
1
|
+
export declare const getResponseProxy: () => {
|
|
2
|
+
headers: Record<string, string>;
|
|
3
|
+
status: number;
|
|
4
|
+
} | undefined;
|
|
2
5
|
export declare const setHeaders: (headers: Record<string, string>) => void;
|
|
3
6
|
export declare const setStatus: (status: number) => void;
|
|
4
7
|
export declare const redirect: (url: string, init?: number | ResponseInit) => void;
|
|
@@ -2,4 +2,4 @@ import type { InternalRuntimeContext } from '@modern-js/plugin/runtime';
|
|
|
2
2
|
import type { RuntimeConfig, RuntimeExtends, RuntimePlugin } from './types';
|
|
3
3
|
export type { RuntimePlugin };
|
|
4
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
|
|
5
|
+
export declare function mergeConfig(config: Record<string, any>, ...otherConfig: Record<string, any>[]): Record<string, any>;
|
|
@@ -15,5 +15,15 @@ export declare function checkIsNode(): boolean;
|
|
|
15
15
|
* license at https://github.com/remix-run/remix/blob/main/LICENSE.md
|
|
16
16
|
*/
|
|
17
17
|
export declare function serializeErrors(errors: StaticHandlerContext['errors']): StaticHandlerContext['errors'];
|
|
18
|
-
export declare function getSSRConfigByEntry(entryName: string, ssr?: ServerUserConfig['ssr'], ssrByEntries?: ServerUserConfig['ssrByEntries']):
|
|
18
|
+
export declare function getSSRConfigByEntry(entryName: string, ssr?: ServerUserConfig['ssr'], ssrByEntries?: ServerUserConfig['ssrByEntries']): true | {
|
|
19
|
+
forceCSR?: boolean;
|
|
20
|
+
mode?: import("@modern-js/types").SSRMode;
|
|
21
|
+
preload?: boolean | {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
inlineScript?: boolean;
|
|
25
|
+
disablePrerender?: boolean;
|
|
26
|
+
unsafeHeaders?: string[];
|
|
27
|
+
moduleFederationAppSSR?: boolean;
|
|
28
|
+
};
|
|
19
29
|
export declare function getSSRMode(ssrConfig?: SSRConfig): 'string' | 'stream' | false;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Helmet as AsyncHelmet, HelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
|
|
2
|
+
import { Helmet as AsyncHelmet, HelmetData as AsyncHelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
|
|
3
3
|
export declare const Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.CElement<React.PropsWithChildren<HelmetProps>, AsyncHelmet> | null;
|
|
4
4
|
declare const head: {
|
|
5
5
|
Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.CElement<React.PropsWithChildren<HelmetProps>, AsyncHelmet> | null;
|
|
6
|
-
HelmetData: typeof
|
|
6
|
+
HelmetData: typeof AsyncHelmetData;
|
|
7
7
|
HelmetProvider: typeof HelmetProvider;
|
|
8
8
|
};
|
|
9
9
|
export default head;
|
|
10
|
-
export type { HelmetDatum, HelmetHTMLBodyDatum, HelmetHTMLElementDatum, HelmetProps, HelmetServerState
|
|
11
|
-
export { HelmetData, HelmetProvider };
|
|
10
|
+
export type { HelmetDatum, HelmetHTMLBodyDatum, HelmetHTMLElementDatum, HelmetProps, HelmetServerState, HelmetTags, };
|
|
11
|
+
export { AsyncHelmetData as HelmetData, HelmetProvider };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type LoadableDefault = typeof import('@loadable/component').default;
|
|
2
2
|
type LoadableLazy = typeof import('@loadable/component').lazy;
|
|
3
3
|
type LoadableReady = typeof import('@loadable/component').loadableReady;
|
|
4
|
-
type LoadableInternals =
|
|
4
|
+
type LoadableInternals = unknown;
|
|
5
5
|
declare const loadable: LoadableDefault;
|
|
6
6
|
export declare const lazy: LoadableLazy;
|
|
7
7
|
export declare const loadableReady: LoadableReady;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const walkDirectory: (dir: string) => string[];
|
|
2
2
|
export declare const isPageComponentFile: (filePath: string) => boolean;
|
|
3
|
-
export declare const replaceWithAlias: (base: string, filePath: string, alias: string) =>
|
|
3
|
+
export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
|
|
4
4
|
export declare const parseModule: ({ source, filename, }: {
|
|
5
5
|
source: string;
|
|
6
6
|
filename: string;
|
|
@@ -13,6 +13,6 @@ export declare const getEntrypointRoutesDir: (entrypoint: {
|
|
|
13
13
|
export declare const getEntrypointRoutesOwner: (entrypoint: {
|
|
14
14
|
[ROUTES_OWNER_META_KEY]?: string;
|
|
15
15
|
}) => string | null;
|
|
16
|
-
export declare const hasNestedRoutes: (dir: string, routesDir?: string) =>
|
|
16
|
+
export declare const hasNestedRoutes: (dir: string, routesDir?: string) => boolean;
|
|
17
17
|
export declare const isRouteEntry: (dir: string, routesDir?: string) => string | false;
|
|
18
18
|
export declare const modifyEntrypoints: (entrypoints: Entrypoint[], routesDir?: string, routesOwner?: string) => EntrypointWithRoutesMeta[];
|
|
@@ -13,14 +13,18 @@ import React from 'react';
|
|
|
13
13
|
*
|
|
14
14
|
* - "intent": Fetched when the user focuses or hovers the link
|
|
15
15
|
* - "render": Fetched when the link is rendered
|
|
16
|
+
* - "viewport": Fetched when the link enters the viewport
|
|
16
17
|
* - "none": Never fetched
|
|
17
18
|
*/
|
|
18
|
-
type PrefetchBehavior = 'intent' | 'render' | 'none';
|
|
19
|
+
type PrefetchBehavior = 'intent' | 'render' | 'viewport' | 'none';
|
|
20
|
+
type PreloadBehavior = PrefetchBehavior | false;
|
|
19
21
|
export interface LinkProps extends RouterLinkProps {
|
|
20
22
|
prefetch?: PrefetchBehavior;
|
|
23
|
+
preload?: PreloadBehavior;
|
|
21
24
|
}
|
|
22
25
|
export interface NavLinkProps extends RouterNavLinkProps {
|
|
23
26
|
prefetch?: PrefetchBehavior;
|
|
27
|
+
preload?: PreloadBehavior;
|
|
24
28
|
}
|
|
25
29
|
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
26
30
|
declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.104",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -233,12 +233,12 @@
|
|
|
233
233
|
"isbot": "5.1.40",
|
|
234
234
|
"react-helmet-async": "3.0.0",
|
|
235
235
|
"react-is": "^19.2.6",
|
|
236
|
-
"@modern-js/plugin
|
|
237
|
-
"@modern-js/
|
|
238
|
-
"@modern-js/
|
|
239
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.
|
|
240
|
-
"@modern-js/
|
|
241
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
236
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.104",
|
|
237
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.104",
|
|
238
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.104",
|
|
239
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.104",
|
|
240
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.104",
|
|
241
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.104"
|
|
242
242
|
},
|
|
243
243
|
"peerDependencies": {
|
|
244
244
|
"react": "^19.2.6",
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
},
|
|
247
247
|
"devDependencies": {
|
|
248
248
|
"@remix-run/web-fetch": "^4.4.2",
|
|
249
|
-
"@rsbuild/core": "2.0.
|
|
249
|
+
"@rsbuild/core": "2.0.10",
|
|
250
250
|
"@rslib/core": "0.21.5",
|
|
251
251
|
"@tanstack/history": "1.162.0",
|
|
252
252
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
258
258
|
"react": "^19.2.6",
|
|
259
259
|
"react-dom": "^19.2.6",
|
|
260
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.
|
|
260
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.104",
|
|
261
261
|
"@scripts/rstest-config": "2.66.0"
|
|
262
262
|
},
|
|
263
263
|
"sideEffects": false,
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
},
|
|
268
268
|
"scripts": {
|
|
269
269
|
"dev": "rslib build --watch",
|
|
270
|
-
"build": "rslib build && pnpm run gen-static",
|
|
270
|
+
"build": "rslib build && pnpm run gen-static && pnpm -w tsgo:dts \"$PWD\"",
|
|
271
271
|
"gen-static": "node --disable-warning=ExperimentalWarning --experimental-strip-types ./scripts/gen-static.mts",
|
|
272
272
|
"test": "rstest"
|
|
273
273
|
}
|