API βΊ @builder.io/qwik/server
getQwikLoaderScript
Provides the qwikloader.js
file as a string. Useful for tooling to inline the qwikloader script into HTML.
export declare function getQwikLoaderScript(opts?: {
events?: string[];
debug?: boolean;
}): string;
Parameter | Type | Description |
---|---|---|
opts | { events?: string[]; debug?: boolean; } | (Optional) |
Returns:
string
getQwikPrefetchWorkerScript
Provides the qwik-prefetch-service-worker.js
file as a string. Useful for tooling to inline the qwikloader script into HTML.
export declare function getQwikPrefetchWorkerScript(opts?: {
debug?: boolean;
}): string;
Parameter | Type | Description |
---|---|---|
opts | { debug?: boolean; } | (Optional) |
Returns:
string
InOrderAuto
export interface InOrderAuto
Property | Modifiers | Type | Description |
---|---|---|---|
maximunChunk? | number | (Optional) | |
maximunInitialChunk? | number | (Optional) | |
strategy | 'auto' |
InOrderDisabled
export interface InOrderDisabled
Property | Modifiers | Type | Description |
---|---|---|---|
strategy | 'disabled' |
InOrderStreaming
export type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;
References: InOrderAuto, InOrderDisabled
PrefetchImplementation
export interface PrefetchImplementation
Property | Modifiers | Type | Description |
---|---|---|---|
linkInsert? | 'js-append' | 'html-append' | null | (Optional) js-append: Use JS runtime to create each <link> and append to the body.html-append: Render each <link> within html, appended at the end of the body. | |
linkRel? | 'prefetch' | 'preload' | 'modulepreload' | null | (Optional) Value of the <link rel="..."> attribute when link is used. Defaults to prefetch if links are inserted. | |
prefetchEvent? | 'always' | null | (Optional) Dispatch a qprefetch event with detail data containing the bundles that should be prefetched. The event dispatch script will be inlined into the document's HTML so any listeners of this event should already be ready to handle the event.This implementation will inject a script similar to: |
<script type="module">
document.dispatchEvent(new CustomEvent("qprefetch", { detail:{ "bundles": [...] } }))
</script>
PrefetchResource
export interface PrefetchResource
Property | Modifiers | Type | Description |
---|---|---|---|
imports | PrefetchResource[] | ||
url | string |
PrefetchStrategy
export interface PrefetchStrategy
Property | Modifiers | Type | Description |
---|---|---|---|
implementation? | PrefetchImplementation | (Optional) | |
symbolsToPrefetch? | SymbolsToPrefetch | (Optional) |
QwikLoaderOptions
export interface QwikLoaderOptions
Property | Modifiers | Type | Description |
---|---|---|---|
events? | string[] | (Optional) | |
include? | 'always' | 'never' | 'auto' | (Optional) | |
position? | 'top' | 'bottom' | (Optional) |
Render
export type Render = RenderToString | RenderToStream;
References: RenderToString, RenderToStream
RenderOptions
export interface RenderOptions extends SerializeDocumentOptions
Extends: SerializeDocumentOptions
Property | Modifiers | Type | Description |
---|---|---|---|
base? | string | ((options: RenderOptions) => string) | (Optional) Specifies the root of the JS files of the client build. Setting a base, will cause the render of the q:base attribute in the q:container element. | |
containerAttributes? | Record<string, string> | (Optional) | |
containerTagName? | string | (Optional) When set, the app is serialized into a fragment. And the returned html is not a complete document. Defaults to html | |
locale? | string | ((options: RenderOptions) => string) | (Optional) Language to use when rendering the document. | |
prefetchStrategy? | PrefetchStrategy | null | (Optional) | |
qwikLoader? | QwikLoaderOptions | (Optional) Specifies if the Qwik Loader script is added to the document or not.Defaults to { include: true }. | |
qwikPrefetchServiceWorker? | QwikPrefetchServiceWorkerOptions | (Optional) Specifies if the Qwik Prefetch Service Worker script is added to the document or not.Defaults to { include: false }. NOTE: This may be change in the future. | |
serverData? | Record<string, any> | (Optional) | |
snapshot? | boolean | (Optional) Defaults to true |
RenderResult
export interface RenderResult
Property | Modifiers | Type | Description |
---|---|---|---|
isStatic | boolean | ||
manifest? | QwikManifest | (Optional) | |
prefetchResources | PrefetchResource[] | ||
snapshotResult | SnapshotResult | undefined |
renderToStream
export type RenderToStream = (
opts: RenderToStreamOptions,
) => Promise<RenderToStreamResult>;
References: RenderToStreamOptions, RenderToStreamResult
RenderToStream
export type RenderToStream = (
opts: RenderToStreamOptions,
) => Promise<RenderToStreamResult>;
References: RenderToStreamOptions, RenderToStreamResult
RenderToStreamOptions
export interface RenderToStreamOptions extends RenderOptions
Extends: RenderOptions
Property | Modifiers | Type | Description |
---|---|---|---|
stream | StreamWriter | ||
streaming? | StreamingOptions | (Optional) |
RenderToStreamResult
export interface RenderToStreamResult extends RenderResult
Extends: RenderResult
Property | Modifiers | Type | Description |
---|---|---|---|
flushes | number | ||
size | number | ||
timing | { firstFlush: number; render: number; snapshot: number; } |
renderToString
export type RenderToString = (
opts: RenderToStringOptions,
) => Promise<RenderToStringResult>;
References: RenderToStringOptions, RenderToStringResult
RenderToString
export type RenderToString = (
opts: RenderToStringOptions,
) => Promise<RenderToStringResult>;
References: RenderToStringOptions, RenderToStringResult
RenderToStringOptions
export interface RenderToStringOptions extends RenderOptions
Extends: RenderOptions
RenderToStringResult
export interface RenderToStringResult extends RenderResult
Extends: RenderResult
resolveManifest
export declare function resolveManifest(
manifest: QwikManifest | ResolvedManifest | undefined,
): ResolvedManifest | undefined;
Parameter | Type | Description |
---|---|---|
manifest | QwikManifest | ResolvedManifest | undefined |
Returns:
ResolvedManifest | undefined
SerializeDocumentOptions
export interface SerializeDocumentOptions
Property | Modifiers | Type | Description |
---|---|---|---|
debug? | boolean | (Optional) | |
manifest? | QwikManifest | ResolvedManifest | (Optional) | |
symbolMapper? | SymbolMapperFn | (Optional) |
setServerPlatform
export declare function setServerPlatform(
manifest: QwikManifest | ResolvedManifest | undefined,
): Promise<void>;
Parameter | Type | Description |
---|---|---|
manifest | QwikManifest | ResolvedManifest | undefined |
Returns:
Promise<void>
StreamingOptions
export interface StreamingOptions
Property | Modifiers | Type | Description |
---|---|---|---|
inOrder? | InOrderStreaming | (Optional) |
SymbolsToPrefetch
Auto: Prefetch all possible QRLs used by the document. Default
export type SymbolsToPrefetch =
| "auto"
| ((opts: { manifest: QwikManifest }) => PrefetchResource[]);
References: PrefetchResource
versions
versions: {
readonly qwik: string;
readonly qwikDom: string;
}