rari 0.7.1 → 0.7.3
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/client.d.mts +3 -2
- package/dist/client.mjs +23 -11
- package/dist/image/index.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{runtime-client-CZzaWbFc.mjs → runtime-client-B7wmvKD3.mjs} +2 -1
- package/dist/{runtime-client-BNivvhrD.d.mts → runtime-client-C2xNyif4.d.mts} +2 -1
- package/dist/{vite-h7H6RaMX.d.mts → vite-O3u7f8Q_.d.mts} +1 -1
- package/dist/vite.d.mts +2 -2
- package/dist/vite.mjs +1 -1
- package/package.json +8 -8
- package/src/router/ClientRouter.tsx +29 -10
- package/src/runtime/AppRouterProvider.tsx +2 -1
- package/src/runtime/LoadingErrorBoundary.tsx +1 -1
- package/src/runtime/entry-client.js +2 -1
- package/src/runtime/react-server-dom-rari-client.js +1 -1
- package/src/runtime-client.ts +2 -1
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, T as MetadataResult, _ as GenerateStaticParams, a as LoadingSpinner, b as LoadingEntry, c as createErrorBoundary, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, n as DefaultLoading, o as NotFound, p as AppRouteMatch, r as ErrorBoundary, s as RuntimeClient, t as DefaultError, u as createLoadingBoundary, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry } from "./runtime-client-
|
|
2
|
-
import
|
|
1
|
+
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, T as MetadataResult, _ as GenerateStaticParams, a as LoadingSpinner, b as LoadingEntry, c as createErrorBoundary, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, n as DefaultLoading, o as NotFound, p as AppRouteMatch, r as ErrorBoundary, s as RuntimeClient, t as DefaultError, u as createLoadingBoundary, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry } from "./runtime-client-C2xNyif4.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Component, ErrorInfo, ReactNode } from "react";
|
|
3
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
5
|
|
|
5
6
|
//#region src/router/ClientRouter.d.ts
|
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as LoadingSpinner, c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, l as createLoadingBoundary, m as extractServerPropsWithCache, n as DefaultLoading, o as NotFound, p as extractServerProps, r as ErrorBoundary, s as createErrorBoundary, t as DefaultError, u as clearPropsCache } from "./runtime-client-
|
|
2
|
-
import
|
|
1
|
+
import { a as LoadingSpinner, c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, l as createLoadingBoundary, m as extractServerPropsWithCache, n as DefaultLoading, o as NotFound, p as extractServerProps, r as ErrorBoundary, s as createErrorBoundary, t as DefaultError, u as clearPropsCache } from "./runtime-client-B7wmvKD3.mjs";
|
|
2
|
+
import { Component, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/router/debounce.ts
|
|
@@ -889,8 +889,20 @@ function ClientRouter({ children, initialRoute }) {
|
|
|
889
889
|
signal: abortController.signal
|
|
890
890
|
});
|
|
891
891
|
if (!response.ok) throw new Error(`Failed to fetch: ${response.status}`);
|
|
892
|
+
const finalPath = new URL(response.url).pathname;
|
|
893
|
+
const actualTargetPath = finalPath !== targetPath ? finalPath : targetPath;
|
|
894
|
+
if (finalPath !== targetPath) window.history.replaceState({
|
|
895
|
+
route: finalPath,
|
|
896
|
+
navigationId,
|
|
897
|
+
scrollPosition: {
|
|
898
|
+
x: window.scrollX,
|
|
899
|
+
y: window.scrollY
|
|
900
|
+
},
|
|
901
|
+
timestamp: Date.now(),
|
|
902
|
+
key: options.historyKey || generateHistoryKey()
|
|
903
|
+
}, "", finalPath);
|
|
892
904
|
if (abortController.signal.aborted) {
|
|
893
|
-
cleanupAbortedNavigation(
|
|
905
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId);
|
|
894
906
|
return;
|
|
895
907
|
}
|
|
896
908
|
try {
|
|
@@ -910,7 +922,7 @@ function ClientRouter({ children, initialRoute }) {
|
|
|
910
922
|
if (done) break;
|
|
911
923
|
if (abortController.signal.aborted) {
|
|
912
924
|
await reader.cancel();
|
|
913
|
-
cleanupAbortedNavigation(
|
|
925
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId);
|
|
914
926
|
return;
|
|
915
927
|
}
|
|
916
928
|
buffer += decoder.decode(value, { stream: true });
|
|
@@ -921,7 +933,7 @@ function ClientRouter({ children, initialRoute }) {
|
|
|
921
933
|
if (buffer.trim()) window.dispatchEvent(new CustomEvent("rari:rsc-row", { detail: { rscRow: buffer } }));
|
|
922
934
|
window.dispatchEvent(new CustomEvent("rari:navigate", { detail: {
|
|
923
935
|
from: fromRoute,
|
|
924
|
-
to:
|
|
936
|
+
to: actualTargetPath,
|
|
925
937
|
navigationId,
|
|
926
938
|
options,
|
|
927
939
|
routeInfo,
|
|
@@ -936,7 +948,7 @@ function ClientRouter({ children, initialRoute }) {
|
|
|
936
948
|
const rscWireFormat = await response.text();
|
|
937
949
|
window.dispatchEvent(new CustomEvent("rari:navigate", { detail: {
|
|
938
950
|
from: fromRoute,
|
|
939
|
-
to:
|
|
951
|
+
to: actualTargetPath,
|
|
940
952
|
navigationId,
|
|
941
953
|
options,
|
|
942
954
|
routeInfo,
|
|
@@ -945,19 +957,19 @@ function ClientRouter({ children, initialRoute }) {
|
|
|
945
957
|
} }));
|
|
946
958
|
}
|
|
947
959
|
if (abortController.signal.aborted) {
|
|
948
|
-
cleanupAbortedNavigation(
|
|
960
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId);
|
|
949
961
|
return;
|
|
950
962
|
}
|
|
951
963
|
if (isMountedRef.current) {
|
|
952
|
-
currentRouteRef.current =
|
|
964
|
+
currentRouteRef.current = actualTargetPath;
|
|
953
965
|
setNavigationState((prev) => ({
|
|
954
966
|
...prev,
|
|
955
|
-
currentRoute:
|
|
967
|
+
currentRoute: actualTargetPath,
|
|
956
968
|
error: null
|
|
957
969
|
}));
|
|
958
|
-
errorHandlerRef.current.resetRetry(
|
|
970
|
+
errorHandlerRef.current.resetRetry(actualTargetPath);
|
|
959
971
|
if (options.historyKey) requestAnimationFrame(() => {
|
|
960
|
-
statePreserverRef.current.restoreState(
|
|
972
|
+
statePreserverRef.current.restoreState(actualTargetPath);
|
|
961
973
|
});
|
|
962
974
|
}
|
|
963
975
|
pendingNavigationsRef.current.delete(targetPath);
|
package/dist/image/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/image/constants.d.ts
|
|
4
4
|
type ImageFormat = 'avif' | 'webp';
|
|
@@ -61,6 +61,6 @@ declare function Image({
|
|
|
61
61
|
loader,
|
|
62
62
|
overrideSrc,
|
|
63
63
|
decoding
|
|
64
|
-
}: ImageProps):
|
|
64
|
+
}: ImageProps): react_jsx_runtime1.JSX.Element;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { DEFAULT_DEVICE_SIZES, DEFAULT_FORMATS, DEFAULT_IMAGE_SIZES, DEFAULT_MAX_CACHE_SIZE, DEFAULT_MINIMUM_CACHE_TTL, DEFAULT_QUALITY_LEVELS, Image, type ImageProps, type StaticImageData };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, S as PageProps, T as MetadataResult, _ as GenerateStaticParams, b as LoadingEntry, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, p as AppRouteMatch, s as RuntimeClient, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry, y as LayoutProps } from "./runtime-client-
|
|
2
|
-
import { C as ApiRouteHandlers, D as RobotsRule, E as Robots, S as ApiResponse, T as RouteHandler, _ as ProxyResult, a as rari, b as RequestCookies, c as ProxyPluginOptions, d as RariRequest, f as CookieOptions, g as ProxyModule, h as ProxyMatcher, i as defineRariOptions, l as rariProxy, m as ProxyFunction, n as Response, o as rariRouter, p as ProxyConfig, r as defineRariConfig, s as generateAppRouteManifest, t as Request, u as RariResponse, v as RariFetchEvent, w as RouteContext, x as ResponseCookies, y as RariURL } from "./vite-
|
|
1
|
+
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, S as PageProps, T as MetadataResult, _ as GenerateStaticParams, b as LoadingEntry, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, p as AppRouteMatch, s as RuntimeClient, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry, y as LayoutProps } from "./runtime-client-C2xNyif4.mjs";
|
|
2
|
+
import { C as ApiRouteHandlers, D as RobotsRule, E as Robots, S as ApiResponse, T as RouteHandler, _ as ProxyResult, a as rari, b as RequestCookies, c as ProxyPluginOptions, d as RariRequest, f as CookieOptions, g as ProxyModule, h as ProxyMatcher, i as defineRariOptions, l as rariProxy, m as ProxyFunction, n as Response, o as rariRouter, p as ProxyConfig, r as defineRariConfig, s as generateAppRouteManifest, t as Request, u as RariResponse, v as RariFetchEvent, w as RouteContext, x as ResponseCookies, y as RariURL } from "./vite-O3u7f8Q_.mjs";
|
|
3
3
|
import "./runtime-executor-NBcG4boA.mjs";
|
|
4
4
|
export { ApiResponse, ApiRouteHandlers, AppRouteEntry, AppRouteManifest, AppRouteMatch, CookieOptions, ErrorEntry, ErrorProps, GenerateMetadata, GenerateStaticParams, HttpRuntimeClient, LayoutEntry, LayoutProps, LoadingEntry, MetadataResult, NotFoundEntry, PageProps, ProxyConfig, ProxyFunction, ProxyMatcher, ProxyModule, ProxyPluginOptions, ProxyResult, RariFetchEvent, RariRequest, RariResponse, RariURL, Request, RequestCookies, Response, ResponseCookies, type Robots, type RobotsRule, RouteContext, RouteHandler, RouteSegment, RouteSegmentType, RuntimeClient, ServerPropsResult, StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, rari, rariProxy, rariRouter };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as rariProxy, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, s as ApiResponse, t as defineRariConfig } from "./vite-DJhQmKAk.mjs";
|
|
2
2
|
import { t as RariRequest } from "./RariRequest-DM6Q4JDB.mjs";
|
|
3
|
-
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-
|
|
3
|
+
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-B7wmvKD3.mjs";
|
|
4
4
|
import { t as generateAppRouteManifest } from "./routes-B_KAzmbj.mjs";
|
|
5
5
|
import "./image-CL9iVW32.mjs";
|
|
6
6
|
import "./server-build-DadtZ6wc.mjs";
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, S as PageProps, T as MetadataResult, _ as GenerateStaticParams, b as LoadingEntry, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, p as AppRouteMatch, s as RuntimeClient, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry, y as LayoutProps } from "./runtime-client-
|
|
2
|
-
import { C as ApiRouteHandlers, D as RobotsRule, E as Robots, S as ApiResponse, T as RouteHandler, _ as ProxyResult, a as rari, b as RequestCookies, c as ProxyPluginOptions, d as RariRequest, f as CookieOptions, g as ProxyModule, h as ProxyMatcher, i as defineRariOptions, l as rariProxy, m as ProxyFunction, n as Response, o as rariRouter, p as ProxyConfig, r as defineRariConfig, s as generateAppRouteManifest, t as Request, u as RariResponse, v as RariFetchEvent, w as RouteContext, x as ResponseCookies, y as RariURL } from "./vite-
|
|
1
|
+
import { A as extractMetadata, C as RouteSegment, D as StaticParamsResult, E as ServerPropsResult, M as extractServerPropsWithCache, N as extractStaticParams, O as clearPropsCache, P as hasServerSideDataFetching, S as PageProps, T as MetadataResult, _ as GenerateStaticParams, b as LoadingEntry, d as AppRouteEntry, f as AppRouteManifest, g as GenerateMetadata, h as ErrorProps, i as HttpRuntimeClient, j as extractServerProps, k as clearPropsCacheForComponent, l as createHttpRuntimeClient, m as ErrorEntry, p as AppRouteMatch, s as RuntimeClient, v as LayoutEntry, w as RouteSegmentType, x as NotFoundEntry, y as LayoutProps } from "./runtime-client-C2xNyif4.mjs";
|
|
2
|
+
import { C as ApiRouteHandlers, D as RobotsRule, E as Robots, S as ApiResponse, T as RouteHandler, _ as ProxyResult, a as rari, b as RequestCookies, c as ProxyPluginOptions, d as RariRequest, f as CookieOptions, g as ProxyModule, h as ProxyMatcher, i as defineRariOptions, l as rariProxy, m as ProxyFunction, n as Response, o as rariRouter, p as ProxyConfig, r as defineRariConfig, s as generateAppRouteManifest, t as Request, u as RariResponse, v as RariFetchEvent, w as RouteContext, x as ResponseCookies, y as RariURL } from "./vite-O3u7f8Q_.mjs";
|
|
3
3
|
import "./runtime-executor-NBcG4boA.mjs";
|
|
4
4
|
export { ApiResponse, ApiRouteHandlers, AppRouteEntry, AppRouteManifest, AppRouteMatch, CookieOptions, ErrorEntry, ErrorProps, GenerateMetadata, GenerateStaticParams, HttpRuntimeClient, LayoutEntry, LayoutProps, LoadingEntry, MetadataResult, NotFoundEntry, PageProps, ProxyConfig, ProxyFunction, ProxyMatcher, ProxyModule, ProxyPluginOptions, ProxyResult, RariFetchEvent, RariRequest, RariResponse, RariURL, Request, RequestCookies, Response, ResponseCookies, Robots, RobotsRule, RouteContext, RouteHandler, RouteSegment, RouteSegmentType, RuntimeClient, ServerPropsResult, StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, rari, rariProxy, rariRouter };
|
package/dist/vite.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as rariProxy, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, s as ApiResponse, t as defineRariConfig } from "./vite-DJhQmKAk.mjs";
|
|
2
2
|
import { t as RariRequest } from "./RariRequest-DM6Q4JDB.mjs";
|
|
3
|
-
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-
|
|
3
|
+
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-B7wmvKD3.mjs";
|
|
4
4
|
import { t as generateAppRouteManifest } from "./routes-B_KAzmbj.mjs";
|
|
5
5
|
import "./image-CL9iVW32.mjs";
|
|
6
6
|
import "./server-build-DadtZ6wc.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (Rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -93,16 +93,16 @@
|
|
|
93
93
|
"picocolors": "^1.1.1"
|
|
94
94
|
},
|
|
95
95
|
"optionalDependencies": {
|
|
96
|
-
"rari-darwin-arm64": "0.7.
|
|
97
|
-
"rari-darwin-x64": "0.7.
|
|
98
|
-
"rari-linux-arm64": "0.7.
|
|
99
|
-
"rari-linux-x64": "0.7.
|
|
100
|
-
"rari-win32-x64": "0.7.
|
|
96
|
+
"rari-darwin-arm64": "0.7.3",
|
|
97
|
+
"rari-darwin-x64": "0.7.3",
|
|
98
|
+
"rari-linux-arm64": "0.7.3",
|
|
99
|
+
"rari-linux-x64": "0.7.3",
|
|
100
|
+
"rari-win32-x64": "0.7.3"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@types/node": "^25.0.
|
|
103
|
+
"@types/node": "^25.0.8",
|
|
104
104
|
"@types/react": "^19.2.8",
|
|
105
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
105
|
+
"@typescript/native-preview": "^7.0.0-dev.20260114.1",
|
|
106
106
|
"chokidar": "^5.0.0",
|
|
107
107
|
"eslint": "^9.39.2",
|
|
108
108
|
"oxlint": "^1.39.0",
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import type { NavigationError } from './navigation-error-handler'
|
|
4
4
|
import type { NavigationOptions } from './navigation-types'
|
|
5
5
|
import type { RouteInfoResponse } from './route-info-types'
|
|
6
|
-
import
|
|
6
|
+
import * as React from 'react'
|
|
7
|
+
import { useEffect, useRef, useState } from 'react'
|
|
7
8
|
import { debounce } from './debounce'
|
|
8
9
|
import { NavigationErrorHandler } from './navigation-error-handler'
|
|
9
10
|
import { extractPathname, isExternalUrl, normalizePath } from './navigation-utils'
|
|
@@ -353,8 +354,26 @@ export function ClientRouter({ children, initialRoute }: ClientRouterProps) {
|
|
|
353
354
|
if (!response.ok)
|
|
354
355
|
throw new Error(`Failed to fetch: ${response.status}`)
|
|
355
356
|
|
|
357
|
+
const finalUrl = new URL(response.url)
|
|
358
|
+
const finalPath = finalUrl.pathname
|
|
359
|
+
const actualTargetPath = finalPath !== targetPath ? finalPath : targetPath
|
|
360
|
+
|
|
361
|
+
if (finalPath !== targetPath) {
|
|
362
|
+
window.history.replaceState(
|
|
363
|
+
{
|
|
364
|
+
route: finalPath,
|
|
365
|
+
navigationId,
|
|
366
|
+
scrollPosition: { x: window.scrollX, y: window.scrollY },
|
|
367
|
+
timestamp: Date.now(),
|
|
368
|
+
key: options.historyKey || generateHistoryKey(),
|
|
369
|
+
},
|
|
370
|
+
'',
|
|
371
|
+
finalPath,
|
|
372
|
+
)
|
|
373
|
+
}
|
|
374
|
+
|
|
356
375
|
if (abortController.signal.aborted) {
|
|
357
|
-
cleanupAbortedNavigation(
|
|
376
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId)
|
|
358
377
|
return
|
|
359
378
|
}
|
|
360
379
|
|
|
@@ -385,7 +404,7 @@ export function ClientRouter({ children, initialRoute }: ClientRouterProps) {
|
|
|
385
404
|
|
|
386
405
|
if (abortController.signal.aborted) {
|
|
387
406
|
await reader.cancel()
|
|
388
|
-
cleanupAbortedNavigation(
|
|
407
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId)
|
|
389
408
|
return
|
|
390
409
|
}
|
|
391
410
|
|
|
@@ -412,7 +431,7 @@ export function ClientRouter({ children, initialRoute }: ClientRouterProps) {
|
|
|
412
431
|
window.dispatchEvent(new CustomEvent('rari:navigate', {
|
|
413
432
|
detail: {
|
|
414
433
|
from: fromRoute,
|
|
415
|
-
to:
|
|
434
|
+
to: actualTargetPath,
|
|
416
435
|
navigationId,
|
|
417
436
|
options,
|
|
418
437
|
routeInfo,
|
|
@@ -432,7 +451,7 @@ export function ClientRouter({ children, initialRoute }: ClientRouterProps) {
|
|
|
432
451
|
window.dispatchEvent(new CustomEvent('rari:navigate', {
|
|
433
452
|
detail: {
|
|
434
453
|
from: fromRoute,
|
|
435
|
-
to:
|
|
454
|
+
to: actualTargetPath,
|
|
436
455
|
navigationId,
|
|
437
456
|
options,
|
|
438
457
|
routeInfo,
|
|
@@ -443,24 +462,24 @@ export function ClientRouter({ children, initialRoute }: ClientRouterProps) {
|
|
|
443
462
|
}
|
|
444
463
|
|
|
445
464
|
if (abortController.signal.aborted) {
|
|
446
|
-
cleanupAbortedNavigation(
|
|
465
|
+
cleanupAbortedNavigation(actualTargetPath, navigationId)
|
|
447
466
|
return
|
|
448
467
|
}
|
|
449
468
|
|
|
450
469
|
if (isMountedRef.current) {
|
|
451
|
-
currentRouteRef.current =
|
|
470
|
+
currentRouteRef.current = actualTargetPath
|
|
452
471
|
|
|
453
472
|
setNavigationState(prev => ({
|
|
454
473
|
...prev,
|
|
455
|
-
currentRoute:
|
|
474
|
+
currentRoute: actualTargetPath,
|
|
456
475
|
error: null,
|
|
457
476
|
}))
|
|
458
477
|
|
|
459
|
-
errorHandlerRef.current.resetRetry(
|
|
478
|
+
errorHandlerRef.current.resetRetry(actualTargetPath)
|
|
460
479
|
|
|
461
480
|
if (options.historyKey) {
|
|
462
481
|
requestAnimationFrame(() => {
|
|
463
|
-
statePreserverRef.current.restoreState(
|
|
482
|
+
statePreserverRef.current.restoreState(actualTargetPath)
|
|
464
483
|
})
|
|
465
484
|
}
|
|
466
485
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Suspense, useEffect, useRef, useState, useTransition } from 'react'
|
|
4
5
|
|
|
5
6
|
interface AppRouterProviderProps {
|
|
6
7
|
children: React.ReactNode
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import { ClientRouter } from 'rari/client'
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Suspense } from 'react'
|
|
4
5
|
import { createRoot } from 'react-dom/client'
|
|
5
6
|
import { AppRouterProvider } from 'virtual:app-router-provider'
|
|
6
7
|
import { createFromReadableStream } from 'virtual:react-server-dom-rari-client'
|
package/src/runtime-client.ts
CHANGED