@pylonsync/react 0.3.249 → 0.3.250

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.249",
6
+ "version": "0.3.250",
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.249",
16
- "@pylonsync/sync": "0.3.249"
15
+ "@pylonsync/sdk": "0.3.250",
16
+ "@pylonsync/sync": "0.3.250"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=19.0.0"
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
  SsrCookieOptions,
21
21
  Metadata,
22
22
  GenerateMetadata,
23
+ RouteSegmentConfig,
23
24
  ErrorBoundaryProps,
24
25
  NotFoundProps,
25
26
  FormFields,
package/src/ssr.ts CHANGED
@@ -206,6 +206,40 @@ export type GenerateMetadata<
206
206
  props: PageProps<TParams, TSearchParams>,
207
207
  ) => Metadata | Promise<Metadata>;
208
208
 
209
+ /**
210
+ * Per-route configuration, declared as top-level `export const` in a
211
+ * `page.tsx` (Next-shaped). All optional. The runtime reads these statically
212
+ * before the render.
213
+ *
214
+ * ```ts
215
+ * export const revalidate = 60; // CDN + origin-disk cache for 60s
216
+ * export const dynamic = "force-dynamic"; // never cache
217
+ * export const streaming = true; // progressive Suspense streaming
218
+ * ```
219
+ *
220
+ * - `revalidate` — seconds an auth-independent render stays cacheable
221
+ * (`public, s-maxage=N`); also kept in the origin disk cache. See the
222
+ * "Anonymous output caching" rules — it only takes effect if the render
223
+ * never reads `auth`, sets no cookie, and isn't running strict policies.
224
+ * - `dynamic` — `"force-static"` caches until the next deploy; `"force-dynamic"`
225
+ * opts out of all caching.
226
+ * - `streaming` — opt into PROGRESSIVE streaming: the shell + each inner
227
+ * `<Suspense>` fallback flush immediately, then each boundary's real content
228
+ * streams in as its data resolves (instead of buffering the whole document).
229
+ * A page with a `loading.tsx` already streams at the route level; this
230
+ * extends it to a page's OWN inner boundaries. Mutually exclusive with
231
+ * caching: a streaming render commits its HTTP head before suspended
232
+ * subtrees finish, so it can never be marked cacheable (and a deep
233
+ * `<Suspense>` throw resolves via its `error.tsx` at HTTP 200, not a 5xx).
234
+ * Set `response.*` (status/cookies) only in the synchronous shell — late
235
+ * calls from a suspended subtree are dropped (the runtime warns).
236
+ */
237
+ export interface RouteSegmentConfig {
238
+ revalidate?: number;
239
+ dynamic?: "force-static" | "force-dynamic";
240
+ streaming?: boolean;
241
+ }
242
+
209
243
  /**
210
244
  * Props an `app/.../error.tsx` boundary receives. Error boundaries are now
211
245
  * HYDRATED (interactive — useState/onClick/effects work), so `reset` is a