Skip to content

Commit a90d464

Browse files
huseeiinbirkskyum
andauthored
perf(solid-start): use srvx FastResponse (#6615)
* perf(solid-start): 51% improvement * patch response * install srvx * import order --------- Co-authored-by: Birk Skyum <birk.skyum@pm.me>
1 parent 88161bd commit a90d464

3 files changed

Lines changed: 22 additions & 15 deletions

File tree

packages/solid-router/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"@tanstack/router-core": "workspace:*",
109109
"@tanstack/solid-store": "^0.8.0",
110110
"isbot": "^5.1.22",
111+
"srvx": "^0.11.2",
111112
"tiny-invariant": "^1.3.3",
112113
"tiny-warning": "^1.0.3"
113114
},

packages/solid-router/src/ssr/renderRouterToStream.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import * as Solid from 'solid-js/web'
22
import { isbot } from 'isbot'
33
import { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'
44
import { makeSsrSerovalPlugin } from '@tanstack/router-core'
5+
import { FastResponse } from 'srvx'
56
import type { JSXElement } from 'solid-js'
67
import type { ReadableStream } from 'node:stream/web'
78
import type { AnyRouter } from '@tanstack/router-core'
89

10+
globalThis.Response = FastResponse
11+
912
export const renderRouterToStream = async ({
1013
request,
1114
router,

pnpm-lock.yaml

Lines changed: 18 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)