File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/solid-router/src/ssr Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import * as Solid from 'solid-js/web'
22import { isbot } from 'isbot'
33import { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'
4+ import { makeSsrSerovalPlugin } from '@tanstack/router-core'
45import type { JSXElement } from 'solid-js'
56import type { ReadableStream } from 'node:stream/web'
67import type { AnyRouter } from '@tanstack/router-core'
@@ -20,6 +21,12 @@ export const renderRouterToStream = async ({
2021
2122 const docType = Solid . ssr ( '<!DOCTYPE html>' )
2223
24+ const serializationAdapters = ( router . options as any ) ?. serializationAdapters || ( router . options . ssr as any ) ?. serializationAdapters
25+ const serovalPlugins = serializationAdapters ?. map ( ( adapter : any ) => {
26+ const plugin = makeSsrSerovalPlugin ( adapter , { didRun : false } )
27+ return plugin
28+ } )
29+
2330 const stream = Solid . renderToStream (
2431 ( ) => (
2532 < >
@@ -29,7 +36,8 @@ export const renderRouterToStream = async ({
2936 ) ,
3037 {
3138 nonce : router . options . ssr ?. nonce ,
32- } ,
39+ plugins : serovalPlugins ,
40+ } as any ,
3341 )
3442
3543 if ( isbot ( request . headers . get ( 'User-Agent' ) ) ) {
You can’t perform that action at this time.
0 commit comments