akanjs 2.2.10 → 2.2.12
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/CHANGELOG.md +19 -0
- package/client/cookie.ts +3 -13
- package/client/router.ts +11 -3
- package/fetch/requestStorage.ts +106 -39
- package/package.json +1 -1
- package/server/akanServer.ts +39 -3
- package/server/console.ts +189 -0
- package/server/hmr/clientScript.ts +2 -8
- package/server/index.ts +1 -0
- package/server/rscClient.tsx +17 -7
- package/server/rscHttp.ts +7 -0
- package/server/rscWorker.tsx +38 -7
- package/server/rscWorkerHost.ts +9 -6
- package/server/ssrFromRscRenderer.tsx +115 -7
- package/server/ssrTypes.ts +1 -0
- package/server/webRouter.ts +39 -20
- package/service/ipcTypes.ts +1 -0
- package/types/client/router.d.ts +8 -2
- package/types/fetch/requestStorage.d.ts +31 -6
- package/types/server/akanServer.d.ts +13 -0
- package/types/server/console.d.ts +25 -0
- package/types/server/hmr/clientScript.d.ts +1 -1
- package/types/server/index.d.ts +1 -0
- package/types/server/rscClient.d.ts +3 -2
- package/types/server/rscHttp.d.ts +2 -0
- package/types/server/rscWorkerHost.d.ts +2 -0
- package/types/server/ssrFromRscRenderer.d.ts +13 -0
- package/types/server/ssrTypes.d.ts +1 -0
- package/types/server/webRouter.d.ts +3 -1
- package/types/service/ipcTypes.d.ts +1 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
type InlineRscChunk = [1, string] | [3, string];
|
|
1
2
|
declare global {
|
|
2
|
-
var __RSC_CHUNKS__:
|
|
3
|
+
var __RSC_CHUNKS__: InlineRscChunk[] | undefined;
|
|
3
4
|
var __RSC_CLOSED__: boolean | undefined;
|
|
4
|
-
var __RSC_PUSH__: ((
|
|
5
|
+
var __RSC_PUSH__: ((type: InlineRscChunk[0], data: string) => void) | undefined;
|
|
5
6
|
var __RSC_CLOSE__: (() => void) | undefined;
|
|
6
7
|
var __AKAN_RSC_NAVIGATE__: ((href: string, options?: {
|
|
7
8
|
replace?: boolean;
|
|
@@ -4,6 +4,7 @@ import type { AkanMetricsReport } from "akanjs/service";
|
|
|
4
4
|
import type { ClientManifest } from "./artifact.d.ts";
|
|
5
5
|
import type { BaseBuildArtifact, CssAsset } from "./types.d.ts";
|
|
6
6
|
export type RscRedirectMethod = "replace" | "push";
|
|
7
|
+
export type RscRedirectStatus = 303 | 307 | 308;
|
|
7
8
|
export type RscRenderResult = {
|
|
8
9
|
type: "stream";
|
|
9
10
|
stream: ReadableStream<Uint8Array>;
|
|
@@ -13,6 +14,7 @@ export type RscRenderResult = {
|
|
|
13
14
|
type: "redirect";
|
|
14
15
|
location: string;
|
|
15
16
|
method: RscRedirectMethod;
|
|
17
|
+
status: RscRedirectStatus;
|
|
16
18
|
} | {
|
|
17
19
|
type: "not-found";
|
|
18
20
|
};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { SsrChunkRegistryStats, SsrFromRscInput } from "./ssrTypes.d.ts";
|
|
2
|
+
export declare class SsrChunkRegistry<T> {
|
|
3
|
+
#private;
|
|
4
|
+
readonly maxEntries: number;
|
|
5
|
+
constructor(maxEntries?: number);
|
|
6
|
+
get size(): number;
|
|
7
|
+
get evictionCount(): number;
|
|
8
|
+
get(key: string): T | undefined;
|
|
9
|
+
set(keys: string[], value: T): void;
|
|
10
|
+
}
|
|
11
|
+
export type InlineRscChunk = readonly [1, string] | readonly [3, string];
|
|
12
|
+
export declare function encodeInlineRscChunk(chunk: Uint8Array): InlineRscChunk;
|
|
13
|
+
export declare function htmlEscapeJsonString(value: string): string;
|
|
14
|
+
export declare function createInlineRscScript(chunk: Uint8Array): string;
|
|
2
15
|
export declare class SsrFromRscRenderer {
|
|
3
16
|
#private;
|
|
4
17
|
static getChunkRegistryStats(): SsrChunkRegistryStats;
|
|
@@ -2,8 +2,10 @@ import { type AkanI18nConfig } from "akanjs/common";
|
|
|
2
2
|
import type { AkanMetricsReport } from "akanjs/service";
|
|
3
3
|
import { type BuilderRpc, type RouteSeedIndex } from "./artifact.d.ts";
|
|
4
4
|
import type { HmrWsData, HmrWsHub } from "./hmr/wsHub.d.ts";
|
|
5
|
-
import { RscWorker } from "./rscWorkerHost.d.ts";
|
|
5
|
+
import { type RscRedirectMethod, type RscRedirectStatus, RscWorker } from "./rscWorkerHost.d.ts";
|
|
6
6
|
import type { BaseBuildArtifact, HttpRoutes, RenderState } from "./types.d.ts";
|
|
7
|
+
export declare function createRscRedirectResponse(location: string, method: RscRedirectMethod, status?: RscRedirectStatus): Response;
|
|
8
|
+
export declare function createRscStreamResponse(stream: BodyInit, status?: number): Response;
|
|
7
9
|
export declare function normalizeRscTargetUrlForHostBasePath(targetUrl: URL, options: {
|
|
8
10
|
basePath: string | null;
|
|
9
11
|
basePaths?: readonly string[];
|
|
@@ -99,6 +99,7 @@ export interface AkanMetricsReport {
|
|
|
99
99
|
ssrChunkRegistrySize?: number;
|
|
100
100
|
ssrChunkLoadCount?: number;
|
|
101
101
|
ssrChunkCacheHitCount?: number;
|
|
102
|
+
ssrChunkEvictionCount?: number;
|
|
102
103
|
httpFullSsrCount?: number;
|
|
103
104
|
httpRscNavigationCount?: number;
|
|
104
105
|
httpStaticAssetCount?: number;
|