mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
perf(nuxt): remove state from nuxt island response (#26863)
This commit is contained in:
parent
3a1137e2b8
commit
f0902f9301
@ -77,7 +77,6 @@ export interface NuxtIslandContext {
|
||||
export interface NuxtIslandResponse {
|
||||
id?: string
|
||||
html: string
|
||||
state: Record<string, any>
|
||||
head: {
|
||||
link: (Record<string, string>)[]
|
||||
style: ({ innerHTML: string, key: string })[]
|
||||
@ -496,7 +495,6 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
||||
id: islandContext.id,
|
||||
head: islandHead,
|
||||
html: getServerComponentHTML(htmlContext.body),
|
||||
state: ssrContext.payload.state,
|
||||
components: getClientIslandResponse(ssrContext),
|
||||
slots: getSlotIslandResponse(ssrContext),
|
||||
}
|
||||
|
@ -2029,7 +2029,6 @@ describe('component islands', () => {
|
||||
},
|
||||
"html": "<pre data-island-uid> Route: /foo
|
||||
</pre>",
|
||||
"state": {},
|
||||
}
|
||||
`)
|
||||
})
|
||||
@ -2088,7 +2087,6 @@ describe('component islands', () => {
|
||||
],
|
||||
},
|
||||
},
|
||||
"state": {},
|
||||
}
|
||||
`)
|
||||
})
|
||||
@ -2117,7 +2115,6 @@ describe('component islands', () => {
|
||||
"html": "<div data-island-uid> This is a .server (20ms) async component that was very long ... <div id="async-server-component-count">2</div><div class="sugar-counter"> Sugar Counter 12 x 1 = 12 <button> Inc </button></div><!--[--><div style="display: contents;" data-island-uid data-island-slot="default"><!--teleport start--><!--teleport end--></div><!--]--></div>",
|
||||
"props": {},
|
||||
"slots": {},
|
||||
"state": {},
|
||||
}
|
||||
`)
|
||||
})
|
||||
@ -2144,7 +2141,6 @@ describe('component islands', () => {
|
||||
},
|
||||
"html": "<div data-island-uid> ServerWithClient.server.vue : <p>count: 0</p> This component should not be preloaded <div><!--[--><div>a</div><div>b</div><div>c</div><!--]--></div> This is not interactive <div class="sugar-counter"> Sugar Counter 12 x 1 = 12 <button> Inc </button></div><div class="interactive-component-wrapper" style="border:solid 1px red;"> The component bellow is not a slot but declared as interactive <!--[--><div style="display: contents;" data-island-uid data-island-component="Counter"></div><!--teleport start--><!--teleport end--><!--]--></div></div>",
|
||||
"slots": {},
|
||||
"state": {},
|
||||
}
|
||||
`)
|
||||
expect(teleportsEntries).toHaveLength(1)
|
||||
@ -2224,12 +2220,6 @@ describe('component islands', () => {
|
||||
bool: false
|
||||
}</pre></div>"
|
||||
`)
|
||||
|
||||
expect(result.state).toMatchInlineSnapshot(`
|
||||
{
|
||||
"$shasRouter": true,
|
||||
}
|
||||
`)
|
||||
})
|
||||
|
||||
it('test client-side navigation', async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user