smolter
Types

ApplicationOptions

Server/application integration contract.

Compatibility

ReactServer/build API, not a browser import.
React SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.
PreactServer/build API, not a browser import.
Preact SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.

Import from @kasperrt/smolter/react/vite @kasperrt/smolter/preact/vite

Signature

interface ApplicationOptions {
  directory?: string;
  framework?: "react" | "preact";
  dataEndpoint?: string;
  ssr?: boolean;
  splitRoutes?: boolean;
  resourceRequest?: (url: string) => boolean;
}

Contract

This type describes the optional server or Vite integration. See the Express and virtual routes guides for complete usage. It is not a browser runtime dependency.

interface ApplicationOptions {
  directory?: string;
  ssr?: boolean;
  splitRoutes?: boolean;
  resourceRequest?: (url: string) => boolean;
}

Application data endpoint

Data requests use the route pathname plus .__smolter by default, independently of the asset/CDN base. Explicit dataEndpoint retains the legacy ?url= transport and must agree across browser, Vite and production adapters. Reserve the suffix in host routing and apply authentication to document and data requests.

Fields

directory

directory?: string;

framework

framework?: "react" | "preact";

dataEndpoint

dataEndpoint?: string;

ssr

ssr?: boolean;

splitRoutes

splitRoutes?: boolean;

resourceRequest

resourceRequest?: (url: string) => boolean;
View implementation ↗