@real-router/preact 0.24.4 → 0.24.5
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 +8 -8
- package/dist/cjs/index.d.ts +3 -41
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/ssr.d.ts +0 -16
- package/dist/cjs/ssr.d.ts.map +1 -1
- package/dist/esm/index.d.mts +3 -41
- package/dist/esm/index.d.mts.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/ssr.d.mts +0 -16
- package/dist/esm/ssr.d.mts.map +1 -1
- package/package.json +4 -4
package/dist/esm/ssr.d.mts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { ComponentChildren } from "preact";
|
|
2
|
-
//#region src/components/ClientOnly.d.ts
|
|
3
2
|
interface ClientOnlyProps {
|
|
4
3
|
readonly children: ComponentChildren;
|
|
5
4
|
readonly fallback?: ComponentChildren;
|
|
6
5
|
}
|
|
7
6
|
export declare function ClientOnly({ children, fallback }: ClientOnlyProps): ComponentChildren;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/components/ServerOnly.d.ts
|
|
10
7
|
interface ServerOnlyProps {
|
|
11
8
|
readonly children: ComponentChildren;
|
|
12
9
|
readonly fallback?: ComponentChildren;
|
|
13
10
|
}
|
|
14
11
|
export declare function ServerOnly({ children, fallback }: ServerOnlyProps): ComponentChildren;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/components/Await.d.ts
|
|
17
12
|
interface AwaitProps<T> {
|
|
18
13
|
/** Deferred key declared in the loader's `defer({ deferred: { <name>: ... } })`. */
|
|
19
14
|
readonly name: string;
|
|
@@ -35,8 +30,6 @@ interface AwaitProps<T> {
|
|
|
35
30
|
* ```
|
|
36
31
|
*/
|
|
37
32
|
export declare function Await<T = unknown>({ name, children }: AwaitProps<T>): ComponentChildren;
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/components/Streamed.d.ts
|
|
40
33
|
interface StreamedProps {
|
|
41
34
|
/** Shown while any descendant `<Await>` / `use(promise)`-equivalent suspends. */
|
|
42
35
|
readonly fallback: ComponentChildren;
|
|
@@ -51,8 +44,6 @@ interface StreamedProps {
|
|
|
51
44
|
* production streaming the preact-render-to-string toolchain is required.
|
|
52
45
|
*/
|
|
53
46
|
export declare function Streamed({ fallback, children }: StreamedProps): ComponentChildren;
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/components/HttpStatusCode.d.ts
|
|
56
47
|
interface HttpStatusCodeProps {
|
|
57
48
|
/** HTTP status to apply to the response. Common values: 404, 410, 451, 503. */
|
|
58
49
|
readonly code: number;
|
|
@@ -103,8 +94,6 @@ interface HttpStatusCodeProps {
|
|
|
103
94
|
* (commonly 4xx/5xx; 100-999 is what Node accepts).
|
|
104
95
|
*/
|
|
105
96
|
export declare function HttpStatusCode({ code }: HttpStatusCodeProps): ComponentChildren;
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/utils/createHttpStatusSink.d.ts
|
|
108
97
|
/**
|
|
109
98
|
* Render-scoped HTTP status sink. Created per request on the server, passed to
|
|
110
99
|
* `<HttpStatusProvider sink={...}>`, and read after `renderToString` (or the
|
|
@@ -129,15 +118,11 @@ interface HttpStatusSink {
|
|
|
129
118
|
code: number | undefined;
|
|
130
119
|
}
|
|
131
120
|
export declare function createHttpStatusSink(): HttpStatusSink;
|
|
132
|
-
//#endregion
|
|
133
|
-
//#region src/components/HttpStatusProvider.d.ts
|
|
134
121
|
interface HttpStatusProviderProps {
|
|
135
122
|
readonly sink: HttpStatusSink;
|
|
136
123
|
readonly children: ComponentChildren;
|
|
137
124
|
}
|
|
138
125
|
export declare function HttpStatusProvider({ sink, children }: HttpStatusProviderProps): ComponentChildren;
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region src/hooks/useDeferred.d.ts
|
|
141
126
|
/**
|
|
142
127
|
* Read a deferred promise published by `defer({ deferred: { <key>: Promise } })`
|
|
143
128
|
* inside an SSR data loader. Mirror of `@real-router/react/ssr` `useDeferred`
|
|
@@ -146,6 +131,5 @@ export declare function HttpStatusProvider({ sink, children }: HttpStatusProvide
|
|
|
146
131
|
* promise-status tracking since Preact 10 has no `use(promise)` analogue.
|
|
147
132
|
*/
|
|
148
133
|
export declare function useDeferred<T = unknown>(key: string): Promise<T>;
|
|
149
|
-
//#endregion
|
|
150
134
|
export type { AwaitProps, ClientOnlyProps, HttpStatusCodeProps, HttpStatusProviderProps, HttpStatusSink, ServerOnlyProps, StreamedProps };
|
|
151
135
|
//# sourceMappingURL=ssr.d.mts.map
|
package/dist/esm/ssr.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.mts","names":[],"sources":["../../src/components/ClientOnly.tsx","../../src/components/ServerOnly.tsx","../../src/components/Await.tsx","../../src/components/Streamed.tsx","../../src/components/HttpStatusCode.tsx","../../src/utils/createHttpStatusSink.ts","../../src/components/HttpStatusProvider.tsx","../../src/hooks/useDeferred.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ssr.d.mts","names":[],"sources":["../../src/components/ClientOnly.tsx","../../src/components/ServerOnly.tsx","../../src/components/Await.tsx","../../src/components/Streamed.tsx","../../src/components/HttpStatusCode.tsx","../../src/utils/createHttpStatusSink.ts","../../src/components/HttpStatusProvider.tsx","../../src/hooks/useDeferred.tsx"],"mappings":";UAIiB;WACN,UAAU;WACV,WAAW;;wBAGN,aACd,UACA,YACC,kBAAkB;UCRJ;WACN,UAAU;WACV,WAAW;;wBAGN,aACd,UACA,YACC,kBAAkB;UC6CJ,WAAW;;WAEjB;;;WAGA,WAAW,OAAO,MAAM;;;;;;;;;;;;;;;wBAgBnB,MAAM,eACpB,MACA,YACC,WAAW,KAAK;UC7EF;;WAEN,UAAU;WACV,UAAU;;;;;;;;;;wBAWL,WACd,UACA,YACC,gBAAgB;UCfF;;WAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDK,iBACd,QACC,sBAAsB;;;;;;;;;;;;;;;;;;;;;UCtCR;EACf;;wBAGc,wBAAwB;UCjBvB;WACN,MAAM;WACN,UAAU;;wBAGL,qBACd,MACA,YACC,0BAA0B;;;;;;;;wBCGb,YAAY,aAAa,cAAc,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/preact",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.5",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Preact integration for Real-Router",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@real-router/sources": "^0.15.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@real-router/browser-plugin": "^0.
|
|
71
|
-
"@real-router/core": "^0.
|
|
70
|
+
"@real-router/browser-plugin": "^0.27.0",
|
|
71
|
+
"@real-router/core": "^0.154.0",
|
|
72
72
|
"@testing-library/dom": "~10.4.1",
|
|
73
73
|
"@testing-library/jest-dom": "~7.0.1",
|
|
74
74
|
"@testing-library/preact": "~3.2.4",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"preact-render-to-string": "~6.8.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@real-router/core": ">=0.
|
|
80
|
+
"@real-router/core": ">=0.154.0",
|
|
81
81
|
"preact": ">=10.28.0 || ^11.0.0-0"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|