Skip to content

Commit d1997b6

Browse files
fix: fix streaming (#7497)
1 parent 72805df commit d1997b6

37 files changed

Lines changed: 5134 additions & 578 deletions

‎.changeset/fuzzy-jobs-eat.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@tanstack/router-ssr-query-core': patch
3+
'@tanstack/start-server-core': patch
4+
'@tanstack/react-router': patch
5+
'@tanstack/solid-router': patch
6+
'@tanstack/router-core': patch
7+
'@tanstack/vue-router': patch
8+
---
9+
10+
fix streaming

‎e2e/react-start/streaming-ssr/tests/query-heavy.spec.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,23 @@ test.describe('Query heavy route (9 useSuspenseQuery)', () => {
128128
.count()
129129
expect(serverSourceCount).toBe(9)
130130
})
131+
132+
test('emits query stream data before stream end marker', async ({
133+
request,
134+
}) => {
135+
const response = await request.get('/query-heavy')
136+
const html = await response.text()
137+
const endMarker = '$_TSR.e()'
138+
const endIndex = html.indexOf(endMarker)
139+
const slowAsyncPayloadIndex = html.indexOf('"slow-async-3"')
140+
const lastScriptOpen = html.lastIndexOf('<script', endIndex)
141+
const lastScriptClose = html.lastIndexOf('</script>', endIndex)
142+
143+
expect(endIndex).toBeGreaterThan(-1)
144+
expect(lastScriptOpen).toBeGreaterThan(lastScriptClose)
145+
expect(slowAsyncPayloadIndex).toBeGreaterThan(-1)
146+
expect(slowAsyncPayloadIndex).toBeLessThan(endIndex)
147+
expect(html.slice(lastScriptOpen, endIndex)).toContain('.return(void 0)')
148+
expect(endIndex).toBeLessThan(html.indexOf('</body>'))
149+
})
131150
})

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/index-BwsVWHwV.js‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/index-ElfLiipA.css‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/index-rPfEOKs3.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/lazy-page.lazy-BzoMuhUY.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/lazy-with-loader-page.lazy-BzLmn584.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/normal-page-BPOVyYTF.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/page-with-search-BhJv4yJI.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎e2e/vue-router/scroll-restoration-sandbox-vite/dist-hash/assets/scroll-block-BAas_Ct-.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)