@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
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Partial prerendering limits and defaults. Internal while the feature is experimental: every
3
+ * number the plan names lives here once, so a deployment overrides it in one object and the request
4
+ * path reads the resolved copy rather than a scattered constant.
5
+ */
6
+ /** Overrides for {@link PPR_DEFAULTS}. Every field is optional; an omitted one keeps its default. */
7
+ export interface PprOptions {
8
+ /** A hole's deadline when its boundary sets no `timeout`. */
9
+ readonly holeTimeoutMs?: number;
10
+ /** The largest `timeout` a boundary may set, and the cap on a route's total deadline. */
11
+ readonly maxHoleTimeoutMs?: number;
12
+ /** Added to the largest hole timeout to give the route's total deadline. */
13
+ readonly totalDeadlineSlackMs?: number;
14
+ /** Dynamic plus shared boundaries one PPR route may declare. */
15
+ readonly maxHolesPerRoute?: number;
16
+ /** Shell entries one route may keep in the memory store. */
17
+ readonly shellEntriesPerRoute?: number;
18
+ /**
19
+ * Bytes every shell entry in the memory store may hold together: its document, an estimate of the
20
+ * heap its loader data holds, and its key. An entry over the whole budget is served but not kept.
21
+ */
22
+ readonly shellStoreBytes?: number;
23
+ /** How long a `notFound()` shell is cached. */
24
+ readonly notFoundTtlSeconds?: number;
25
+ /** Shell builds one route may run at once; requests over it get the blocking render. */
26
+ readonly shellBuildConcurrency?: number;
27
+ /**
28
+ * Once the store is full, requests one shell key must see before its shell is built and may push
29
+ * an older one out. The ones before stream the page whole, each hole as it settles, so a path
30
+ * visited once cannot evict a popular one. While the store has room, every key builds at once.
31
+ */
32
+ readonly shellAfterRequests?: number;
33
+ /** A failing rebuild keeps serving the stale shell for `revalidate` times this... */
34
+ readonly staleOnErrorFactor?: number;
35
+ /** ...but never longer than this. */
36
+ readonly maxStaleOnErrorSeconds?: number;
37
+ /** Requests that get the blocking render instead of a stream: a user-agent pattern or a predicate. */
38
+ readonly blockingFor?: RegExp | ((request: Request) => boolean);
39
+ /** Abandoned invocations at which one boundary stops being admitted. */
40
+ readonly boundaryAbandonedTrip?: number;
41
+ /** Abandoned invocations per process at which boundaries holding any stop being admitted. */
42
+ readonly processAbandonedTrip?: number;
43
+ /** Abandoned invocations per process at which no hole is admitted. */
44
+ readonly admissionStop?: number;
45
+ /** How long after its abort a still-pending invocation counts as abandoned. */
46
+ readonly abandonGraceMs?: number;
47
+ /** PPR responses per process with hole loaders still running. */
48
+ readonly maxHoleWork?: number;
49
+ /** How long after the total deadline an undrained stream is kept before it is aborted. */
50
+ readonly writeGraceMs?: number;
51
+ /** Unsent bytes one response may queue. */
52
+ readonly maxUnsentBytesPerResponse?: number;
53
+ /** Unsent bytes every PPR response in the process may queue together. */
54
+ readonly maxUnsentBytes?: number;
55
+ /** Serialized size of one hole frame. */
56
+ readonly frameBytes?: number;
57
+ /** The shell is padded to at least this many bytes; Safari holds back smaller first chunks. */
58
+ readonly minShellBytes?: number;
59
+ /**
60
+ * When hole HTML is checked for script, handlers and other escapes before it is framed:
61
+ * `"always"`, or `"development"` only. The check costs about 20 us per KB of hole HTML; turn it off
62
+ * in production only when a strict CSP already blocks inline script.
63
+ */
64
+ readonly holeHtmlValidation?: "always" | "development";
65
+ /**
66
+ * Whether a page left with holes pending posts a cancel beacon, so their loaders stop before their
67
+ * deadline. Off by default on Cloudflare Workers, where the beacon reaches another isolate.
68
+ */
69
+ readonly cancelBeacon?: boolean;
70
+ /**
71
+ * How long a process serves a shell or shared hole it wrote to or read from the shared store before
72
+ * reading it there again, so a purge another process made reaches this one. 0 reads it every time.
73
+ */
74
+ readonly sharedRecheckMs?: number;
75
+ }
76
+ export type ResolvedPprOptions = {
77
+ readonly [K in keyof PprOptions]-?: Exclude<PprOptions[K], undefined>;
78
+ };
79
+ /**
80
+ * Crawlers that read the document without running streamed scripts, so they get the blocking render.
81
+ * The same set Next.js treats as HTML-limited bots. Googlebot itself is absent on purpose: it renders
82
+ * JavaScript. `[\w-]-Google` matches what `[\w-]+-Google` does without backtracking at every position.
83
+ */
84
+ export declare const HTML_LIMITED_BOTS: RegExp;
85
+ export declare const PPR_DEFAULTS: ResolvedPprOptions;
86
+ /** The latest request a shell may wait for; the canary check requests a path this many times. */
87
+ export declare const MAX_SHELL_AFTER_REQUESTS = 8;
88
+ /**
89
+ * Merge `overrides` over {@link PPR_DEFAULTS} and check the result. Unknown keys, non-integers and
90
+ * limits that contradict each other throw at startup, never on a request.
91
+ */
92
+ export declare function resolvePprOptions(overrides?: PprOptions): ResolvedPprOptions;
93
+ /** A route's total deadline: its largest hole timeout plus the slack, capped. */
94
+ export declare function totalDeadlineMs(options: ResolvedPprOptions, holeTimeouts: readonly number[]): number;
95
+ export { wantsBlockingRender } from "./contract.js";
96
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/internal/ppr/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qGAAqG;AACrG,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IACtC,gEAAgE;IAChE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IACtC;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IACpC,wFAAwF;IACxF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IACpC,qFAAqF;IACrF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IACpC,qCAAqC;IACrC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IACxC,sGAAsG;IACtG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAA;IAC/D,wEAAwE;IACxE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IACvC,6FAA6F;IAC7F,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IACtC,sEAAsE;IACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,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AAM,eAAe,CAAA"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Partial prerendering limits and defaults. Internal while the feature is experimental: every
3
+ * number the plan names lives here once, so a deployment overrides it in one object and the request
4
+ * path reads the resolved copy rather than a scattered constant.
5
+ */
6
+ /**
7
+ * Crawlers that read the document without running streamed scripts, so they get the blocking render.
8
+ * The same set Next.js treats as HTML-limited bots. Googlebot itself is absent on purpose: it renders
9
+ * JavaScript. `[\w-]-Google` matches what `[\w-]+-Google` does without backtracking at every position.
10
+ */
11
+ export const HTML_LIMITED_BOTS = /[\w-]-Google|Google-[\w-]|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i;
12
+ const MB = 1024 * 1024;
13
+ export const PPR_DEFAULTS = Object.freeze({
14
+ holeTimeoutMs: 5_000,
15
+ maxHoleTimeoutMs: 30_000,
16
+ totalDeadlineSlackMs: 1_000,
17
+ maxHolesPerRoute: 32,
18
+ shellEntriesPerRoute: 10_000,
19
+ shellStoreBytes: 64 * MB,
20
+ notFoundTtlSeconds: 60,
21
+ shellBuildConcurrency: 4,
22
+ shellAfterRequests: 2,
23
+ staleOnErrorFactor: 10,
24
+ maxStaleOnErrorSeconds: 86_400,
25
+ blockingFor: HTML_LIMITED_BOTS,
26
+ boundaryAbandonedTrip: 64,
27
+ processAbandonedTrip: 1_024,
28
+ admissionStop: 4_096,
29
+ abandonGraceMs: 100,
30
+ maxHoleWork: 1_024,
31
+ writeGraceMs: 5_000,
32
+ maxUnsentBytesPerResponse: MB,
33
+ maxUnsentBytes: 64 * MB,
34
+ frameBytes: 256 * 1024,
35
+ minShellBytes: 1_024,
36
+ holeHtmlValidation: "always",
37
+ cancelBeacon: true,
38
+ sharedRecheckMs: 1_000,
39
+ });
40
+ /**
41
+ * On Cloudflare Workers an isolate's memory is shared by everything it runs, and a beacon almost
42
+ * always reaches another isolate than the one running the holes.
43
+ */
44
+ const WORKERS_DEFAULTS = Object.freeze({
45
+ shellStoreBytes: 8 * MB,
46
+ cancelBeacon: false,
47
+ });
48
+ const onWorkers = () => globalThis.navigator?.userAgent === "Cloudflare-Workers";
49
+ const optionError = (message) => new TypeError(`[nifra/web] ppr: ${message}`);
50
+ function assertOrdered(options, smaller, larger) {
51
+ if (options[smaller] > options[larger]) {
52
+ throw optionError(`${smaller} (${options[smaller]}) must not exceed ${larger} (${options[larger]})`);
53
+ }
54
+ }
55
+ /** The latest request a shell may wait for; the canary check requests a path this many times. */
56
+ export const MAX_SHELL_AFTER_REQUESTS = 8;
57
+ /**
58
+ * Merge `overrides` over {@link PPR_DEFAULTS} and check the result. Unknown keys, non-integers and
59
+ * limits that contradict each other throw at startup, never on a request.
60
+ */
61
+ export function resolvePprOptions(overrides = {}) {
62
+ for (const key of Object.keys(overrides)) {
63
+ if (!Object.hasOwn(PPR_DEFAULTS, key))
64
+ throw optionError(`unknown option "${key}"`);
65
+ }
66
+ const defined = Object.fromEntries(Object.entries(overrides).filter(([, value]) => value !== undefined));
67
+ const resolved = {
68
+ ...PPR_DEFAULTS,
69
+ ...(onWorkers() ? WORKERS_DEFAULTS : undefined),
70
+ ...defined,
71
+ };
72
+ for (const [key, value] of Object.entries(resolved)) {
73
+ if (key === "blockingFor" || key === "holeHtmlValidation" || key === "cancelBeacon")
74
+ continue;
75
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
76
+ throw optionError(`${key} must be a non-negative integer, got ${String(value)}`);
77
+ }
78
+ }
79
+ for (const key of [
80
+ "holeTimeoutMs",
81
+ "maxHolesPerRoute",
82
+ "shellBuildConcurrency",
83
+ "shellAfterRequests",
84
+ "boundaryAbandonedTrip",
85
+ "maxHoleWork",
86
+ "maxUnsentBytesPerResponse",
87
+ "frameBytes",
88
+ ]) {
89
+ if (resolved[key] === 0)
90
+ throw optionError(`${key} must be at least 1`);
91
+ }
92
+ if (resolved.shellAfterRequests > MAX_SHELL_AFTER_REQUESTS) {
93
+ throw optionError(`shellAfterRequests must be at most ${MAX_SHELL_AFTER_REQUESTS}, got ${resolved.shellAfterRequests}`);
94
+ }
95
+ const blockingFor = resolved.blockingFor;
96
+ if (!(blockingFor instanceof RegExp) && typeof blockingFor !== "function") {
97
+ throw optionError("blockingFor must be a RegExp or a function of the request");
98
+ }
99
+ if (resolved.holeHtmlValidation !== "always" && resolved.holeHtmlValidation !== "development") {
100
+ throw optionError(`holeHtmlValidation must be "always" or "development", got ${String(resolved.holeHtmlValidation)}`);
101
+ }
102
+ if (typeof resolved.cancelBeacon !== "boolean") {
103
+ throw optionError(`cancelBeacon must be a boolean, got ${String(resolved.cancelBeacon)}`);
104
+ }
105
+ // A global or sticky pattern keeps `lastIndex` between `test` calls, so one bot would alternate.
106
+ if (blockingFor instanceof RegExp && (blockingFor.global || blockingFor.sticky)) {
107
+ throw optionError("blockingFor must not use the g or y flag");
108
+ }
109
+ assertOrdered(resolved, "holeTimeoutMs", "maxHoleTimeoutMs");
110
+ assertOrdered(resolved, "boundaryAbandonedTrip", "processAbandonedTrip");
111
+ assertOrdered(resolved, "processAbandonedTrip", "admissionStop");
112
+ assertOrdered(resolved, "frameBytes", "maxUnsentBytesPerResponse");
113
+ assertOrdered(resolved, "maxUnsentBytesPerResponse", "maxUnsentBytes");
114
+ return Object.freeze(resolved);
115
+ }
116
+ /** A route's total deadline: its largest hole timeout plus the slack, capped. */
117
+ export function totalDeadlineMs(options, holeTimeouts) {
118
+ let largest = 0;
119
+ for (const timeout of holeTimeouts)
120
+ if (timeout > largest)
121
+ largest = timeout;
122
+ return Math.min(largest + options.totalDeadlineSlackMs, options.maxHoleTimeoutMs);
123
+ }
124
+ export { wantsBlockingRender } from "./contract.js";
125
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources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AAM,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QAChF,MAAM,WAAW,CAAC,0CAA0C,CAAC,CAAA;IAC/D,CAAC;IACD,aAAa,CAAC,QAAQ,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAA;IAC5D,aAAa,CAAC,QAAQ,EAAE,uBAAuB,EAAE,sBAAsB,CAAC,CAAA;IACxE,aAAa,CAAC,QAAQ,EAAE,sBAAsB,EAAE,eAAe,CAAC,CAAA;IAChE,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,2BAA2B,CAAC,CAAA;IAClE,aAAa,CAAC,QAAQ,EAAE,2BAA2B,EAAE,gBAAgB,CAAC,CAAA;IACtE,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAC7B,OAA2B,EAC3B,YAA+B;IAE/B,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,KAAK,MAAM,OAAO,IAAI,YAAY;QAAE,IAAI,OAAO,GAAG,OAAO;YAAE,OAAO,GAAG,OAAO,CAAA;IAC5E,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACnF,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { BoundaryRegistration } from "../../boundary.js";
2
+ import type { RouteEntry, RouteModule } from "../../manifest.js";
3
+ import type { LoadedLayoutModules } from "../render-document.js";
4
+ import type { ResolvedPprOptions } from "./options.js";
5
+ /**
6
+ * The declared variations `search` selects. A parameter given twice, or a value outside its set,
7
+ * selects nothing, so every spelling of one choice maps to one shell.
8
+ */
9
+ export declare function variationsOf(declared: RouteModule["shellVariations"], search: string): Readonly<Record<string, string>>;
10
+ /** The PPR eligibility rules a route's own files cannot check: its layouts and boundary modes. */
11
+ export declare function assertPprRoute(route: RouteEntry, layouts: LoadedLayoutModules, boundaries: readonly BoundaryRegistration[], limits: ResolvedPprOptions): void;
12
+ //# sourceMappingURL=route-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-rules.d.ts","sourceRoot":"","sources":["../../../src/internal/ppr/route-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEtD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,CAAC,EACxC,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAWlC;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAC3C,MAAM,EAAE,kBAAkB,GACzB,IAAI,CA4CN"}
@@ -0,0 +1,53 @@
1
+ import { isHole, serverHoleComponent } from "./contract.js";
2
+ /**
3
+ * The declared variations `search` selects. A parameter given twice, or a value outside its set,
4
+ * selects nothing, so every spelling of one choice maps to one shell.
5
+ */
6
+ export function variationsOf(declared, search) {
7
+ const lists = declared?.search;
8
+ if (lists === undefined || search === "")
9
+ return {};
10
+ const query = new URLSearchParams(search);
11
+ const chosen = {};
12
+ for (const [name, allowed] of Object.entries(lists)) {
13
+ const values = query.getAll(name);
14
+ const value = values[0];
15
+ if (values.length === 1 && value !== undefined && allowed.includes(value))
16
+ chosen[name] = value;
17
+ }
18
+ return chosen;
19
+ }
20
+ /** The PPR eligibility rules a route's own files cannot check: its layouts and boundary modes. */
21
+ export function assertPprRoute(route, layouts, boundaries, limits) {
22
+ // `compileShells` refuses the same chain at startup; this catches a record made from other files.
23
+ layouts.forEach((layout, index) => {
24
+ if (layout.loader !== undefined && layout.gate !== true) {
25
+ throw new Error(`[nifra/web] ppr: route "${route.id}" has a shellLoader, but its layout "${route.layoutIds[index]}" has a loader that is not a gate. A layout loader reads the request, so its output cannot be in a shared shell`);
26
+ }
27
+ });
28
+ let holes = 0;
29
+ for (const boundary of boundaries) {
30
+ if (typeof boundary.mode === "object") {
31
+ throw new Error(`[nifra/web] ppr: route "${route.id}" has a shellLoader and an intercepting boundary "${boundary.name}", which partial prerendering does not support yet`);
32
+ }
33
+ if (!isHole(boundary))
34
+ continue;
35
+ holes++;
36
+ if (typeof boundary.load !== "function") {
37
+ throw new Error(`[nifra/web] ppr: boundary "${boundary.name}" of route "${route.id}" has no boundaryLoaders entry; a hole is filled from its own loader`);
38
+ }
39
+ if (serverHoleComponent(boundary.render) !== undefined &&
40
+ (boundary.mode !== "dynamic" || boundary.interactive === true)) {
41
+ throw new Error(`[nifra/web] ppr: boundary "${boundary.name}" of route "${route.id}" shows a server component, so it must be a dynamic hole that is not interactive: the component runs for each visitor, and its client islands hydrate`);
42
+ }
43
+ const { timeout } = boundary;
44
+ const max = limits.maxHoleTimeoutMs;
45
+ if (timeout !== undefined && !(Number.isInteger(timeout) && timeout >= 1 && timeout <= max)) {
46
+ throw new RangeError(`[nifra/web] ppr: boundary "${boundary.name}" of route "${route.id}" has timeout ${String(timeout)}; it must be a whole number of milliseconds from 1 to ${max}`);
47
+ }
48
+ }
49
+ if (holes === 0 || holes > limits.maxHolesPerRoute) {
50
+ throw new RangeError(`[nifra/web] ppr: route "${route.id}" has a shellLoader and ${holes} dynamic or shared boundaries; it needs 1 to ${limits.maxHolesPerRoute}. A page with no per-visitor or fast-changing part needs no shell: prerender it or give it \`revalidate\``);
51
+ }
52
+ }
53
+ //# sour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AAC,yDAAyD,GAAG,EAAE,CACjK,CAAA;QACH,CAAC;IACH,CAAC;IACD,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACnD,MAAM,IAAI,UAAU,CAClB,2BAA2B,KAAK,CAAC,EAAE,2BAA2B,KAAK,gDAAgD,MAAM,CAAC,gBAAgB,2GAA2G,CACtP,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The PPR client runtime: one inline script in the shell, constant per release, listed in the CSP by
3
+ * hash. It fills each hole host from that hole's inert JSON frame, keeps interactive holes' props for
4
+ * the adapter, with a server component's record and HTML for the islands inside it, and on leaving
5
+ * the route sends the response's cancel token. `put` is how an adapter refills a host from a data
6
+ * request's fill, through the same sink; it writes only into a host of the hole it names, so the
7
+ * global cannot carry a string into any other element under the policy.
8
+ *
9
+ * `__nifraPpr(name)` is the only entry point a frame calls, so every invoker is constant per hole name
10
+ * and hashable at build. Hole HTML goes in through `innerHTML`, where a `<script>` never runs, under a
11
+ * Trusted Types policy named `nifra-ppr` when the browser has the API. The server has validated that
12
+ * HTML before framing it; the policy only names the one sink.
13
+ */
14
+ export declare const PPR_RUNTIME = "(()=>{var w=window,d=document,h={},s={},dead=0,p;var pol=function(){if(!p){try{p=w.trustedTypes?w.trustedTypes.createPolicy(\"nifra-ppr\",{createHTML:function(x){return x}}):null}catch(_){}p=p||{createHTML:function(x){return x}}}return p};var ap=function(t,n,v){t.innerHTML=pol().createHTML(typeof v.html===\"string\"?v.html:\"\");t.setAttribute(\"data-nifra-filled\",\"\");t.setAttribute(\"aria-busy\",\"false\");if(v.error)t.setAttribute(\"data-nifra-hole-error\",\"\");else t.removeAttribute(\"data-nifra-hole-error\");var o={props:v.props,error:!!v.error};if(v.component){o.component=v.component;o.html=v.html}h[n]=o;return o};var f=function(n){if(dead)return;var e=d.getElementById(\"nifra-ppr:\"+n);if(!e)return;var v;try{v=JSON.parse(e.textContent)}catch(_){return}e.remove();var t=d.querySelector('[data-nifra-hole=\"'+n+'\"]');if(!t||t.hasAttribute(\"data-nifra-filled\"))return;var o=ap(t,n,v);(s[n]||[]).slice().forEach(function(c){c(o)})};f.put=function(n,v,t){if(v&&typeof v===\"object\"&&t&&t.getAttribute&&t.getAttribute(\"data-nifra-hole\")===n)ap(t,n,v)};f.get=function(n){return h[n]};f.subscribe=function(n,c){(s[n]||(s[n]=[])).push(c);return function(){s[n]=(s[n]||[]).filter(function(x){return x!==c})}};f.leave=function(){if(dead)return;dead=1;s={};var r=d.getElementById(\"nifra-ppr-req\");if(!r)return;var q;try{q=JSON.parse(r.textContent)}catch(_){return}if(q.cancel&&q.holes.some(function(n){return!h[n]})&&navigator.sendBeacon)navigator.sendBeacon(q.cancel,q.token)};f.dead=function(){return!!dead};f.boot=function(){var c=d.currentScript,e=c&&c.previousElementSibling;if(e&&e.rel===\"modulepreload\"&&e.href)import(e.href)};w.__nifraPpr=f})()";
15
+ /**
16
+ * What loads each module script of a shell, after a `<link rel="modulepreload">` naming it. WebKit
17
+ * evaluates a module script, `async` or not, only once the parser finishes, which on a streamed page
18
+ * is after the slowest hole, and a dynamic import of the same URL waits with it. A dynamic import
19
+ * from a classic script with no such element evaluates at once in every engine.
20
+ */
21
+ export declare const PPR_BOOT = "__nifraPpr.boot()";
22
+ /** The script a frame runs to fill hole `name`. Constant per name, so it is listed by hash. */
23
+ export declare const holeInvoker: (name: string) => string;
24
+ /**
25
+ * The `script-src` hash sources a PPR route needs: the runtime, the boot call and one invoker per hole. Computed once
26
+ * per route at startup, never per request.
27
+ */
28
+ export declare function pprScriptHashes(holeNames: readonly string[]): Promise<readonly string[]>;
29
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/internal/ppr/runtime.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,2oDAColD,CAAA;AAE5mD;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,sBAAsB,CAAA;AAE3C,+FAA+F;AAC/F,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAA+C,CAAA;AAE1F;;;GAGG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAE9F"}
@@ -0,0 +1,32 @@
1
+ import { hashSource } from "../../csp.js";
2
+ /**
3
+ * The PPR client runtime: one inline script in the shell, constant per release, listed in the CSP by
4
+ * hash. It fills each hole host from that hole's inert JSON frame, keeps interactive holes' props for
5
+ * the adapter, with a server component's record and HTML for the islands inside it, and on leaving
6
+ * the route sends the response's cancel token. `put` is how an adapter refills a host from a data
7
+ * request's fill, through the same sink; it writes only into a host of the hole it names, so the
8
+ * global cannot carry a string into any other element under the policy.
9
+ *
10
+ * `__nifraPpr(name)` is the only entry point a frame calls, so every invoker is constant per hole name
11
+ * and hashable at build. Hole HTML goes in through `innerHTML`, where a `<script>` never runs, under a
12
+ * Trusted Types policy named `nifra-ppr` when the browser has the API. The server has validated that
13
+ * HTML before framing it; the policy only names the one sink.
14
+ */
15
+ export const PPR_RUNTIME = '(()=>{var w=window,d=document,h={},s={},dead=0,p;var pol=function(){if(!p){try{p=w.trustedTypes?w.trustedTypes.createPolicy("nifra-ppr",{createHTML:function(x){return x}}):null}catch(_){}p=p||{createHTML:function(x){return x}}}return p};var ap=function(t,n,v){t.innerHTML=pol().createHTML(typeof v.html==="string"?v.html:"");t.setAttribute("data-nifra-filled","");t.setAttribute("aria-busy","false");if(v.error)t.setAttribute("data-nifra-hole-error","");else t.removeAttribute("data-nifra-hole-error");var o={props:v.props,error:!!v.error};if(v.component){o.component=v.component;o.html=v.html}h[n]=o;return o};var f=function(n){if(dead)return;var e=d.getElementById("nifra-ppr:"+n);if(!e)return;var v;try{v=JSON.parse(e.textContent)}catch(_){return}e.remove();var t=d.querySelector(\'[data-nifra-hole="\'+n+\'"]\');if(!t||t.hasAttribute("data-nifra-filled"))return;var o=ap(t,n,v);(s[n]||[]).slice().forEach(function(c){c(o)})};f.put=function(n,v,t){if(v&&typeof v==="object"&&t&&t.getAttribute&&t.getAttribute("data-nifra-hole")===n)ap(t,n,v)};f.get=function(n){return h[n]};f.subscribe=function(n,c){(s[n]||(s[n]=[])).push(c);return function(){s[n]=(s[n]||[]).filter(function(x){return x!==c})}};f.leave=function(){if(dead)return;dead=1;s={};var r=d.getElementById("nifra-ppr-req");if(!r)return;var q;try{q=JSON.parse(r.textContent)}catch(_){return}if(q.cancel&&q.holes.some(function(n){return!h[n]})&&navigator.sendBeacon)navigator.sendBeacon(q.cancel,q.token)};f.dead=function(){return!!dead};f.boot=function(){var c=d.currentScript,e=c&&c.previousElementSibling;if(e&&e.rel==="modulepreload"&&e.href)import(e.href)};w.__nifraPpr=f})()';
16
+ /**
17
+ * What loads each module script of a shell, after a `<link rel="modulepreload">` naming it. WebKit
18
+ * evaluates a module script, `async` or not, only once the parser finishes, which on a streamed page
19
+ * is after the slowest hole, and a dynamic import of the same URL waits with it. A dynamic import
20
+ * from a classic script with no such element evaluates at once in every engine.
21
+ */
22
+ export const PPR_BOOT = "__nifraPpr.boot()";
23
+ /** The script a frame runs to fill hole `name`. Constant per name, so it is listed by hash. */
24
+ export const holeInvoker = (name) => `__nifraPpr(${JSON.stringify(name)})`;
25
+ /**
26
+ * The `script-src` hash sources a PPR route needs: the runtime, the boot call and one invoker per hole. Computed once
27
+ * per route at startup, never per request.
28
+ */
29
+ export async function pprScriptHashes(holeNames) {
30
+ return Promise.all([PPR_RUNTIME, PPR_BOOT, ...holeNames.map(holeInvoker)].map(hashSource));
31
+ }
32
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/internal/ppr/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB,0mDAA0mD,CAAA;AAE5mD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAAA;AAE3C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAA;AAE1F;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAA4B;IAChE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;AAC5F,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type CspPolicy } from "../../csp.js";
2
+ import type { RenderAdapter } from "../../render-seam.js";
3
+ import type { ShellCheckRecord } from "./compile-shell.js";
4
+ import { type PprServer } from "./contract.js";
5
+ import { type ResolvedPprOptions } from "./options.js";
6
+ import type { SharedShellStore } from "./shell-store.js";
7
+ export { type DynamicHole, type HoleRegistration, type HoleStatesMode, PPR_CANCEL_PATH, PPR_SERVER, type PprRequest, type PprServer, type PprServerStats, PprShellBusy, PprShellCold, PprShellUnavailable, PprShellUnchecked, type SharedHole, variationQuery, } from "./contract.js";
8
+ export interface PprServerConfig {
9
+ readonly options: ResolvedPprOptions;
10
+ readonly adapter: RenderAdapter;
11
+ readonly csp?: CspPolicy;
12
+ /** Part of every shell key, so a shell built by one deployment is never served by another. */
13
+ readonly deployment: string;
14
+ /** The client entry `shellChecks` was recorded for; `deployment` when not given. */
15
+ readonly clientEntry?: string;
16
+ readonly cancelUrl: string;
17
+ /**
18
+ * The routes whose shell import check passed, for this deployment. A route not listed, or a record
19
+ * made for another deployment, gets no shared shell (fail closed). `"unchecked-development"` waives
20
+ * the check and is refused in production.
21
+ */
22
+ readonly shellChecks: ShellCheckRecord | "unchecked-development";
23
+ /** Milliseconds, for shell freshness. Tests pass their own clock. */
24
+ readonly now?: () => number;
25
+ /** Shells shared with other processes, behind this process's own; signed entries only. */
26
+ readonly shared?: SharedShellStore | undefined;
27
+ }
28
+ export declare function createPprServer(config: PprServerConfig): PprServer;
29
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/internal/ppr/server.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,cAAc,CAAA;AAErF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAGL,KAAK,SAAS,EAOf,MAAM,eAAe,CAAA;AAStB,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,cAAc,CAAA;AAEvE,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,kBAAkB,CAAA;AAErE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,eAAe,EACf,UAAU,EACV,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,UAAU,EACf,cAAc,GACf,MAAM,eAAe,CAAA;AA0DtB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,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