@pylonsync/react 0.3.247 → 0.3.248
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/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/ssr.ts +34 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.248",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "src/index.ts",
|
|
9
9
|
"types": "src/index.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"check": "tsc -p tsconfig.json --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pylonsync/sdk": "0.3.
|
|
16
|
-
"@pylonsync/sync": "0.3.
|
|
15
|
+
"@pylonsync/sdk": "0.3.248",
|
|
16
|
+
"@pylonsync/sync": "0.3.248"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=19.0.0"
|
package/src/index.ts
CHANGED
package/src/ssr.ts
CHANGED
|
@@ -205,3 +205,37 @@ export type GenerateMetadata<
|
|
|
205
205
|
> = (
|
|
206
206
|
props: PageProps<TParams, TSearchParams>,
|
|
207
207
|
) => Metadata | Promise<Metadata>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Props an `app/.../error.tsx` boundary receives. Error boundaries are now
|
|
211
|
+
* HYDRATED (interactive — useState/onClick/effects work), so `reset` is a
|
|
212
|
+
* real callback that re-attempts rendering the segment (a transient error
|
|
213
|
+
* clears to the page; a deterministic one re-shows the boundary).
|
|
214
|
+
*
|
|
215
|
+
* `error` carries ONLY the thrown error's `message` plus a short,
|
|
216
|
+
* non-reversible `digest` (a correlation id matching the server log). The
|
|
217
|
+
* stack NEVER reaches the client — read it from the dev overlay
|
|
218
|
+
* (`PYLON_DEV_MODE`) or the server logs.
|
|
219
|
+
*
|
|
220
|
+
* ```tsx
|
|
221
|
+
* export default function Error({ error, reset }: ErrorBoundaryProps) {
|
|
222
|
+
* return (
|
|
223
|
+
* <div>
|
|
224
|
+
* <p>Something went wrong: {error.message}</p>
|
|
225
|
+
* <button onClick={reset}>Try again</button>
|
|
226
|
+
* </div>
|
|
227
|
+
* );
|
|
228
|
+
* }
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export interface ErrorBoundaryProps {
|
|
232
|
+
error: { message: string; digest?: string };
|
|
233
|
+
reset: () => void;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Props an `app/.../not-found.tsx` boundary receives. Not-found boundaries
|
|
238
|
+
* are hydrated (interactive) too, but — matching Next — receive NO `reset`.
|
|
239
|
+
* Same shape as a page.
|
|
240
|
+
*/
|
|
241
|
+
export type NotFoundProps = PageProps;
|