@lastshotlabs/slingshot-ssr
npm install @lastshotlabs/slingshot-ssr
Functions
Section titled “Functions”buildAfterFn
Section titled “buildAfterFn”Returns the AsyncLocalStorage constructor, or null on edge runtimes.
Resolution order: globalThis polyfill → node:async_hooks → null.
function buildAfterFn(): (callback: () => void | Promise<void>) => voidSource: packages/slingshot-ssr/src/after/index.ts
buildPageChain
Section titled “buildPageChain”Compile manifest page declarations into a route table.
The returned table is sorted by specificity so static routes win over dynamic ones, mirroring the file-system SSR resolver.
function buildPageChain(declaration: ResolvedPageDeclaration, params: Record<string, string>, url: URL, query: Record<string, string>,): SsrRouteChainSource: packages/slingshot-ssr/src/pageResolver.ts
buildPageRouteTable
Section titled “buildPageRouteTable”Compile manifest page declarations into a route table.
The returned table is sorted by specificity so static routes win over dynamic ones, mirroring the file-system SSR resolver.
function buildPageRouteTable(pages: Readonly<Record<string, PageDeclaration>>, entityConfigs: ReadonlyMap<string, ResolvedEntityConfig>,): readonly ResolvedPageDeclaration[]Source: packages/slingshot-ssr/src/pageResolver.ts
clearRouteModuleCache
Section titled “clearRouteModuleCache”The shape of a route module produced by defineRoute() and exported via
the named-export pattern shown in the defineRoute JSDoc.
function clearRouteModuleCache(): voidSource: packages/slingshot-ssr/src/routeExecution.ts
createCircuitBreaker
Section titled “createCircuitBreaker”Circuit breaker for external rendering dependencies in slingshot-ssr.
The circuit breaker protects the SSR render pipeline from cascading failures when external rendering dependencies (e.g. the renderer’s own page rendering, external API calls from loaders) become degraded or unavailable.
States
Section titled “States”- CLOSED (normal): requests pass through. Failures are counted.
- OPEN (degraded): requests are rejected immediately without calling the protected function. A cooldown timer starts.
- HALF_OPEN (probing): after the cooldown, one probe request is allowed. If it succeeds, the circuit closes. If it fails, the circuit re-opens.
This module provides both a generic CircuitBreaker interface and a
concrete createCircuitBreaker() factory with sensible defaults for SSR.
function createCircuitBreaker(options: Partial<CircuitBreakerOptions> = {}): CircuitBreakerSource: packages/slingshot-ssr/src/circuitBreaker.ts
createFileBasedRouteSource
Section titled “createFileBasedRouteSource”Configuration for createFileBasedRouteSource.
function createFileBasedRouteSource(config: FileBasedRouteSourceConfig): SsrRouteSourceSource: packages/slingshot-ssr/src/routeSource/fileBased.ts
createSsrPackage
Section titled “createSsrPackage”Create the Slingshot SSR package.
Registers SSR middleware, server action routes, metadata routes, and
optional entity-driven page support when config.pages is supplied.
The package itself owns no entities — page routes are driven imperatively
from setupMiddleware/setupRoutes/setupPost lifecycle hooks, so the
definePackage input has empty entities: [].
function createSsrPackage(rawConfig: SsrPluginConfig): SlingshotPackageDefinitionSource: packages/slingshot-ssr/src/plugin.ts
DEFAULT_MAX_ROUTE_PARAM_BYTES
Section titled “DEFAULT_MAX_ROUTE_PARAM_BYTES”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
Source: packages/slingshot-ssr/src/resolver.ts
DRAFT_MODE_COOKIE
Section titled “DRAFT_MODE_COOKIE”Returns the AsyncLocalStorage constructor, or null when running in an
edge runtime that does not provide node:async_hooks.
Resolution order:
globalThis.AsyncLocalStorage— edge adapters may polyfill this.require('node:async_hooks').AsyncLocalStorage— Node / Bun.null— edge runtime with no polyfill; draft mode degrades gracefully.
Source: packages/slingshot-ssr/src/draft/index.ts
draftMode
Section titled “draftMode”Returns the AsyncLocalStorage constructor, or null when running in an
edge runtime that does not provide node:async_hooks.
Resolution order:
globalThis.AsyncLocalStorage— edge adapters may polyfill this.require('node:async_hooks').AsyncLocalStorage— Node / Bun.null— edge runtime with no polyfill; draft mode degrades gracefully.
function draftMode(): voidSource: packages/slingshot-ssr/src/draft/index.ts
drainAfterCallbacks
Section titled “drainAfterCallbacks”Returns the AsyncLocalStorage constructor, or null on edge runtimes.
Resolution order: globalThis polyfill → node:async_hooks → null.
async function drainAfterCallbacks(): Promise<void>Source: packages/slingshot-ssr/src/after/index.ts
generatePageStaticParams
Section titled “generatePageStaticParams”Generate static param sets for entity-driven page declarations.
Static list, create-form, and dashboard pages emit a single empty param set when their path contains no dynamic segments. Detail and edit-form pages enumerate entity records and map route param names to record field names.
async function generatePageStaticParams(declaration: ResolvedPageDeclaration, adapters: Readonly<Record<string, PageEntityAdapter>>,): Promise<StaticParamSet[]>Source: packages/slingshot-ssr/src/static-params/pageStaticParams.ts
initRouteTree
Section titled “initRouteTree”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
function initRouteTree(serverRoutesDir: string): voidSource: packages/slingshot-ssr/src/resolver.ts
invalidateRouteTree
Section titled “invalidateRouteTree”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
function invalidateRouteTree(serverRoutesDir: string): voidSource: packages/slingshot-ssr/src/resolver.ts
isDraftRequest
Section titled “isDraftRequest”Returns the AsyncLocalStorage constructor, or null when running in an
edge runtime that does not provide node:async_hooks.
Resolution order:
globalThis.AsyncLocalStorage— edge adapters may polyfill this.require('node:async_hooks').AsyncLocalStorage— Node / Bun.null— edge runtime with no polyfill; draft mode degrades gracefully.
function isDraftRequest(c: HonoContext): booleanSource: packages/slingshot-ssr/src/draft/index.ts
isForbidden
Section titled “isForbidden”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
function isForbidden(result: SsrLoaderReturn): result is SsrForbiddenResultSource: packages/slingshot-ssr/src/types.ts
isLoadResult
Section titled “isLoadResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
function isLoadResult(result: SsrLoaderReturn): result is SsrLoadResultSource: packages/slingshot-ssr/src/types.ts
isNotFound
Section titled “isNotFound”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
function isNotFound(result: SsrLoaderReturn): result is SsrNotFoundResultSource: packages/slingshot-ssr/src/types.ts
isRedirect
Section titled “isRedirect”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
function isRedirect(result: SsrLoaderReturn): result is SsrRedirectResultSource: packages/slingshot-ssr/src/types.ts
isRouteParamTooLargeError
Section titled “isRouteParamTooLargeError”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
function isRouteParamTooLargeError(err: unknown): err is RouteParamTooLargeErrorSource: packages/slingshot-ssr/src/resolver.ts
isUnauthorized
Section titled “isUnauthorized”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
function isUnauthorized(result: SsrLoaderReturn): result is SsrUnauthorizedResultSource: packages/slingshot-ssr/src/types.ts
prerenderPprShells
Section titled “prerenderPprShells”Structural equivalent of PprShell from @lastshotlabs/snapshot/ssr.
async function prerenderPprShells(routes: readonly PprRouteDescriptor[], cache: PprCacheShape, extractShell: (element: ReactElement) => Promise<PprShellShape>,): Promise<void>Source: packages/slingshot-ssr/src/ppr/index.ts
registerMetadataRoutes
Section titled “registerMetadataRoutes”Context passed to metadata convention functions (sitemap, robots,
manifest).
bsCtx is the slingshot instance context — pass it to
requireEntityAdapter(...) from @lastshotlabs/slingshot-core to read
data when generating a dynamic sitemap or per-environment robots/manifest.
Convention functions may ignore the argument entirely (the no-arg signature is still supported and back-compat).
function registerMetadataRoutes(app: unknown, serverRoutesDir: string): voidSource: packages/slingshot-ssr/src/metadata/index.ts
registerMetadataRoutesFromDir
Section titled “registerMetadataRoutesFromDir”Context passed to metadata convention functions (sitemap, robots,
manifest).
bsCtx is the slingshot instance context — pass it to
requireEntityAdapter(...) from @lastshotlabs/slingshot-core to read
data when generating a dynamic sitemap or per-environment robots/manifest.
Convention functions may ignore the argument entirely (the no-arg signature is still supported and back-compat).
function registerMetadataRoutesFromDir(app: unknown, metadataDir: string): voidSource: packages/slingshot-ssr/src/metadata/index.ts
resolveGlobalMiddlewarePath
Section titled “resolveGlobalMiddlewarePath”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
function resolveGlobalMiddlewarePath(serverRoutesDir: string): string | nullSource: packages/slingshot-ssr/src/resolver.ts
resolvePageDeclaration
Section titled “resolvePageDeclaration”Compile manifest page declarations into a route table.
The returned table is sorted by specificity so static routes win over dynamic ones, mirroring the file-system SSR resolver.
function resolvePageDeclaration(pathname: string, routeTable: readonly ResolvedPageDeclaration[],): voidSource: packages/slingshot-ssr/src/pageResolver.ts
resolvePageLoader
Section titled “resolvePageLoader”P-SSR-3: Validate at plugin setup time that every entity referenced by a page declaration has a registered adapter. Without this, missing adapters surface only when the page is requested, returning a 500. Catching at setup fails the plugin init with a descriptive message that includes the offending page route.
async function resolvePageLoader(declaration: ResolvedPageDeclaration, params: Readonly<Record<string, string>>, query: Readonly<Record<string, string>>, adapters: Readonly<Record<string, PageEntityAdapter>>, entityConfigs: ReadonlyMap<string, ResolvedEntityConfig>, navigation?: NavigationConfig,): Promise<PageLoaderResult>Source: packages/slingshot-ssr/src/pageLoaders.ts
resolveRouteChain
Section titled “resolveRouteChain”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
function resolveRouteChain(pathname: string, serverRoutesDir: string, fromPath?: string, options: ResolveRouteOptions = {},): SsrRouteChain | nullSource: packages/slingshot-ssr/src/resolver.ts
Retry logic for page load failures in slingshot-ssr.
Provides a generic retry() function with exponential backoff and jitter.
Used by the SSR middleware to retry renderer calls when they fail with
retryable errors (network timeouts, 5xx responses from upstream APIs).
Non-retryable errors (e.g. validation errors, authentication failures) are re-thrown immediately without retrying.
async function retry<T>(fn: () => Promise<T>, options: Partial<RetryOptions> = {},): Promise<T>Source: packages/slingshot-ssr/src/retry.ts
validatePageAdapters
Section titled “validatePageAdapters”P-SSR-3: Validate at plugin setup time that every entity referenced by a page declaration has a registered adapter. Without this, missing adapters surface only when the page is requested, returning a 500. Catching at setup fails the plugin init with a descriptive message that includes the offending page route.
function validatePageAdapters(pages: Readonly<Record<string, PageDeclaration>>, adapters: Readonly<Record<string, PageEntityAdapter | undefined>>,): voidSource: packages/slingshot-ssr/src/pageLoaders.ts
withAfterContext
Section titled “withAfterContext”Returns the AsyncLocalStorage constructor, or null on edge runtimes.
Resolution order: globalThis polyfill → node:async_hooks → null.
function withAfterContext<T>(fn: () => Promise<T>): Promise<T>Source: packages/slingshot-ssr/src/after/index.ts
withDraftContext
Section titled “withDraftContext”Returns the AsyncLocalStorage constructor, or null when running in an
edge runtime that does not provide node:async_hooks.
Resolution order:
globalThis.AsyncLocalStorage— edge adapters may polyfill this.require('node:async_hooks').AsyncLocalStorage— Node / Bun.null— edge runtime with no polyfill; draft mode degrades gracefully.
function withDraftContext<T>(c: HonoContext, fn: () => T | Promise<T>): Promise<T>Source: packages/slingshot-ssr/src/draft/index.ts
Constants
Section titled “Constants”IsrInvalidatorsCap
Section titled “IsrInvalidatorsCap”Public contract for slingshot-ssr.
Cross-package consumers (server actions, route handlers, peer plugins) resolve
IsrInvalidatorsCap through ctx.capabilities.require(...) to invalidate paths
and tags on the active ISR cache adapter.
Source: packages/slingshot-ssr/src/public.ts
Public contract for slingshot-ssr.
Cross-package consumers (server actions, route handlers, peer plugins) resolve
IsrInvalidatorsCap through ctx.capabilities.require(...) to invalidate paths
and tags on the active ISR cache adapter.
Source: packages/slingshot-ssr/src/public.ts
Classes
Section titled “Classes”PageNotFoundError
Section titled “PageNotFoundError”P-SSR-3: Validate at plugin setup time that every entity referenced by a page declaration has a registered adapter. Without this, missing adapters surface only when the page is requested, returning a 500. Catching at setup fails the plugin init with a descriptive message that includes the offending page route.
Source: packages/slingshot-ssr/src/pageLoaders.ts
RouteParamTooLargeError
Section titled “RouteParamTooLargeError”Default maximum byte length of a single decoded route param.
Per spec — pluggable through SsrPluginConfig.maxRouteParamBytes. Requests
whose decoded params exceed this cap are rejected with HTTP 414.
Source: packages/slingshot-ssr/src/resolver.ts
SsrAssetManifestError
Section titled “SsrAssetManifestError”Subset of Vite’s manifest.json structure. Full spec: https://vitejs.dev/guide/backend-integration
Source: packages/slingshot-ssr/src/assets.ts
Interfaces
Section titled “Interfaces”CircuitBreaker
Section titled “CircuitBreaker”Circuit breaker for external rendering dependencies in slingshot-ssr.
The circuit breaker protects the SSR render pipeline from cascading failures when external rendering dependencies (e.g. the renderer’s own page rendering, external API calls from loaders) become degraded or unavailable.
States
Section titled “States”- CLOSED (normal): requests pass through. Failures are counted.
- OPEN (degraded): requests are rejected immediately without calling the protected function. A cooldown timer starts.
- HALF_OPEN (probing): after the cooldown, one probe request is allowed. If it succeeds, the circuit closes. If it fails, the circuit re-opens.
This module provides both a generic CircuitBreaker interface and a
concrete createCircuitBreaker() factory with sensible defaults for SSR.
Source: packages/slingshot-ssr/src/circuitBreaker.ts
CircuitBreakerOptions
Section titled “CircuitBreakerOptions”Circuit breaker for external rendering dependencies in slingshot-ssr.
The circuit breaker protects the SSR render pipeline from cascading failures when external rendering dependencies (e.g. the renderer’s own page rendering, external API calls from loaders) become degraded or unavailable.
States
Section titled “States”- CLOSED (normal): requests pass through. Failures are counted.
- OPEN (degraded): requests are rejected immediately without calling the protected function. A cooldown timer starts.
- HALF_OPEN (probing): after the cooldown, one probe request is allowed. If it succeeds, the circuit closes. If it fails, the circuit re-opens.
This module provides both a generic CircuitBreaker interface and a
concrete createCircuitBreaker() factory with sensible defaults for SSR.
Source: packages/slingshot-ssr/src/circuitBreaker.ts
CustomPageDeclaration
Section titled “CustomPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
DefineRouteOptions
Section titled “DefineRouteOptions”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
DraftModeStatus
Section titled “DraftModeStatus”Returns the AsyncLocalStorage constructor, or null when running in an
edge runtime that does not provide node:async_hooks.
Resolution order:
globalThis.AsyncLocalStorage— edge adapters may polyfill this.require('node:async_hooks').AsyncLocalStorage— Node / Bun.null— edge runtime with no polyfill; draft mode degrades gracefully.
Source: packages/slingshot-ssr/src/draft/index.ts
EntityDashboardPageDeclaration
Section titled “EntityDashboardPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
EntityDetailPageDeclaration
Section titled “EntityDetailPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
EntityFieldMeta
Section titled “EntityFieldMeta”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
EntityFormPageDeclaration
Section titled “EntityFormPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
EntityListPageDeclaration
Section titled “EntityListPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
EntityMeta
Section titled “EntityMeta”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
FileBasedRouteSourceConfig
Section titled “FileBasedRouteSourceConfig”Configuration for createFileBasedRouteSource.
Source: packages/slingshot-ssr/src/routeSource/fileBased.ts
IsrCacheAdapter
Section titled “IsrCacheAdapter”A single cached ISR page entry.
Stores the rendered HTML, response headers, and timing metadata needed to implement stale-while-revalidate logic. Both memory and Redis adapters use this shape — Redis serializes it as JSON.
Source: packages/slingshot-ssr/src/isr/types.ts
IsrCacheEntry
Section titled “IsrCacheEntry”A single cached ISR page entry.
Stores the rendered HTML, response headers, and timing metadata needed to implement stale-while-revalidate logic. Both memory and Redis adapters use this shape — Redis serializes it as JSON.
Source: packages/slingshot-ssr/src/isr/types.ts
IsrConfig
Section titled “IsrConfig”A single cached ISR page entry.
Stores the rendered HTML, response headers, and timing metadata needed to implement stale-while-revalidate logic. Both memory and Redis adapters use this shape — Redis serializes it as JSON.
Source: packages/slingshot-ssr/src/isr/types.ts
IsrSink
Section titled “IsrSink”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
NavigationBadgeConfig
Section titled “NavigationBadgeConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
NavigationConfig
Section titled “NavigationConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
NavigationItem
Section titled “NavigationItem”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageChartConfig
Section titled “PageChartConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageDeclarationBase
Section titled “PageDeclarationBase”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageDetailSection
Section titled “PageDetailSection”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageFieldOverride
Section titled “PageFieldOverride”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageFilterConfig
Section titled “PageFilterConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageLoaderResult
Section titled “PageLoaderResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
PagePermissionConfig
Section titled “PagePermissionConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageRelatedSection
Section titled “PageRelatedSection”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageStatConfig
Section titled “PageStatConfig”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageTitleField
Section titled “PageTitleField”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageTitleTemplate
Section titled “PageTitleTemplate”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PprCacheShape
Section titled “PprCacheShape”Structural equivalent of PprShell from @lastshotlabs/snapshot/ssr.
Source: packages/slingshot-ssr/src/ppr/index.ts
PprRouteDescriptor
Section titled “PprRouteDescriptor”Structural equivalent of PprShell from @lastshotlabs/snapshot/ssr.
Source: packages/slingshot-ssr/src/ppr/index.ts
ResolvedPageDeclaration
Section titled “ResolvedPageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
ResolveRouteChainOptions
Section titled “ResolveRouteChainOptions”Per-call options for SsrRouteSource.resolve.
Source: packages/slingshot-ssr/src/routeSource/types.ts
ResolveRouteOptions
Section titled “ResolveRouteOptions”Per-call options for SsrRouteSource.resolve.
Source: packages/slingshot-ssr/src/routeSource/types.ts
RetryOptions
Section titled “RetryOptions”Retry logic for page load failures in slingshot-ssr.
Provides a generic retry() function with exponential backoff and jitter.
Used by the SSR middleware to retry renderer calls when they fail with
retryable errors (network timeouts, 5xx responses from upstream APIs).
Non-retryable errors (e.g. validation errors, authentication failures) are re-thrown immediately without retrying.
Source: packages/slingshot-ssr/src/retry.ts
RobotsConfig
Section titled “RobotsConfig”Context passed to metadata convention functions (sitemap, robots,
manifest).
bsCtx is the slingshot instance context — pass it to
requireEntityAdapter(...) from @lastshotlabs/slingshot-core to read
data when generating a dynamic sitemap or per-environment robots/manifest.
Convention functions may ignore the argument entirely (the no-arg signature is still supported and back-compat).
Source: packages/slingshot-ssr/src/metadata/index.ts
RouteExecution
Section titled “RouteExecution”The shape of a route module produced by defineRoute() and exported via
the named-export pattern shown in the defineRoute JSDoc.
Source: packages/slingshot-ssr/src/routeExecution.ts
SerializableHandlerRef
Section titled “SerializableHandlerRef”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
SitemapEntry
Section titled “SitemapEntry”Context passed to metadata convention functions (sitemap, robots,
manifest).
bsCtx is the slingshot instance context — pass it to
requireEntityAdapter(...) from @lastshotlabs/slingshot-core to read
data when generating a dynamic sitemap or per-environment robots/manifest.
Convention functions may ignore the argument entirely (the no-arg signature is still supported and back-compat).
Source: packages/slingshot-ssr/src/metadata/index.ts
SlingshotSsrRenderer
Section titled “SlingshotSsrRenderer”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrCacheControl
Section titled “SsrCacheControl”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrForbiddenResult
Section titled “SsrForbiddenResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrLoadContext
Section titled “SsrLoadContext”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrLoadResult
Section titled “SsrLoadResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrMeta
Section titled “SsrMeta”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrNotFoundResult
Section titled “SsrNotFoundResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrPluginConfig
Section titled “SsrPluginConfig”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrQueryCacheEntry
Section titled “SsrQueryCacheEntry”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrRedirectResult
Section titled “SsrRedirectResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrRouteChain
Section titled “SsrRouteChain”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrRouteMatch
Section titled “SsrRouteMatch”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrRouteSource
Section titled “SsrRouteSource”Per-call options for SsrRouteSource.resolve.
Source: packages/slingshot-ssr/src/routeSource/types.ts
SsrShell
Section titled “SsrShell”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrUnauthorizedResult
Section titled “SsrUnauthorizedResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
StaticRoute
Section titled “StaticRoute”A single route that exports generateStaticParams, plus the pre-computed
param sets returned by calling it at build time.
routePath uses the file-system-derived URL pattern (e.g. /players/[id]).
paramSets is the array returned by the route’s generateStaticParams export.
Source: packages/slingshot-ssr/src/static-params/index.ts
CircuitResult
Section titled “CircuitResult”Circuit breaker for external rendering dependencies in slingshot-ssr.
The circuit breaker protects the SSR render pipeline from cascading failures when external rendering dependencies (e.g. the renderer’s own page rendering, external API calls from loaders) become degraded or unavailable.
States
Section titled “States”- CLOSED (normal): requests pass through. Failures are counted.
- OPEN (degraded): requests are rejected immediately without calling the protected function. A cooldown timer starts.
- HALF_OPEN (probing): after the cooldown, one probe request is allowed. If it succeeds, the circuit closes. If it fails, the circuit re-opens.
This module provides both a generic CircuitBreaker interface and a
concrete createCircuitBreaker() factory with sensible defaults for SSR.
Source: packages/slingshot-ssr/src/circuitBreaker.ts
CircuitState
Section titled “CircuitState”Circuit breaker for external rendering dependencies in slingshot-ssr.
The circuit breaker protects the SSR render pipeline from cascading failures when external rendering dependencies (e.g. the renderer’s own page rendering, external API calls from loaders) become degraded or unavailable.
States
Section titled “States”- CLOSED (normal): requests pass through. Failures are counted.
- OPEN (degraded): requests are rejected immediately without calling the protected function. A cooldown timer starts.
- HALF_OPEN (probing): after the cooldown, one probe request is allowed. If it succeeds, the circuit closes. If it fails, the circuit re-opens.
This module provides both a generic CircuitBreaker interface and a
concrete createCircuitBreaker() factory with sensible defaults for SSR.
Source: packages/slingshot-ssr/src/circuitBreaker.ts
GenerateStaticParams
Section titled “GenerateStaticParams”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
PageData
Section titled “PageData”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
PageDeclaration
Section titled “PageDeclaration”Serializable handler reference used in manifest-backed page declarations.
This mirrors the root manifest handler-ref shape without introducing a runtime
dependency from slingshot-ssr back to the root package.
Source: packages/slingshot-ssr/src/pageDeclarations.ts
SsgStaticPathsFn
Section titled “SsgStaticPathsFn”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrLoaderReturn
Section titled “SsrLoaderReturn”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
SsrMiddlewareResult
Section titled “SsrMiddlewareResult”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
Exports
Section titled “Exports”defineRoute
Section titled “defineRoute”A TanStack Query cache entry to pre-seed during SSR.
The queryKey array must match exactly the key used by the corresponding
client-side useQuery() hook. On hydration, the client reads this entry
from the dehydrated state and skips the network request.
Source: packages/slingshot-ssr/src/types.ts
executeRouteModule
Section titled “executeRouteModule”The shape of a route module produced by defineRoute() and exported via
the named-export pattern shown in the defineRoute JSDoc.
Source: packages/slingshot-ssr/src/routeExecution.ts
loadRouteModule
Section titled “loadRouteModule”The shape of a route module produced by defineRoute() and exported via
the named-export pattern shown in the defineRoute JSDoc.
Source: packages/slingshot-ssr/src/routeExecution.ts