Skip to content

Commit 76640fa

Browse files
textDecoder instance per stream
1 parent 0d738d8 commit 76640fa

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎packages/router-core/src/ssr/transformStreamWithRouter.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ export function transformPipeableStreamWithRouter(
2222
export const TSR_SCRIPT_BARRIER_ID = '$tsr-stream-barrier'
2323

2424
// regex pattern for matching closing body and html tags
25-
const patternBodyStart = /(<body)/
2625
const patternBodyEnd = /(<\/body>)/
2726
const patternHtmlEnd = /(<\/html>)/
2827
// regex pattern for matching closing tags
2928
const patternClosingTag = /(<\/[a-zA-Z][\w:.-]*?>)/g
3029

31-
const textDecoder = new TextDecoder()
32-
3330
type ReadablePassthrough = {
3431
stream: ReadableStream
3532
write: (chunk: unknown) => void
@@ -100,6 +97,7 @@ export function transformStreamWithRouter(
10097
},
10198
) {
10299
const finalPassThrough = createPassthrough()
100+
const textDecoder = new TextDecoder()
103101

104102
let isAppRendering = true as boolean
105103
let routerStreamBuffer = ''

0 commit comments

Comments
 (0)