@nifrajs/web 5.5.1 → 5.7.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.
- package/CHANGELOG.md +243 -0
- package/README.md +21 -11
- package/dist/boundary.d.ts +67 -7
- package/dist/boundary.d.ts.map +1 -1
- package/dist/boundary.js +6 -4
- package/dist/boundary.js.map +1 -1
- package/dist/build-plan.d.ts +3 -0
- package/dist/build-plan.d.ts.map +1 -1
- package/dist/build-plan.js.map +1 -1
- package/dist/build-vite.d.ts.map +1 -1
- package/dist/build-vite.js +2 -0
- package/dist/build-vite.js.map +1 -1
- package/dist/build.d.ts +9 -2
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +10 -0
- package/dist/build.js.map +1 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +174 -23
- package/dist/client.js.map +1 -1
- package/dist/csp.d.ts +8 -0
- package/dist/csp.d.ts.map +1 -1
- package/dist/csp.js +11 -2
- package/dist/csp.js.map +1 -1
- package/dist/deferred.d.ts +6 -4
- package/dist/deferred.d.ts.map +1 -1
- package/dist/deferred.js +10 -6
- package/dist/deferred.js.map +1 -1
- package/dist/dev-feed.d.ts.map +1 -1
- package/dist/dev-feed.js +11 -2
- package/dist/dev-feed.js.map +1 -1
- package/dist/dev-session.d.ts.map +1 -1
- package/dist/dev-session.js +13 -6
- package/dist/dev-session.js.map +1 -1
- package/dist/dev.d.ts +4 -1
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +12 -5
- package/dist/dev.js.map +1 -1
- package/dist/diagnostic-catalog.d.ts +4 -0
- package/dist/diagnostic-catalog.d.ts.map +1 -1
- package/dist/diagnostic-catalog.js +48 -0
- package/dist/diagnostic-catalog.js.map +1 -1
- package/dist/diagnostic.d.ts +1 -1
- package/dist/diagnostic.d.ts.map +1 -1
- package/dist/diagnostic.js +1 -1
- package/dist/diagnostic.js.map +1 -1
- package/dist/fn.d.ts +5 -3
- package/dist/fn.d.ts.map +1 -1
- package/dist/fn.js +20 -5
- package/dist/fn.js.map +1 -1
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +13 -3
- package/dist/fs.js.map +1 -1
- package/dist/identity.d.ts +22 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +60 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/cdn/cloudflare.d.ts +2 -1
- package/dist/internal/cdn/cloudflare.d.ts.map +1 -1
- package/dist/internal/cdn/cloudflare.js +2 -1
- package/dist/internal/cdn/cloudflare.js.map +1 -1
- package/dist/internal/certified-components.d.ts +1 -1
- package/dist/internal/certified-components.js +1 -1
- package/dist/internal/codegen.d.ts +11 -10
- package/dist/internal/codegen.d.ts.map +1 -1
- package/dist/internal/codegen.js +73 -10
- package/dist/internal/codegen.js.map +1 -1
- package/dist/internal/dev-websocket.d.ts +73 -0
- package/dist/internal/dev-websocket.d.ts.map +1 -0
- package/dist/internal/dev-websocket.js +145 -0
- package/dist/internal/dev-websocket.js.map +1 -0
- package/dist/internal/hole-runtime.d.ts +66 -0
- package/dist/internal/hole-runtime.d.ts.map +1 -0
- package/dist/internal/hole-runtime.js +211 -0
- package/dist/internal/hole-runtime.js.map +1 -0
- package/dist/internal/identity-epoch.d.ts +50 -0
- package/dist/internal/identity-epoch.d.ts.map +1 -0
- package/dist/internal/identity-epoch.js +180 -0
- package/dist/internal/identity-epoch.js.map +1 -0
- package/dist/internal/invalidation-contract.d.ts +23 -0
- package/dist/internal/invalidation-contract.d.ts.map +1 -0
- package/dist/internal/invalidation-contract.js +11 -0
- package/dist/internal/invalidation-contract.js.map +1 -0
- package/dist/internal/invalidation.d.ts +62 -0
- package/dist/internal/invalidation.d.ts.map +1 -0
- package/dist/internal/invalidation.js +149 -0
- package/dist/internal/invalidation.js.map +1 -0
- package/dist/internal/island-bindings.d.ts +51 -0
- package/dist/internal/island-bindings.d.ts.map +1 -0
- package/dist/internal/island-bindings.js +147 -0
- package/dist/internal/island-bindings.js.map +1 -0
- package/dist/internal/island-list.d.ts +26 -0
- package/dist/internal/island-list.d.ts.map +1 -0
- package/dist/internal/island-list.js +78 -0
- package/dist/internal/island-list.js.map +1 -0
- package/dist/internal/island-mount.d.ts +4 -0
- package/dist/internal/island-mount.d.ts.map +1 -0
- package/dist/internal/island-mount.js +66 -0
- package/dist/internal/island-mount.js.map +1 -0
- package/dist/internal/island-owner.d.ts +5 -0
- package/dist/internal/island-owner.d.ts.map +1 -0
- package/dist/internal/island-owner.js +20 -0
- package/dist/internal/island-owner.js.map +1 -0
- package/dist/internal/island-resource.d.ts +30 -0
- package/dist/internal/island-resource.d.ts.map +1 -0
- package/dist/internal/island-resource.js +57 -0
- package/dist/internal/island-resource.js.map +1 -0
- package/dist/internal/island-signals.d.ts +51 -0
- package/dist/internal/island-signals.d.ts.map +1 -0
- package/dist/internal/island-signals.js +220 -0
- package/dist/internal/island-signals.js.map +1 -0
- package/dist/internal/keep-alive-table.d.ts +23 -0
- package/dist/internal/keep-alive-table.d.ts.map +1 -0
- package/dist/internal/keep-alive-table.js +53 -0
- package/dist/internal/keep-alive-table.js.map +1 -0
- package/dist/internal/live-contract.d.ts +101 -0
- package/dist/internal/live-contract.d.ts.map +1 -0
- package/dist/internal/live-contract.js +5 -0
- package/dist/internal/live-contract.js.map +1 -0
- package/dist/internal/live-queries.d.ts +22 -0
- package/dist/internal/live-queries.d.ts.map +1 -0
- package/dist/internal/live-queries.js +54 -0
- package/dist/internal/live-queries.js.map +1 -0
- package/dist/internal/page-events.d.ts +10 -0
- package/dist/internal/page-events.d.ts.map +1 -0
- package/dist/internal/page-events.js +26 -0
- package/dist/internal/page-events.js.map +1 -0
- package/dist/internal/page-execution.d.ts +16 -1
- package/dist/internal/page-execution.d.ts.map +1 -1
- package/dist/internal/page-execution.js +432 -31
- package/dist/internal/page-execution.js.map +1 -1
- package/dist/internal/parity.d.ts +3 -0
- package/dist/internal/parity.d.ts.map +1 -1
- package/dist/internal/parity.js +28 -5
- package/dist/internal/parity.js.map +1 -1
- package/dist/internal/ppr/admission.d.ts +83 -0
- package/dist/internal/ppr/admission.d.ts.map +1 -0
- package/dist/internal/ppr/admission.js +221 -0
- package/dist/internal/ppr/admission.js.map +1 -0
- package/dist/internal/ppr/canary.d.ts +24 -0
- package/dist/internal/ppr/canary.d.ts.map +1 -0
- package/dist/internal/ppr/canary.js +102 -0
- package/dist/internal/ppr/canary.js.map +1 -0
- package/dist/internal/ppr/compile-shell.d.ts +39 -0
- package/dist/internal/ppr/compile-shell.d.ts.map +1 -0
- package/dist/internal/ppr/compile-shell.js +298 -0
- package/dist/internal/ppr/compile-shell.js.map +1 -0
- package/dist/internal/ppr/contract.d.ts +177 -0
- package/dist/internal/ppr/contract.d.ts.map +1 -0
- package/dist/internal/ppr/contract.js +80 -0
- package/dist/internal/ppr/contract.js.map +1 -0
- package/dist/internal/ppr/frames.d.ts +71 -0
- package/dist/internal/ppr/frames.d.ts.map +1 -0
- package/dist/internal/ppr/frames.js +119 -0
- package/dist/internal/ppr/frames.js.map +1 -0
- package/dist/internal/ppr/integration.d.ts +19 -0
- package/dist/internal/ppr/integration.d.ts.map +1 -0
- package/dist/internal/ppr/integration.js +106 -0
- package/dist/internal/ppr/integration.js.map +1 -0
- package/dist/internal/ppr/options.d.ts +96 -0
- package/dist/internal/ppr/options.d.ts.map +1 -0
- package/dist/internal/ppr/options.js +125 -0
- package/dist/internal/ppr/options.js.map +1 -0
- package/dist/internal/ppr/route-rules.d.ts +12 -0
- package/dist/internal/ppr/route-rules.d.ts.map +1 -0
- package/dist/internal/ppr/route-rules.js +53 -0
- package/dist/internal/ppr/route-rules.js.map +1 -0
- package/dist/internal/ppr/runtime.d.ts +29 -0
- package/dist/internal/ppr/runtime.d.ts.map +1 -0
- package/dist/internal/ppr/runtime.js +35 -0
- package/dist/internal/ppr/runtime.js.map +1 -0
- package/dist/internal/ppr/server.d.ts +29 -0
- package/dist/internal/ppr/server.d.ts.map +1 -0
- package/dist/internal/ppr/server.js +1409 -0
- package/dist/internal/ppr/server.js.map +1 -0
- package/dist/internal/ppr/shell-store.d.ts +39 -0
- package/dist/internal/ppr/shell-store.d.ts.map +1 -0
- package/dist/internal/ppr/shell-store.js +106 -0
- package/dist/internal/ppr/shell-store.js.map +1 -0
- package/dist/internal/prerendered-pages.d.ts +1 -1
- package/dist/internal/prerendered-pages.d.ts.map +1 -1
- package/dist/internal/prerendered-pages.js +7 -4
- package/dist/internal/prerendered-pages.js.map +1 -1
- package/dist/internal/present.d.ts +11 -0
- package/dist/internal/present.d.ts.map +1 -0
- package/dist/internal/present.js +13 -0
- package/dist/internal/present.js.map +1 -0
- package/dist/internal/query-digest.d.ts +9 -0
- package/dist/internal/query-digest.d.ts.map +1 -0
- package/dist/internal/query-digest.js +23 -0
- package/dist/internal/query-digest.js.map +1 -0
- package/dist/internal/query-runtime.d.ts +6 -1
- package/dist/internal/query-runtime.d.ts.map +1 -1
- package/dist/internal/query-runtime.js +9 -0
- package/dist/internal/query-runtime.js.map +1 -1
- package/dist/internal/query-seam.d.ts +29 -0
- package/dist/internal/query-seam.d.ts.map +1 -0
- package/dist/internal/query-seam.js +23 -0
- package/dist/internal/query-seam.js.map +1 -0
- package/dist/internal/render-document.d.ts +34 -64
- package/dist/internal/render-document.d.ts.map +1 -1
- package/dist/internal/render-document.js +82 -64
- package/dist/internal/render-document.js.map +1 -1
- package/dist/internal/request-abort.d.ts +8 -0
- package/dist/internal/request-abort.d.ts.map +1 -0
- package/dist/internal/request-abort.js +22 -0
- package/dist/internal/request-abort.js.map +1 -0
- package/dist/internal/server-boundary.d.ts +2 -0
- package/dist/internal/server-boundary.d.ts.map +1 -1
- package/dist/internal/server-boundary.js +8 -1
- package/dist/internal/server-boundary.js.map +1 -1
- package/dist/internal/share-data.d.ts +10 -0
- package/dist/internal/share-data.d.ts.map +1 -0
- package/dist/internal/share-data.js +135 -0
- package/dist/internal/share-data.js.map +1 -0
- package/dist/internal/status-page.d.ts +68 -0
- package/dist/internal/status-page.d.ts.map +1 -0
- package/dist/internal/status-page.js +66 -0
- package/dist/internal/status-page.js.map +1 -0
- package/dist/internal/store-signature.d.ts +15 -0
- package/dist/internal/store-signature.d.ts.map +1 -0
- package/dist/internal/store-signature.js +114 -0
- package/dist/internal/store-signature.js.map +1 -0
- package/dist/internal/vite-plugin-compat.d.ts +2 -2
- package/dist/internal/vite-plugin-compat.js +2 -2
- package/dist/internal/web-app.d.ts +26 -0
- package/dist/internal/web-app.d.ts.map +1 -1
- package/dist/internal/web-app.js +79 -3
- package/dist/internal/web-app.js.map +1 -1
- package/dist/islands-swap.d.ts +41 -0
- package/dist/islands-swap.d.ts.map +1 -0
- package/dist/islands-swap.js +270 -0
- package/dist/islands-swap.js.map +1 -0
- package/dist/islands.d.ts +86 -24
- package/dist/islands.d.ts.map +1 -1
- package/dist/islands.js +138 -78
- package/dist/islands.js.map +1 -1
- package/dist/isr.d.ts +67 -13
- package/dist/isr.d.ts.map +1 -1
- package/dist/isr.js +247 -99
- package/dist/isr.js.map +1 -1
- package/dist/keep-alive.d.ts +147 -0
- package/dist/keep-alive.d.ts.map +1 -0
- package/dist/keep-alive.js +1102 -0
- package/dist/keep-alive.js.map +1 -0
- package/dist/live/bus.d.ts +70 -0
- package/dist/live/bus.d.ts.map +1 -0
- package/dist/live/bus.js +55 -0
- package/dist/live/bus.js.map +1 -0
- package/dist/live/core.d.ts +25 -0
- package/dist/live/core.d.ts.map +1 -0
- package/dist/live/core.js +29 -0
- package/dist/live/core.js.map +1 -0
- package/dist/live/history.d.ts +38 -0
- package/dist/live/history.d.ts.map +1 -0
- package/dist/live/history.js +104 -0
- package/dist/live/history.js.map +1 -0
- package/dist/live/hub-protocol.d.ts +46 -0
- package/dist/live/hub-protocol.d.ts.map +1 -0
- package/dist/live/hub-protocol.js +108 -0
- package/dist/live/hub-protocol.js.map +1 -0
- package/dist/live/hub.d.ts +185 -0
- package/dist/live/hub.d.ts.map +1 -0
- package/dist/live/hub.js +544 -0
- package/dist/live/hub.js.map +1 -0
- package/dist/live/keyring.d.ts +92 -0
- package/dist/live/keyring.d.ts.map +1 -0
- package/dist/live/keyring.js +265 -0
- package/dist/live/keyring.js.map +1 -0
- package/dist/live/read-capped.d.ts +6 -0
- package/dist/live/read-capped.d.ts.map +1 -0
- package/dist/live/read-capped.js +42 -0
- package/dist/live/read-capped.js.map +1 -0
- package/dist/live/revocations.d.ts +52 -0
- package/dist/live/revocations.d.ts.map +1 -0
- package/dist/live/revocations.js +116 -0
- package/dist/live/revocations.js.map +1 -0
- package/dist/live/settings.d.ts +14 -0
- package/dist/live/settings.d.ts.map +1 -0
- package/dist/live/settings.js +38 -0
- package/dist/live/settings.js.map +1 -0
- package/dist/live-client.d.ts +34 -0
- package/dist/live-client.d.ts.map +1 -0
- package/dist/live-client.js +878 -0
- package/dist/live-client.js.map +1 -0
- package/dist/live-hub.d.ts +130 -0
- package/dist/live-hub.d.ts.map +1 -0
- package/dist/live-hub.js +507 -0
- package/dist/live-hub.js.map +1 -0
- package/dist/live-redis.d.ts +60 -0
- package/dist/live-redis.d.ts.map +1 -0
- package/dist/live-redis.js +212 -0
- package/dist/live-redis.js.map +1 -0
- package/dist/live.d.ts +150 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +972 -0
- package/dist/live.js.map +1 -0
- package/dist/manifest.d.ts +113 -2
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +109 -5
- package/dist/manifest.js.map +1 -1
- package/dist/navigation.d.ts +9 -3
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +13 -3
- package/dist/navigation.js.map +1 -1
- package/dist/plugins/vite-zone-guard.d.ts +6 -0
- package/dist/plugins/vite-zone-guard.d.ts.map +1 -1
- package/dist/plugins/vite-zone-guard.js +8 -2
- package/dist/plugins/vite-zone-guard.js.map +1 -1
- package/dist/ppr.d.ts +73 -0
- package/dist/ppr.d.ts.map +1 -0
- package/dist/ppr.js +76 -0
- package/dist/ppr.js.map +1 -0
- package/dist/query.d.ts +8 -13
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +112 -18
- package/dist/query.js.map +1 -1
- package/dist/render-seam.d.ts +32 -0
- package/dist/render-seam.d.ts.map +1 -1
- package/dist/render-seam.js +7 -0
- package/dist/render-seam.js.map +1 -1
- package/dist/route-types.d.ts.map +1 -1
- package/dist/route-types.js +2 -2
- package/dist/route-types.js.map +1 -1
- package/dist/router.d.ts +72 -4
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +416 -129
- package/dist/router.js.map +1 -1
- package/dist/server-components/build.d.ts.map +1 -1
- package/dist/server-components/build.js +3 -3
- package/dist/server-components/build.js.map +1 -1
- package/dist/server-components/client.d.ts +23 -1
- package/dist/server-components/client.d.ts.map +1 -1
- package/dist/server-components/client.js +92 -5
- package/dist/server-components/client.js.map +1 -1
- package/dist/server-components/definition.d.ts.map +1 -1
- package/dist/server-components/definition.js +2 -1
- package/dist/server-components/definition.js.map +1 -1
- package/dist/server-components/hole.d.ts +8 -0
- package/dist/server-components/hole.d.ts.map +1 -0
- package/dist/server-components/hole.js +20 -0
- package/dist/server-components/hole.js.map +1 -0
- package/dist/server-components/html-policy.d.ts.map +1 -1
- package/dist/server-components/html-policy.js +62 -4
- package/dist/server-components/html-policy.js.map +1 -1
- package/dist/server-components/html-scan.d.ts +17 -0
- package/dist/server-components/html-scan.d.ts.map +1 -0
- package/dist/server-components/html-scan.js +180 -0
- package/dist/server-components/html-scan.js.map +1 -0
- package/dist/server-components/html.d.ts.map +1 -1
- package/dist/server-components/html.js +19 -4
- package/dist/server-components/html.js.map +1 -1
- package/dist/server-components/router-integration.d.ts +4 -1
- package/dist/server-components/router-integration.d.ts.map +1 -1
- package/dist/server-components/router-integration.js +23 -2
- package/dist/server-components/router-integration.js.map +1 -1
- package/dist/server-components/runtime.d.ts +6 -1
- package/dist/server-components/runtime.d.ts.map +1 -1
- package/dist/server-components/runtime.js +88 -29
- package/dist/server-components/runtime.js.map +1 -1
- package/dist/server-components/state.d.ts +3 -1
- package/dist/server-components/state.d.ts.map +1 -1
- package/dist/server-components/state.js +50 -38
- package/dist/server-components/state.js.map +1 -1
- package/dist/server-components/types.d.ts +9 -0
- package/dist/server-components/types.d.ts.map +1 -1
- package/dist/server-components/vite.d.ts.map +1 -1
- package/dist/server-components/vite.js +26 -9
- package/dist/server-components/vite.js.map +1 -1
- package/dist/vite.d.ts +5 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +58 -4
- package/dist/vite.js.map +1 -1
- package/package.json +48 -8
- package/src/boundary.ts +77 -5
- package/src/build-plan.ts +3 -0
- package/src/build-vite.ts +2 -0
- package/src/build.ts +20 -1
- package/src/client.ts +183 -23
- package/src/csp.ts +16 -2
- package/src/deferred.ts +11 -5
- package/src/dev-feed.ts +11 -2
- package/src/dev-session.ts +22 -11
- package/src/dev.ts +29 -8
- package/src/diagnostic-catalog.ts +53 -0
- package/src/diagnostic.ts +1 -0
- package/src/fn.ts +24 -7
- package/src/fs.ts +22 -8
- package/src/identity.ts +61 -0
- package/src/index.ts +20 -4
- package/src/internal/cdn/cloudflare.ts +2 -1
- package/src/internal/certified-components.ts +1 -1
- package/src/internal/codegen.ts +95 -9
- package/src/internal/dev-websocket.ts +230 -0
- package/src/internal/hole-runtime.ts +286 -0
- package/src/internal/identity-epoch.ts +239 -0
- package/src/internal/invalidation-contract.ts +35 -0
- package/src/internal/invalidation.ts +213 -0
- package/src/internal/island-bindings.ts +191 -0
- package/src/internal/island-list.ts +92 -0
- package/src/internal/island-mount.ts +68 -0
- package/src/internal/island-owner.ts +20 -0
- package/src/internal/island-resource.ts +76 -0
- package/src/internal/island-signals.ts +249 -0
- package/src/internal/keep-alive-table.ts +72 -0
- package/src/internal/live-contract.ts +111 -0
- package/src/internal/live-queries.ts +60 -0
- package/src/internal/page-events.ts +27 -0
- package/src/internal/page-execution.ts +605 -45
- package/src/internal/parity.ts +35 -6
- package/src/internal/ppr/admission.ts +300 -0
- package/src/internal/ppr/canary.ts +122 -0
- package/src/internal/ppr/compile-shell.ts +379 -0
- package/src/internal/ppr/contract.ts +265 -0
- package/src/internal/ppr/frames.ts +170 -0
- package/src/internal/ppr/integration.ts +137 -0
- package/src/internal/ppr/options.ts +221 -0
- package/src/internal/ppr/route-rules.ts +77 -0
- package/src/internal/ppr/runtime.ts +39 -0
- package/src/internal/ppr/server.ts +1766 -0
- package/src/internal/ppr/shell-store.ts +152 -0
- package/src/internal/prerendered-pages.ts +7 -4
- package/src/internal/present.ts +20 -0
- package/src/internal/query-digest.ts +34 -0
- package/src/internal/query-runtime.ts +14 -1
- package/src/internal/query-seam.ts +48 -0
- package/src/internal/render-document.ts +158 -113
- package/src/internal/request-abort.ts +26 -0
- package/src/internal/server-boundary.ts +10 -1
- package/src/internal/share-data.ts +136 -0
- package/src/internal/status-page.ts +95 -0
- package/src/internal/store-signature.ts +149 -0
- package/src/internal/vite-plugin-compat.ts +2 -2
- package/src/internal/web-app.ts +123 -3
- package/src/islands-swap.ts +283 -0
- package/src/islands.ts +169 -72
- package/src/isr.ts +348 -106
- package/src/keep-alive.ts +1354 -0
- package/src/live/bus.ts +104 -0
- package/src/live/core.ts +52 -0
- package/src/live/history.ts +109 -0
- package/src/live/hub-protocol.ts +133 -0
- package/src/live/hub.ts +620 -0
- package/src/live/keyring.ts +384 -0
- package/src/live/read-capped.ts +36 -0
- package/src/live/revocations.ts +155 -0
- package/src/live/settings.ts +46 -0
- package/src/live-client.ts +1011 -0
- package/src/live-hub.ts +658 -0
- package/src/live-redis.ts +284 -0
- package/src/live.ts +1257 -0
- package/src/manifest.ts +274 -6
- package/src/navigation.ts +14 -2
- package/src/plugins/vite-zone-guard.ts +15 -2
- package/src/ppr.ts +153 -0
- package/src/query.ts +147 -20
- package/src/render-seam.ts +37 -0
- package/src/route-types.ts +3 -1
- package/src/router.ts +534 -132
- package/src/server-components/build.ts +9 -3
- package/src/server-components/client.ts +89 -5
- package/src/server-components/definition.ts +2 -1
- package/src/server-components/hole.ts +23 -0
- package/src/server-components/html-policy.ts +63 -4
- package/src/server-components/html-scan.ts +159 -0
- package/src/server-components/html.ts +18 -4
- package/src/server-components/router-integration.ts +21 -2
- package/src/server-components/runtime.ts +114 -31
- package/src/server-components/state.ts +66 -44
- package/src/server-components/types.ts +16 -0
- package/src/server-components/vite.ts +33 -14
- package/src/vite.ts +75 -6
- package/dist/nano.d.ts +0 -125
- package/dist/nano.d.ts.map +0 -1
- package/dist/nano.js +0 -190
- package/dist/nano.js.map +0 -1
- package/src/nano.ts +0 -246
package/src/dev.ts
CHANGED
|
@@ -67,8 +67,15 @@ import {
|
|
|
67
67
|
import { createSsrGraph, type SsrGraph } from "./dev-ssr-graph.ts"
|
|
68
68
|
import { formatBuildLog } from "./diagnostic.ts"
|
|
69
69
|
import { discoverRoutes } from "./fs.ts"
|
|
70
|
-
import { DEFAULT_DEV_PORT, generateClientEntry } from "./index.ts"
|
|
70
|
+
import { DEFAULT_DEV_PORT, generateClientEntry, type LiveClientEntry } from "./index.ts"
|
|
71
71
|
import { DEV_ENTRY_FILE } from "./internal/dev-reserved.ts"
|
|
72
|
+
import {
|
|
73
|
+
type BunUpgradeServer,
|
|
74
|
+
bunDevWebSocket,
|
|
75
|
+
isWebSocketUpgrade,
|
|
76
|
+
type UpgradableApp,
|
|
77
|
+
upgradeOnBun,
|
|
78
|
+
} from "./internal/dev-websocket.ts"
|
|
72
79
|
import { DEV_HMR_ENV, DEV_ROOT_ENV, DEV_ROUTES_ENV } from "./plugins/kit.ts"
|
|
73
80
|
import { servePublicDir } from "./public-dir.ts"
|
|
74
81
|
|
|
@@ -76,7 +83,7 @@ export type { DevAppHooks } from "./dev-session.ts"
|
|
|
76
83
|
export { LAST_ERROR_PATH } from "./diagnostic.ts"
|
|
77
84
|
|
|
78
85
|
/** Minimal app surface the dev server needs - `createWebApp(...)` satisfies it. */
|
|
79
|
-
interface FetchApp {
|
|
86
|
+
interface FetchApp extends UpgradableApp {
|
|
80
87
|
fetch(request: Request): Response | Promise<Response>
|
|
81
88
|
}
|
|
82
89
|
|
|
@@ -169,7 +176,8 @@ interface BunServeOptions {
|
|
|
169
176
|
readonly hostname: "127.0.0.1"
|
|
170
177
|
readonly development: { readonly hmr: boolean }
|
|
171
178
|
readonly routes: Record<string, HtmlBundle>
|
|
172
|
-
fetch(request: Request): Promise<Response>
|
|
179
|
+
fetch(request: Request, server: BunUpgradeServer): Promise<Response | undefined>
|
|
180
|
+
readonly websocket: typeof bunDevWebSocket
|
|
173
181
|
}
|
|
174
182
|
interface BunServerHandle {
|
|
175
183
|
readonly port: number
|
|
@@ -214,6 +222,7 @@ export function devHtml(entryHref: string): string {
|
|
|
214
222
|
interface WriteDevFilesOptions {
|
|
215
223
|
readonly routesDir: string
|
|
216
224
|
readonly clientModule: string
|
|
225
|
+
readonly live?: LiveClientEntry | undefined
|
|
217
226
|
readonly entryPath: string
|
|
218
227
|
readonly htmlPath: string
|
|
219
228
|
}
|
|
@@ -226,7 +235,7 @@ interface WriteDevFilesOptions {
|
|
|
226
235
|
* the way the runtime does, so a leading slash there would mean the filesystem root.
|
|
227
236
|
*/
|
|
228
237
|
export function writeDevFiles(options: WriteDevFilesOptions): void {
|
|
229
|
-
const { routesDir, clientModule, entryPath, htmlPath } = options
|
|
238
|
+
const { routesDir, clientModule, entryPath, htmlPath, live } = options
|
|
230
239
|
mkdirSync(dirname(entryPath), { recursive: true })
|
|
231
240
|
const manifest = discoverRoutes(routesDir)
|
|
232
241
|
const entryDir = dirname(entryPath)
|
|
@@ -244,7 +253,10 @@ export function writeDevFiles(options: WriteDevFilesOptions): void {
|
|
|
244
253
|
// already been passed to createRoot()") and only then does the callback get to reload - trading an
|
|
245
254
|
// accurate warning for a real error. Editing a component-only module never reaches this path: Bun
|
|
246
255
|
// applies React Fast Refresh there and state is preserved.
|
|
247
|
-
writeIfChanged(
|
|
256
|
+
writeIfChanged(
|
|
257
|
+
entryPath,
|
|
258
|
+
generateClientEntry(manifest, { clientModule, resolve: toSpecifier, live }),
|
|
259
|
+
)
|
|
248
260
|
const entryHref = `./${relative(dirname(htmlPath), entryPath).replaceAll("\\", "/")}`
|
|
249
261
|
writeIfChanged(htmlPath, devHtml(entryHref))
|
|
250
262
|
}
|
|
@@ -355,7 +367,7 @@ export async function createDevServer(options: DevServerOptions): Promise<DevSer
|
|
|
355
367
|
? async (): Promise<undefined> => undefined
|
|
356
368
|
: servePublicDir({ dir: resolve(publicDir) })
|
|
357
369
|
|
|
358
|
-
writeDevFiles({ routesDir, clientModule, entryPath, htmlPath })
|
|
370
|
+
writeDevFiles({ routesDir, clientModule, entryPath, htmlPath, live: options.live })
|
|
359
371
|
// Importing the generated HTML is what hands it to Bun's bundler. A runtime-computed path is fine:
|
|
360
372
|
// Bun resolves and bundles the HTML, and everything it references, at import time.
|
|
361
373
|
const htmlModule = (await import(htmlPath)) as { default: HtmlBundle }
|
|
@@ -486,7 +498,8 @@ export async function createDevServer(options: DevServerOptions): Promise<DevSer
|
|
|
486
498
|
development: { hmr: true },
|
|
487
499
|
// The probe route is the ONLY path Bun owns; everything else falls through to nifra's SSR.
|
|
488
500
|
routes: { [PROBE_PATH]: htmlModule.default },
|
|
489
|
-
|
|
501
|
+
websocket: bunDevWebSocket,
|
|
502
|
+
fetch: async (req: Request, bun: BunUpgradeServer): Promise<Response | undefined> => {
|
|
490
503
|
const url = new URL(req.url)
|
|
491
504
|
const host = req.headers.get("host") ?? url.host
|
|
492
505
|
if (!isLoopbackHost(host) && !allowedHosts.has(hostName(host)))
|
|
@@ -494,6 +507,14 @@ export async function createDevServer(options: DevServerOptions): Promise<DevSer
|
|
|
494
507
|
`[nifra/web/dev] ${hostName(host)} is not a loopback host; add it to allowedHosts if this server should answer it.\n`,
|
|
495
508
|
{ status: 403, headers: { "content-type": "text/plain; charset=utf-8" } },
|
|
496
509
|
)
|
|
510
|
+
if (isWebSocketUpgrade(req)) {
|
|
511
|
+
const answer = await upgradeOnBun(
|
|
512
|
+
await appForRequest((await currentEntry()).src),
|
|
513
|
+
req,
|
|
514
|
+
bun,
|
|
515
|
+
)
|
|
516
|
+
if (answer !== "pass") return answer
|
|
517
|
+
}
|
|
497
518
|
// The stable client-entry URL. Pages reference THIS; it redirects to whichever hashed chunk Bun
|
|
498
519
|
// is serving at the moment the browser asks. A redirect rather than a proxy so the module's final
|
|
499
520
|
// URL is Bun's own - its HMR client derives its socket and module identity from `import.meta.url`,
|
|
@@ -554,7 +575,7 @@ export async function createDevServer(options: DevServerOptions): Promise<DevSer
|
|
|
554
575
|
syncWatchedFiles(false)
|
|
555
576
|
session.markChange()
|
|
556
577
|
try {
|
|
557
|
-
writeDevFiles({ routesDir, clientModule, entryPath, htmlPath })
|
|
578
|
+
writeDevFiles({ routesDir, clientModule, entryPath, htmlPath, live: options.live })
|
|
558
579
|
} catch (err) {
|
|
559
580
|
// A half-saved file can fail the scan mid-edit; the next change re-runs this.
|
|
560
581
|
console.error("[nifra/web/dev] client entry regeneration failed:", err)
|
|
@@ -17,6 +17,8 @@ interface CatalogEntry {
|
|
|
17
17
|
readonly fix: string
|
|
18
18
|
readonly docsAnchor: string
|
|
19
19
|
readonly options?: readonly FixOption[]
|
|
20
|
+
/** Reported by a console warning, not thrown: the dev feed records the warning as an entry. */
|
|
21
|
+
readonly console?: true
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -191,6 +193,52 @@ export const DIAGNOSTIC_CATALOG: readonly CatalogEntry[] = [
|
|
|
191
193
|
fix: "Read the reason in the line: a 401 or 403 means the token lacks purge permission for this zone, project or service; a 5xx or network_error is retried on its own.",
|
|
192
194
|
docsAnchor: "errors#cdn-purge-failed",
|
|
193
195
|
},
|
|
196
|
+
{
|
|
197
|
+
code: "NIFRA_KEEPALIVE_IDENTITY_COOKIE",
|
|
198
|
+
match: (_n, m) => m.includes("NIFRA_KEEPALIVE_IDENTITY_COOKIE"),
|
|
199
|
+
console: true,
|
|
200
|
+
cause:
|
|
201
|
+
"The app keeps pages alive, and a response changed an HttpOnly cookie nifra does not know as a sign-in cookie. If that cookie says who is signed in, a sign-in or sign-out through it leaves the previous visitor's kept pages in every tab, and back shows them.",
|
|
202
|
+
fix: "Name the cookie in createWebApp({ keepAlive: { identityCookies } }) if it carries the session, or in keepAlive.ignoreCookies if it does not.",
|
|
203
|
+
docsAnchor: "errors#keepalive-identity-cookie",
|
|
204
|
+
options: [
|
|
205
|
+
{
|
|
206
|
+
label: "It is the session cookie",
|
|
207
|
+
fix: 'Add it to createWebApp({ keepAlive: { identityCookies: ["<name>"] } }): a response that changes or deletes it rotates the identity epoch, and every tab drops its kept pages.',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
label: "It says nothing about the visitor",
|
|
211
|
+
fix: 'Add it to createWebApp({ keepAlive: { ignoreCookies: ["<name>"] } }) so development stops reporting it.',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
label: "Identity lives in a token",
|
|
215
|
+
fix: "When the session is a bearer token in client storage, call identityChanged() from @nifrajs/web/client at sign-in and sign-out; it drops kept pages in every tab.",
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
code: "NIFRA_KEEPALIVE_DIRECT_CHILD_CSS",
|
|
221
|
+
match: (_n, m) => m.includes("NIFRA_KEEPALIVE_DIRECT_CHILD_CSS"),
|
|
222
|
+
console: true,
|
|
223
|
+
cause:
|
|
224
|
+
"A keepAlive page renders inside two display:contents wrappers, so a selector that reached its top-level element as a direct child (or by its position among siblings) no longer matches it.",
|
|
225
|
+
fix: "Rewrite the selector the message names: a descendant combinator, the wrapper as the parent, or a class on the page's root element.",
|
|
226
|
+
docsAnchor: "errors#keepalive-direct-child-css",
|
|
227
|
+
options: [
|
|
228
|
+
{
|
|
229
|
+
label: "Use a descendant combinator",
|
|
230
|
+
fix: "Write `main section` instead of `main > section`: the wrappers sit between the two.",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "Target the wrapper",
|
|
234
|
+
fix: "Write `[data-nifra-page] > section`: the inner wrapper is the page's parent while it is shown.",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "Put a class on the page root",
|
|
238
|
+
fix: "Give the page's root element a class and select it directly, instead of by its parent or its position.",
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
194
242
|
{
|
|
195
243
|
code: "NIFRA_SCHEMA_PARSE",
|
|
196
244
|
match: (n, m) =>
|
|
@@ -215,6 +263,11 @@ const HYDRATION_MESSAGES: readonly RegExp[] = [
|
|
|
215
263
|
/Minified React error #(?:418|423|425)\b/,
|
|
216
264
|
]
|
|
217
265
|
|
|
266
|
+
/** True when a console `message` reports a catalog failure that is only ever logged, never thrown. */
|
|
267
|
+
export function isConsoleDiagnostic(message: string): boolean {
|
|
268
|
+
return DIAGNOSTIC_CATALOG.some((entry) => entry.console === true && entry.match("", message))
|
|
269
|
+
}
|
|
270
|
+
|
|
218
271
|
/** True when `message` is a framework's report of a server/browser render mismatch. */
|
|
219
272
|
export function isHydrationMismatch(message: string): boolean {
|
|
220
273
|
return HYDRATION_MESSAGES.some((pattern) => pattern.test(message))
|
package/src/diagnostic.ts
CHANGED
package/src/fn.ts
CHANGED
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
type StandardSchemaV1,
|
|
55
55
|
} from "@nifrajs/core/server"
|
|
56
56
|
import { guardChannel, outputGuard } from "./internal/output-guard.ts"
|
|
57
|
+
import { SERVER_FN_NAMESPACE } from "./internal/server-boundary.ts"
|
|
57
58
|
|
|
58
59
|
/** The URL prefix every mounted function lives under. Namespaced per mount, then by export name. */
|
|
59
60
|
export const SERVER_FN_PREFIX = "/_nifra/fn"
|
|
@@ -78,8 +79,9 @@ export interface ServerFnConfig<Input> {
|
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
81
|
* A declared server function. Callable directly on the server (the same value your own server-side
|
|
81
|
-
* code can await);
|
|
82
|
-
*
|
|
82
|
+
* code can await); in a client build, this module becomes typed stubs that POST under its
|
|
83
|
+
* file's name (`todos.fn.ts` posts under `todos`), so {@link serverFunctions} must mount it
|
|
84
|
+
* under that name.
|
|
83
85
|
*
|
|
84
86
|
* This is the SERVER declaration type, so context is required. Client builds replace the module with
|
|
85
87
|
* a one-argument {@link ClientServerFn}; UI bindings accept either shape and adapt at that boundary.
|
|
@@ -123,8 +125,6 @@ export function serverFn<Input = void, Output = unknown>(
|
|
|
123
125
|
const isServerFn = (value: unknown): value is ServerFn<unknown, unknown> =>
|
|
124
126
|
typeof value === "function" && SERVER_FN in (value as object)
|
|
125
127
|
|
|
126
|
-
/** A namespace segment: lowercase, dot/dash separated. Constrained so a mount cannot invent a path. */
|
|
127
|
-
const NAMESPACE = /^[a-z0-9]+(?:[-.][a-z0-9]+)*$/
|
|
128
128
|
/** An export name that is safe in a URL path without escaping. */
|
|
129
129
|
const EXPORT_NAME = /^[A-Za-z_$][A-Za-z0-9_$]*$/
|
|
130
130
|
|
|
@@ -156,12 +156,13 @@ export type ServerFnModule = Readonly<Record<string, unknown>>
|
|
|
156
156
|
*
|
|
157
157
|
* The namespace is explicit rather than derived from the file path: a path-derived one would put the
|
|
158
158
|
* build machine's layout in a public URL, and this keeps the route readable in logs and greppable in
|
|
159
|
-
* the codebase.
|
|
159
|
+
* the codebase. The client build's stubs call the namespace named by the module's file (`todos.fn.ts`
|
|
160
|
+
* calls `todos`), so pass that same word here.
|
|
160
161
|
*
|
|
161
162
|
* Exports that are not server functions are ignored, so `export type` and helpers can live alongside.
|
|
162
163
|
*/
|
|
163
164
|
export function serverFunctions(namespace: string, module: ServerFnModule): IdentityPlugin {
|
|
164
|
-
if (!
|
|
165
|
+
if (!SERVER_FN_NAMESPACE.test(namespace)) {
|
|
165
166
|
throw new Error(
|
|
166
167
|
`[nifra/fn] invalid server-function namespace ${JSON.stringify(namespace)} - use lowercase dot/dash segments (it becomes a URL path).`,
|
|
167
168
|
)
|
|
@@ -213,5 +214,21 @@ export function serverFunctions(namespace: string, module: ServerFnModule): Iden
|
|
|
213
214
|
}
|
|
214
215
|
return app
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
+
// A plugin name per module: the same module mounted twice stays one mount, while a second module
|
|
218
|
+
// under a taken namespace mounts too, so its functions are served, or a name both modules export
|
|
219
|
+
// fails as a duplicate route instead of the second module silently answering nothing.
|
|
220
|
+
const indexes = MODULE_INDEXES.get(module) ?? new Map<string, number>()
|
|
221
|
+
MODULE_INDEXES.set(module, indexes)
|
|
222
|
+
let index = indexes.get(namespace)
|
|
223
|
+
if (index === undefined) {
|
|
224
|
+
index = NEXT_MODULE_INDEX.get(namespace) ?? 0
|
|
225
|
+
NEXT_MODULE_INDEX.set(namespace, index + 1)
|
|
226
|
+
indexes.set(namespace, index)
|
|
227
|
+
}
|
|
228
|
+
const suffix = index === 0 ? "" : `#${index + 1}`
|
|
229
|
+
return defineIdentityPlugin(`nifra:server-fn:${namespace}${suffix}`, apply)
|
|
217
230
|
}
|
|
231
|
+
|
|
232
|
+
// Weak, so a module an app no longer uses (a dev reload, a discarded test app) is not held here.
|
|
233
|
+
const MODULE_INDEXES = new WeakMap<ServerFnModule, Map<string, number>>()
|
|
234
|
+
const NEXT_MODULE_INDEX = new Map<string, number>()
|
package/src/fs.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* (and the rest of @nifrajs/web) stays fs-free + edge-portable: this runs at build/startup
|
|
4
4
|
* only. It scans a routes dir and feeds the pure `buildManifest`.
|
|
5
5
|
*/
|
|
6
|
-
import { readdirSync } from "node:fs"
|
|
6
|
+
import { readdirSync, readFileSync } from "node:fs"
|
|
7
7
|
import { join } from "node:path"
|
|
8
8
|
import {
|
|
9
9
|
buildManifest,
|
|
10
|
+
exportsKeepAlive,
|
|
10
11
|
isMiddlewareFile,
|
|
11
12
|
isRouteBackendFile,
|
|
12
13
|
type Manifest,
|
|
@@ -45,12 +46,25 @@ export function discoverRoutes(dir: string, options: DiscoverRoutesOptions = {})
|
|
|
45
46
|
)
|
|
46
47
|
const query = options.importQuery ? `?${options.importQuery}` : ""
|
|
47
48
|
const load = options.load
|
|
48
|
-
return buildManifest(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
49
|
+
return buildManifest(
|
|
50
|
+
files,
|
|
51
|
+
(file) =>
|
|
52
|
+
load === undefined
|
|
53
|
+
? () => import(`${dir}/${file}${query}`) as Promise<RouteModule>
|
|
54
|
+
: // No `importQuery` here: an injected loader owns its own invalidation (Vite's module graph
|
|
55
|
+
// re-evaluates on change), and appending a cache-buster would defeat it by minting a new
|
|
56
|
+
// module id per request.
|
|
57
|
+
() => load(join(dir, file)) as Promise<RouteModule>,
|
|
58
|
+
{ keepAlive: files.filter((file) => keepsAlive(join(dir, file))) },
|
|
55
59
|
)
|
|
56
60
|
}
|
|
61
|
+
|
|
62
|
+
const keepsAlive = (path: string): boolean => {
|
|
63
|
+
if (isRouteBackendFile(path) || path.slice(path.lastIndexOf("/") + 1).startsWith("_"))
|
|
64
|
+
return false
|
|
65
|
+
try {
|
|
66
|
+
return exportsKeepAlive(readFileSync(path, "utf8"))
|
|
67
|
+
} catch {
|
|
68
|
+
return false
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/identity.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identity epoch: a value the server rotates whenever a response signs a visitor in or out, so a
|
|
3
|
+
* page kept mounted for one visitor is never shown to the next. Browser-safe and free of module-level
|
|
4
|
+
* state, so a client bundle that never calls it carries none of it.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** The readable cookie holding the epoch on an `https:` origin. */
|
|
8
|
+
export const EPOCH_COOKIE = "__Host-nifra-epoch"
|
|
9
|
+
/** The same cookie on local `http:` dev, where a `__Host-` cookie cannot be set. */
|
|
10
|
+
export const LOCAL_EPOCH_COOKIE = "nifra-epoch"
|
|
11
|
+
/** The channel every tab of an origin hears a sign-in or sign-out on. */
|
|
12
|
+
export const IDENTITY_CHANNEL = "nifra-identity-v1"
|
|
13
|
+
|
|
14
|
+
type Listeners = Set<() => void>
|
|
15
|
+
|
|
16
|
+
// Looked up per call: a module-level `Symbol.for` would be code every client bundle keeps.
|
|
17
|
+
const listenersOf = (): Listeners => {
|
|
18
|
+
const key = Symbol.for("nifra.identity.listeners")
|
|
19
|
+
let listeners: unknown = Reflect.get(globalThis, key)
|
|
20
|
+
if (!(listeners instanceof Set)) {
|
|
21
|
+
listeners = new Set<() => void>()
|
|
22
|
+
Reflect.set(globalThis, key, listeners)
|
|
23
|
+
}
|
|
24
|
+
// biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion: only this module writes the slot, always a set of listeners
|
|
25
|
+
return listeners as Listeners
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The epoch in a `document.cookie` string, or `""` when it carries none. */
|
|
29
|
+
export function epochOf(cookie: string): string {
|
|
30
|
+
let local = ""
|
|
31
|
+
for (const part of cookie.split(";")) {
|
|
32
|
+
const at = part.indexOf("=")
|
|
33
|
+
if (at === -1) continue
|
|
34
|
+
const name = part.slice(0, at).trim()
|
|
35
|
+
if (name === EPOCH_COOKIE) return part.slice(at + 1).trim()
|
|
36
|
+
if (name === LOCAL_EPOCH_COOKIE) local = part.slice(at + 1).trim()
|
|
37
|
+
}
|
|
38
|
+
return local
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Run `listener` when this document hears that the visitor changed; returns its removal. */
|
|
42
|
+
export function onIdentityChange(listener: () => void): () => void {
|
|
43
|
+
const listeners = listenersOf()
|
|
44
|
+
listeners.add(listener)
|
|
45
|
+
return () => {
|
|
46
|
+
listeners.delete(listener)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Tell this tab and every other tab of the origin that the visitor signed in or out. Call it at login
|
|
52
|
+
* and logout when identity lives in client storage (a bearer token) rather than in a cookie, which the
|
|
53
|
+
* server's epoch cookie already covers: every page kept alive for the previous visitor is dropped.
|
|
54
|
+
*/
|
|
55
|
+
export function identityChanged(): void {
|
|
56
|
+
for (const listener of [...listenersOf()]) listener()
|
|
57
|
+
if (typeof BroadcastChannel === "undefined") return
|
|
58
|
+
const channel = new BroadcastChannel(IDENTITY_CHANNEL)
|
|
59
|
+
channel.postMessage("changed")
|
|
60
|
+
channel.close()
|
|
61
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,9 @@ export {
|
|
|
29
29
|
type PendingBoundary,
|
|
30
30
|
resolveDynamicBoundaries,
|
|
31
31
|
resolveStaticBoundaries,
|
|
32
|
+
type SharedBoundary,
|
|
33
|
+
type SharedHoleCtx,
|
|
34
|
+
type ShellCtx,
|
|
32
35
|
type StaticBoundary,
|
|
33
36
|
type StaticBoundaryCache,
|
|
34
37
|
type StaticBoundaryImportEdge,
|
|
@@ -93,25 +96,29 @@ export {
|
|
|
93
96
|
generateClientEntry,
|
|
94
97
|
generateRouteSearchTypes,
|
|
95
98
|
generateServerManifest,
|
|
99
|
+
type LiveClientEntry,
|
|
96
100
|
} from "./internal/codegen.ts"
|
|
97
101
|
export { mergeHeads, resolveChainMeta, resolveMeta } from "./internal/head-merge.ts"
|
|
102
|
+
// The server half of the identity epoch that drops kept pages on a sign-in or sign-out.
|
|
103
|
+
export {
|
|
104
|
+
type IdentityEpochContext,
|
|
105
|
+
type KeepAliveServerOptions,
|
|
106
|
+
rotateIdentityEpoch,
|
|
107
|
+
} from "./internal/identity-epoch.ts"
|
|
98
108
|
export type { PrerenderedPages } from "./internal/prerendered-pages.ts"
|
|
99
109
|
export {
|
|
100
|
-
gone,
|
|
101
|
-
notFound,
|
|
102
110
|
type RedirectOptions,
|
|
103
111
|
type RenderAssemblyCache,
|
|
104
112
|
type RenderedPage,
|
|
105
113
|
type RenderPageInput,
|
|
106
114
|
type RenderPageOptions,
|
|
115
|
+
type RevalidateOptions,
|
|
107
116
|
type RevalidateResult,
|
|
108
117
|
redirect,
|
|
109
118
|
renderPage,
|
|
110
119
|
renderPageResult,
|
|
111
120
|
revalidate,
|
|
112
|
-
type StatusPageOptions,
|
|
113
121
|
serializeData,
|
|
114
|
-
statusPage,
|
|
115
122
|
unsafeInlineScript,
|
|
116
123
|
} from "./internal/render-document.ts"
|
|
117
124
|
export {
|
|
@@ -126,6 +133,7 @@ export {
|
|
|
126
133
|
* stubbed by both build pipelines and waved through by the guard meant to stop it leaking.
|
|
127
134
|
*/
|
|
128
135
|
export { SERVER_FN_MODULE } from "./internal/server-boundary.ts"
|
|
136
|
+
export { gone, notFound, type StatusPageOptions, statusPage } from "./internal/status-page.ts"
|
|
129
137
|
export {
|
|
130
138
|
type CreateWebAppOptions,
|
|
131
139
|
createWebApp,
|
|
@@ -163,6 +171,8 @@ export {
|
|
|
163
171
|
// File-based routing manifest - pure + fs-free. `discoverRoutes` (fs) lives in `@nifrajs/web/fs`.
|
|
164
172
|
export {
|
|
165
173
|
type Action,
|
|
174
|
+
type BoundaryLoaderEntry,
|
|
175
|
+
type BoundaryLoadersOf,
|
|
166
176
|
buildManifest,
|
|
167
177
|
type ClientAction,
|
|
168
178
|
type ClientActionArgs,
|
|
@@ -176,6 +186,7 @@ export {
|
|
|
176
186
|
filePathToPatterns,
|
|
177
187
|
type GetStaticPaths,
|
|
178
188
|
type InertScriptType,
|
|
189
|
+
type KeepAliveOptions,
|
|
179
190
|
type LayoutEntry,
|
|
180
191
|
type LinkDescriptor,
|
|
181
192
|
type Loader,
|
|
@@ -210,6 +221,7 @@ export {
|
|
|
210
221
|
type BlockerLocation,
|
|
211
222
|
type BlockerState,
|
|
212
223
|
type BrowserNavigate,
|
|
224
|
+
closeBoundary,
|
|
213
225
|
getBrowserNavigate,
|
|
214
226
|
IDLE_BLOCKER,
|
|
215
227
|
type NavigateFunction,
|
|
@@ -292,11 +304,15 @@ export {
|
|
|
292
304
|
createClientRouter,
|
|
293
305
|
createMatcher,
|
|
294
306
|
DATA_HEADER,
|
|
307
|
+
type DataText,
|
|
295
308
|
type Fetcher,
|
|
296
309
|
type FetcherState,
|
|
297
310
|
type FetchRouteData,
|
|
311
|
+
type Intercepted,
|
|
312
|
+
type KeptPage,
|
|
298
313
|
type MountRouterOptions,
|
|
299
314
|
NAV_FROM_HEADER,
|
|
315
|
+
PREFETCH_HEADER,
|
|
300
316
|
REDIRECT_HEADER,
|
|
301
317
|
RETAIN_HEADER,
|
|
302
318
|
REVALIDATE_HEADER,
|
|
@@ -32,7 +32,8 @@ export interface CloudflareZoneOptions {
|
|
|
32
32
|
/**
|
|
33
33
|
* A Cloudflare zone proxying the origin. HTML is only cached by a Cache Rule that makes it eligible,
|
|
34
34
|
* and the zone's cache ignores `Vary`: the rule must also bypass the cache when the request carries
|
|
35
|
-
* `x-nifra-data` (soft navigations fetch the page URL with
|
|
35
|
+
* `x-nifra-data` or `x-nifra-swap` (soft navigations and slot swaps fetch the page URL with those
|
|
36
|
+
* headers). `nifra cdn-check` tests all three.
|
|
36
37
|
*/
|
|
37
38
|
export function cloudflareZone(options: CloudflareZoneOptions): CdnProvider {
|
|
38
39
|
if (!/^[a-f0-9]{32}$/.test(options.zoneId)) {
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* guard and the consumer check read these; `component-certification.test.ts` holds the exact pins
|
|
4
4
|
* in every manifest that runs the pipeline to them, so a range bump cannot drift past the guard.
|
|
5
5
|
*/
|
|
6
|
-
export const CERTIFIED_COMPONENT_VITE = "8.
|
|
6
|
+
export const CERTIFIED_COMPONENT_VITE = "8.3.4"
|
|
7
7
|
export const CERTIFIED_COMPONENT_REACT = "19.3.1"
|