UNPKG

@tanstack/solid-router

Version:

Modern and scalable routing for Solid applications

22 lines 847 B
import { makeSsrSerovalPlugin } from '@tanstack/router-core/ssr/server'; // Adapters are module-level singletons, so their SSR plugins are cached per // adapter rather than rebuilt for every request. const pluginCache = new WeakMap(); function getPlugin(adapter) { let plugin = pluginCache.get(adapter); if (!plugin) { plugin = makeSsrSerovalPlugin(adapter); pluginCache.set(adapter, plugin); } return plugin; } /** Solid renderer options shared by the stream and string paths. */ export function getSolidRenderOptions(router) { return { nonce: router.options.ssr?.nonce, // `plugins` is honoured by Solid's server runtime but absent from its // public option type. plugins: router.options.serializationAdapters?.map(getPlugin), }; } //# sourceMappingURL=renderOptions.js.map