@softistx/alxia-react-router 0.0.0-stage → 0.83.1
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/LICENSE +21 -0
- package/README.md +2085 -2
- package/dist/api-keys/api-keys.d.ts +93 -0
- package/dist/api-keys/api-keys.d.ts.map +1 -0
- package/dist/api-keys/index.d.ts +9 -0
- package/dist/api-keys/index.d.ts.map +1 -0
- package/dist/api-keys/index.js +66 -0
- package/dist/api-keys/index.js.map +10 -0
- package/dist/assets.d.ts +14 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/chunks/index-0786n4qe.js +25 -0
- package/dist/chunks/index-0786n4qe.js.map +10 -0
- package/dist/chunks/index-1nw5yeek.js +169 -0
- package/dist/chunks/index-1nw5yeek.js.map +11 -0
- package/dist/chunks/index-59vhfj6n.js +10 -0
- package/dist/chunks/index-59vhfj6n.js.map +10 -0
- package/dist/chunks/index-5gqcpyyg.js +34 -0
- package/dist/chunks/index-5gqcpyyg.js.map +10 -0
- package/dist/chunks/index-6jf7zpxz.js +119 -0
- package/dist/chunks/index-6jf7zpxz.js.map +11 -0
- package/dist/chunks/index-8as4j8m3.js +340 -0
- package/dist/chunks/index-8as4j8m3.js.map +16 -0
- package/dist/chunks/index-9xv2a8et.js +108 -0
- package/dist/chunks/index-9xv2a8et.js.map +11 -0
- package/dist/chunks/index-ajtvyq35.js +16 -0
- package/dist/chunks/index-ajtvyq35.js.map +10 -0
- package/dist/chunks/index-c55hxgr5.js +124 -0
- package/dist/chunks/index-c55hxgr5.js.map +14 -0
- package/dist/chunks/index-d42p3mdp.js +19 -0
- package/dist/chunks/index-d42p3mdp.js.map +10 -0
- package/dist/chunks/index-gac44rs5.js +42 -0
- package/dist/chunks/index-gac44rs5.js.map +11 -0
- package/dist/chunks/index-j4ktpcke.js +62 -0
- package/dist/chunks/index-j4ktpcke.js.map +10 -0
- package/dist/chunks/index-mscfme4r.js +12 -0
- package/dist/chunks/index-mscfme4r.js.map +10 -0
- package/dist/chunks/index-pghmb2dm.js +30 -0
- package/dist/chunks/index-pghmb2dm.js.map +10 -0
- package/dist/chunks/index-rfr02vg4.js +40 -0
- package/dist/chunks/index-rfr02vg4.js.map +10 -0
- package/dist/chunks/index-sfhshxqz.js +31 -0
- package/dist/chunks/index-sfhshxqz.js.map +10 -0
- package/dist/chunks/index-skwypsjz.js +357 -0
- package/dist/chunks/index-skwypsjz.js.map +12 -0
- package/dist/chunks/index-sxh06ged.js +118 -0
- package/dist/chunks/index-sxh06ged.js.map +11 -0
- package/dist/chunks/index-t2ph23wk.js +96 -0
- package/dist/chunks/index-t2ph23wk.js.map +13 -0
- package/dist/chunks/index-thyabr5n.js +19 -0
- package/dist/chunks/index-thyabr5n.js.map +10 -0
- package/dist/chunks/index-tx36swjx.js +134 -0
- package/dist/chunks/index-tx36swjx.js.map +11 -0
- package/dist/chunks/index-v2z5k640.js +54 -0
- package/dist/chunks/index-v2z5k640.js.map +11 -0
- package/dist/chunks/index-vr82typq.js +23 -0
- package/dist/chunks/index-vr82typq.js.map +11 -0
- package/dist/chunks/index-whj6h5eg.js +9 -0
- package/dist/chunks/index-whj6h5eg.js.map +10 -0
- package/dist/chunks/index-wyypkfdv.js +130 -0
- package/dist/chunks/index-wyypkfdv.js.map +13 -0
- package/dist/chunks/index-xd5aqy3g.js +90 -0
- package/dist/chunks/index-xd5aqy3g.js.map +10 -0
- package/dist/chunks/index-zdbqzcjp.js +97 -0
- package/dist/chunks/index-zdbqzcjp.js.map +12 -0
- package/dist/chunks/index-zyg8amjc.js +23 -0
- package/dist/chunks/index-zyg8amjc.js.map +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +215 -0
- package/dist/cli/index.js.map +13 -0
- package/dist/cli/main.d.ts +13 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/reveal.d.ts +18 -0
- package/dist/cli/reveal.d.ts.map +1 -0
- package/dist/cli/template.d.ts +8 -0
- package/dist/cli/template.d.ts.map +1 -0
- package/dist/context.d.ts +104 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +19 -0
- package/dist/document/index.js.map +9 -0
- package/dist/document/inline-script.d.ts +27 -0
- package/dist/document/inline-script.d.ts.map +1 -0
- package/dist/document/language-store.d.ts +8 -0
- package/dist/document/language-store.d.ts.map +1 -0
- package/dist/document/nonce.d.ts +34 -0
- package/dist/document/nonce.d.ts.map +1 -0
- package/dist/document/page-language.d.ts +39 -0
- package/dist/document/page-language.d.ts.map +1 -0
- package/dist/document/text-direction.d.ts +10 -0
- package/dist/document/text-direction.d.ts.map +1 -0
- package/dist/entry/abort.d.ts +21 -0
- package/dist/entry/abort.d.ts.map +1 -0
- package/dist/entry/create-entry.d.ts +41 -0
- package/dist/entry/create-entry.d.ts.map +1 -0
- package/dist/entry/index.d.ts +8 -0
- package/dist/entry/index.d.ts.map +1 -0
- package/dist/entry/index.js +154 -0
- package/dist/entry/index.js.map +13 -0
- package/dist/entry/root-data.d.ts +27 -0
- package/dist/entry/root-data.d.ts.map +1 -0
- package/dist/entry/whole-page.d.ts +10 -0
- package/dist/entry/whole-page.d.ts.map +1 -0
- package/dist/errors/api-error.d.ts +117 -0
- package/dist/errors/api-error.d.ts.map +1 -0
- package/dist/errors/api-errors.d.ts +122 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/call-failure.d.ts +45 -0
- package/dist/errors/call-failure.d.ts.map +1 -0
- package/dist/errors/catalogue-check.d.ts +24 -0
- package/dist/errors/catalogue-check.d.ts.map +1 -0
- package/dist/errors/catalogue-read.d.ts +33 -0
- package/dist/errors/catalogue-read.d.ts.map +1 -0
- package/dist/errors/catalogue.d.ts +59 -0
- package/dist/errors/catalogue.d.ts.map +1 -0
- package/dist/errors/code-resolver.d.ts +44 -0
- package/dist/errors/code-resolver.d.ts.map +1 -0
- package/dist/errors/cross-site.d.ts +8 -0
- package/dist/errors/cross-site.d.ts.map +1 -0
- package/dist/errors/describe-refusal.d.ts +6 -0
- package/dist/errors/describe-refusal.d.ts.map +1 -0
- package/dist/errors/describe.d.ts +3 -0
- package/dist/errors/describe.d.ts.map +1 -0
- package/dist/errors/fetcher-result.d.ts +33 -0
- package/dist/errors/fetcher-result.d.ts.map +1 -0
- package/dist/errors/field-placement.d.ts +12 -0
- package/dist/errors/field-placement.d.ts.map +1 -0
- package/dist/errors/form-errors.d.ts +8 -0
- package/dist/errors/form-errors.d.ts.map +1 -0
- package/dist/errors/form-refusal.d.ts +25 -0
- package/dist/errors/form-refusal.d.ts.map +1 -0
- package/dist/errors/index.d.ts +21 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +588 -0
- package/dist/errors/index.js.map +26 -0
- package/dist/errors/json-actions.d.ts +38 -0
- package/dist/errors/json-actions.d.ts.map +1 -0
- package/dist/errors/log.d.ts +8 -0
- package/dist/errors/log.d.ts.map +1 -0
- package/dist/errors/message-values.d.ts +11 -0
- package/dist/errors/message-values.d.ts.map +1 -0
- package/dist/errors/messages.d.ts +63 -0
- package/dist/errors/messages.d.ts.map +1 -0
- package/dist/errors/page-path.d.ts +9 -0
- package/dist/errors/page-path.d.ts.map +1 -0
- package/dist/errors/problem-error.d.ts +50 -0
- package/dist/errors/problem-error.d.ts.map +1 -0
- package/dist/errors/provider.d.ts +20 -0
- package/dist/errors/provider.d.ts.map +1 -0
- package/dist/errors/request-id.d.ts +5 -0
- package/dist/errors/request-id.d.ts.map +1 -0
- package/dist/errors/route-error.d.ts +33 -0
- package/dist/errors/route-error.d.ts.map +1 -0
- package/dist/errors/route-refusal.d.ts +20 -0
- package/dist/errors/route-refusal.d.ts.map +1 -0
- package/dist/errors/same-site.d.ts +49 -0
- package/dist/errors/same-site.d.ts.map +1 -0
- package/dist/errors/section-action.d.ts +46 -0
- package/dist/errors/section-action.d.ts.map +1 -0
- package/dist/errors/standard-schema.d.ts +34 -0
- package/dist/errors/standard-schema.d.ts.map +1 -0
- package/dist/errors/submit-form.d.ts +16 -0
- package/dist/errors/submit-form.d.ts.map +1 -0
- package/dist/errors/upstream-headers.d.ts +18 -0
- package/dist/errors/upstream-headers.d.ts.map +1 -0
- package/dist/errors/use-json-fetcher.d.ts +18 -0
- package/dist/errors/use-json-fetcher.d.ts.map +1 -0
- package/dist/fetcher/auth-refusal.d.ts +29 -0
- package/dist/fetcher/auth-refusal.d.ts.map +1 -0
- package/dist/fetcher/index.d.ts +20 -0
- package/dist/fetcher/index.d.ts.map +1 -0
- package/dist/fetcher/index.js +392 -0
- package/dist/fetcher/index.js.map +21 -0
- package/dist/fetcher/section-form.d.ts +24 -0
- package/dist/fetcher/section-form.d.ts.map +1 -0
- package/dist/fetcher/section-reload.d.ts +17 -0
- package/dist/fetcher/section-reload.d.ts.map +1 -0
- package/dist/fetcher/section-save.d.ts +29 -0
- package/dist/fetcher/section-save.d.ts.map +1 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
- package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-done.d.ts +15 -0
- package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
- package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
- package/dist/fetcher/use-form-refusal.d.ts +20 -0
- package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
- package/dist/fetcher/use-row-save.d.ts +32 -0
- package/dist/fetcher/use-row-save.d.ts.map +1 -0
- package/dist/fetcher/use-section-save.d.ts +46 -0
- package/dist/fetcher/use-section-save.d.ts.map +1 -0
- package/dist/fetcher/use-visible-interval.d.ts +24 -0
- package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
- package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
- package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
- package/dist/health.d.ts +21 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/help/check/check.d.ts +35 -0
- package/dist/help/check/check.d.ts.map +1 -0
- package/dist/help/check/index.d.ts +8 -0
- package/dist/help/check/index.d.ts.map +1 -0
- package/dist/help/check/index.js +17 -0
- package/dist/help/check/index.js.map +9 -0
- package/dist/help/check/routes.d.ts +22 -0
- package/dist/help/check/routes.d.ts.map +1 -0
- package/dist/help/guide.d.ts +33 -0
- package/dist/help/guide.d.ts.map +1 -0
- package/dist/help/index.d.ts +16 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +192 -0
- package/dist/help/index.js.map +14 -0
- package/dist/help/load.d.ts +39 -0
- package/dist/help/load.d.ts.map +1 -0
- package/dist/help/panel.d.ts +69 -0
- package/dist/help/panel.d.ts.map +1 -0
- package/dist/help/parse-flow.d.ts +27 -0
- package/dist/help/parse-flow.d.ts.map +1 -0
- package/dist/help/react.d.ts +12 -0
- package/dist/help/react.d.ts.map +1 -0
- package/dist/help/resolve.d.ts +24 -0
- package/dist/help/resolve.d.ts.map +1 -0
- package/dist/help/types.d.ts +50 -0
- package/dist/help/types.d.ts.map +1 -0
- package/dist/help/yaml.d.ts +18 -0
- package/dist/help/yaml.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +14 -0
- package/dist/link/index.d.ts +7 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +16 -0
- package/dist/link/index.js.map +10 -0
- package/dist/link/router-link.d.ts +27 -0
- package/dist/link/router-link.d.ts.map +1 -0
- package/dist/lists/connection-page.d.ts +50 -0
- package/dist/lists/connection-page.d.ts.map +1 -0
- package/dist/lists/index.d.ts +13 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +205 -0
- package/dist/lists/index.js.map +15 -0
- package/dist/lists/newest-first.d.ts +5 -0
- package/dist/lists/newest-first.d.ts.map +1 -0
- package/dist/lists/nodes-of.d.ts +21 -0
- package/dist/lists/nodes-of.d.ts.map +1 -0
- package/dist/lists/or-failed.d.ts +19 -0
- package/dist/lists/or-failed.d.ts.map +1 -0
- package/dist/lists/use-paged-rows.d.ts +40 -0
- package/dist/lists/use-paged-rows.d.ts.map +1 -0
- package/dist/lists/use-same-route-loading.d.ts +8 -0
- package/dist/lists/use-same-route-loading.d.ts.map +1 -0
- package/dist/lists/use-search-change.d.ts +20 -0
- package/dist/lists/use-search-change.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +105 -0
- package/dist/mcp/index.js.map +11 -0
- package/dist/mcp/mcp-relay.d.ts +58 -0
- package/dist/mcp/mcp-relay.d.ts.map +1 -0
- package/dist/mcp/relay.d.ts +38 -0
- package/dist/mcp/relay.d.ts.map +1 -0
- package/dist/media/client/error.d.ts +29 -0
- package/dist/media/client/error.d.ts.map +1 -0
- package/dist/media/client/index.d.ts +8 -0
- package/dist/media/client/index.d.ts.map +1 -0
- package/dist/media/client/index.js +133 -0
- package/dist/media/client/index.js.map +11 -0
- package/dist/media/client/upload.d.ts +32 -0
- package/dist/media/client/upload.d.ts.map +1 -0
- package/dist/media/forward.d.ts +14 -0
- package/dist/media/forward.d.ts.map +1 -0
- package/dist/media/headers.d.ts +11 -0
- package/dist/media/headers.d.ts.map +1 -0
- package/dist/media/index.d.ts +9 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +396 -0
- package/dist/media/index.js.map +16 -0
- package/dist/media/options.d.ts +114 -0
- package/dist/media/options.d.ts.map +1 -0
- package/dist/media/path.d.ts +12 -0
- package/dist/media/path.d.ts.map +1 -0
- package/dist/media/read.d.ts +11 -0
- package/dist/media/read.d.ts.map +1 -0
- package/dist/media/refusal.d.ts +11 -0
- package/dist/media/refusal.d.ts.map +1 -0
- package/dist/media/respond.d.ts +8 -0
- package/dist/media/respond.d.ts.map +1 -0
- package/dist/media/write.d.ts +13 -0
- package/dist/media/write.d.ts.map +1 -0
- package/dist/navigation/index.d.ts +9 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +48 -0
- package/dist/navigation/index.js.map +11 -0
- package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
- package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
- package/dist/navigation/use-route-transition.d.ts +19 -0
- package/dist/navigation/use-route-transition.d.ts.map +1 -0
- package/dist/nonce.d.ts +16 -0
- package/dist/nonce.d.ts.map +1 -0
- package/dist/oauth/answer.d.ts +33 -0
- package/dist/oauth/answer.d.ts.map +1 -0
- package/dist/oauth/binding.d.ts +43 -0
- package/dist/oauth/binding.d.ts.map +1 -0
- package/dist/oauth/consent.d.ts +134 -0
- package/dist/oauth/consent.d.ts.map +1 -0
- package/dist/oauth/grants.d.ts +88 -0
- package/dist/oauth/grants.d.ts.map +1 -0
- package/dist/oauth/index.d.ts +16 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +207 -0
- package/dist/oauth/index.js.map +12 -0
- package/dist/oauth/model.d.ts +13 -0
- package/dist/oauth/model.d.ts.map +1 -0
- package/dist/oauth/react/index.d.ts +7 -0
- package/dist/oauth/react/index.d.ts.map +1 -0
- package/dist/oauth/react/index.js +99 -0
- package/dist/oauth/react/index.js.map +10 -0
- package/dist/oauth/react/use-consent.d.ts +52 -0
- package/dist/oauth/react/use-consent.d.ts.map +1 -0
- package/dist/oidc/dpop.d.ts +80 -0
- package/dist/oidc/dpop.d.ts.map +1 -0
- package/dist/oidc/errors.d.ts +16 -0
- package/dist/oidc/errors.d.ts.map +1 -0
- package/dist/oidc/flow.d.ts +59 -0
- package/dist/oidc/flow.d.ts.map +1 -0
- package/dist/oidc/index.d.ts +11 -0
- package/dist/oidc/index.d.ts.map +1 -0
- package/dist/oidc/index.js +742 -0
- package/dist/oidc/index.js.map +15 -0
- package/dist/oidc/oidc.d.ts +132 -0
- package/dist/oidc/oidc.d.ts.map +1 -0
- package/dist/oidc/revoke.d.ts +28 -0
- package/dist/oidc/revoke.d.ts.map +1 -0
- package/dist/oidc/seal.d.ts +20 -0
- package/dist/oidc/seal.d.ts.map +1 -0
- package/dist/pwa/build/build-worker.d.ts +41 -0
- package/dist/pwa/build/build-worker.d.ts.map +1 -0
- package/dist/pwa/build/index.d.ts +9 -0
- package/dist/pwa/build/index.d.ts.map +1 -0
- package/dist/pwa/build/index.js +9 -0
- package/dist/pwa/build/index.js.map +9 -0
- package/dist/pwa/build/precache.d.ts +17 -0
- package/dist/pwa/build/precache.d.ts.map +1 -0
- package/dist/pwa/index.d.ts +16 -0
- package/dist/pwa/index.d.ts.map +1 -0
- package/dist/pwa/index.js +110 -0
- package/dist/pwa/index.js.map +12 -0
- package/dist/pwa/model/caching.d.ts +46 -0
- package/dist/pwa/model/caching.d.ts.map +1 -0
- package/dist/pwa/model/clear-app-caches.d.ts +9 -0
- package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
- package/dist/pwa/model/font-precache.d.ts +15 -0
- package/dist/pwa/model/font-precache.d.ts.map +1 -0
- package/dist/pwa/model/manifest.d.ts +80 -0
- package/dist/pwa/model/manifest.d.ts.map +1 -0
- package/dist/pwa/model/precache-list.d.ts +40 -0
- package/dist/pwa/model/precache-list.d.ts.map +1 -0
- package/dist/pwa/model/registration.d.ts +39 -0
- package/dist/pwa/model/registration.d.ts.map +1 -0
- package/dist/pwa/model/start-service-worker.d.ts +24 -0
- package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
- package/dist/pwa/model/storable.d.ts +8 -0
- package/dist/pwa/model/storable.d.ts.map +1 -0
- package/dist/pwa/model/theme-color.d.ts +20 -0
- package/dist/pwa/model/theme-color.d.ts.map +1 -0
- package/dist/pwa/model/update-notice.d.ts +38 -0
- package/dist/pwa/model/update-notice.d.ts.map +1 -0
- package/dist/pwa/model/worker-contract.d.ts +61 -0
- package/dist/pwa/model/worker-contract.d.ts.map +1 -0
- package/dist/pwa/react/index.d.ts +9 -0
- package/dist/pwa/react/index.d.ts.map +1 -0
- package/dist/pwa/react/index.js +75 -0
- package/dist/pwa/react/index.js.map +13 -0
- package/dist/pwa/react/use-online.d.ts +6 -0
- package/dist/pwa/react/use-online.d.ts.map +1 -0
- package/dist/pwa/react/use-service-worker.d.ts +33 -0
- package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
- package/dist/pwa/react/use-update-notice.d.ts +14 -0
- package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
- package/dist/pwa/server/index.d.ts +7 -0
- package/dist/pwa/server/index.d.ts.map +1 -0
- package/dist/pwa/server/index.js +18 -0
- package/dist/pwa/server/index.js.map +10 -0
- package/dist/pwa/server/no-cache.d.ts +22 -0
- package/dist/pwa/server/no-cache.d.ts.map +1 -0
- package/dist/pwa/worker/index.d.ts +9 -0
- package/dist/pwa/worker/index.d.ts.map +1 -0
- package/dist/pwa/worker/index.js +144 -0
- package/dist/pwa/worker/index.js.map +12 -0
- package/dist/pwa/worker/injected.d.ts +15 -0
- package/dist/pwa/worker/injected.d.ts.map +1 -0
- package/dist/pwa/worker/plan.d.ts +65 -0
- package/dist/pwa/worker/plan.d.ts.map +1 -0
- package/dist/pwa/worker/scope.d.ts +18 -0
- package/dist/pwa/worker/scope.d.ts.map +1 -0
- package/dist/pwa/worker/start-worker.d.ts +17 -0
- package/dist/pwa/worker/start-worker.d.ts.map +1 -0
- package/dist/react-router.d.ts +68 -0
- package/dist/react-router.d.ts.map +1 -0
- package/dist/server.d.ts +127 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/session/codes.d.ts +9 -0
- package/dist/session/codes.d.ts.map +1 -0
- package/dist/session/cookies.d.ts +128 -0
- package/dist/session/cookies.d.ts.map +1 -0
- package/dist/session/flow-types.d.ts +235 -0
- package/dist/session/flow-types.d.ts.map +1 -0
- package/dist/session/guard.d.ts +10 -0
- package/dist/session/guard.d.ts.map +1 -0
- package/dist/session/index.d.ts +22 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +1090 -0
- package/dist/session/index.js.map +27 -0
- package/dist/session/land.d.ts +28 -0
- package/dist/session/land.d.ts.map +1 -0
- package/dist/session/link-json.d.ts +22 -0
- package/dist/session/link-json.d.ts.map +1 -0
- package/dist/session/link-land.d.ts +20 -0
- package/dist/session/link-land.d.ts.map +1 -0
- package/dist/session/link-token.d.ts +24 -0
- package/dist/session/link-token.d.ts.map +1 -0
- package/dist/session/link-types.d.ts +142 -0
- package/dist/session/link-types.d.ts.map +1 -0
- package/dist/session/links.d.ts +14 -0
- package/dist/session/links.d.ts.map +1 -0
- package/dist/session/model/index.d.ts +8 -0
- package/dist/session/model/index.d.ts.map +1 -0
- package/dist/session/model/index.js +35 -0
- package/dist/session/model/index.js.map +9 -0
- package/dist/session/model/link-post.d.ts +35 -0
- package/dist/session/model/link-post.d.ts.map +1 -0
- package/dist/session/model/paths.d.ts +24 -0
- package/dist/session/model/paths.d.ts.map +1 -0
- package/dist/session/model/safe-next.d.ts +15 -0
- package/dist/session/model/safe-next.d.ts.map +1 -0
- package/dist/session/model/second-factor.d.ts +16 -0
- package/dist/session/model/second-factor.d.ts.map +1 -0
- package/dist/session/model/site-path.d.ts +10 -0
- package/dist/session/model/site-path.d.ts.map +1 -0
- package/dist/session/model/step-up-answers.d.ts +45 -0
- package/dist/session/model/step-up-answers.d.ts.map +1 -0
- package/dist/session/model/step-up-props.d.ts +22 -0
- package/dist/session/model/step-up-props.d.ts.map +1 -0
- package/dist/session/model/step-up.d.ts +48 -0
- package/dist/session/model/step-up.d.ts.map +1 -0
- package/dist/session/react/index.d.ts +13 -0
- package/dist/session/react/index.d.ts.map +1 -0
- package/dist/session/react/index.js +196 -0
- package/dist/session/react/index.js.map +14 -0
- package/dist/session/react/step-up/answers.d.ts +9 -0
- package/dist/session/react/step-up/answers.d.ts.map +1 -0
- package/dist/session/react/step-up/dialog-props.d.ts +27 -0
- package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
- package/dist/session/react/step-up/index.d.ts +7 -0
- package/dist/session/react/step-up/index.d.ts.map +1 -0
- package/dist/session/react/step-up/pending-runs.d.ts +21 -0
- package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
- package/dist/session/react/step-up/phase.d.ts +8 -0
- package/dist/session/react/step-up/phase.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up.d.ts +51 -0
- package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
- package/dist/session/react/use-code-field.d.ts +37 -0
- package/dist/session/react/use-code-field.d.ts.map +1 -0
- package/dist/session/react/use-link-fragment.d.ts +22 -0
- package/dist/session/react/use-link-fragment.d.ts.map +1 -0
- package/dist/session/react/use-link-param.d.ts +26 -0
- package/dist/session/react/use-link-param.d.ts.map +1 -0
- package/dist/session/react/use-link-post.d.ts +39 -0
- package/dist/session/react/use-link-post.d.ts.map +1 -0
- package/dist/session/react/use-sign-out.d.ts +46 -0
- package/dist/session/react/use-sign-out.d.ts.map +1 -0
- package/dist/session/second-factor.d.ts +22 -0
- package/dist/session/second-factor.d.ts.map +1 -0
- package/dist/session/serialize.d.ts +42 -0
- package/dist/session/serialize.d.ts.map +1 -0
- package/dist/session/sign-in.d.ts +19 -0
- package/dist/session/sign-in.d.ts.map +1 -0
- package/dist/session/signed.d.ts +44 -0
- package/dist/session/signed.d.ts.map +1 -0
- package/dist/session/social-flow.d.ts +22 -0
- package/dist/session/social-flow.d.ts.map +1 -0
- package/dist/session/social-land.d.ts +31 -0
- package/dist/session/social-land.d.ts.map +1 -0
- package/dist/session/social-types.d.ts +136 -0
- package/dist/session/social-types.d.ts.map +1 -0
- package/dist/session/social.d.ts +32 -0
- package/dist/session/social.d.ts.map +1 -0
- package/dist/session/step-up-codes.d.ts +9 -0
- package/dist/session/step-up-codes.d.ts.map +1 -0
- package/dist/session/step-up-signed-out.d.ts +21 -0
- package/dist/session/step-up-signed-out.d.ts.map +1 -0
- package/dist/session/step-up-types.d.ts +127 -0
- package/dist/session/step-up-types.d.ts.map +1 -0
- package/dist/session/step-up.d.ts +17 -0
- package/dist/session/step-up.d.ts.map +1 -0
- package/dist/session/step.d.ts +22 -0
- package/dist/session/step.d.ts.map +1 -0
- package/dist/session/throttle.d.ts +73 -0
- package/dist/session/throttle.d.ts.map +1 -0
- package/dist/session/timed-wait.d.ts +4 -0
- package/dist/session/timed-wait.d.ts.map +1 -0
- package/dist/session/viewer.d.ts +34 -0
- package/dist/session/viewer.d.ts.map +1 -0
- package/dist/subscription/documents.d.ts +3 -0
- package/dist/subscription/documents.d.ts.map +1 -0
- package/dist/subscription/index.d.ts +7 -0
- package/dist/subscription/index.d.ts.map +1 -0
- package/dist/subscription/index.js +359 -0
- package/dist/subscription/index.js.map +14 -0
- package/dist/subscription/proxy.d.ts +54 -0
- package/dist/subscription/proxy.d.ts.map +1 -0
- package/dist/subscription/react/backoff.d.ts +8 -0
- package/dist/subscription/react/backoff.d.ts.map +1 -0
- package/dist/subscription/react/classify.d.ts +15 -0
- package/dist/subscription/react/classify.d.ts.map +1 -0
- package/dist/subscription/react/controller.d.ts +40 -0
- package/dist/subscription/react/controller.d.ts.map +1 -0
- package/dist/subscription/react/fake-timers.d.ts +8 -0
- package/dist/subscription/react/fake-timers.d.ts.map +1 -0
- package/dist/subscription/react/index.d.ts +15 -0
- package/dist/subscription/react/index.d.ts.map +1 -0
- package/dist/subscription/react/index.js +227 -0
- package/dist/subscription/react/index.js.map +17 -0
- package/dist/subscription/react/reconnect.d.ts +9 -0
- package/dist/subscription/react/reconnect.d.ts.map +1 -0
- package/dist/subscription/react/scheduler.d.ts +13 -0
- package/dist/subscription/react/scheduler.d.ts.map +1 -0
- package/dist/subscription/react/timers.d.ts +7 -0
- package/dist/subscription/react/timers.d.ts.map +1 -0
- package/dist/subscription/react/use-live-subscription.d.ts +36 -0
- package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
- package/dist/subscription/react/versions.d.ts +6 -0
- package/dist/subscription/react/versions.d.ts.map +1 -0
- package/dist/subscription/read.d.ts +17 -0
- package/dist/subscription/read.d.ts.map +1 -0
- package/dist/subscription/refusal.d.ts +11 -0
- package/dist/subscription/refusal.d.ts.map +1 -0
- package/dist/subscription/relay.d.ts +16 -0
- package/dist/subscription/relay.d.ts.map +1 -0
- package/dist/vite/bun.d.ts +21 -0
- package/dist/vite/bun.d.ts.map +1 -0
- package/dist/vite/bundle.d.ts +33 -0
- package/dist/vite/bundle.d.ts.map +1 -0
- package/dist/vite/compress.d.ts +18 -0
- package/dist/vite/compress.d.ts.map +1 -0
- package/dist/vite/config.d.ts +33 -0
- package/dist/vite/config.d.ts.map +1 -0
- package/dist/vite/dev.d.ts +28 -0
- package/dist/vite/dev.d.ts.map +1 -0
- package/dist/vite/entry.d.ts +20 -0
- package/dist/vite/entry.d.ts.map +1 -0
- package/dist/vite/hosts.d.ts +16 -0
- package/dist/vite/hosts.d.ts.map +1 -0
- package/dist/vite/index.d.ts +68 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +635 -0
- package/dist/vite/index.js.map +22 -0
- package/dist/vite/inline.d.ts +18 -0
- package/dist/vite/inline.d.ts.map +1 -0
- package/dist/vite/node.d.ts +16 -0
- package/dist/vite/node.d.ts.map +1 -0
- package/dist/vite/preview.d.ts +8 -0
- package/dist/vite/preview.d.ts.map +1 -0
- package/dist/vite/runtime.d.ts +8 -0
- package/dist/vite/runtime.d.ts.map +1 -0
- package/dist/vite/socket.d.ts +75 -0
- package/dist/vite/socket.d.ts.map +1 -0
- package/dist/vite/worker.d.ts +16 -0
- package/dist/vite/worker.d.ts.map +1 -0
- package/dist/with-alxia.d.ts +36 -0
- package/dist/with-alxia.d.ts.map +1 -0
- package/docs/README.md +42 -0
- package/docs/guide/api-keys.md +216 -0
- package/docs/guide/beside-the-pages.md +201 -0
- package/docs/guide/csp-nonce.md +166 -0
- package/docs/guide/customising-the-server.md +324 -0
- package/docs/guide/deploying.md +102 -0
- package/docs/guide/document.md +334 -0
- package/docs/guide/errors.md +1147 -0
- package/docs/guide/fetcher.md +355 -0
- package/docs/guide/getting-started.md +112 -0
- package/docs/guide/help.md +325 -0
- package/docs/guide/how-it-works.md +274 -0
- package/docs/guide/link.md +32 -0
- package/docs/guide/lists.md +225 -0
- package/docs/guide/mcp.md +173 -0
- package/docs/guide/media.md +273 -0
- package/docs/guide/navigation.md +52 -0
- package/docs/guide/oauth.md +342 -0
- package/docs/guide/oidc.md +262 -0
- package/docs/guide/openapi.md +51 -0
- package/docs/guide/pwa.md +670 -0
- package/docs/guide/session.md +2105 -0
- package/docs/guide/subscriptions.md +211 -0
- package/docs/guide/testing.md +42 -0
- package/docs/guide/typing-the-loaders.md +311 -0
- package/docs/guide.md +82 -0
- package/docs/roadmap.md +474 -0
- package/docs/troubleshooting.md +3837 -0
- package/package.json +301 -5
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Subscriptions for a BFF
|
|
2
|
+
|
|
3
|
+
This page is for a React Router app that is the backend of its own pages (a
|
|
4
|
+
BFF) and wants to show a GraphQL subscription in the browser: a room's
|
|
5
|
+
events, a chat, a live counter. The browser must not hold the API's token and
|
|
6
|
+
must not be able to send the API a document of its own, so the app exposes
|
|
7
|
+
**one resource route** that checks the user's session, looks the operation up
|
|
8
|
+
in a list the server holds, and relays the API's server-sent events.
|
|
9
|
+
|
|
10
|
+
`@softistx/alxia-react-router/subscription` is that route. It imports nothing (web APIs only), so it adds no peer. Its browser side, `useLiveSubscription`, is [further down](#keep-it-alive-in-the-page).
|
|
11
|
+
|
|
12
|
+
## Expose a subscription
|
|
13
|
+
|
|
14
|
+
`allow` maps each operation name to the **document the server sends for it**.
|
|
15
|
+
Build the map from your codegen's documents, so the text is the one your
|
|
16
|
+
client was generated from:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// app/routes/events.ts: a resource route, served at /events
|
|
20
|
+
import { alxiaOf } from '@softistx/alxia-react-router';
|
|
21
|
+
import {
|
|
22
|
+
createSubscriptionProxy,
|
|
23
|
+
type SubscriptionArgs,
|
|
24
|
+
} from '@softistx/alxia-react-router/subscription';
|
|
25
|
+
import { print } from 'graphql';
|
|
26
|
+
import type { RouterContextProvider } from 'react-router';
|
|
27
|
+
import { ChatMessagesDocument, RoomEventsDocument } from '../generated/graphql';
|
|
28
|
+
import { cookies } from '../session.server';
|
|
29
|
+
|
|
30
|
+
const events = createSubscriptionProxy({
|
|
31
|
+
endpoint: 'https://api.example.com/graphql',
|
|
32
|
+
allow: {
|
|
33
|
+
RoomEvents: print(RoomEventsDocument), // a TypedDocumentNode
|
|
34
|
+
ChatMessages: print(ChatMessagesDocument),
|
|
35
|
+
// or the document string codegen exports, or a literal
|
|
36
|
+
},
|
|
37
|
+
getToken: (request) => cookies.token(request),
|
|
38
|
+
headers: (
|
|
39
|
+
request,
|
|
40
|
+
{ context }: SubscriptionArgs<Readonly<RouterContextProvider>>,
|
|
41
|
+
) => ({
|
|
42
|
+
'x-client-name': 'my-bff',
|
|
43
|
+
'x-proxy-secret': process.env.PROXY_SECRET,
|
|
44
|
+
// the trusted client address (behind `proxy: trustProxy(...)`), not the browser's own header; null leaves it out
|
|
45
|
+
'x-forwarded-for': context ? alxiaOf(context).ip : null,
|
|
46
|
+
'accept-language': request.headers.get('accept-language'),
|
|
47
|
+
}),});
|
|
48
|
+
|
|
49
|
+
export const loader = events.loader; // GET: operationName and variables in the query string
|
|
50
|
+
export const action = events.action; // POST: the same in a JSON body
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// app/routes.ts
|
|
55
|
+
import { route, type RouteConfig } from '@react-router/dev/routes';
|
|
56
|
+
|
|
57
|
+
export default [route('events', 'routes/events.ts')] satisfies RouteConfig;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The browser talks to `/events` with a client that speaks GraphQL over SSE in
|
|
61
|
+
its distinct connections mode, such as `graphql-sse`. It names the operation
|
|
62
|
+
and sends its variables; the `query` it sends, as `graphql-sse` always does,
|
|
63
|
+
is **ignored**:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { createClient } from 'graphql-sse';
|
|
67
|
+
|
|
68
|
+
const client = createClient({ url: '/events', singleConnection: false });
|
|
69
|
+
|
|
70
|
+
const dispose = client.subscribe(
|
|
71
|
+
{
|
|
72
|
+
query: 'subscription RoomEvents($id: ID!) { roomEvents(id: $id) { id kind } }',
|
|
73
|
+
operationName: 'RoomEvents',
|
|
74
|
+
variables: { id: roomId },
|
|
75
|
+
},
|
|
76
|
+
{ next: show, error: report, complete: () => {} },
|
|
77
|
+
);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`graphql-sse` sends a POST by default and a GET for `method: 'GET'`; both
|
|
81
|
+
work, each through the matching export.
|
|
82
|
+
|
|
83
|
+
## What the proxy does
|
|
84
|
+
|
|
85
|
+
| Step | Rule |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| Same site | Both methods run the rule of `jsonActions`: an `Origin` that is not the app's own, or a `Sec-Fetch-Site` other than `same-origin` or `none`, is a **403** (`origin` sets the app's origin; the request's own by default). It reads headers only. A POST must be `application/json`, else **415**. |
|
|
88
|
+
| Session | `getToken(request)` gives the token, read on the server from the HttpOnly cookie. Empty, `null`, `undefined` or a token holding a line break is a **401**; nothing goes upstream. |
|
|
89
|
+
| Request | The client's `operationName` and `variables` are read. A body that cannot be read (the client left) is a **400**; a body past 64 KiB (`Content-Length` first, then the bytes read), a query string past 16 KiB or `variables` past 16 KiB is a **400**, as is malformed input. Its `query` and `extensions` are ignored. |
|
|
90
|
+
| Allow-list | Each document of `allow` must define `subscription <key>` and no other operation (fragments are fine), or `createSubscriptionProxy` throws a `TypeError` when it is created. `operationName` must be a key of `allow`, else **403**. The proxy sends **its own document** for it, with the client's variables: no document, fragment, extension or persisted id of the client's reaches the API. |
|
|
91
|
+
| Upstream request | A `POST` to `endpoint` with `Accept: text/event-stream`, `Authorization: Bearer <token>` and your `headers`. The browser's own headers and cookies are never forwarded. A header name or value no header can hold (a line break) is a worded **500**. |
|
|
92
|
+
| Relay | Whole events are relayed in order, as the client takes them: a slow client holds the upstream back instead of growing a buffer, and a heartbeat is skipped while one is waiting. A heartbeat comment (`:`) goes out every `heartbeatMs` (15000 by default, `0` turns it off), never inside an event. An event of more than 1 MiB with no end cuts the stream with an `UPSTREAM_ERROR`. |
|
|
93
|
+
| End | The upstream's `complete`, or the end of its stream, closes the client's stream. A stream that breaks sends a `next` with an `UPSTREAM_ERROR` and a `complete`. |
|
|
94
|
+
| Abort | When the browser closes the request, the upstream request is aborted: no subscription is left running. A request that is already aborted never starts one. |
|
|
95
|
+
| Rate limit | An upstream **429** is passed through with `Retry-After` and `retryAfter` in the body (`{ "retryAfter": 12, "errors": [{ "extensions": { "code": "RATE_LIMITED", "retryAfter": 12 } }] }`), read from the upstream's header or body. The proxy never retries. |
|
|
96
|
+
| Other failures | An upstream 5xx, an unreachable API or an answer that is not an event stream is a **502** (`UPSTREAM_ERROR`); an upstream 4xx such as a 401 passes through. |
|
|
97
|
+
|
|
98
|
+
The stream is answered with `Content-Type: text/event-stream`,
|
|
99
|
+
`Cache-Control: no-store, no-transform` and `X-Accel-Buffering: no`, so no
|
|
100
|
+
adapter or reverse proxy needs to buffer it.
|
|
101
|
+
|
|
102
|
+
## Options
|
|
103
|
+
|
|
104
|
+
| Option | |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `endpoint` | the API's GraphQL URL (required) |
|
|
107
|
+
| `allow` | operation name to the document sent upstream (required); each document must define `subscription <name>`, that operation alone, checked when the proxy is created |
|
|
108
|
+
| `getToken(request)` | the session's token, sync or async (required) |
|
|
109
|
+
| `headers` | a record, `Headers`, or `(request, args) => record`, sync or async; `args` is what React Router gave the route (`request`, `context`, `params`), so a header can come from the app's context; a `null` or `undefined` value is left out. A `(request) => record` function keeps working |
|
|
110
|
+
| `origin` | the app's origin for the same-site check, a string or a getter; the request's own by default |
|
|
111
|
+
| `heartbeatMs` | 15000 |
|
|
112
|
+
| `fetch` | the `fetch` used upstream (the global one); useful in specs |
|
|
113
|
+
|
|
114
|
+
## Keep the stream alive
|
|
115
|
+
|
|
116
|
+
Bun closes a connection that has been idle for `idleTimeout` seconds, 10 by
|
|
117
|
+
default, which is shorter than the proxy's 15 second heartbeat (`heartbeatMs`)
|
|
118
|
+
and than the API's own 12 second ping. Left alone, an idle subscription is
|
|
119
|
+
reset at about 8 to 10 seconds, before the first heartbeat. Set `idleTimeout`
|
|
120
|
+
above both in the server's `listen` options:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// app/server.ts
|
|
124
|
+
export default createServer({
|
|
125
|
+
listen: { idleTimeout: 30 }, // seconds
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The same goes for the API's server (`app.listen({ idleTimeout: 30 })` with
|
|
130
|
+
`@softistx/alxia-graphql`), and for a proxy's read timeout, which must be longer than
|
|
131
|
+
`heartbeatMs` too. Calling `server.timeout(request, 0)` from a resolver does
|
|
132
|
+
not lift it for the stream. Behind nginx, keep `proxy_buffering off` for the
|
|
133
|
+
route (the `X-Accel-Buffering: no` header does it per response).
|
|
134
|
+
|
|
135
|
+
## Cross-site requests
|
|
136
|
+
|
|
137
|
+
Both methods refuse a request from another site (the rule above), and the
|
|
138
|
+
session cookie should stay `SameSite=Lax` (`sessionCookies` does it). The
|
|
139
|
+
allow-list is what the browser may start; because the documents are the
|
|
140
|
+
server's, it cannot start anything else, a mutation included. The route does
|
|
141
|
+
not stop a signed-in user from starting an allowed subscription as often as
|
|
142
|
+
they like: rate-limit it (`@softistx/alxia-rate-limit`) if the API does not.
|
|
143
|
+
|
|
144
|
+
## Keep it alive in the page
|
|
145
|
+
|
|
146
|
+
`@softistx/alxia-react-router/subscription/react` is the browser side of the route
|
|
147
|
+
above. `useLiveSubscription(document, variables, options)` wraps
|
|
148
|
+
`useSubscription` of `@nxgt/graphql-client/react` (an optional peer, `>=0.7.0 <0.9.0`;
|
|
149
|
+
the page needs its `GraphQLProvider`) and handles what a stream that lives for
|
|
150
|
+
minutes needs. The bare client never retries, reconnects or deduplicates.
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { useLiveSubscription } from '@softistx/alxia-react-router/subscription/react';
|
|
154
|
+
import { useRevalidator } from 'react-router';
|
|
155
|
+
import { PublicationChangedDocument } from '../generated/graphql';
|
|
156
|
+
|
|
157
|
+
export function useLivePublication(id: string) {
|
|
158
|
+
const revalidator = useRevalidator();
|
|
159
|
+
return useLiveSubscription(
|
|
160
|
+
PublicationChangedDocument,
|
|
161
|
+
{ id },
|
|
162
|
+
{
|
|
163
|
+
keyOf: ({ publicationChanged }) => publicationChanged.publication.id,
|
|
164
|
+
versionOf: ({ publicationChanged }) =>
|
|
165
|
+
publicationChanged.publication.version,
|
|
166
|
+
onChange: ({ publicationChanged }, { revalidate }) => {
|
|
167
|
+
if (!isOnPage(publicationChanged.publication.id)) revalidate();
|
|
168
|
+
},
|
|
169
|
+
revalidate: () => revalidator.revalidate(),
|
|
170
|
+
},
|
|
171
|
+
); // { status, retry, revalidate }
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
| Rule | What it does |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| Reconnect | After an end or a failure, the stream is opened again after 1 s, then 2 s, 4 s, up to 30 s, each spread over its upper half so tabs do not reconnect together. An accepted stream resets the wait. `status` is `reconnecting` meanwhile. |
|
|
178
|
+
| End classification | A **401** stops at once (the session is over; no reconnecting flicker). Any other **4xx** stops: repeating cannot change it. A **429** waits the `retryAfter` the proxy passes on (`errors[0].extensions.retryAfter`, or the body's), when it is longer than the backoff. A 5xx, a network error, a `realtime.session-ended` inside a 200 stream and a clean complete (the API closes a stream after its lifetime) reconnect. |
|
|
179
|
+
| Stopped | `status` is `stopped`; nothing reconnects. `retry()` opens the stream again from `connecting`. |
|
|
180
|
+
| Version dedupe | With `keyOf` and `versionOf`, an event whose version is **lower** than the highest seen for its key is dropped; `onChange` gets fresh events only. An event whose `keyOf` is `null` or `undefined` is never dropped. |
|
|
181
|
+
| Revalidate | Events are hints and nothing is replayed, so after every reopen but the first the page's data is read again through your `revalidate`: once after 300 ms of quiet, or 2 s after the first request of a burst. `onChange` can ask for one too, with `revalidate()` from its second argument. |
|
|
182
|
+
| Cleanup | Timers are cleared on unmount. |
|
|
183
|
+
|
|
184
|
+
**Reconnect only.** For a stream whose every event is the whole state (a
|
|
185
|
+
presence list), leave out `versionOf` and `revalidate`: every event reaches
|
|
186
|
+
`onChange`, and a reopen reads nothing since the stream lists everyone on open.
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
const [others, setOthers] = useState<Present[]>([]);
|
|
190
|
+
const { status } = useLiveSubscription(
|
|
191
|
+
PresenceDocument,
|
|
192
|
+
{ roomId },
|
|
193
|
+
{ onChange: ({ presence }) => setOthers(presence), skip: !roomId },
|
|
194
|
+
);
|
|
195
|
+
// on 'stopped' (a 401), drop what was shown
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`onChange` and `revalidate` are read when they are called, so a new closure
|
|
199
|
+
each render does not reopen the stream; only the document and the variables
|
|
200
|
+
(by value) do. The rules apart from React are exported too
|
|
201
|
+
(`createLiveController`, `classifyEnd`, `backoffDelay`) for a hook of your own.
|
|
202
|
+
|
|
203
|
+
## Testing
|
|
204
|
+
|
|
205
|
+
For the hook, mock `@nxgt/graphql-client/react`'s `useSubscription` and call the
|
|
206
|
+
`onOpen`, `onData`, `onError` and `onComplete` it was given. For the rules, use
|
|
207
|
+
`createLiveController` with a `timers` of your own (a fake clock).
|
|
208
|
+
|
|
209
|
+
Give the proxy a fake API through `fetch`, or start a `Bun.serve` that
|
|
210
|
+
answers with an event stream, and call `events.action({ request })`; the
|
|
211
|
+
answer is a plain `Response`.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
This page covers testing the app in process, with no server.
|
|
4
|
+
|
|
5
|
+
`server.create(wiring)` makes the app in process, from a build: import
|
|
6
|
+
the server, and pass it React Router's build, which
|
|
7
|
+
`build/server/index.js` holds. The test needs Bun's types:
|
|
8
|
+
`bun add -d @types/bun`, and `"bun"` in the tsconfig's `types`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
// app/server.test.ts
|
|
12
|
+
import { expect, test } from 'bun:test';
|
|
13
|
+
import type { ServerBuild } from 'react-router';
|
|
14
|
+
import server from './server';
|
|
15
|
+
|
|
16
|
+
const BROWSER = 'Mozilla/5.0 (Macintosh) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0 Safari/537.36';
|
|
17
|
+
|
|
18
|
+
test('the home page renders', async () => {
|
|
19
|
+
// After `bun run build`: React Router's build is inside the server build.
|
|
20
|
+
const build: ServerBuild = await import(new URL('../build/server/index.js', import.meta.url).href);
|
|
21
|
+
const app = server.create({ build, client: new URL('../build/client', import.meta.url) });
|
|
22
|
+
const response = await app.request('/', { headers: { 'user-agent': BROWSER } });
|
|
23
|
+
expect(response.status).toBe(200);
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or drive the built app itself, the default export of
|
|
28
|
+
`build/server/index.js`: importing it starts no server. Or run it, as
|
|
29
|
+
[the example's spec](https://github.com/softistx/alxia/blob/develop/examples/react-router/app/server.spec.ts)
|
|
30
|
+
does: `bun build/server/index.js` with `PORT=0`, then read the URL from
|
|
31
|
+
its `alxia listening on <url>` line.
|
|
32
|
+
|
|
33
|
+
Send a browser's user agent. `isbot('Bun/1.4.2')` is true, and React
|
|
34
|
+
Router's entry waits for the whole page before it answers a bot, so a test
|
|
35
|
+
with Bun's own user agent never sees a page stream. An index route's action
|
|
36
|
+
is `POST /?index`, not `POST /`.
|
|
37
|
+
|
|
38
|
+
`app.request` runs without a server, so a loader's `alxiaOf(context).server`
|
|
39
|
+
is `undefined` there, and a `publish` it guards with `?.` sends nothing.
|
|
40
|
+
To test one, listen on a free port, `app.listen({ port: 0 })`, open the
|
|
41
|
+
socket, then post to the action (`/todos.data`, the single-fetch URL, for
|
|
42
|
+
its data rather than the page).
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# Typing the loaders
|
|
2
|
+
|
|
3
|
+
This page covers reading alxia's context in a loader, an action or a
|
|
4
|
+
middleware, typed with `Register` or a type argument, and the keys an app
|
|
5
|
+
makes for itself.
|
|
6
|
+
|
|
7
|
+
Every request through the catch-all sets `alxiaContext`, this package's
|
|
8
|
+
key, on React Router's context provider, to what alxia's middlewares built for
|
|
9
|
+
that request. Three forms read it, each the same object:
|
|
10
|
+
|
|
11
|
+
- **`withAlxia(fn)`**, for a route typed by the generated `Route.*Args`:
|
|
12
|
+
`fn` gets `alxia` beside React Router's arguments;
|
|
13
|
+
- **`alxiaOf(context)`**, inside a plain function, and with a type argument;
|
|
14
|
+
- **`context.alxia`**, where the arguments are typed with `react-router`'s
|
|
15
|
+
own `LoaderFunctionArgs` and `ActionFunctionArgs`
|
|
16
|
+
([below](#the-shorthand-contextalxia)).
|
|
17
|
+
|
|
18
|
+
## `withAlxia(fn)`
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// app/routes/account.tsx
|
|
22
|
+
import { type AlxiaArgs, withAlxia } from '@softistx/alxia-react-router';
|
|
23
|
+
import { redirect } from 'react-router';
|
|
24
|
+
import type { Route } from './+types/account';
|
|
25
|
+
|
|
26
|
+
export const loader = withAlxia(({ alxia, params }: Route.LoaderArgs & AlxiaArgs) => {
|
|
27
|
+
if (alxia.user === null) throw redirect('/login');
|
|
28
|
+
return { name: alxia.user.name, tab: params.tab ?? 'profile' };
|
|
29
|
+
});
|
|
30
|
+
// The page's Route.ComponentProps['loaderData']: { name: string; tab: string }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Annotate `fn`'s parameter as the generated arguments and `AlxiaArgs`:
|
|
34
|
+
`AlxiaArgs` is `{ alxia }`, typed by `Register`, and `AlxiaArgs<typeof server>`
|
|
35
|
+
names a server where nothing is registered. `withAlxia` returns a function of
|
|
36
|
+
React Router's arguments alone, with `fn`'s return type, so the generated
|
|
37
|
+
`loaderData` and `actionData`, and `useLoaderData<typeof loader>`, read what
|
|
38
|
+
`fn` returns. An action is written the same way; a middleware too, and its
|
|
39
|
+
`next` is passed on:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { type AlxiaArgs, withAlxia } from '@softistx/alxia-react-router';
|
|
43
|
+
import type { Route } from './+types/admin';
|
|
44
|
+
|
|
45
|
+
export const middleware: Route.MiddlewareFunction[] = [
|
|
46
|
+
withAlxia(async ({ alxia }: Parameters<Route.MiddlewareFunction>[0] & AlxiaArgs, next) => {
|
|
47
|
+
alxia.log.info('admin');
|
|
48
|
+
return next();
|
|
49
|
+
}),
|
|
50
|
+
];
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Why a wrapper: `context.alxia` cannot be typed under the generated
|
|
54
|
+
arguments ([below](#the-shorthand-contextalxia)), and a wrapper that adds a
|
|
55
|
+
key is the one form TypeScript infers from the annotation alone. A type
|
|
56
|
+
argument, `withAlxia<Route.LoaderArgs>(fn)`, would fix the arguments but
|
|
57
|
+
stop TypeScript inferring `fn`'s return type, since it infers no type
|
|
58
|
+
argument once one is given: the page's `loaderData` would be lost. On a request that did not come
|
|
59
|
+
through alxia it throws what `alxiaOf` throws.
|
|
60
|
+
|
|
61
|
+
## With `Register`: no type argument
|
|
62
|
+
|
|
63
|
+
The `declare module` block in `app/server.ts` names the server once:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
declare module '@softistx/alxia-react-router' {
|
|
67
|
+
interface Register {
|
|
68
|
+
server: typeof server;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Every loader, action and middleware then reads it typed, with no import:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
// app/routes/account.tsx
|
|
77
|
+
import { alxiaOf } from '@softistx/alxia-react-router';
|
|
78
|
+
import { data, redirect } from 'react-router';
|
|
79
|
+
import type { Route } from './+types/account';
|
|
80
|
+
|
|
81
|
+
export function loader({ context }: Route.LoaderArgs) {
|
|
82
|
+
const { user, log, requestId } = alxiaOf(context);
|
|
83
|
+
if (user === null) throw redirect('/login');
|
|
84
|
+
log.info('account');
|
|
85
|
+
return { name: user.name, requestId };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function action({ request, context }: Route.ActionArgs) {
|
|
89
|
+
const { user } = alxiaOf(context);
|
|
90
|
+
const form = await request.formData();
|
|
91
|
+
if (user === null) return data({ error: 'signed out' }, { status: 401 });
|
|
92
|
+
return { saved: form.get('name'), by: user.name };
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Name `typeof server`, the default export's type, not the module's
|
|
97
|
+
(`typeof import('./server')`): a wrong registration makes every read a
|
|
98
|
+
compile error, as [the troubleshooting entry](../troubleshooting.md#property--does-not-exist-on-type-basecontext---readonly-registerserver-must-be-typeof-server-the-default-export-of-createserver-never-)
|
|
99
|
+
shows. The checks it gives:
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
const ctx = alxiaOf(context);
|
|
103
|
+
ctx.tenant; // error: no middleware derives `tenant`
|
|
104
|
+
ctx.user.name; // error: `user` may be null
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Without `Register`: the type argument
|
|
108
|
+
|
|
109
|
+
Pass the server's type, imported with `import type`, so nothing is
|
|
110
|
+
bundled and the route never imports the server at runtime:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
// app/server.ts
|
|
114
|
+
const server = createServer({ configure: (app) => app.use(logger()) });
|
|
115
|
+
export default server;
|
|
116
|
+
export type Server = typeof server;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
// app/routes/home.tsx
|
|
121
|
+
import { alxiaOf } from '@softistx/alxia-react-router';
|
|
122
|
+
import type { Server } from '../server';
|
|
123
|
+
import type { Route } from './+types/home';
|
|
124
|
+
|
|
125
|
+
export function loader({ context }: Route.LoaderArgs) {
|
|
126
|
+
const { log } = alxiaOf<Server>(context);
|
|
127
|
+
log.info('home');
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The type argument may also be an alxia app, the app *before* the
|
|
133
|
+
catch-all, for a server of your own. Anything else is a compile error.
|
|
134
|
+
|
|
135
|
+
## With `@softistx/alxia`'s `Register`
|
|
136
|
+
|
|
137
|
+
`@softistx/alxia` has a `Register` of its own, which names the chain that
|
|
138
|
+
builds an app's context, for its route files
|
|
139
|
+
([The app's type](https://github.com/softistx/alxia/blob/develop/packages/core/docs/guide/types.md#register-and-appcontext)).
|
|
140
|
+
`alxiaOf(context)` reads it when this package's `Register` names no
|
|
141
|
+
server:
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
// app/context.ts
|
|
145
|
+
import { alxia } from '@softistx/alxia';
|
|
146
|
+
|
|
147
|
+
export const base = alxia().derive(({ request }) => ({ user: request.headers.get('x-user') }));
|
|
148
|
+
|
|
149
|
+
declare module '@softistx/alxia' {
|
|
150
|
+
interface Register {
|
|
151
|
+
context: typeof base;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// app/server.ts
|
|
156
|
+
const server = createServer({ configure: (app) => app.plugin(base) });
|
|
157
|
+
export default server;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`alxiaOf(context).user` is then typed with no declaration in
|
|
161
|
+
`@softistx/alxia-react-router`. Which one is read, in order:
|
|
162
|
+
|
|
163
|
+
1. a type argument, `alxiaOf<typeof server>(context)`;
|
|
164
|
+
2. this package's `Register`, `server: typeof server`: the whole app the
|
|
165
|
+
pages run behind, `base` and everything `configure` adds after it;
|
|
166
|
+
3. `@softistx/alxia`'s `Register`, `context: typeof base`: only what `base`
|
|
167
|
+
builds;
|
|
168
|
+
4. neither: `BaseContext`, the request, its URL, `reply` and the rest of
|
|
169
|
+
what every middleware reads.
|
|
170
|
+
|
|
171
|
+
Declare this package's `Register` when `configure` adds to the context
|
|
172
|
+
after the base, and the loaders read it.
|
|
173
|
+
|
|
174
|
+
## Why a global augmentation is right here
|
|
175
|
+
|
|
176
|
+
alxia's core refuses a global augmentation of a context key: a plugin
|
|
177
|
+
that added `user` to every route, declared before it or after, would
|
|
178
|
+
type `user` on routes that run before the plugin. That is the lie "order
|
|
179
|
+
is meaning" forbids. Core's own `Register` names the base that builds
|
|
180
|
+
the context instead, and what reads it requires it. `Register` here does
|
|
181
|
+
something else: it names the **one** server of the React Router build,
|
|
182
|
+
at the point of its catch-all, which is exactly what every loader runs
|
|
183
|
+
behind. One build has one server entry, so there is no second app for a
|
|
184
|
+
module to be confused with.
|
|
185
|
+
|
|
186
|
+
If two React Router apps share one TypeScript program (one tsconfig over
|
|
187
|
+
both folders of a monorepo), their two declarations conflict, and `tsc`
|
|
188
|
+
says so (`Subsequent property declarations must have the same type`).
|
|
189
|
+
Give each app its own tsconfig, or use the type argument in both.
|
|
190
|
+
|
|
191
|
+
## The server: `server`
|
|
192
|
+
|
|
193
|
+
`alxiaOf(context).server` is core's `ctx.server`, the `Bun.Server` serving
|
|
194
|
+
the request, `undefined` with none
|
|
195
|
+
([Serving](https://github.com/softistx/alxia/blob/develop/packages/core/docs/guide/serving.md#the-server-ctxserver)).
|
|
196
|
+
It is not `Register`'s `server`, which names what `createServer()` returned
|
|
197
|
+
for the types. From an action, its `publish` reaches the app's
|
|
198
|
+
[WebSocket](beside-the-pages.md#websockets) subscribers:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
// app/routes/todos.tsx
|
|
202
|
+
import { alxiaOf } from '@softistx/alxia-react-router';
|
|
203
|
+
import type { Route } from './+types/todos';
|
|
204
|
+
|
|
205
|
+
export async function action({ request, context }: Route.ActionArgs) {
|
|
206
|
+
const title = String((await request.formData()).get('title'));
|
|
207
|
+
// Bun's own publish: the bytes as given, not checked by a socket's `send` schema.
|
|
208
|
+
alxiaOf(context).server?.publish('todos', JSON.stringify({ added: title }));
|
|
209
|
+
return { added: title };
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
What it is, by how the app runs:
|
|
214
|
+
|
|
215
|
+
| | `alxiaOf(context).server` |
|
|
216
|
+
| --- | --- |
|
|
217
|
+
| `bun build/server/index.js`, `server.start(app)`, `app.listen()` | the server `listen` started |
|
|
218
|
+
| `react-router dev`, `vite preview` | the `Bun.Server` on a loopback port that the plugin relays the app's sockets to (Vite's own server is `node:http`, not a `Bun.Server`): `publish` reaches every socket the app opened, its `url` is that port's, and `requestIP` and `timeout` know nothing of the request Vite took, so `ctx.ip` stays `undefined` there |
|
|
219
|
+
| Vite in middleware mode, a server of your own calling `app.fetch(request)` alone, `app.request(…)` in a test | `undefined` |
|
|
220
|
+
|
|
221
|
+
## The shorthand: `context.alxia`
|
|
222
|
+
|
|
223
|
+
This package augments React Router's `RouterContextProvider` with a
|
|
224
|
+
read-only `alxia` property: the object `alxiaOf(context)` returns, with no
|
|
225
|
+
import and no call, typed by the same `Register` (core's, then
|
|
226
|
+
`BaseContext`, with none of this package's):
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
|
230
|
+
|
|
231
|
+
export function loader({ context }: LoaderFunctionArgs) {
|
|
232
|
+
const { user, server } = context.alxia;
|
|
233
|
+
return { name: user?.name ?? 'anonymous', listening: server !== undefined };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export async function action({ context }: ActionFunctionArgs) {
|
|
237
|
+
context.alxia.server?.publish('todos', JSON.stringify({ changed: true }));
|
|
238
|
+
return { ok: true };
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Typed with react-router's own argument types, not yet the generated
|
|
243
|
+
ones.** `LoaderFunctionArgs`, `ActionFunctionArgs`, `MiddlewareFunction` and
|
|
244
|
+
`RouterContextProvider`, imported from `react-router`, see `alxia`. The
|
|
245
|
+
generated `Route.LoaderArgs` does not: the `+types` files import from
|
|
246
|
+
`react-router/internal`, whose types (in react-router 8.4 and 8.5) point at its
|
|
247
|
+
`dist/development` build, while `react-router` itself points at
|
|
248
|
+
`dist/production`. That is a second declaration of `RouterContextProvider`,
|
|
249
|
+
which no exported path reaches, so no package can augment it. With
|
|
250
|
+
`Route.LoaderArgs`, `context.alxia` works at runtime and `tsc` reports
|
|
251
|
+
TS2339 ([Troubleshooting](../troubleshooting.md#property-alxia-does-not-exist-on-type-readonlyroutercontextprovider)):
|
|
252
|
+
use `withAlxia` (or `alxiaOf(context)`) there, until react-router ships one declaration.
|
|
253
|
+
|
|
254
|
+
It is a getter on the provider's prototype that reads `alxiaContext`: it
|
|
255
|
+
holds exactly when that key is set, in dev as in production, and on a
|
|
256
|
+
provider no catch-all filled it throws what `alxiaOf` throws. It is the
|
|
257
|
+
server's alone: a `clientLoader` or a `clientAction` has no alxia context.
|
|
258
|
+
|
|
259
|
+
## Outside the catch-all
|
|
260
|
+
|
|
261
|
+
Without the plugin, under a plain `react-router dev`, or in a unit test
|
|
262
|
+
that calls a loader with a bare provider, there is no alxia context, and
|
|
263
|
+
`alxiaOf` and `context.alxia` throw, saying so. The getter is installed
|
|
264
|
+
when `@softistx/alxia-react-router` is first imported: a test whose program never
|
|
265
|
+
imports it reads `context.alxia` as `undefined`. See
|
|
266
|
+
[the troubleshooting entry](../troubleshooting.md#alxiaof-this-request-has-no-alxia-context-).
|
|
267
|
+
|
|
268
|
+
## The app's own context keys
|
|
269
|
+
|
|
270
|
+
React Router 8 passes data to loaders through keys made by
|
|
271
|
+
`createContext<T>()`, and matches a key by object identity. Under the
|
|
272
|
+
plugin, the server is built and loaded with the routes, so a key in
|
|
273
|
+
`app/` is one object for both:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
// app/context.ts
|
|
277
|
+
import { createContext } from 'react-router';
|
|
278
|
+
|
|
279
|
+
export const greetingContext = createContext<string>('unset');
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
// app/server.ts
|
|
284
|
+
import { createServer } from '@softistx/alxia-react-router';
|
|
285
|
+
import { greetingContext } from './context';
|
|
286
|
+
|
|
287
|
+
export default createServer({
|
|
288
|
+
getLoadContext: (_ctx, context) => context.set(greetingContext, 'hello'),
|
|
289
|
+
});
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
// app/routes/home.tsx
|
|
294
|
+
import { greetingContext } from '../context';
|
|
295
|
+
import type { Route } from './+types/home';
|
|
296
|
+
|
|
297
|
+
export function loader({ context }: Route.LoaderArgs) {
|
|
298
|
+
return { greeting: context.get(greetingContext) };
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
`getLoadContext` runs before React Router, on every request, with
|
|
303
|
+
`alxiaContext` already set. Its `ctx` is typed by `configure`'s app:
|
|
304
|
+
reading something no middleware derives is a compile error. Keep the keys in a
|
|
305
|
+
module of their own, such as `app/context.ts`, rather than in
|
|
306
|
+
`app/server.ts`: a route imports them, and the server file then stays out
|
|
307
|
+
of the client's module graph.
|
|
308
|
+
|
|
309
|
+
A server of your own, without the plugin, holds another copy of every
|
|
310
|
+
key under `app/`: see
|
|
311
|
+
[the troubleshooting entry](../troubleshooting.md#error-no-value-found-for-context).
|
package/docs/guide.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Guide
|
|
2
|
+
|
|
3
|
+
The guide moved to `docs/guide/`, one page per topic; the
|
|
4
|
+
[documentation index](README.md) lists them. This page only keeps the old
|
|
5
|
+
anchors, so a link to one of them still lands on the topic: each heading
|
|
6
|
+
below links to where it went.
|
|
7
|
+
|
|
8
|
+
## Setup
|
|
9
|
+
|
|
10
|
+
Moved to [Getting started](guide/getting-started.md).
|
|
11
|
+
|
|
12
|
+
## How it works
|
|
13
|
+
|
|
14
|
+
Moved to [How it works](guide/how-it-works.md).
|
|
15
|
+
|
|
16
|
+
## Built for Bun
|
|
17
|
+
|
|
18
|
+
Moved to [Built for Bun](guide/how-it-works.md#built-for-bun).
|
|
19
|
+
|
|
20
|
+
## Self-contained
|
|
21
|
+
|
|
22
|
+
Moved to [Self-contained](guide/how-it-works.md#self-contained).
|
|
23
|
+
|
|
24
|
+
## Customising the server
|
|
25
|
+
|
|
26
|
+
Moved to [Customising the server](guide/customising-the-server.md).
|
|
27
|
+
|
|
28
|
+
## Typing the loaders
|
|
29
|
+
|
|
30
|
+
Moved to [Typing the loaders](guide/typing-the-loaders.md).
|
|
31
|
+
|
|
32
|
+
## The server: `server`
|
|
33
|
+
|
|
34
|
+
Moved to [The server: `server`](guide/typing-the-loaders.md#the-server-server).
|
|
35
|
+
|
|
36
|
+
## The app's own context keys
|
|
37
|
+
|
|
38
|
+
Moved to [The app's own context keys](guide/typing-the-loaders.md#the-apps-own-context-keys).
|
|
39
|
+
|
|
40
|
+
## A CSP nonce
|
|
41
|
+
|
|
42
|
+
Moved to [A CSP nonce](guide/csp-nonce.md).
|
|
43
|
+
|
|
44
|
+
## Escape hatches
|
|
45
|
+
|
|
46
|
+
Moved to [Escape hatches](guide/customising-the-server.md#escape-hatches).
|
|
47
|
+
|
|
48
|
+
## A server of your own, without the plugin
|
|
49
|
+
|
|
50
|
+
Moved to [A server of your own, without the plugin](guide/customising-the-server.md#a-server-of-your-own-without-the-plugin).
|
|
51
|
+
|
|
52
|
+
## Middlewares around the pages
|
|
53
|
+
|
|
54
|
+
Moved to [Middlewares around the pages](guide/beside-the-pages.md#middlewares-around-the-pages).
|
|
55
|
+
|
|
56
|
+
## Routes beside the pages
|
|
57
|
+
|
|
58
|
+
Moved to [Routes beside the pages](guide/beside-the-pages.md#routes-beside-the-pages).
|
|
59
|
+
|
|
60
|
+
## WebSockets
|
|
61
|
+
|
|
62
|
+
Moved to [WebSockets](guide/beside-the-pages.md#websockets).
|
|
63
|
+
|
|
64
|
+
## The client's files
|
|
65
|
+
|
|
66
|
+
Moved to [The client's files](guide/beside-the-pages.md#the-clients-files).
|
|
67
|
+
|
|
68
|
+
## OpenAPI
|
|
69
|
+
|
|
70
|
+
Moved to [OpenAPI](guide/openapi.md).
|
|
71
|
+
|
|
72
|
+
## Testing
|
|
73
|
+
|
|
74
|
+
Moved to [Testing](guide/testing.md).
|
|
75
|
+
|
|
76
|
+
## Deploying
|
|
77
|
+
|
|
78
|
+
Moved to [Deploying](guide/deploying.md).
|
|
79
|
+
|
|
80
|
+
## Docker
|
|
81
|
+
|
|
82
|
+
Moved to [Docker](guide/deploying.md#docker).
|