olova 2.0.54 → 2.0.56
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/README.md +34 -283
- package/dist/chunk-23UAGQ6N.js +2208 -0
- package/dist/chunk-23UAGQ6N.js.map +1 -0
- package/dist/chunk-D7SIC5TC.js +367 -0
- package/dist/chunk-D7SIC5TC.js.map +1 -0
- package/dist/entry-server.cjs +2341 -0
- package/dist/entry-server.cjs.map +1 -0
- package/dist/entry-server.js +114 -0
- package/dist/entry-server.js.map +1 -0
- package/dist/entry-worker.cjs +2354 -0
- package/dist/entry-worker.cjs.map +1 -0
- package/dist/entry-worker.js +126 -0
- package/dist/entry-worker.js.map +1 -0
- package/dist/main.cjs +18 -0
- package/dist/main.cjs.map +1 -0
- package/dist/main.js +16 -0
- package/dist/main.js.map +1 -0
- package/dist/olova.cjs +1684 -0
- package/dist/olova.cjs.map +1 -0
- package/dist/olova.d.cts +72 -0
- package/dist/olova.d.ts +72 -0
- package/dist/olova.js +1325 -0
- package/dist/olova.js.map +1 -0
- package/dist/performance.cjs +386 -0
- package/dist/performance.cjs.map +1 -0
- package/dist/performance.js +3 -0
- package/dist/performance.js.map +1 -0
- package/dist/router.cjs +646 -0
- package/dist/router.cjs.map +1 -0
- package/dist/router.d.cts +113 -0
- package/dist/router.d.ts +113 -0
- package/dist/router.js +632 -0
- package/dist/router.js.map +1 -0
- package/main.tsx +76 -0
- package/olova.ts +619 -0
- package/package.json +37 -55
- package/src/entry-server.tsx +165 -0
- package/src/entry-worker.tsx +201 -0
- package/src/generator/index.ts +409 -0
- package/src/hydration/flight.ts +320 -0
- package/src/hydration/index.ts +12 -0
- package/src/hydration/types.ts +225 -0
- package/src/logger.ts +182 -0
- package/src/main.tsx +24 -0
- package/src/performance.ts +488 -0
- package/src/plugin/index.ts +204 -0
- package/src/router/ErrorBoundary.tsx +145 -0
- package/src/router/Link.tsx +117 -0
- package/src/router/OlovaRouter.tsx +354 -0
- package/src/router/Outlet.tsx +8 -0
- package/src/router/context.ts +117 -0
- package/src/router/index.ts +29 -0
- package/src/router/matching.ts +63 -0
- package/src/router/router.tsx +23 -0
- package/src/router/search-params.ts +29 -0
- package/src/scanner/index.ts +116 -0
- package/src/types/index.ts +191 -0
- package/src/utils/export.ts +85 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/naming.ts +54 -0
- package/src/utils/path.ts +45 -0
- package/tsup.config.ts +35 -0
- package/dist/client-BBLXpllK.d.ts +0 -487
- package/dist/client-C0av_vTZ.d.cts +0 -487
- package/dist/client.cjs +0 -850
- package/dist/client.cjs.map +0 -1
- package/dist/client.d.cts +0 -5
- package/dist/client.d.ts +0 -5
- package/dist/client.js +0 -816
- package/dist/client.js.map +0 -1
- package/dist/image.cjs +0 -25
- package/dist/image.cjs.map +0 -1
- package/dist/image.d.cts +0 -1
- package/dist/image.d.ts +0 -1
- package/dist/image.js +0 -3
- package/dist/image.js.map +0 -1
- package/dist/index.cjs +0 -907
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -31
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -868
- package/dist/index.js.map +0 -1
- package/dist/plugin/index.cjs +0 -1550
- package/dist/plugin/index.cjs.map +0 -1
- package/dist/plugin/index.d.cts +0 -131
- package/dist/plugin/index.d.ts +0 -131
- package/dist/plugin/index.js +0 -1490
- package/dist/plugin/index.js.map +0 -1
- package/dist/serialization-xKcOESDh.d.cts +0 -122
- package/dist/serialization-xKcOESDh.d.ts +0 -122
- package/dist/server.cjs +0 -547
- package/dist/server.cjs.map +0 -1
- package/dist/server.d.cts +0 -148
- package/dist/server.d.ts +0 -148
- package/dist/server.js +0 -493
- package/dist/server.js.map +0 -1
package/dist/server.d.cts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Writable } from 'stream';
|
|
3
|
-
import { e as FlightSEO, f as FlightMeta, F as FlightPayload, H as HydrationHint, h as FlightContext } from './serialization-xKcOESDh.cjs';
|
|
4
|
-
export { b as FlightChunk, a as FlightNode, i as generateFlightScript } from './serialization-xKcOESDh.cjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* For SSR/SSG - extract head elements to string
|
|
8
|
-
*/
|
|
9
|
-
declare function renderHeadToString(children: React.ReactNode): {
|
|
10
|
-
title: string;
|
|
11
|
-
metas: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Serialize data for injection into HTML
|
|
16
|
-
*/
|
|
17
|
-
declare function serializePageData(data: any): string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Reset node ID counter
|
|
21
|
-
*/
|
|
22
|
-
declare function resetFlightContext(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Create an empty Flight payload
|
|
25
|
-
*/
|
|
26
|
-
declare function createFlightPayload(route: string, options?: {
|
|
27
|
-
seo?: FlightSEO;
|
|
28
|
-
meta?: FlightMeta;
|
|
29
|
-
buildId?: string;
|
|
30
|
-
}): FlightPayload;
|
|
31
|
-
/**
|
|
32
|
-
* Add a node to the Flight payload
|
|
33
|
-
*/
|
|
34
|
-
declare function addFlightNode(payload: FlightPayload, type: string, props: Record<string, any>, options?: {
|
|
35
|
-
hydrate?: boolean;
|
|
36
|
-
suspense?: boolean;
|
|
37
|
-
children?: string[];
|
|
38
|
-
}): string;
|
|
39
|
-
/**
|
|
40
|
-
* Add component data to payload
|
|
41
|
-
*/
|
|
42
|
-
declare function addFlightData(payload: FlightPayload, key: string, data: any): void;
|
|
43
|
-
/**
|
|
44
|
-
* Add a streaming chunk
|
|
45
|
-
*/
|
|
46
|
-
declare function addFlightChunk(payload: FlightPayload, id: string, html: string, data?: any): void;
|
|
47
|
-
/**
|
|
48
|
-
* Add hydration hint
|
|
49
|
-
*/
|
|
50
|
-
declare function addHydrationHint(payload: FlightPayload, hint: HydrationHint): void;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Set current Flight context (server-side)
|
|
54
|
-
*/
|
|
55
|
-
declare function setFlightContext(context: FlightContext): void;
|
|
56
|
-
/**
|
|
57
|
-
* Clear Flight context
|
|
58
|
-
*/
|
|
59
|
-
declare function clearFlightContext(): void;
|
|
60
|
-
|
|
61
|
-
interface StreamingOptions {
|
|
62
|
-
bootstrapScripts?: string[];
|
|
63
|
-
bootstrapModules?: string[];
|
|
64
|
-
onShellReady?: () => void;
|
|
65
|
-
onShellError?: (error: Error) => void;
|
|
66
|
-
onAllReady?: () => void;
|
|
67
|
-
onError?: (error: Error) => void;
|
|
68
|
-
signal?: AbortSignal;
|
|
69
|
-
timeout?: number;
|
|
70
|
-
progressiveHydration?: boolean;
|
|
71
|
-
}
|
|
72
|
-
interface StreamingResult {
|
|
73
|
-
pipe: (destination: Writable) => Writable;
|
|
74
|
-
abort: () => void;
|
|
75
|
-
payload: FlightPayload;
|
|
76
|
-
}
|
|
77
|
-
interface RenderToStringResult {
|
|
78
|
-
html: string;
|
|
79
|
-
payload: FlightPayload;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Render React tree to a streaming response
|
|
83
|
-
*/
|
|
84
|
-
declare function renderToStream(element: React.ReactElement, route: string, options?: StreamingOptions): StreamingResult;
|
|
85
|
-
/**
|
|
86
|
-
* Render to string with Flight payload
|
|
87
|
-
*/
|
|
88
|
-
declare function renderToStringWithFlight(element: React.ReactElement, route: string): RenderToStringResult;
|
|
89
|
-
|
|
90
|
-
interface HtmlShellOptions {
|
|
91
|
-
title?: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
head?: string;
|
|
94
|
-
/** Array of stylesheet URLs to include */
|
|
95
|
-
styles?: string[];
|
|
96
|
-
/** Critical CSS to inline in the head for above-the-fold content */
|
|
97
|
-
criticalCss?: string;
|
|
98
|
-
/** Global CSS file URLs (injected before other styles) */
|
|
99
|
-
globalCss?: string[];
|
|
100
|
-
/** CSS Module file URLs */
|
|
101
|
-
cssModules?: string[];
|
|
102
|
-
scripts?: string[];
|
|
103
|
-
flightPayload?: FlightPayload;
|
|
104
|
-
pageData?: any;
|
|
105
|
-
lang?: string;
|
|
106
|
-
bodyClass?: string;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Generate HTML shell
|
|
110
|
-
*/
|
|
111
|
-
declare function generateHtmlShell(options?: HtmlShellOptions): {
|
|
112
|
-
head: string;
|
|
113
|
-
tail: string;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Generate complete HTML with content
|
|
117
|
-
*/
|
|
118
|
-
declare function generateCompleteHtml(content: string, options?: HtmlShellOptions): string;
|
|
119
|
-
|
|
120
|
-
interface StreamingResponseOptions extends StreamingOptions {
|
|
121
|
-
status?: number;
|
|
122
|
-
headers?: Record<string, string>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Create a Transform stream that injects Flight chunks
|
|
126
|
-
*/
|
|
127
|
-
declare function createFlightInjector(payload: FlightPayload): {
|
|
128
|
-
addChunk(id: string, html: string, data?: any): void;
|
|
129
|
-
flush(): string;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Create a Suspense fallback placeholder
|
|
133
|
-
*/
|
|
134
|
-
declare function createSuspensePlaceholder(id: string): string;
|
|
135
|
-
/**
|
|
136
|
-
* Create resolved Suspense content
|
|
137
|
-
*/
|
|
138
|
-
declare function createSuspenseResolved(id: string, html: string): string;
|
|
139
|
-
/**
|
|
140
|
-
* Check if we're in a streaming context
|
|
141
|
-
*/
|
|
142
|
-
declare function isStreaming(): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Create headers for streaming response
|
|
145
|
-
*/
|
|
146
|
-
declare function createStreamingHeaders(options?: StreamingResponseOptions): Record<string, string>;
|
|
147
|
-
|
|
148
|
-
export { FlightContext, FlightPayload, type HtmlShellOptions, HydrationHint, type StreamingOptions, type StreamingResult, addFlightChunk, addFlightData, addFlightNode, addHydrationHint, clearFlightContext, createFlightInjector, createFlightPayload, createStreamingHeaders, createSuspensePlaceholder, createSuspenseResolved, generateCompleteHtml, generateHtmlShell, isStreaming, renderHeadToString, renderToStream, renderToStringWithFlight, resetFlightContext, serializePageData, setFlightContext };
|
package/dist/server.d.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Writable } from 'stream';
|
|
3
|
-
import { e as FlightSEO, f as FlightMeta, F as FlightPayload, H as HydrationHint, h as FlightContext } from './serialization-xKcOESDh.js';
|
|
4
|
-
export { b as FlightChunk, a as FlightNode, i as generateFlightScript } from './serialization-xKcOESDh.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* For SSR/SSG - extract head elements to string
|
|
8
|
-
*/
|
|
9
|
-
declare function renderHeadToString(children: React.ReactNode): {
|
|
10
|
-
title: string;
|
|
11
|
-
metas: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Serialize data for injection into HTML
|
|
16
|
-
*/
|
|
17
|
-
declare function serializePageData(data: any): string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Reset node ID counter
|
|
21
|
-
*/
|
|
22
|
-
declare function resetFlightContext(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Create an empty Flight payload
|
|
25
|
-
*/
|
|
26
|
-
declare function createFlightPayload(route: string, options?: {
|
|
27
|
-
seo?: FlightSEO;
|
|
28
|
-
meta?: FlightMeta;
|
|
29
|
-
buildId?: string;
|
|
30
|
-
}): FlightPayload;
|
|
31
|
-
/**
|
|
32
|
-
* Add a node to the Flight payload
|
|
33
|
-
*/
|
|
34
|
-
declare function addFlightNode(payload: FlightPayload, type: string, props: Record<string, any>, options?: {
|
|
35
|
-
hydrate?: boolean;
|
|
36
|
-
suspense?: boolean;
|
|
37
|
-
children?: string[];
|
|
38
|
-
}): string;
|
|
39
|
-
/**
|
|
40
|
-
* Add component data to payload
|
|
41
|
-
*/
|
|
42
|
-
declare function addFlightData(payload: FlightPayload, key: string, data: any): void;
|
|
43
|
-
/**
|
|
44
|
-
* Add a streaming chunk
|
|
45
|
-
*/
|
|
46
|
-
declare function addFlightChunk(payload: FlightPayload, id: string, html: string, data?: any): void;
|
|
47
|
-
/**
|
|
48
|
-
* Add hydration hint
|
|
49
|
-
*/
|
|
50
|
-
declare function addHydrationHint(payload: FlightPayload, hint: HydrationHint): void;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Set current Flight context (server-side)
|
|
54
|
-
*/
|
|
55
|
-
declare function setFlightContext(context: FlightContext): void;
|
|
56
|
-
/**
|
|
57
|
-
* Clear Flight context
|
|
58
|
-
*/
|
|
59
|
-
declare function clearFlightContext(): void;
|
|
60
|
-
|
|
61
|
-
interface StreamingOptions {
|
|
62
|
-
bootstrapScripts?: string[];
|
|
63
|
-
bootstrapModules?: string[];
|
|
64
|
-
onShellReady?: () => void;
|
|
65
|
-
onShellError?: (error: Error) => void;
|
|
66
|
-
onAllReady?: () => void;
|
|
67
|
-
onError?: (error: Error) => void;
|
|
68
|
-
signal?: AbortSignal;
|
|
69
|
-
timeout?: number;
|
|
70
|
-
progressiveHydration?: boolean;
|
|
71
|
-
}
|
|
72
|
-
interface StreamingResult {
|
|
73
|
-
pipe: (destination: Writable) => Writable;
|
|
74
|
-
abort: () => void;
|
|
75
|
-
payload: FlightPayload;
|
|
76
|
-
}
|
|
77
|
-
interface RenderToStringResult {
|
|
78
|
-
html: string;
|
|
79
|
-
payload: FlightPayload;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Render React tree to a streaming response
|
|
83
|
-
*/
|
|
84
|
-
declare function renderToStream(element: React.ReactElement, route: string, options?: StreamingOptions): StreamingResult;
|
|
85
|
-
/**
|
|
86
|
-
* Render to string with Flight payload
|
|
87
|
-
*/
|
|
88
|
-
declare function renderToStringWithFlight(element: React.ReactElement, route: string): RenderToStringResult;
|
|
89
|
-
|
|
90
|
-
interface HtmlShellOptions {
|
|
91
|
-
title?: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
head?: string;
|
|
94
|
-
/** Array of stylesheet URLs to include */
|
|
95
|
-
styles?: string[];
|
|
96
|
-
/** Critical CSS to inline in the head for above-the-fold content */
|
|
97
|
-
criticalCss?: string;
|
|
98
|
-
/** Global CSS file URLs (injected before other styles) */
|
|
99
|
-
globalCss?: string[];
|
|
100
|
-
/** CSS Module file URLs */
|
|
101
|
-
cssModules?: string[];
|
|
102
|
-
scripts?: string[];
|
|
103
|
-
flightPayload?: FlightPayload;
|
|
104
|
-
pageData?: any;
|
|
105
|
-
lang?: string;
|
|
106
|
-
bodyClass?: string;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Generate HTML shell
|
|
110
|
-
*/
|
|
111
|
-
declare function generateHtmlShell(options?: HtmlShellOptions): {
|
|
112
|
-
head: string;
|
|
113
|
-
tail: string;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Generate complete HTML with content
|
|
117
|
-
*/
|
|
118
|
-
declare function generateCompleteHtml(content: string, options?: HtmlShellOptions): string;
|
|
119
|
-
|
|
120
|
-
interface StreamingResponseOptions extends StreamingOptions {
|
|
121
|
-
status?: number;
|
|
122
|
-
headers?: Record<string, string>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Create a Transform stream that injects Flight chunks
|
|
126
|
-
*/
|
|
127
|
-
declare function createFlightInjector(payload: FlightPayload): {
|
|
128
|
-
addChunk(id: string, html: string, data?: any): void;
|
|
129
|
-
flush(): string;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Create a Suspense fallback placeholder
|
|
133
|
-
*/
|
|
134
|
-
declare function createSuspensePlaceholder(id: string): string;
|
|
135
|
-
/**
|
|
136
|
-
* Create resolved Suspense content
|
|
137
|
-
*/
|
|
138
|
-
declare function createSuspenseResolved(id: string, html: string): string;
|
|
139
|
-
/**
|
|
140
|
-
* Check if we're in a streaming context
|
|
141
|
-
*/
|
|
142
|
-
declare function isStreaming(): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Create headers for streaming response
|
|
145
|
-
*/
|
|
146
|
-
declare function createStreamingHeaders(options?: StreamingResponseOptions): Record<string, string>;
|
|
147
|
-
|
|
148
|
-
export { FlightContext, FlightPayload, type HtmlShellOptions, HydrationHint, type StreamingOptions, type StreamingResult, addFlightChunk, addFlightData, addFlightNode, addHydrationHint, clearFlightContext, createFlightInjector, createFlightPayload, createStreamingHeaders, createSuspensePlaceholder, createSuspenseResolved, generateCompleteHtml, generateHtmlShell, isStreaming, renderHeadToString, renderToStream, renderToStringWithFlight, resetFlightContext, serializePageData, setFlightContext };
|