@nifrajs/web 5.5.1 → 5.6.0

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.
Files changed (457) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/dist/boundary.d.ts +67 -7
  3. package/dist/boundary.d.ts.map +1 -1
  4. package/dist/boundary.js +6 -4
  5. package/dist/boundary.js.map +1 -1
  6. package/dist/build-plan.d.ts +3 -0
  7. package/dist/build-plan.d.ts.map +1 -1
  8. package/dist/build-plan.js.map +1 -1
  9. package/dist/build-vite.d.ts.map +1 -1
  10. package/dist/build-vite.js +2 -0
  11. package/dist/build-vite.js.map +1 -1
  12. package/dist/build.d.ts +9 -2
  13. package/dist/build.d.ts.map +1 -1
  14. package/dist/build.js +9 -0
  15. package/dist/build.js.map +1 -1
  16. package/dist/client.d.ts +2 -1
  17. package/dist/client.d.ts.map +1 -1
  18. package/dist/client.js +140 -12
  19. package/dist/client.js.map +1 -1
  20. package/dist/csp.d.ts +8 -0
  21. package/dist/csp.d.ts.map +1 -1
  22. package/dist/csp.js +11 -2
  23. package/dist/csp.js.map +1 -1
  24. package/dist/deferred.d.ts +6 -4
  25. package/dist/deferred.d.ts.map +1 -1
  26. package/dist/deferred.js +10 -6
  27. package/dist/deferred.js.map +1 -1
  28. package/dist/dev-feed.d.ts.map +1 -1
  29. package/dist/dev-feed.js +11 -2
  30. package/dist/dev-feed.js.map +1 -1
  31. package/dist/dev-session.d.ts.map +1 -1
  32. package/dist/dev-session.js +13 -6
  33. package/dist/dev-session.js.map +1 -1
  34. package/dist/dev.d.ts +4 -1
  35. package/dist/dev.d.ts.map +1 -1
  36. package/dist/dev.js +12 -5
  37. package/dist/dev.js.map +1 -1
  38. package/dist/diagnostic-catalog.d.ts +4 -0
  39. package/dist/diagnostic-catalog.d.ts.map +1 -1
  40. package/dist/diagnostic-catalog.js +48 -0
  41. package/dist/diagnostic-catalog.js.map +1 -1
  42. package/dist/diagnostic.d.ts +1 -1
  43. package/dist/diagnostic.d.ts.map +1 -1
  44. package/dist/diagnostic.js +1 -1
  45. package/dist/diagnostic.js.map +1 -1
  46. package/dist/fn.d.ts +5 -3
  47. package/dist/fn.d.ts.map +1 -1
  48. package/dist/fn.js +20 -5
  49. package/dist/fn.js.map +1 -1
  50. package/dist/fs.d.ts.map +1 -1
  51. package/dist/fs.js +13 -3
  52. package/dist/fs.js.map +1 -1
  53. package/dist/identity.d.ts +22 -0
  54. package/dist/identity.d.ts.map +1 -0
  55. package/dist/identity.js +60 -0
  56. package/dist/identity.js.map +1 -0
  57. package/dist/index.d.ts +7 -6
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +4 -2
  60. package/dist/index.js.map +1 -1
  61. package/dist/internal/cdn/cloudflare.d.ts +2 -1
  62. package/dist/internal/cdn/cloudflare.d.ts.map +1 -1
  63. package/dist/internal/cdn/cloudflare.js +2 -1
  64. package/dist/internal/cdn/cloudflare.js.map +1 -1
  65. package/dist/internal/certified-components.d.ts +1 -1
  66. package/dist/internal/certified-components.js +1 -1
  67. package/dist/internal/codegen.d.ts +11 -10
  68. package/dist/internal/codegen.d.ts.map +1 -1
  69. package/dist/internal/codegen.js +65 -8
  70. package/dist/internal/codegen.js.map +1 -1
  71. package/dist/internal/dev-websocket.d.ts +73 -0
  72. package/dist/internal/dev-websocket.d.ts.map +1 -0
  73. package/dist/internal/dev-websocket.js +145 -0
  74. package/dist/internal/dev-websocket.js.map +1 -0
  75. package/dist/internal/hole-runtime.d.ts +66 -0
  76. package/dist/internal/hole-runtime.d.ts.map +1 -0
  77. package/dist/internal/hole-runtime.js +211 -0
  78. package/dist/internal/hole-runtime.js.map +1 -0
  79. package/dist/internal/identity-epoch.d.ts +50 -0
  80. package/dist/internal/identity-epoch.d.ts.map +1 -0
  81. package/dist/internal/identity-epoch.js +179 -0
  82. package/dist/internal/identity-epoch.js.map +1 -0
  83. package/dist/internal/invalidation-contract.d.ts +23 -0
  84. package/dist/internal/invalidation-contract.d.ts.map +1 -0
  85. package/dist/internal/invalidation-contract.js +11 -0
  86. package/dist/internal/invalidation-contract.js.map +1 -0
  87. package/dist/internal/invalidation.d.ts +62 -0
  88. package/dist/internal/invalidation.d.ts.map +1 -0
  89. package/dist/internal/invalidation.js +149 -0
  90. package/dist/internal/invalidation.js.map +1 -0
  91. package/dist/internal/island-bindings.d.ts +51 -0
  92. package/dist/internal/island-bindings.d.ts.map +1 -0
  93. package/dist/internal/island-bindings.js +147 -0
  94. package/dist/internal/island-bindings.js.map +1 -0
  95. package/dist/internal/island-list.d.ts +26 -0
  96. package/dist/internal/island-list.d.ts.map +1 -0
  97. package/dist/internal/island-list.js +78 -0
  98. package/dist/internal/island-list.js.map +1 -0
  99. package/dist/internal/island-mount.d.ts +4 -0
  100. package/dist/internal/island-mount.d.ts.map +1 -0
  101. package/dist/internal/island-mount.js +66 -0
  102. package/dist/internal/island-mount.js.map +1 -0
  103. package/dist/internal/island-owner.d.ts +5 -0
  104. package/dist/internal/island-owner.d.ts.map +1 -0
  105. package/dist/internal/island-owner.js +20 -0
  106. package/dist/internal/island-owner.js.map +1 -0
  107. package/dist/internal/island-resource.d.ts +30 -0
  108. package/dist/internal/island-resource.d.ts.map +1 -0
  109. package/dist/internal/island-resource.js +57 -0
  110. package/dist/internal/island-resource.js.map +1 -0
  111. package/dist/internal/island-signals.d.ts +51 -0
  112. package/dist/internal/island-signals.d.ts.map +1 -0
  113. package/dist/internal/island-signals.js +220 -0
  114. package/dist/internal/island-signals.js.map +1 -0
  115. package/dist/internal/keep-alive-table.d.ts +23 -0
  116. package/dist/internal/keep-alive-table.d.ts.map +1 -0
  117. package/dist/internal/keep-alive-table.js +53 -0
  118. package/dist/internal/keep-alive-table.js.map +1 -0
  119. package/dist/internal/live-contract.d.ts +96 -0
  120. package/dist/internal/live-contract.d.ts.map +1 -0
  121. package/dist/internal/live-contract.js +5 -0
  122. package/dist/internal/live-contract.js.map +1 -0
  123. package/dist/internal/live-queries.d.ts +22 -0
  124. package/dist/internal/live-queries.d.ts.map +1 -0
  125. package/dist/internal/live-queries.js +54 -0
  126. package/dist/internal/live-queries.js.map +1 -0
  127. package/dist/internal/page-events.d.ts +10 -0
  128. package/dist/internal/page-events.d.ts.map +1 -0
  129. package/dist/internal/page-events.js +26 -0
  130. package/dist/internal/page-events.js.map +1 -0
  131. package/dist/internal/page-execution.d.ts +14 -1
  132. package/dist/internal/page-execution.d.ts.map +1 -1
  133. package/dist/internal/page-execution.js +415 -31
  134. package/dist/internal/page-execution.js.map +1 -1
  135. package/dist/internal/ppr/admission.d.ts +83 -0
  136. package/dist/internal/ppr/admission.d.ts.map +1 -0
  137. package/dist/internal/ppr/admission.js +221 -0
  138. package/dist/internal/ppr/admission.js.map +1 -0
  139. package/dist/internal/ppr/canary.d.ts +24 -0
  140. package/dist/internal/ppr/canary.d.ts.map +1 -0
  141. package/dist/internal/ppr/canary.js +102 -0
  142. package/dist/internal/ppr/canary.js.map +1 -0
  143. package/dist/internal/ppr/compile-shell.d.ts +39 -0
  144. package/dist/internal/ppr/compile-shell.d.ts.map +1 -0
  145. package/dist/internal/ppr/compile-shell.js +298 -0
  146. package/dist/internal/ppr/compile-shell.js.map +1 -0
  147. package/dist/internal/ppr/contract.d.ts +177 -0
  148. package/dist/internal/ppr/contract.d.ts.map +1 -0
  149. package/dist/internal/ppr/contract.js +80 -0
  150. package/dist/internal/ppr/contract.js.map +1 -0
  151. package/dist/internal/ppr/frames.d.ts +71 -0
  152. package/dist/internal/ppr/frames.d.ts.map +1 -0
  153. package/dist/internal/ppr/frames.js +119 -0
  154. package/dist/internal/ppr/frames.js.map +1 -0
  155. package/dist/internal/ppr/integration.d.ts +19 -0
  156. package/dist/internal/ppr/integration.d.ts.map +1 -0
  157. package/dist/internal/ppr/integration.js +106 -0
  158. package/dist/internal/ppr/integration.js.map +1 -0
  159. package/dist/internal/ppr/options.d.ts +96 -0
  160. package/dist/internal/ppr/options.d.ts.map +1 -0
  161. package/dist/internal/ppr/options.js +125 -0
  162. package/dist/internal/ppr/options.js.map +1 -0
  163. package/dist/internal/ppr/route-rules.d.ts +12 -0
  164. package/dist/internal/ppr/route-rules.d.ts.map +1 -0
  165. package/dist/internal/ppr/route-rules.js +53 -0
  166. package/dist/internal/ppr/route-rules.js.map +1 -0
  167. package/dist/internal/ppr/runtime.d.ts +29 -0
  168. package/dist/internal/ppr/runtime.d.ts.map +1 -0
  169. package/dist/internal/ppr/runtime.js +32 -0
  170. package/dist/internal/ppr/runtime.js.map +1 -0
  171. package/dist/internal/ppr/server.d.ts +29 -0
  172. package/dist/internal/ppr/server.d.ts.map +1 -0
  173. package/dist/internal/ppr/server.js +1407 -0
  174. package/dist/internal/ppr/server.js.map +1 -0
  175. package/dist/internal/ppr/shell-store.d.ts +38 -0
  176. package/dist/internal/ppr/shell-store.d.ts.map +1 -0
  177. package/dist/internal/ppr/shell-store.js +90 -0
  178. package/dist/internal/ppr/shell-store.js.map +1 -0
  179. package/dist/internal/prerendered-pages.d.ts +1 -1
  180. package/dist/internal/prerendered-pages.d.ts.map +1 -1
  181. package/dist/internal/prerendered-pages.js +7 -4
  182. package/dist/internal/prerendered-pages.js.map +1 -1
  183. package/dist/internal/query-digest.d.ts +9 -0
  184. package/dist/internal/query-digest.d.ts.map +1 -0
  185. package/dist/internal/query-digest.js +23 -0
  186. package/dist/internal/query-digest.js.map +1 -0
  187. package/dist/internal/query-runtime.d.ts +6 -1
  188. package/dist/internal/query-runtime.d.ts.map +1 -1
  189. package/dist/internal/query-runtime.js +9 -0
  190. package/dist/internal/query-runtime.js.map +1 -1
  191. package/dist/internal/query-seam.d.ts +29 -0
  192. package/dist/internal/query-seam.d.ts.map +1 -0
  193. package/dist/internal/query-seam.js +23 -0
  194. package/dist/internal/query-seam.js.map +1 -0
  195. package/dist/internal/render-document.d.ts +28 -1
  196. package/dist/internal/render-document.d.ts.map +1 -1
  197. package/dist/internal/render-document.js +83 -18
  198. package/dist/internal/render-document.js.map +1 -1
  199. package/dist/internal/request-abort.d.ts +8 -0
  200. package/dist/internal/request-abort.d.ts.map +1 -0
  201. package/dist/internal/request-abort.js +22 -0
  202. package/dist/internal/request-abort.js.map +1 -0
  203. package/dist/internal/server-boundary.d.ts +2 -0
  204. package/dist/internal/server-boundary.d.ts.map +1 -1
  205. package/dist/internal/server-boundary.js +8 -1
  206. package/dist/internal/server-boundary.js.map +1 -1
  207. package/dist/internal/share-data.d.ts +10 -0
  208. package/dist/internal/share-data.d.ts.map +1 -0
  209. package/dist/internal/share-data.js +135 -0
  210. package/dist/internal/share-data.js.map +1 -0
  211. package/dist/internal/store-signature.d.ts +15 -0
  212. package/dist/internal/store-signature.d.ts.map +1 -0
  213. package/dist/internal/store-signature.js +114 -0
  214. package/dist/internal/store-signature.js.map +1 -0
  215. package/dist/internal/vite-plugin-compat.d.ts +2 -2
  216. package/dist/internal/vite-plugin-compat.js +2 -2
  217. package/dist/internal/web-app.d.ts +25 -0
  218. package/dist/internal/web-app.d.ts.map +1 -1
  219. package/dist/internal/web-app.js +78 -3
  220. package/dist/internal/web-app.js.map +1 -1
  221. package/dist/islands-swap.d.ts +41 -0
  222. package/dist/islands-swap.d.ts.map +1 -0
  223. package/dist/islands-swap.js +270 -0
  224. package/dist/islands-swap.js.map +1 -0
  225. package/dist/islands.d.ts +86 -24
  226. package/dist/islands.d.ts.map +1 -1
  227. package/dist/islands.js +138 -78
  228. package/dist/islands.js.map +1 -1
  229. package/dist/isr.d.ts +67 -13
  230. package/dist/isr.d.ts.map +1 -1
  231. package/dist/isr.js +247 -99
  232. package/dist/isr.js.map +1 -1
  233. package/dist/keep-alive.d.ts +147 -0
  234. package/dist/keep-alive.d.ts.map +1 -0
  235. package/dist/keep-alive.js +1069 -0
  236. package/dist/keep-alive.js.map +1 -0
  237. package/dist/live/bus.d.ts +56 -0
  238. package/dist/live/bus.d.ts.map +1 -0
  239. package/dist/live/bus.js +32 -0
  240. package/dist/live/bus.js.map +1 -0
  241. package/dist/live/core.d.ts +25 -0
  242. package/dist/live/core.d.ts.map +1 -0
  243. package/dist/live/core.js +29 -0
  244. package/dist/live/core.js.map +1 -0
  245. package/dist/live/history.d.ts +38 -0
  246. package/dist/live/history.d.ts.map +1 -0
  247. package/dist/live/history.js +104 -0
  248. package/dist/live/history.js.map +1 -0
  249. package/dist/live/hub-protocol.d.ts +46 -0
  250. package/dist/live/hub-protocol.d.ts.map +1 -0
  251. package/dist/live/hub-protocol.js +108 -0
  252. package/dist/live/hub-protocol.js.map +1 -0
  253. package/dist/live/hub.d.ts +181 -0
  254. package/dist/live/hub.d.ts.map +1 -0
  255. package/dist/live/hub.js +539 -0
  256. package/dist/live/hub.js.map +1 -0
  257. package/dist/live/keyring.d.ts +87 -0
  258. package/dist/live/keyring.d.ts.map +1 -0
  259. package/dist/live/keyring.js +260 -0
  260. package/dist/live/keyring.js.map +1 -0
  261. package/dist/live/read-capped.d.ts +6 -0
  262. package/dist/live/read-capped.d.ts.map +1 -0
  263. package/dist/live/read-capped.js +42 -0
  264. package/dist/live/read-capped.js.map +1 -0
  265. package/dist/live/revocations.d.ts +52 -0
  266. package/dist/live/revocations.d.ts.map +1 -0
  267. package/dist/live/revocations.js +116 -0
  268. package/dist/live/revocations.js.map +1 -0
  269. package/dist/live/settings.d.ts +14 -0
  270. package/dist/live/settings.d.ts.map +1 -0
  271. package/dist/live/settings.js +38 -0
  272. package/dist/live/settings.js.map +1 -0
  273. package/dist/live-client.d.ts +34 -0
  274. package/dist/live-client.d.ts.map +1 -0
  275. package/dist/live-client.js +840 -0
  276. package/dist/live-client.js.map +1 -0
  277. package/dist/live-hub.d.ts +130 -0
  278. package/dist/live-hub.d.ts.map +1 -0
  279. package/dist/live-hub.js +507 -0
  280. package/dist/live-hub.js.map +1 -0
  281. package/dist/live-redis.d.ts +48 -0
  282. package/dist/live-redis.d.ts.map +1 -0
  283. package/dist/live-redis.js +201 -0
  284. package/dist/live-redis.js.map +1 -0
  285. package/dist/live.d.ts +94 -0
  286. package/dist/live.d.ts.map +1 -0
  287. package/dist/live.js +869 -0
  288. package/dist/live.js.map +1 -0
  289. package/dist/manifest.d.ts +113 -2
  290. package/dist/manifest.d.ts.map +1 -1
  291. package/dist/manifest.js +109 -5
  292. package/dist/manifest.js.map +1 -1
  293. package/dist/navigation.d.ts +9 -3
  294. package/dist/navigation.d.ts.map +1 -1
  295. package/dist/navigation.js +13 -3
  296. package/dist/navigation.js.map +1 -1
  297. package/dist/plugins/vite-zone-guard.d.ts +6 -0
  298. package/dist/plugins/vite-zone-guard.d.ts.map +1 -1
  299. package/dist/plugins/vite-zone-guard.js +8 -2
  300. package/dist/plugins/vite-zone-guard.js.map +1 -1
  301. package/dist/ppr.d.ts +73 -0
  302. package/dist/ppr.d.ts.map +1 -0
  303. package/dist/ppr.js +76 -0
  304. package/dist/ppr.js.map +1 -0
  305. package/dist/query.d.ts +8 -13
  306. package/dist/query.d.ts.map +1 -1
  307. package/dist/query.js +112 -18
  308. package/dist/query.js.map +1 -1
  309. package/dist/render-seam.d.ts +30 -0
  310. package/dist/render-seam.d.ts.map +1 -1
  311. package/dist/render-seam.js +5 -0
  312. package/dist/render-seam.js.map +1 -1
  313. package/dist/route-types.d.ts.map +1 -1
  314. package/dist/route-types.js +2 -2
  315. package/dist/route-types.js.map +1 -1
  316. package/dist/router.d.ts +72 -4
  317. package/dist/router.d.ts.map +1 -1
  318. package/dist/router.js +374 -99
  319. package/dist/router.js.map +1 -1
  320. package/dist/server-components/build.d.ts.map +1 -1
  321. package/dist/server-components/build.js +3 -3
  322. package/dist/server-components/build.js.map +1 -1
  323. package/dist/server-components/client.d.ts +23 -1
  324. package/dist/server-components/client.d.ts.map +1 -1
  325. package/dist/server-components/client.js +92 -5
  326. package/dist/server-components/client.js.map +1 -1
  327. package/dist/server-components/hole.d.ts +8 -0
  328. package/dist/server-components/hole.d.ts.map +1 -0
  329. package/dist/server-components/hole.js +20 -0
  330. package/dist/server-components/hole.js.map +1 -0
  331. package/dist/server-components/html-policy.d.ts.map +1 -1
  332. package/dist/server-components/html-policy.js +62 -4
  333. package/dist/server-components/html-policy.js.map +1 -1
  334. package/dist/server-components/html-scan.d.ts +17 -0
  335. package/dist/server-components/html-scan.d.ts.map +1 -0
  336. package/dist/server-components/html-scan.js +180 -0
  337. package/dist/server-components/html-scan.js.map +1 -0
  338. package/dist/server-components/html.d.ts.map +1 -1
  339. package/dist/server-components/html.js +19 -4
  340. package/dist/server-components/html.js.map +1 -1
  341. package/dist/server-components/router-integration.d.ts +4 -1
  342. package/dist/server-components/router-integration.d.ts.map +1 -1
  343. package/dist/server-components/router-integration.js +23 -2
  344. package/dist/server-components/router-integration.js.map +1 -1
  345. package/dist/server-components/runtime.d.ts +6 -1
  346. package/dist/server-components/runtime.d.ts.map +1 -1
  347. package/dist/server-components/runtime.js +86 -28
  348. package/dist/server-components/runtime.js.map +1 -1
  349. package/dist/server-components/state.d.ts +3 -1
  350. package/dist/server-components/state.d.ts.map +1 -1
  351. package/dist/server-components/state.js +50 -38
  352. package/dist/server-components/state.js.map +1 -1
  353. package/dist/server-components/types.d.ts +9 -0
  354. package/dist/server-components/types.d.ts.map +1 -1
  355. package/dist/vite.d.ts +5 -1
  356. package/dist/vite.d.ts.map +1 -1
  357. package/dist/vite.js +58 -4
  358. package/dist/vite.js.map +1 -1
  359. package/package.json +48 -8
  360. package/src/boundary.ts +77 -5
  361. package/src/build-plan.ts +3 -0
  362. package/src/build-vite.ts +2 -0
  363. package/src/build.ts +19 -1
  364. package/src/client.ts +147 -10
  365. package/src/csp.ts +16 -2
  366. package/src/deferred.ts +11 -5
  367. package/src/dev-feed.ts +11 -2
  368. package/src/dev-session.ts +22 -11
  369. package/src/dev.ts +29 -8
  370. package/src/diagnostic-catalog.ts +53 -0
  371. package/src/diagnostic.ts +1 -0
  372. package/src/fn.ts +24 -7
  373. package/src/fs.ts +22 -8
  374. package/src/identity.ts +61 -0
  375. package/src/index.ts +19 -0
  376. package/src/internal/cdn/cloudflare.ts +2 -1
  377. package/src/internal/certified-components.ts +1 -1
  378. package/src/internal/codegen.ts +87 -8
  379. package/src/internal/dev-websocket.ts +230 -0
  380. package/src/internal/hole-runtime.ts +286 -0
  381. package/src/internal/identity-epoch.ts +235 -0
  382. package/src/internal/invalidation-contract.ts +35 -0
  383. package/src/internal/invalidation.ts +213 -0
  384. package/src/internal/island-bindings.ts +191 -0
  385. package/src/internal/island-list.ts +92 -0
  386. package/src/internal/island-mount.ts +68 -0
  387. package/src/internal/island-owner.ts +20 -0
  388. package/src/internal/island-resource.ts +76 -0
  389. package/src/internal/island-signals.ts +249 -0
  390. package/src/internal/keep-alive-table.ts +72 -0
  391. package/src/internal/live-contract.ts +106 -0
  392. package/src/internal/live-queries.ts +60 -0
  393. package/src/internal/page-events.ts +27 -0
  394. package/src/internal/page-execution.ts +579 -40
  395. package/src/internal/ppr/admission.ts +300 -0
  396. package/src/internal/ppr/canary.ts +122 -0
  397. package/src/internal/ppr/compile-shell.ts +379 -0
  398. package/src/internal/ppr/contract.ts +265 -0
  399. package/src/internal/ppr/frames.ts +170 -0
  400. package/src/internal/ppr/integration.ts +137 -0
  401. package/src/internal/ppr/options.ts +221 -0
  402. package/src/internal/ppr/route-rules.ts +77 -0
  403. package/src/internal/ppr/runtime.ts +36 -0
  404. package/src/internal/ppr/server.ts +1764 -0
  405. package/src/internal/ppr/shell-store.ts +139 -0
  406. package/src/internal/prerendered-pages.ts +7 -4
  407. package/src/internal/query-digest.ts +34 -0
  408. package/src/internal/query-runtime.ts +14 -1
  409. package/src/internal/query-seam.ts +48 -0
  410. package/src/internal/render-document.ts +149 -22
  411. package/src/internal/request-abort.ts +26 -0
  412. package/src/internal/server-boundary.ts +10 -1
  413. package/src/internal/share-data.ts +136 -0
  414. package/src/internal/store-signature.ts +149 -0
  415. package/src/internal/vite-plugin-compat.ts +2 -2
  416. package/src/internal/web-app.ts +121 -3
  417. package/src/islands-swap.ts +283 -0
  418. package/src/islands.ts +169 -72
  419. package/src/isr.ts +348 -106
  420. package/src/keep-alive.ts +1315 -0
  421. package/src/live/bus.ts +77 -0
  422. package/src/live/core.ts +52 -0
  423. package/src/live/history.ts +109 -0
  424. package/src/live/hub-protocol.ts +133 -0
  425. package/src/live/hub.ts +615 -0
  426. package/src/live/keyring.ts +379 -0
  427. package/src/live/read-capped.ts +36 -0
  428. package/src/live/revocations.ts +155 -0
  429. package/src/live/settings.ts +46 -0
  430. package/src/live-client.ts +973 -0
  431. package/src/live-hub.ts +658 -0
  432. package/src/live-redis.ts +259 -0
  433. package/src/live.ts +1096 -0
  434. package/src/manifest.ts +274 -6
  435. package/src/navigation.ts +14 -2
  436. package/src/plugins/vite-zone-guard.ts +15 -2
  437. package/src/ppr.ts +153 -0
  438. package/src/query.ts +147 -20
  439. package/src/render-seam.ts +35 -0
  440. package/src/route-types.ts +3 -1
  441. package/src/router.ts +494 -101
  442. package/src/server-components/build.ts +9 -3
  443. package/src/server-components/client.ts +89 -5
  444. package/src/server-components/hole.ts +23 -0
  445. package/src/server-components/html-policy.ts +63 -4
  446. package/src/server-components/html-scan.ts +159 -0
  447. package/src/server-components/html.ts +18 -4
  448. package/src/server-components/router-integration.ts +21 -2
  449. package/src/server-components/runtime.ts +112 -30
  450. package/src/server-components/state.ts +66 -44
  451. package/src/server-components/types.ts +16 -0
  452. package/src/vite.ts +75 -6
  453. package/dist/nano.d.ts +0 -125
  454. package/dist/nano.d.ts.map +0 -1
  455. package/dist/nano.js +0 -190
  456. package/dist/nano.js.map +0 -1
  457. package/src/nano.ts +0 -246
package/dist/islands.js CHANGED
@@ -1,24 +1,36 @@
1
1
  /**
2
- * @nifrajs/web/islands - the framework-agnostic islands client runtime.
2
+ * @nifrajs/web/islands - the islands client runtime: interactivity for server-rendered pages without a
3
+ * framework runtime.
3
4
  *
4
- * An "island" is a server-rendered `<nifra-island>` element whose interactivity is mounted by a small
5
- * **plain-DOM** enhancer instead of a framework runtime. On a route that opts out of full-document
6
- * hydration (`export const hydrate = false`), the page ships **zero** framework JS; only the island
7
- * bundle (this runtime + your enhancers) loads. This variant ships ~99% less client JS than full
8
- * React hydration on a mostly-static page - the framework runtime is the cost, and islands skip it
9
- * entirely here.
5
+ * An island is a server-rendered element marked `data-island="<id>"`. Its interactivity is mounted by
6
+ * an enhancer instead of hydration, so on a route with `export const hydrate = false` the page ships
7
+ * no framework JS; only the island bundle (this runtime + your enhancers) loads via `islandScripts`.
10
8
  *
11
- * Server side: render the marker with `@nifrajs/web-react`'s `<Island>` (or any framework's host element
12
- * `<nifra-island data-id data-strategy data-props>`). Props are JSON-encoded inline in `data-props`
13
- * (attribute-escaped by the framework) - no central registry, so concurrent SSR renders never share
14
- * state. Client side: bundle one entry that calls `mountIslands({ <id>: enhancer })` and load it via
15
- * the route's `islandScripts`.
9
+ * Two tiers, one mount:
10
+ * - `defineIsland((el, props) => cleanup)` - plain DOM code. The default.
11
+ * - `bindIsland(({ state, onDispose }) => handlers)` - signals the markup binds by name through a
12
+ * closed set of `data-bind-*` attributes. No expression language: names only.
13
+ * `signal`/`computed`/`effect`, a keyed `bindList` and an async `resource` work inside either tier;
14
+ * whatever an enhancer creates stops when its island unmounts.
15
+ *
16
+ * Server side: `<div data-island="counter" data-island-props="${islandProps({ start: 0 })}">`, or
17
+ * `@nifrajs/web-react`'s `<Island>`. Optional `data-island-strategy` (`load` | `idle` | `visible` |
18
+ * `media`, with `data-island-media`). Props travel as JSON in the attribute - no central registry, so
19
+ * concurrent SSR renders never share state. Nothing inside a `data-island-ignore` element mounts or
20
+ * binds: render user HTML there.
16
21
  */
17
- import { MAX_MEDIA_QUERY_LENGTH, scheduleTrigger, } from "@nifrajs/island-trigger";
18
- export { MAX_MEDIA_QUERY_LENGTH, scheduleTrigger };
22
+ import { bindScope } from "./internal/island-bindings.js";
23
+ import { mountIsland } from "./internal/island-mount.js";
24
+ import { owned } from "./internal/island-owner.js";
25
+ import { signal } from "./internal/island-signals.js";
26
+ import { PAGE_HIDE_EVENT, PAGE_SHOW_EVENT } from "./internal/page-events.js";
27
+ export { MAX_MEDIA_QUERY_LENGTH, scheduleTrigger, } from "@nifrajs/island-trigger";
28
+ export { bindList, } from "./internal/island-list.js";
29
+ export { resource } from "./internal/island-resource.js";
30
+ export { batch, computed, effect, signal, untrack, } from "./internal/island-signals.js";
19
31
  /**
20
32
  * Author a typed enhancer. Pure identity at runtime (zero cost, tree-shaken away) - its only job is
21
- * to pin the `data-props` shape so `el` and `props` are typed inside the body and the enhancer is
33
+ * to pin the props shape so `el` and `props` are typed inside the body and the enhancer is
22
34
  * assignable to `mountIslands`. Prefer this over an inline arrow whenever an island reads props:
23
35
  *
24
36
  * const counter = defineIsland<{ start: number }>((el, props) => {
@@ -30,80 +42,128 @@ export { MAX_MEDIA_QUERY_LENGTH, scheduleTrigger };
30
42
  * })
31
43
  * mountIslands({ counter })
32
44
  *
33
- * The props type is a contract, not a validator - `data-props` is JSON authored by your own SSR, so
34
- * it is trusted framing, not user input. Keep the enhancer body imperative: read the DOM, wire
35
- * listeners, return cleanup. No hidden reactivity to get wrong.
45
+ * The props type is a contract, not a validator - `data-island-props` is JSON authored by your own
46
+ * SSR, so it is trusted framing, not user input. Keep the enhancer body imperative: read the DOM,
47
+ * wire listeners, return cleanup.
36
48
  */
37
49
  export function defineIsland(enhancer) {
38
50
  return enhancer;
39
51
  }
40
- /** Parse an island's inline `data-props` JSON; malformed/absent → `undefined` (never throws). */
41
- function readProps(el) {
42
- const raw = el.dataset.props;
43
- if (raw === undefined || raw === "")
44
- return undefined;
45
- try {
46
- return JSON.parse(raw);
47
- }
48
- catch {
49
- return undefined;
50
- }
52
+ const onPage = (type, el, callback) => {
53
+ if (typeof document === "undefined")
54
+ return () => { };
55
+ const listener = (event) => {
56
+ if (event.target instanceof Node && event.target.contains(el))
57
+ callback();
58
+ };
59
+ document.addEventListener(type, listener);
60
+ return () => document.removeEventListener(type, listener);
61
+ };
62
+ /**
63
+ * Run `callback` each time the `keepAlive` page `el` renders in is hidden behind another page, just
64
+ * before it leaves the document. An island in a kept page stays mounted, and its timers and window
65
+ * listeners keep running, while the page is hidden: pause them here. Returns its removal - hand it back
66
+ * as part of the enhancer's cleanup. Never runs outside a kept page.
67
+ *
68
+ * const clock = defineIsland((el) => {
69
+ * let timer = setInterval(tick, 1000)
70
+ * const hide = onPageHide(el, () => clearInterval(timer))
71
+ * const show = onPageShow(el, () => { timer = setInterval(tick, 1000) })
72
+ * return () => { hide(); show(); clearInterval(timer) }
73
+ * })
74
+ */
75
+ export function onPageHide(el, callback) {
76
+ return onPage(PAGE_HIDE_EVENT, el, callback);
77
+ }
78
+ /** Run `callback` each time the `keepAlive` page `el` renders in is shown again; returns its removal. */
79
+ export function onPageShow(el, callback) {
80
+ return onPage(PAGE_SHOW_EVENT, el, callback);
51
81
  }
52
82
  /**
53
- * Find every `<nifra-island data-id>` under `root` (default `document`) and enhance each with the
54
- * matching enhancer, honoring its `data-strategy`. An island whose `id` has no enhancer is left as
55
- * inert SSR HTML (forward-compatible). An enhancer that throws is isolated - it never blocks the
56
- * others (each island is independent). Returns a disposer that cancels pending triggers and runs every
57
- * enhancer's cleanup (call it on soft-nav teardown; harmless if your app never navigates).
83
+ * The binding tier: `setup` creates the island's state and returns the event handlers its markup
84
+ * names; the island's `data-bind-*` attributes then bind them.
85
+ *
86
+ * data-bind-text="count" data-bind-show="open" data-bind-class="active:open"
87
+ * data-bind-attr="aria-expanded:open" data-bind-value="query" data-bind-on="click:add"
88
+ *
89
+ * Attribute values are signal and handler names, never code; an unknown name warns once and the
90
+ * server-rendered content stays as it is. A binding belongs to its nearest island.
91
+ *
92
+ * A setup or binding that throws stops everything the island started before the error reaches
93
+ * `mountIslands`. On unmount every cleanup runs; one that throws is logged and the rest still run.
58
94
  */
59
- export function mountIslands(enhancers, options = {}) {
60
- const root = options.root ?? document;
61
- const disposers = [];
62
- for (const el of root.querySelectorAll("nifra-island[data-id]")) {
63
- const id = el.dataset.id;
64
- if (id === undefined)
65
- continue;
66
- const enhancer = enhancers[id];
67
- if (enhancer === undefined)
68
- continue; // no enhancer for this id → leave it as inert SSR markup
69
- const props = readProps(el);
70
- const strategyAttr = el.dataset.strategy;
71
- const strategy = strategyAttr === "idle" || strategyAttr === "visible" || strategyAttr === "load"
72
- ? strategyAttr
73
- : strategyAttr === "media" &&
74
- el.dataset.media !== undefined &&
75
- el.dataset.media.length > 0 &&
76
- el.dataset.media.length <= MAX_MEDIA_QUERY_LENGTH
77
- ? { media: el.dataset.media }
78
- : strategyAttr === undefined
79
- ? "load"
80
- : undefined;
81
- // Invalid media markers remain inert rather than silently becoming eager. Their SSR content stays
82
- // usable, and untrusted HTML cannot turn an oversized query into an unexpected trigger.
83
- if (strategy === undefined)
84
- continue;
85
- const run = () => {
86
- try {
87
- const cleanup = enhancer(el, props);
88
- if (typeof cleanup === "function")
89
- disposers.push(cleanup);
90
- }
91
- catch (err) {
92
- // One island's failure must not take down the others; surface it without throwing.
93
- console.error(`[nifra/islands] enhancer "${id}" failed:`, err);
95
+ export function bindIsland(setup) {
96
+ return (root, props) => {
97
+ const stops = [];
98
+ let live = true;
99
+ const seeded = typeof props === "object" && props !== null ? props : {};
100
+ // No prototype: a state key like `constructor` is an entry like any other.
101
+ const signals = Object.create(null);
102
+ const ctx = {
103
+ root,
104
+ props,
105
+ state(key, fallback) {
106
+ signals[key] ??= signal(Object.hasOwn(seeded, key) ? seeded[key] : fallback);
107
+ // biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion: each key's signal is created once, from this call's type
108
+ return signals[key];
109
+ },
110
+ onDispose: (fn) => {
111
+ if (live)
112
+ stops.push(fn);
113
+ else
114
+ fn();
115
+ },
116
+ };
117
+ const dispose = () => {
118
+ live = false;
119
+ for (let stop = stops.pop(); stop !== undefined; stop = stops.pop()) {
120
+ try {
121
+ stop();
122
+ }
123
+ catch (err) {
124
+ console.error("[nifra/islands] cleanup failed:", err);
125
+ }
94
126
  }
95
127
  };
96
- disposers.push(scheduleTrigger(strategy, run, { target: el }));
128
+ try {
129
+ // Owned, so a binding whose first run throws is registered before it throws.
130
+ owned(stops, () => bindScope(root, { signals, handlers: setup(ctx) ?? {} }, stops));
131
+ }
132
+ catch (err) {
133
+ dispose();
134
+ throw err;
135
+ }
136
+ return dispose;
137
+ };
138
+ }
139
+ /**
140
+ * The `data-island-props` value for `props`: JSON. Emit it through an escaping renderer into a quoted
141
+ * attribute (`data-island-props="${...}"`): unquoted, a space in the JSON ends the value and the rest
142
+ * parses as attributes.
143
+ */
144
+ export function islandProps(props) {
145
+ return JSON.stringify(props);
146
+ }
147
+ /**
148
+ * Find every `[data-island]` element under `root` (default `document`) and enhance each with the
149
+ * matching enhancer, honoring its `data-island-strategy`. An island whose id has no enhancer, or that
150
+ * is already mounted, is left alone, so calling again after a soft navigation mounts only new hosts.
151
+ * An enhancer that throws is isolated - it never blocks the others. Every effect, list binding and
152
+ * resource an enhancer creates is owned by its island. Returns a disposer that cancels pending
153
+ * triggers and tears down every island it mounted (call it on soft-nav teardown).
154
+ */
155
+ export function mountIslands(
156
+ // `never` admits an enhancer of any props type: each one's props are its own island's JSON.
157
+ enhancers, options = {}) {
158
+ const disposers = [];
159
+ for (const el of (options.root ?? document).querySelectorAll("[data-island]:not([data-island-ignore],[data-island-ignore] *)")) {
160
+ const dispose = mountIsland(el, enhancers);
161
+ if (dispose !== undefined)
162
+ disposers.push(dispose);
97
163
  }
98
164
  return () => {
99
- for (const dispose of disposers) {
100
- try {
101
- dispose();
102
- }
103
- catch {
104
- // best-effort teardown - a failing cleanup must not block the rest
105
- }
106
- }
165
+ for (const dispose of disposers.splice(0))
166
+ dispose();
107
167
  };
108
168
  }
109
169
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"islands.js","sourceRoot":"","sources":["../src/islands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAEL,sBAAsB,EACtB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAuB,sBAAsB,EAAE,eAAe,EAAE,CAAA;AAavE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CA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@ -1,3 +1,4 @@
1
+ import { type InvalidationReport } from "./internal/invalidation.js";
1
2
  /** A cached SSR response - the bytes + metadata a {@link CacheStore} persists. */
2
3
  export interface CachedResponse {
3
4
  /** The rendered document (UTF-8 HTML, fully buffered). */
@@ -34,7 +35,9 @@ export interface CacheStore {
34
35
  * The current point in this store's purge order. `withISR` takes one before each render and hands it
35
36
  * back as {@link CachedResponse.fence}, and `set` skips that entry when its key or one of its tags
36
37
  * was purged after the point. Without it, a purge that lands while a page renders is undone when the
37
- * render stores the page it built from data read before the purge.
38
+ * render stores the page it built from data read before the purge. A store whose purges reach other
39
+ * instances late must also check on read, as {@link KVCacheStore} does: `set` there cannot see a
40
+ * purge that has not arrived yet.
38
41
  */
39
42
  readonly fence?: () => number | Promise<number>;
40
43
  }
@@ -46,6 +49,10 @@ export declare function serializeISRTags(tags: readonly string[]): string | unde
46
49
  /** What a `revalidateTags` function is given: the URL and route params only, both already public. */
47
50
  export interface RevalidateTagsInput {
48
51
  readonly params: Readonly<Record<string, string>>;
52
+ /**
53
+ * The request's URL. On a partially prerendered route and its shared holes, the shell's: the
54
+ * configured origin, the path and the declared variations, never the visitor's Host or other query.
55
+ */
49
56
  readonly url: URL;
50
57
  }
51
58
  /**
@@ -132,7 +139,8 @@ export interface KVCacheStoreOptions {
132
139
  * binding) - the production-grade shared/durable store ISR wants: cached pages and on-demand purges
133
140
  * hold *across* worker instances (unlike the per-instance {@link MemoryCacheStore}). Entries serialize
134
141
  * to JSON; every read is validated before it's trusted (a malformed/version-skewed entry is treated as
135
- * a miss). Construct it in your Workers `fetch` from the binding: `new KVCacheStore(env.ISR_CACHE)`.
142
+ * a miss). Construct it in your Workers `fetch` from the binding: `new KVCacheStore(env.ISR_CACHE)`,
143
+ * and give `withISR` the `storeSecret` it signs these pages with.
136
144
  *
137
145
  * Cloudflare is the default, not a requirement: {@link KVNamespaceLike} is three structural methods,
138
146
  * so a Redis, Deno KV, or Upstash binding satisfies it (pass `minExpirationTtl` for their TTL floor).
@@ -142,17 +150,23 @@ export interface KVCacheStoreOptions {
142
150
  export declare class KVCacheStore implements CacheStore {
143
151
  private readonly kv;
144
152
  private readonly putOptions;
153
+ private readonly pathEpochOptions;
145
154
  constructor(kv: KVNamespaceLike, options?: KVCacheStoreOptions);
146
155
  get(key: string): Promise<CachedResponse | undefined>;
147
- /** Wall-clock time, so purges on any instance order against it. KV is eventually consistent, so the
148
- * fence holds only for purges this location has already seen. */
156
+ /** Wall-clock time, so purges on any instance order against it. KV is eventually consistent, so
157
+ * `set` refuses only purges this location has already seen; a page stored before a purge reached
158
+ * its location keeps the older epoch and reads as a miss once the purge arrives. */
149
159
  fence(): number;
150
160
  set(key: string, value: CachedResponse): Promise<void>;
151
- /** Leaves a marker rather than removing the key, so `set` can refuse a render that began before
152
- * the purge. The marker reads as a miss. */
161
+ /** Moves the path's epoch and leaves the page: a page stored under the old epoch reads as a miss,
162
+ * even one another location stored before this purge reached it, and `set` refuses a render begun
163
+ * before the purge. */
153
164
  delete(key: string): Promise<void>;
154
165
  invalidateTag(tag: string): Promise<void>;
155
166
  private tagKey;
167
+ /** The page key under a prefix, or its digest when that would pass KV's key limit. */
168
+ private pathKey;
169
+ private pathEpoch;
156
170
  }
157
171
  /** Minimal platform shape `withISR` needs - just `waitUntil` (edge runtimes extend the response
158
172
  * lifetime so background regeneration finishes). Off-edge it's absent and regen runs fire-and-forget. */
@@ -184,6 +198,19 @@ export declare function openCacheChannel(app: object): void;
184
198
  export declare function withoutCacheChannel(res: Response): Response;
185
199
  export interface ISROptions {
186
200
  readonly store: CacheStore;
201
+ /**
202
+ * Signs every page written to `store` and checks the signature on every read, so whoever else can
203
+ * write the store (another service on the same KV namespace, a leaked token) cannot hand visitors a
204
+ * page this app did not render. Required for every store but a {@link MemoryCacheStore}, whose
205
+ * pages never leave the process and stay unsigned. The same in every process, at least 32
206
+ * characters, and random: generate it, such as 32 random bytes as hex, since a guessable secret
207
+ * can be found from any signed page and then signs pages of its own. A page whose signature is
208
+ * missing or wrong reads as a miss and renders again, so a new secret only empties the cache. It
209
+ * cannot stop a store writer from deleting pages, or from putting back an older page this app
210
+ * stored for the same key. That page keeps its age: still within its freshness window, it is a hit
211
+ * until the window ends; past it, it serves stale and regenerates.
212
+ */
213
+ readonly storeSecret?: string;
187
214
  /** Default freshness window (**seconds**) for a cached page; older ⇒ stale (served, regenerated
188
215
  * behind). A route overrides it per-page via `export const revalidate` (surfaced as the
189
216
  * `x-nifra-isr-revalidate` response header). */
@@ -194,7 +221,10 @@ export interface ISROptions {
194
221
  * so host-routed apps do not share entries across tenants. Return `null` to bypass the cache for
195
222
  * this request (it goes straight to the app, uncached). Replaces `query` entirely. Under the default
196
223
  * key a request carrying `Authorization` or a cookie outside `anonymousCookies` never reads the
197
- * store; a custom key takes that decision over, so include whatever identifies the visitor in it. */
224
+ * store; a custom key takes that decision over, so include whatever identifies the visitor in it.
225
+ * An action's `revalidate(paths)` keys each path with the action request's own headers, so it purges
226
+ * the variant that client reads; a variant keyed on another header value (another language) is not
227
+ * reached - tag those pages and revalidate the tag. */
198
228
  readonly key?: (req: Request) => string | null;
199
229
  /**
200
230
  * Cookie names that never change the page, such as a consent or analytics cookie. Under the default
@@ -217,10 +247,11 @@ export interface ISROptions {
217
247
  * fresh, and a draft render is never written to the store (it can't poison the public cache). */
218
248
  readonly draftSecret?: string;
219
249
  /**
220
- * Called when a store call fails: it throws, rejects, or outlives {@link storeTimeoutMs}. The request
221
- * is served without the cache either way - a failed read is a miss, a failed write still returns the
222
- * rendered page, a failed regeneration keeps the stale entry - so a store outage never changes a
223
- * status. Default: one `console.error` line per operation per minute, never naming the cache key.
250
+ * Called when a store call fails: it throws, rejects, or outlives {@link storeTimeoutMs}, or (op
251
+ * `"verify"`) a page it returns fails its {@link storeSecret} signature check. The request is served
252
+ * without the cache either way - a failed read is a miss, a failed write still returns the rendered
253
+ * page, a failed regeneration keeps the stale entry - so a store outage never changes a status.
254
+ * Default: one `console.error` line per operation per minute, never naming the cache key.
224
255
  */
225
256
  readonly onStoreError?: (error: unknown, info: {
226
257
  readonly op: ISRStoreOp;
@@ -230,9 +261,25 @@ export interface ISROptions {
230
261
  * the request; set it when the store is a network service.
231
262
  */
232
263
  readonly storeTimeoutMs?: number;
264
+ /**
265
+ * Caches below the pages whose entries carry the same tags, such as a `@nifrajs/cache` holding loader
266
+ * data. An action's `revalidate(paths, data, { tags })` invalidates them first, then this store, then
267
+ * publishes to live pages, then purges `cdn`; a cache that fails stops the rest, so no client reloads
268
+ * stale data.
269
+ */
270
+ readonly dataCaches?: readonly {
271
+ invalidateTag(tag: string): unknown;
272
+ }[];
273
+ /** A CDN an action's invalidation purges last (a `@nifrajs/web/cdn` provider). */
274
+ readonly cdn?: CdnPurgeTarget;
275
+ /**
276
+ * An action's invalidation that still failed after its retries; the action's own answer never
277
+ * changes. Default: one `console.error` line naming the operation id and stage.
278
+ */
279
+ readonly onInvalidationError?: (report: InvalidationReport) => void;
233
280
  }
234
281
  /** The store operation an {@link ISROptions.onStoreError} report is about. */
235
- export type ISRStoreOp = "get" | "set" | "delete" | "fence";
282
+ export type ISRStoreOp = "get" | "set" | "delete" | "fence" | "verify";
236
283
  /** Which query parameters an ISR key carries - see {@link ISROptions.query}. */
237
284
  export type ISRQuery = "bypass" | "all" | readonly string[];
238
285
  /** The default key for a URL under a `query` policy, or `null` when the URL must bypass the cache. */
@@ -240,7 +287,7 @@ export declare const urlKeyOf: (query?: ISRQuery) => ((url: URL) => string | nul
240
287
  /**
241
288
  * Whether `res` may be stored by a shared cache and served to anyone requesting `req`'s URL: a
242
289
  * full-document `GET` 200 `text/html` with no Set-Cookie, no `private`/`no-store`, no `Vary` beyond
243
- * the data header, and, for a request carrying a cookie or Authorization or accepted by an
290
+ * the data/swap headers, and, for a request carrying a cookie or Authorization or accepted by an
244
291
  * authentication stage, an explicit `public`.
245
292
  * The one rule both `withISR` and `@nifrajs/web/cdn` cache by.
246
293
  */
@@ -303,6 +350,13 @@ export interface RevalidateEndpointOptions {
303
350
  readonly dataCaches?: readonly {
304
351
  invalidateTag(tag: string): unknown;
305
352
  }[];
353
+ /**
354
+ * The app's live runtime: a purge also tells live pages watching a purged tag to reload, after the
355
+ * caches and before the CDN. A publish that fails answers `502` with `origin: "done"`.
356
+ */
357
+ readonly live?: {
358
+ publish(...keys: string[]): Promise<void>;
359
+ };
306
360
  }
307
361
  /**
308
362
  * An **on-demand revalidation** (purge) endpoint - a `fetch` handler that drops cached pages by path
package/dist/isr.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"isr.d.ts","sourceRoot":"","sources":["../src/isr.ts"],"names":[],"mappings":"AAaA,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,sGAAsG;IACtG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC;2FACuF;IACvF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IACrD,gDAAgD;IAChD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtD,sEAAsE;IACtE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI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