File tree Expand file tree Collapse file tree 6 files changed +16
-14
lines changed
e2e/solid-start/serialization-adapters/src/routes
packages/solid-router/src/ssr Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ import {
88 useRouterState ,
99} from '@tanstack/solid-router'
1010import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
11- import { HydrationScript } from 'solid-js/web' ;
12- import type { JSX } from 'solid-js' ;
11+ import { HydrationScript } from 'solid-js/web'
12+ import type { JSX } from 'solid-js'
1313import appCss from '~/styles/app.css?url'
1414
1515export const Route = createRootRoute ( {
1616 head : ( ) => ( {
1717 meta : [
18- {
18+ {
1919 charset : 'utf-8' ,
2020 } ,
2121 {
Original file line number Diff line number Diff line change 11import { Link , createFileRoute } from '@tanstack/solid-router'
22
33export const Route = createFileRoute ( '/' ) ( {
4- component : Home ,
5- errorComponent : ( e ) => < div > { e . error . message } </ div > ,
4+ component : Home ,
5+ errorComponent : ( e ) => < div > { e . error . message } </ div > ,
66} )
77
88function Home ( ) {
Original file line number Diff line number Diff line change @@ -22,9 +22,8 @@ export const Route = createFileRoute('/server-function/custom-error')({
2222
2323function RouteComponent ( ) {
2424 const [ validResponse , setValidResponse ] = createSignal < any > ( null )
25- const [ invalidResponse , setInvalidResponse ] = createSignal < CustomError | null > (
26- null ,
27- )
25+ const [ invalidResponse , setInvalidResponse ] =
26+ createSignal < CustomError | null > ( null )
2827
2928 return (
3029 < div >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const Route = createFileRoute('/ssr/stream')({
1313 }
1414 } ,
1515
16- errorComponent : ( e ) => < div > { e . error . message } </ div > ,
16+ errorComponent : ( e ) => < div > { e . error . message } </ div > ,
1717 component : RouteComponent ,
1818} )
1919
Original file line number Diff line number Diff line change @@ -21,12 +21,14 @@ export const renderRouterToStream = async ({
2121
2222 const docType = Solid . ssr ( '<!DOCTYPE html>' )
2323
24- const serializationAdapters = ( router . options as any ) ?. serializationAdapters || ( router . options . ssr as any ) ?. serializationAdapters
24+ const serializationAdapters =
25+ ( router . options as any ) ?. serializationAdapters ||
26+ ( router . options . ssr as any ) ?. serializationAdapters
2527 const serovalPlugins = serializationAdapters ?. map ( ( adapter : any ) => {
2628 const plugin = makeSsrSerovalPlugin ( adapter , { didRun : false } )
2729 return plugin
2830 } )
29-
31+
3032 const stream = Solid . renderToStream (
3133 ( ) => (
3234 < >
Original file line number Diff line number Diff line change 11import * as Solid from 'solid-js/web'
22import { makeSsrSerovalPlugin } from '@tanstack/router-core'
3- import type { AnyRouter } from '@tanstack/router-core' ;
3+ import type { AnyRouter } from '@tanstack/router-core'
44import type { JSXElement } from 'solid-js'
55
66export const renderRouterToString = async ( {
@@ -13,8 +13,9 @@ export const renderRouterToString = async ({
1313 children : ( ) => JSXElement
1414} ) => {
1515 try {
16-
17- const serializationAdapters = ( router . options as any ) ?. serializationAdapters || ( router . options . ssr as any ) ?. serializationAdapters
16+ const serializationAdapters =
17+ ( router . options as any ) ?. serializationAdapters ||
18+ ( router . options . ssr as any ) ?. serializationAdapters
1819 const serovalPlugins = serializationAdapters ?. map ( ( adapter : any ) => {
1920 const plugin = makeSsrSerovalPlugin ( adapter , { didRun : false } )
2021 return plugin
You can’t perform that action at this time.
0 commit comments