rari 0.5.28 → 0.5.30
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/cli.mjs +2 -2
- package/dist/client.d.mts +134 -2
- package/dist/client.mjs +1214 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/{loading-component-map-C1KKbIfe.mjs → loading-component-map-BQWkwB_z.mjs} +1 -1
- package/dist/runtime-client-2LnsnJtK.mjs +475 -0
- package/dist/{runtime-client-DS02_tXZ.d.mts → runtime-client-C_igMkq4.d.mts} +2 -149
- package/dist/server-build-HX1-lDRR.mjs +3 -0
- package/dist/{vite-BbAT_IZh.d.mts → vite-C0q8SoeH.d.mts} +2 -6
- package/dist/{vite-Crp6BBHv.mjs → vite-Dwd6mlC3.mjs} +59 -28
- package/dist/vite.d.mts +3 -3
- package/dist/vite.mjs +4 -4
- package/package.json +9 -9
- package/src/client.ts +1 -4
- package/src/router/ClientRouter.tsx +74 -63
- package/src/router/app-types.ts +0 -37
- package/src/router/debounce.ts +0 -11
- package/src/router/navigation-types.ts +0 -14
- package/src/router/navigation-utils.ts +1 -42
- package/src/runtime/AppRouterProvider.tsx +224 -221
- package/src/runtime/entry-client.js +404 -186
- package/src/runtime/react-server-dom-rari-client.js +203 -35
- package/src/runtime/rsc-client-runtime.js +185 -14
- package/src/vite/index.ts +72 -1
- package/src/vite.ts +6 -10
- package/dist/loading-component-map-DZYu3WJb.mjs +0 -3
- package/dist/runtime-client-DXbydP6X.mjs +0 -1720
- package/dist/server-build-DpwAKSJu.mjs +0 -3
- package/src/async-context.ts +0 -34
- package/src/router/LayoutDataManager.ts +0 -141
- package/src/router/LayoutManager.ts +0 -176
- package/src/router/LoadingComponentRegistry.ts +0 -151
- package/src/router/hmr-utils.ts +0 -117
- package/src/router/index.ts +0 -100
- package/src/router/rsc-parser.ts +0 -192
- package/src/router/rsc-types.ts +0 -28
- package/src/router/types.ts +0 -14
- package/src/runtime/LayoutWrapper.tsx +0 -13
- package/src/runtime/NavigationProvider.tsx +0 -56
- package/src/runtime/api-request.ts +0 -158
- package/src/vite/hmr-client.ts +0 -83
- package/src/vite/hmr-error-overlay.ts +0 -117
- package/src/vite/hmr-progress-indicator.ts +0 -196
- /package/dist/{platform-Bv9HDvl_.mjs → platform-DIRVyfTw.mjs} +0 -0
- /package/dist/{railway-B8SUWVNF.mjs → railway-B8VEi9Qi.mjs} +0 -0
- /package/dist/{render-CnuI67F1.mjs → render-Dz1orMws.mjs} +0 -0
- /package/dist/{server-build-CQpjQCX6.mjs → server-build-DCJr3PU7.mjs} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -187,7 +187,7 @@ async function deployToRailway() {
|
|
|
187
187
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
188
188
|
process.exit(1);
|
|
189
189
|
}
|
|
190
|
-
const { createRailwayDeployment } = await import("./railway-
|
|
190
|
+
const { createRailwayDeployment } = await import("./railway-B8VEi9Qi.mjs");
|
|
191
191
|
await createRailwayDeployment();
|
|
192
192
|
}
|
|
193
193
|
async function deployToRender() {
|
|
@@ -196,7 +196,7 @@ async function deployToRender() {
|
|
|
196
196
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
197
197
|
process.exit(1);
|
|
198
198
|
}
|
|
199
|
-
const { createRenderDeployment } = await import("./render-
|
|
199
|
+
const { createRenderDeployment } = await import("./render-Dz1orMws.mjs");
|
|
200
200
|
await createRenderDeployment();
|
|
201
201
|
}
|
|
202
202
|
async function main() {
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,134 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { A as LoadingEntry, C as AppRouteMatch, D as GenerateStaticParams, E as GenerateMetadata, M as PageProps, N as RouteSegment, O as LayoutEntry, P as RouteSegmentType, S as AppRouteManifest, T as ErrorProps, _ as extractServerProps, a as LoadingSpinner, b as hasServerSideDataFetching, c as createErrorBoundary, d as MetadataResult, f as ServerPropsResult, g as extractMetadata, h as clearPropsCacheForComponent, i as HttpRuntimeClient, j as NotFoundEntry, k as LayoutProps, l as createHttpRuntimeClient, m as clearPropsCache, n as DefaultLoading, o as NotFound, p as StaticParamsResult, r as ErrorBoundary, s as RuntimeClient, t as DefaultError, u as createLoadingBoundary, v as extractServerPropsWithCache, w as ErrorEntry, x as AppRouteEntry, y as extractStaticParams } from "./runtime-client-C_igMkq4.mjs";
|
|
2
|
+
import React, { Component, ErrorInfo, ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/router/ClientRouter.d.ts
|
|
6
|
+
interface ClientRouterProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
initialRoute: string;
|
|
9
|
+
}
|
|
10
|
+
declare function ClientRouter({
|
|
11
|
+
children,
|
|
12
|
+
initialRoute
|
|
13
|
+
}: ClientRouterProps): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/router/LayoutErrorBoundary.d.ts
|
|
16
|
+
interface LayoutErrorBoundaryProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
layoutPath: string;
|
|
19
|
+
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
20
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
21
|
+
}
|
|
22
|
+
interface LayoutErrorBoundaryState {
|
|
23
|
+
hasError: boolean;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
}
|
|
26
|
+
declare class LayoutErrorBoundary extends Component<LayoutErrorBoundaryProps, LayoutErrorBoundaryState> {
|
|
27
|
+
constructor(props: LayoutErrorBoundaryProps);
|
|
28
|
+
static getDerivedStateFromError(error: Error): LayoutErrorBoundaryState;
|
|
29
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
render(): ReactNode;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/router/navigation-error-handler.d.ts
|
|
35
|
+
type NavigationErrorType = 'fetch-error' | 'timeout' | 'abort' | 'parse-error' | 'network-error' | 'not-found' | 'server-error';
|
|
36
|
+
interface NavigationError {
|
|
37
|
+
type: NavigationErrorType;
|
|
38
|
+
message: string;
|
|
39
|
+
originalError?: Error;
|
|
40
|
+
statusCode?: number;
|
|
41
|
+
url?: string;
|
|
42
|
+
timestamp: number;
|
|
43
|
+
retryable: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface NavigationErrorHandlerOptions {
|
|
46
|
+
timeout?: number;
|
|
47
|
+
maxRetries?: number;
|
|
48
|
+
onError?: (error: NavigationError) => void;
|
|
49
|
+
onRetry?: (attempt: number, error: NavigationError) => void;
|
|
50
|
+
}
|
|
51
|
+
declare class NavigationErrorHandler {
|
|
52
|
+
private options;
|
|
53
|
+
private retryCount;
|
|
54
|
+
constructor(options?: NavigationErrorHandlerOptions);
|
|
55
|
+
handleError(error: unknown, url: string): NavigationError;
|
|
56
|
+
canRetry(error: NavigationError, url: string): boolean;
|
|
57
|
+
incrementRetry(url: string): number;
|
|
58
|
+
resetRetry(url: string): void;
|
|
59
|
+
getRetryCount(url: string): number;
|
|
60
|
+
clearRetries(): void;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/router/NavigationErrorOverlay.d.ts
|
|
64
|
+
interface NavigationErrorOverlayProps {
|
|
65
|
+
error: NavigationError;
|
|
66
|
+
onRetry?: () => void;
|
|
67
|
+
onReload?: () => void;
|
|
68
|
+
onDismiss?: () => void;
|
|
69
|
+
retryCount?: number;
|
|
70
|
+
maxRetries?: number;
|
|
71
|
+
}
|
|
72
|
+
declare function NavigationErrorOverlay({
|
|
73
|
+
error,
|
|
74
|
+
onRetry,
|
|
75
|
+
onReload,
|
|
76
|
+
onDismiss,
|
|
77
|
+
retryCount,
|
|
78
|
+
maxRetries
|
|
79
|
+
}: NavigationErrorOverlayProps): react_jsx_runtime0.JSX.Element;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/router/route-info-types.d.ts
|
|
82
|
+
interface RouteInfoRequest {
|
|
83
|
+
path: string;
|
|
84
|
+
}
|
|
85
|
+
interface RouteInfoResponse {
|
|
86
|
+
exists: boolean;
|
|
87
|
+
layouts: string[];
|
|
88
|
+
loading: string | null;
|
|
89
|
+
isDynamic: boolean;
|
|
90
|
+
params?: string[];
|
|
91
|
+
}
|
|
92
|
+
interface RouteInfoError {
|
|
93
|
+
error: string;
|
|
94
|
+
code: 'NOT_FOUND' | 'INVALID_PATH' | 'SERVER_ERROR';
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/router/StatePreserver.d.ts
|
|
98
|
+
interface ScrollPosition {
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
element: string;
|
|
102
|
+
}
|
|
103
|
+
interface PreservedState {
|
|
104
|
+
scrollPositions: Map<string, ScrollPosition>;
|
|
105
|
+
formData: Map<string, FormData>;
|
|
106
|
+
focusedElement: string | null;
|
|
107
|
+
}
|
|
108
|
+
interface StatePreserverConfig {
|
|
109
|
+
maxHistorySize?: number;
|
|
110
|
+
scrollableSelector?: string;
|
|
111
|
+
}
|
|
112
|
+
declare class StatePreserver {
|
|
113
|
+
private stateHistory;
|
|
114
|
+
private routeAccessOrder;
|
|
115
|
+
private maxHistorySize;
|
|
116
|
+
private scrollableSelector;
|
|
117
|
+
constructor(config?: StatePreserverConfig);
|
|
118
|
+
captureState(route: string): PreservedState;
|
|
119
|
+
private captureScrollPositions;
|
|
120
|
+
private captureFormData;
|
|
121
|
+
private captureFocusedElement;
|
|
122
|
+
private storeState;
|
|
123
|
+
getHistorySize(): number;
|
|
124
|
+
hasState(route: string): boolean;
|
|
125
|
+
getState(route: string): PreservedState | undefined;
|
|
126
|
+
clearAll(): void;
|
|
127
|
+
clearState(route: string): void;
|
|
128
|
+
restoreState(route: string): boolean;
|
|
129
|
+
private restoreScrollPositions;
|
|
130
|
+
private restoreFormData;
|
|
131
|
+
private restoreFocus;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { type AppRouteEntry, type AppRouteManifest, type AppRouteMatch, ClientRouter, type ClientRouterProps, DefaultError, DefaultLoading, ErrorBoundary, type ErrorEntry, type ErrorProps, type GenerateMetadata, type GenerateStaticParams, HttpRuntimeClient, type LayoutEntry, LayoutErrorBoundary, type LayoutProps, type LoadingEntry, LoadingSpinner, type MetadataResult, type NavigationError, NavigationErrorHandler, type NavigationErrorHandlerOptions, NavigationErrorOverlay, type NavigationErrorOverlayProps, type NavigationErrorType, NotFound, type NotFoundEntry, type PageProps, type PreservedState, RouteInfoError, RouteInfoRequest, RouteInfoResponse, type RouteSegment, type RouteSegmentType, type RuntimeClient, type ScrollPosition, type ServerPropsResult, StatePreserver, type StatePreserverConfig, type StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createErrorBoundary, createHttpRuntimeClient, createLoadingBoundary, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, hasServerSideDataFetching };
|