@bleedingdev/modern-js-plugin-tanstack 3.2.0-ultramodern.0 → 3.2.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/types/runtime/hooks.d.ts +24 -9
- package/package.json +8 -8
- package/dist/types-direct/cli/index.d.ts +0 -20
- package/dist/types-direct/cli/tanstackTypes.d.ts +0 -11
- package/dist/types-direct/cli.d.ts +0 -2
- package/dist/types-direct/runtime/DefaultNotFound.d.ts +0 -2
- package/dist/types-direct/runtime/basepathRewrite.d.ts +0 -8
- package/dist/types-direct/runtime/dataMutation.d.ts +0 -29
- package/dist/types-direct/runtime/hooks.d.ts +0 -18
- package/dist/types-direct/runtime/index.d.ts +0 -9
- package/dist/types-direct/runtime/lifecycle.d.ts +0 -22
- package/dist/types-direct/runtime/plugin.d.ts +0 -17
- package/dist/types-direct/runtime/plugin.node.d.ts +0 -17
- package/dist/types-direct/runtime/prefetchLink.d.ts +0 -11
- package/dist/types-direct/runtime/routeTree.d.ts +0 -11
- package/dist/types-direct/runtime/rsc/ClientSlot.d.ts +0 -5
- package/dist/types-direct/runtime/rsc/CompositeComponent.d.ts +0 -3
- package/dist/types-direct/runtime/rsc/ReplayableStream.d.ts +0 -24
- package/dist/types-direct/runtime/rsc/RscNodeRenderer.d.ts +0 -5
- package/dist/types-direct/runtime/rsc/SlotContext.d.ts +0 -11
- package/dist/types-direct/runtime/rsc/client.d.ts +0 -11
- package/dist/types-direct/runtime/rsc/createRscProxy.d.ts +0 -7
- package/dist/types-direct/runtime/rsc/index.d.ts +0 -2
- package/dist/types-direct/runtime/rsc/payloadRouter.d.ts +0 -24
- package/dist/types-direct/runtime/rsc/server.d.ts +0 -14
- package/dist/types-direct/runtime/rsc/slotUsageSanitizer.d.ts +0 -2
- package/dist/types-direct/runtime/rsc/symbols.d.ts +0 -46
- package/dist/types-direct/runtime/types.d.ts +0 -68
- package/dist/types-direct/runtime/utils.d.ts +0 -36
- package/dist/types-direct/runtime.d.ts +0 -1
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const onBeforeCreateRoutes:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const
|
|
1
|
+
declare const modifyRoutes: {
|
|
2
|
+
tap: (cb: any) => void;
|
|
3
|
+
call: (...params: any[]) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const onBeforeCreateRoutes: {
|
|
6
|
+
tap: (cb: any) => void;
|
|
7
|
+
call: (...params: any[]) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const onBeforeCreateRouter: {
|
|
10
|
+
tap: (cb: any) => void;
|
|
11
|
+
call: (...params: any[]) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const onAfterCreateRouter: {
|
|
14
|
+
tap: (cb: any) => void;
|
|
15
|
+
call: (...params: any[]) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const onBeforeHydrateRouter: {
|
|
18
|
+
tap: (cb: any) => void;
|
|
19
|
+
call: (...params: any[]) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const onAfterHydrateRouter: {
|
|
22
|
+
tap: (cb: any) => void;
|
|
23
|
+
call: (...params: any[]) => any;
|
|
24
|
+
};
|
|
10
25
|
export { modifyRoutes, onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeCreateRoutes, onBeforeHydrateRouter, };
|
|
11
26
|
export type RouterExtendsHooks = {
|
|
12
27
|
modifyRoutes: typeof modifyRoutes;
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"modern.js",
|
|
19
19
|
"tanstack-router"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.2.0-ultramodern.
|
|
21
|
+
"version": "3.2.0-ultramodern.1",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -88,13 +88,13 @@
|
|
|
88
88
|
"@swc/helpers": "^0.5.21",
|
|
89
89
|
"@tanstack/react-router": "1.170.1",
|
|
90
90
|
"@tanstack/router-core": "1.170.1",
|
|
91
|
-
"@modern-js/
|
|
92
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.
|
|
93
|
-
"@modern-js/
|
|
94
|
-
"@modern-js/
|
|
91
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.1",
|
|
92
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.1",
|
|
93
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.1",
|
|
94
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.1"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@modern-js/runtime": "3.2.0-ultramodern.
|
|
97
|
+
"@modern-js/runtime": "3.2.0-ultramodern.1",
|
|
98
98
|
"react": "^19.2.6",
|
|
99
99
|
"react-dom": "^19.2.6"
|
|
100
100
|
},
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"@typescript/native-preview": "7.0.0-dev.20260516.1",
|
|
110
110
|
"react": "^19.2.6",
|
|
111
111
|
"react-dom": "^19.2.6",
|
|
112
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.
|
|
113
|
-
"@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.2.0-ultramodern.
|
|
112
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.1",
|
|
113
|
+
"@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.2.0-ultramodern.1",
|
|
114
114
|
"@scripts/rstest-config": "2.66.0"
|
|
115
115
|
},
|
|
116
116
|
"sideEffects": false,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AppTools, AppToolsContext, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
-
import type { NestedRouteForCli, PageRoute } from '@modern-js/types';
|
|
3
|
-
export { generateTanstackRouterTypesSourceForEntry, isTanstackRouterFrameworkEnabled, } from './tanstackTypes';
|
|
4
|
-
export type TanstackRouterPluginOptions = {
|
|
5
|
-
routesDir?: string;
|
|
6
|
-
generatedDirName?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function writeTanstackRegisterFile(opts: {
|
|
9
|
-
entries: string[];
|
|
10
|
-
generatedDirName?: string;
|
|
11
|
-
runtimeModule?: string;
|
|
12
|
-
srcDirectory: string;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
export declare function writeTanstackRouterTypesForEntries(opts: {
|
|
15
|
-
appContext: AppToolsContext;
|
|
16
|
-
generatedDirName?: string;
|
|
17
|
-
routesByEntry: Record<string, (NestedRouteForCli | PageRoute)[]>;
|
|
18
|
-
}): Promise<void>;
|
|
19
|
-
export declare function tanstackRouterPlugin(options?: TanstackRouterPluginOptions): CliPlugin<AppTools>;
|
|
20
|
-
export default tanstackRouterPlugin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AppToolsContext } from '@modern-js/app-tools';
|
|
2
|
-
import type { NestedRouteForCli, PageRoute } from '@modern-js/types';
|
|
3
|
-
export declare function isTanstackRouterFrameworkEnabled(appContext: AppToolsContext): Promise<boolean>;
|
|
4
|
-
export declare function generateTanstackRouterTypesSourceForEntry(opts: {
|
|
5
|
-
appContext: AppToolsContext;
|
|
6
|
-
entryName: string;
|
|
7
|
-
generatedDirName?: string;
|
|
8
|
-
routes: (NestedRouteForCli | PageRoute)[];
|
|
9
|
-
}): Promise<{
|
|
10
|
-
routerGenTs: string;
|
|
11
|
-
}>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
type SubmitTarget = HTMLFormElement | FormData | URLSearchParams | Record<string, string | number | boolean | null | undefined>;
|
|
3
|
-
export type SubmitOptions = {
|
|
4
|
-
action?: string;
|
|
5
|
-
method?: string;
|
|
6
|
-
encType?: string;
|
|
7
|
-
};
|
|
8
|
-
export type FetcherState = 'idle' | 'submitting' | 'loading';
|
|
9
|
-
export declare class RouteActionResponseError<TData = unknown> extends Error {
|
|
10
|
-
readonly response: Response;
|
|
11
|
-
readonly data: TData;
|
|
12
|
-
constructor(response: Response, data: TData);
|
|
13
|
-
}
|
|
14
|
-
export type FormProps = Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit' | 'action'> & {
|
|
15
|
-
action?: string;
|
|
16
|
-
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
17
|
-
reloadDocument?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare function Form({ action, method, encType, reloadDocument, onSubmit, ...rest }: FormProps): React.JSX.Element;
|
|
20
|
-
export type FetcherSubmitOptions = SubmitOptions;
|
|
21
|
-
export type Fetcher = {
|
|
22
|
-
state: FetcherState;
|
|
23
|
-
data: unknown;
|
|
24
|
-
error: unknown;
|
|
25
|
-
Form: React.ComponentType<FormProps>;
|
|
26
|
-
submit: (target: SubmitTarget, options?: FetcherSubmitOptions) => Promise<void>;
|
|
27
|
-
};
|
|
28
|
-
export declare function useFetcher(): Fetcher;
|
|
29
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { TRuntimeContext } from '@modern-js/runtime/context';
|
|
2
|
-
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
3
|
-
import type { RouterLifecycleContext } from './lifecycle';
|
|
4
|
-
declare const modifyRoutes: import("@modern-js/plugin").SyncHook<(routes: RouteObject[]) => RouteObject[]>;
|
|
5
|
-
declare const onBeforeCreateRoutes: import("@modern-js/plugin").SyncHook<(context: TRuntimeContext) => void>;
|
|
6
|
-
declare const onBeforeCreateRouter: import("@modern-js/plugin").SyncHook<(context: RouterLifecycleContext) => void>;
|
|
7
|
-
declare const onAfterCreateRouter: import("@modern-js/plugin").SyncHook<(context: RouterLifecycleContext) => void>;
|
|
8
|
-
declare const onBeforeHydrateRouter: import("@modern-js/plugin").SyncHook<(context: RouterLifecycleContext) => void>;
|
|
9
|
-
declare const onAfterHydrateRouter: import("@modern-js/plugin").SyncHook<(context: RouterLifecycleContext) => void>;
|
|
10
|
-
export { modifyRoutes, onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeCreateRoutes, onBeforeHydrateRouter, };
|
|
11
|
-
export type RouterExtendsHooks = {
|
|
12
|
-
modifyRoutes: typeof modifyRoutes;
|
|
13
|
-
onBeforeCreateRoutes: typeof onBeforeCreateRoutes;
|
|
14
|
-
onBeforeCreateRouter: typeof onBeforeCreateRouter;
|
|
15
|
-
onAfterCreateRouter: typeof onAfterCreateRouter;
|
|
16
|
-
onBeforeHydrateRouter: typeof onBeforeHydrateRouter;
|
|
17
|
-
onAfterHydrateRouter: typeof onAfterHydrateRouter;
|
|
18
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from '@tanstack/react-router';
|
|
2
|
-
export { useMatch } from '@tanstack/react-router';
|
|
3
|
-
export type { Fetcher, FetcherState, FetcherSubmitOptions, FormProps, SubmitOptions, } from './dataMutation';
|
|
4
|
-
export { Form, RouteActionResponseError, useFetcher, } from './dataMutation';
|
|
5
|
-
export { tanstackRouterPlugin, tanstackRouterPlugin as default, } from './plugin';
|
|
6
|
-
export type { LinkProps, NavLinkProps, PrefetchBehavior, } from './prefetchLink';
|
|
7
|
-
export { Link, NavLink } from './prefetchLink';
|
|
8
|
-
export type { AnyCompositeComponent, AnyRenderableServerComponent, CompositeComponentProps, } from './rsc/client';
|
|
9
|
-
export { CompositeComponent } from './rsc/client';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { TInternalRuntimeContext } from '@modern-js/runtime/context';
|
|
2
|
-
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
3
|
-
import type { InternalRouterRuntimeState, InternalRouterServerSnapshot, RouterFramework, RouterRouteMatchSnapshot, RouterServerPrepareResult } from './types';
|
|
4
|
-
export type RouterLifecyclePhase = 'ssr-prepare' | 'client-create' | 'hydrate';
|
|
5
|
-
export type RouterLifecycleContext = {
|
|
6
|
-
framework: RouterFramework;
|
|
7
|
-
phase: RouterLifecyclePhase;
|
|
8
|
-
routes: RouteObject[];
|
|
9
|
-
runtimeContext: TInternalRuntimeContext;
|
|
10
|
-
basename?: string;
|
|
11
|
-
hydrationData?: unknown;
|
|
12
|
-
router?: unknown;
|
|
13
|
-
matches?: RouterRouteMatchSnapshot[];
|
|
14
|
-
cleanup?: () => void | Promise<void>;
|
|
15
|
-
serverSnapshot?: InternalRouterServerSnapshot;
|
|
16
|
-
};
|
|
17
|
-
type RouterSnapshotLike = Partial<InternalRouterServerSnapshot>;
|
|
18
|
-
export declare function createRouterServerSnapshot(state: RouterSnapshotLike): InternalRouterServerSnapshot;
|
|
19
|
-
export declare function createRouterRuntimeState(state: InternalRouterRuntimeState): InternalRouterRuntimeState;
|
|
20
|
-
export declare function applyRouterRuntimeState(runtimeContext: TInternalRuntimeContext, state: InternalRouterRuntimeState): TInternalRuntimeContext;
|
|
21
|
-
export declare function applyRouterServerPrepareResult(runtimeContext: TInternalRuntimeContext, result: RouterServerPrepareResult): TInternalRuntimeContext;
|
|
22
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Plugin, RuntimePluginExtends } from '@modern-js/plugin';
|
|
2
|
-
import type { RuntimePluginAPI } from '@modern-js/plugin/runtime';
|
|
3
|
-
import { type TInternalRuntimeContext } from '@modern-js/runtime/context';
|
|
4
|
-
import { type RouterExtendsHooks } from './hooks';
|
|
5
|
-
import type { RouterConfig } from './types';
|
|
6
|
-
type TanstackRouterRuntimeConfig = {
|
|
7
|
-
plugins?: TanstackRouterRuntimePlugin[];
|
|
8
|
-
router?: Partial<RouterConfig>;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
type TanstackRouterRuntimeExtends = Required<RuntimePluginExtends<TanstackRouterRuntimeConfig, TInternalRuntimeContext>> & {
|
|
12
|
-
extendHooks: RouterExtendsHooks;
|
|
13
|
-
};
|
|
14
|
-
type TanstackRouterPluginAPI = RuntimePluginAPI<TanstackRouterRuntimeExtends>;
|
|
15
|
-
type TanstackRouterRuntimePlugin = Plugin<TanstackRouterPluginAPI, TInternalRuntimeContext>;
|
|
16
|
-
export declare const tanstackRouterPlugin: (userConfig?: Partial<RouterConfig>) => TanstackRouterRuntimePlugin;
|
|
17
|
-
export default tanstackRouterPlugin;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Plugin, RuntimePluginExtends } from '@modern-js/plugin';
|
|
2
|
-
import type { RuntimePluginAPI } from '@modern-js/plugin/runtime';
|
|
3
|
-
import { type TInternalRuntimeContext } from '@modern-js/runtime/context';
|
|
4
|
-
import { type RouterExtendsHooks } from './hooks';
|
|
5
|
-
import type { RouterConfig } from './types';
|
|
6
|
-
type TanstackRouterRuntimeConfig = {
|
|
7
|
-
plugins?: TanstackRouterRuntimePlugin[];
|
|
8
|
-
router?: Partial<RouterConfig>;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
type TanstackRouterRuntimeExtends = Required<RuntimePluginExtends<TanstackRouterRuntimeConfig, TInternalRuntimeContext>> & {
|
|
12
|
-
extendHooks: RouterExtendsHooks;
|
|
13
|
-
};
|
|
14
|
-
type TanstackRouterPluginAPI = RuntimePluginAPI<TanstackRouterRuntimeExtends>;
|
|
15
|
-
type TanstackRouterRuntimePlugin = Plugin<TanstackRouterPluginAPI, TInternalRuntimeContext>;
|
|
16
|
-
export declare const tanstackRouterPlugin: (userConfig?: Partial<RouterConfig>) => TanstackRouterRuntimePlugin;
|
|
17
|
-
export default tanstackRouterPlugin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type AnyRouter, type LinkComponentProps, type RegisteredRouter } from '@tanstack/react-router';
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
3
|
-
export type PrefetchBehavior = 'intent' | 'render' | 'viewport' | 'none';
|
|
4
|
-
export type LinkProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkComponentProps<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
5
|
-
prefetch?: PrefetchBehavior;
|
|
6
|
-
};
|
|
7
|
-
export type NavLinkProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkProps<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
|
|
8
|
-
type LinkComponent = <TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: LinkProps<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => ReactElement;
|
|
9
|
-
export declare const Link: LinkComponent;
|
|
10
|
-
export declare const NavLink: LinkComponent;
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { NestedRoute, PageRoute } from '@modern-js/types';
|
|
3
|
-
import type { AnyRouter, RootRoute as TanstackRootRoute } from '@tanstack/react-router';
|
|
4
|
-
type ModernTanstackRootRoute = TanstackRootRoute;
|
|
5
|
-
type RouteTreeOptions = {
|
|
6
|
-
rscPayloadRouter?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function createRouteTreeFromModernRoutes(routes: Array<NestedRoute | PageRoute>, options?: RouteTreeOptions): ModernTanstackRootRoute;
|
|
9
|
-
export declare function createRouteTreeFromRouteObjects(routes: RouteObject[], options?: RouteTreeOptions): ModernTanstackRootRoute;
|
|
10
|
-
export declare function getModernRouteIdsFromMatches(router: AnyRouter): string[];
|
|
11
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface ReplayableStreamOptions {
|
|
2
|
-
signal?: AbortSignal;
|
|
3
|
-
}
|
|
4
|
-
export declare const REPLAYABLE_STREAM_MARKER: unique symbol;
|
|
5
|
-
export declare class ReplayableStream<T = Uint8Array> {
|
|
6
|
-
private source;
|
|
7
|
-
private options;
|
|
8
|
-
readonly [REPLAYABLE_STREAM_MARKER] = true;
|
|
9
|
-
private chunks;
|
|
10
|
-
private done;
|
|
11
|
-
private error;
|
|
12
|
-
private waiter;
|
|
13
|
-
private released;
|
|
14
|
-
private reader;
|
|
15
|
-
private abortListener;
|
|
16
|
-
constructor(source: ReadableStream<T>, options?: ReplayableStreamOptions);
|
|
17
|
-
private start;
|
|
18
|
-
private detachAbortListener;
|
|
19
|
-
private notify;
|
|
20
|
-
private wait;
|
|
21
|
-
release(): void;
|
|
22
|
-
isReleased(): boolean;
|
|
23
|
-
createReplayStream(): ReadableStream<T>;
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export type SlotImplementations = Record<string, unknown>;
|
|
3
|
-
export declare function useSlotContext(): {
|
|
4
|
-
implementations: SlotImplementations;
|
|
5
|
-
strict: boolean;
|
|
6
|
-
} | null;
|
|
7
|
-
export declare function SlotProvider({ children, implementations, strict, }: {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
implementations: SlotImplementations;
|
|
10
|
-
strict?: boolean;
|
|
11
|
-
}): React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CompositeComponent } from './CompositeComponent';
|
|
2
|
-
import type { AnyCompositeComponent, RscSlotUsageEvent } from './symbols';
|
|
3
|
-
export type { AnyCompositeComponent, AnyRenderableServerComponent, CompositeComponentProps, } from './symbols';
|
|
4
|
-
export { CompositeComponent };
|
|
5
|
-
type SerializedRsc = {
|
|
6
|
-
kind: 'renderable' | 'composite';
|
|
7
|
-
stream: ReadableStream<Uint8Array>;
|
|
8
|
-
slotUsagesStream?: ReadableStream<RscSlotUsageEvent>;
|
|
9
|
-
};
|
|
10
|
-
export declare function getTanstackRscSerializationAdapters(): import("@tanstack/router-core").SerializationAdapter<AnyCompositeComponent<Record<string, unknown>, import("react").ReactNode>, SerializedRsc, never>[];
|
|
11
|
-
export declare const rscSerializationAdapter: typeof getTanstackRscSerializationAdapters;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type RscSlotUsageEvent, type ServerComponentStream } from './symbols';
|
|
2
|
-
export declare function createRscProxy(getTree: () => unknown, options?: {
|
|
3
|
-
renderable?: boolean;
|
|
4
|
-
slotUsages?: RscSlotUsageEvent[];
|
|
5
|
-
slotUsagesStream?: ReadableStream<RscSlotUsageEvent>;
|
|
6
|
-
stream?: ServerComponentStream;
|
|
7
|
-
}): any;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ServerPayload } from '@modern-js/runtime/context';
|
|
2
|
-
type PayloadDecoder = (stream: ReadableStream<Uint8Array>) => Promise<unknown>;
|
|
3
|
-
type TanstackPayloadRouterLike = {
|
|
4
|
-
state?: {
|
|
5
|
-
location?: unknown;
|
|
6
|
-
matches?: unknown;
|
|
7
|
-
statusCode?: unknown;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
type LoadRouteDataOptions = {
|
|
11
|
-
hasClientLoader?: boolean;
|
|
12
|
-
loadClientData: () => Promise<unknown>;
|
|
13
|
-
request: Request;
|
|
14
|
-
routeId?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare function createTanstackRscServerPayload(router: TanstackPayloadRouterLike, options?: {
|
|
17
|
-
omitClientLoaderData?: boolean;
|
|
18
|
-
}): ServerPayload;
|
|
19
|
-
export declare function handleTanstackRscRedirect(headers: Headers, basename: string, status: number): Response;
|
|
20
|
-
export declare function isTanstackRscPayloadNavigationEnabled(): boolean;
|
|
21
|
-
export declare function loadTanstackRscPayload(request: Request): Promise<ServerPayload>;
|
|
22
|
-
export declare function loadTanstackRscRouteData({ hasClientLoader, loadClientData, request, routeId, }: LoadRouteDataOptions): Promise<unknown>;
|
|
23
|
-
export declare function __setTanstackRscPayloadDecoderForTests(decoder?: PayloadDecoder): void;
|
|
24
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { RawStream } from '@tanstack/router-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { type AnyCompositeComponent, type AnyRenderableServerComponent, type RscSlotUsageEvent } from './symbols';
|
|
4
|
-
export { CompositeComponent } from './CompositeComponent';
|
|
5
|
-
export type { AnyCompositeComponent, AnyRenderableServerComponent, CompositeComponentProps, } from './symbols';
|
|
6
|
-
export declare function renderServerComponent<TNode extends React.ReactNode>(node: TNode): Promise<TNode & AnyRenderableServerComponent<TNode>>;
|
|
7
|
-
export declare function createCompositeComponent<TProps extends object = Record<string, unknown>, TReturn = React.ReactNode>(component: (props: TProps) => React.ReactNode | Promise<React.ReactNode>): Promise<AnyCompositeComponent<TProps, TReturn>>;
|
|
8
|
-
type SerializedRsc = {
|
|
9
|
-
kind: 'renderable' | 'composite';
|
|
10
|
-
stream: RawStream;
|
|
11
|
-
slotUsagesStream?: ReadableStream<RscSlotUsageEvent>;
|
|
12
|
-
};
|
|
13
|
-
export declare function getTanstackRscSerializationAdapters(): import("@tanstack/router-core").SerializationAdapter<AnyCompositeComponent<Record<string, unknown>, React.ReactNode> | AnyRenderableServerComponent<React.ReactNode>, SerializedRsc, never>[];
|
|
14
|
-
export declare const rscSerializationAdapter: typeof getTanstackRscSerializationAdapters;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export interface ServerComponentStream {
|
|
3
|
-
createReplayStream: () => ReadableStream<Uint8Array>;
|
|
4
|
-
}
|
|
5
|
-
export declare const SERVER_COMPONENT_STREAM: unique symbol;
|
|
6
|
-
export declare const RENDERABLE_RSC: unique symbol;
|
|
7
|
-
export declare const RSC_PROXY_GET_TREE: unique symbol;
|
|
8
|
-
export declare const RSC_PROXY_PATH: unique symbol;
|
|
9
|
-
export declare const RSC_SLOT_USAGES_STREAM: unique symbol;
|
|
10
|
-
export declare const RSC_SLOT_USAGES: unique symbol;
|
|
11
|
-
export type SerializableSlotArg = string | number | boolean | bigint | null | undefined | SerializableSlotArg[] | {
|
|
12
|
-
[key: string]: SerializableSlotArg;
|
|
13
|
-
};
|
|
14
|
-
export type RscSlotUsageEvent = {
|
|
15
|
-
slot: string;
|
|
16
|
-
args?: SerializableSlotArg[];
|
|
17
|
-
};
|
|
18
|
-
export interface AnyRenderableServerComponent<TNode = React.ReactNode> {
|
|
19
|
-
[SERVER_COMPONENT_STREAM]: ServerComponentStream;
|
|
20
|
-
[RENDERABLE_RSC]: true;
|
|
21
|
-
[RSC_PROXY_GET_TREE]?: () => unknown;
|
|
22
|
-
[RSC_PROXY_PATH]?: string[];
|
|
23
|
-
[RSC_SLOT_USAGES_STREAM]?: ReadableStream<RscSlotUsageEvent>;
|
|
24
|
-
'~types'?: {
|
|
25
|
-
node: TNode;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface AnyCompositeComponent<TProps extends object = Record<string, unknown>, TReturn = React.ReactNode> {
|
|
29
|
-
[SERVER_COMPONENT_STREAM]?: ServerComponentStream;
|
|
30
|
-
[RSC_PROXY_GET_TREE]?: () => unknown;
|
|
31
|
-
[RSC_PROXY_PATH]?: string[];
|
|
32
|
-
[RSC_SLOT_USAGES]?: RscSlotUsageEvent[];
|
|
33
|
-
[RSC_SLOT_USAGES_STREAM]?: ReadableStream<RscSlotUsageEvent>;
|
|
34
|
-
'~types'?: {
|
|
35
|
-
props: TProps;
|
|
36
|
-
return: TReturn;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
type InferCompositeProps<TComp extends AnyCompositeComponent> = TComp extends AnyCompositeComponent<infer TProps, unknown> ? TProps : Record<string, unknown>;
|
|
40
|
-
export type CompositeComponentProps<TComp extends AnyCompositeComponent> = {
|
|
41
|
-
src: TComp;
|
|
42
|
-
strict?: boolean;
|
|
43
|
-
} & InferCompositeProps<TComp>;
|
|
44
|
-
export declare function isServerComponent(value: unknown): value is AnyCompositeComponent | AnyRenderableServerComponent;
|
|
45
|
-
export declare function isRenderableServerComponent(value: unknown): boolean;
|
|
46
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { RequestContext } from '@modern-js/runtime-utils/node';
|
|
2
|
-
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
3
|
-
import type { NestedRoute, PageRoute } from '@modern-js/types';
|
|
4
|
-
import type React from 'react';
|
|
5
|
-
export type BuiltInRouterFramework = 'react-router' | 'tanstack';
|
|
6
|
-
export type RouterFramework = BuiltInRouterFramework | (string & {});
|
|
7
|
-
export type RouterConfig = {
|
|
8
|
-
framework?: RouterFramework;
|
|
9
|
-
routesConfig: {
|
|
10
|
-
globalApp?: React.ComponentType<any>;
|
|
11
|
-
routes?: (NestedRoute | PageRoute)[];
|
|
12
|
-
};
|
|
13
|
-
oldVersion?: boolean;
|
|
14
|
-
serverBase?: string[];
|
|
15
|
-
supportHtml5History?: boolean;
|
|
16
|
-
basename?: string;
|
|
17
|
-
createRoutes?: () => RouteObject[];
|
|
18
|
-
future?: Partial<{
|
|
19
|
-
v7_startTransition: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
unstable_reloadOnURLMismatch?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export interface RouterRouteMatchSnapshot {
|
|
24
|
-
routeId: string;
|
|
25
|
-
assetRouteId?: string;
|
|
26
|
-
pathname?: string;
|
|
27
|
-
params?: Record<string, string>;
|
|
28
|
-
}
|
|
29
|
-
export interface InternalRouterServerSnapshot {
|
|
30
|
-
framework?: RouterFramework;
|
|
31
|
-
basename?: string;
|
|
32
|
-
statusCode?: number;
|
|
33
|
-
errors?: Record<string, unknown>;
|
|
34
|
-
routerData?: {
|
|
35
|
-
loaderData?: Record<string, unknown>;
|
|
36
|
-
errors?: Record<string, unknown>;
|
|
37
|
-
};
|
|
38
|
-
hydrationScript?: string;
|
|
39
|
-
hydrationScripts?: string[];
|
|
40
|
-
matchedRouteIds?: string[];
|
|
41
|
-
matches?: RouterRouteMatchSnapshot[];
|
|
42
|
-
}
|
|
43
|
-
export interface InternalRouterRuntimeState {
|
|
44
|
-
framework: RouterFramework;
|
|
45
|
-
basename?: string;
|
|
46
|
-
instance?: unknown;
|
|
47
|
-
hydrationScript?: string;
|
|
48
|
-
hydrationScripts?: string[];
|
|
49
|
-
matchedRouteIds?: string[];
|
|
50
|
-
matches?: RouterRouteMatchSnapshot[];
|
|
51
|
-
serverSnapshot?: InternalRouterServerSnapshot;
|
|
52
|
-
cleanup?: () => void | Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
export interface RouterServerPrepareResult {
|
|
55
|
-
state: InternalRouterRuntimeState;
|
|
56
|
-
snapshot?: InternalRouterServerSnapshot;
|
|
57
|
-
redirect?: Response;
|
|
58
|
-
cleanup?: () => void | Promise<void>;
|
|
59
|
-
}
|
|
60
|
-
interface DataFunctionArgs<D = any> {
|
|
61
|
-
request: Request;
|
|
62
|
-
params: Record<string, string>;
|
|
63
|
-
context?: D;
|
|
64
|
-
}
|
|
65
|
-
export type LoaderFunctionArgs<P extends Record<string, unknown> = Record<string, unknown>> = DataFunctionArgs<RequestContext<P>>;
|
|
66
|
-
type DataFunctionValue = Response | NonNullable<unknown> | null;
|
|
67
|
-
export type LoaderFunction = <P extends Record<string, unknown> = Record<string, unknown>>(args: LoaderFunctionArgs<P>) => Promise<DataFunctionValue> | DataFunctionValue;
|
|
68
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { RouteObject } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { NestedRoute, PageRoute, SSRMode } from '@modern-js/types';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
type RouterConfig = {
|
|
5
|
-
routesConfig: {
|
|
6
|
-
globalApp?: React.ComponentType<any>;
|
|
7
|
-
routes?: (NestedRoute | PageRoute)[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
type GlobalAppProps = {
|
|
11
|
-
Component: React.ComponentType;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
export type ModernRouteObject = RouteObject & {
|
|
15
|
-
isClientComponent?: boolean;
|
|
16
|
-
hasClientLoader?: boolean;
|
|
17
|
-
hasLoader?: boolean;
|
|
18
|
-
hasAction?: boolean;
|
|
19
|
-
inValidSSRRoute?: boolean;
|
|
20
|
-
lazyImport?: () => Promise<{
|
|
21
|
-
default: React.ComponentType;
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
export declare function getRouteObjects(routes: (NestedRoute | PageRoute)[], { globalApp, ssrMode, props, }: {
|
|
25
|
-
globalApp?: React.ComponentType<GlobalAppProps>;
|
|
26
|
-
ssrMode?: SSRMode;
|
|
27
|
-
props?: Record<string, unknown>;
|
|
28
|
-
}): RouteObject[];
|
|
29
|
-
export declare function createRouteObjectsFromConfig({ routesConfig, props, ssrMode, }: {
|
|
30
|
-
routesConfig: RouterConfig['routesConfig'];
|
|
31
|
-
props?: Record<string, unknown>;
|
|
32
|
-
ssrMode?: SSRMode;
|
|
33
|
-
}): RouteObject[] | null;
|
|
34
|
-
export declare const urlJoin: (...parts: string[]) => string;
|
|
35
|
-
export declare function standardSlash(str: string): string;
|
|
36
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './runtime/index';
|