fix(ssr): resolve nested async teleport content#9431
Conversation
Size ReportBundles
Usages
|
|
this would also resolve nuxt/nuxt#35427 @edison1105 I came up with a couple of extra tests if that would be helpful in getting this merged 🙏 |
|
@danielroe will be merged soon. |
📝 WalkthroughWalkthroughSSR teleport handling now marks async teleport buffers and resolves them directly. A new SSR test covers Teleport with Suspense around an async component and checks the rendered teleport output. ChangesSSR teleport with Suspense
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/server-renderer/__tests__/ssrTeleport.spec.ts`:
- Around line 220-222: The teleport target assertion in ssrTeleport.spec.ts is
missing the leading `<!--teleport start anchor-->` marker. Update the expected
value in the `ssrRenderTeleport` test to match the enabled teleport wrapping
produced by `ssrRenderTeleport`, using the existing `ctx.teleports['`#target`']`
assertion as the location to fix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0f30626d-5800-4951-aba6-fe6a84a3205f
📒 Files selected for processing (2)
packages/server-renderer/__tests__/ssrTeleport.spec.tspackages/server-renderer/src/renderToString.ts
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [vue](https://vuejs.org/) ([source](https://github.com/vuejs/core)) | [`3.5.38` → `3.5.39`](https://renovatebot.com/diffs/npm/vue/3.5.38/3.5.39) |  |  | --- ### Release Notes <details> <summary>vuejs/core (vue)</summary> ### [`v3.5.39`](https://github.com/vuejs/core/blob/HEAD/CHANGELOG.md#3539-2026-06-25) [Compare Source](vuejs/core@v3.5.38...v3.5.39) ##### Bug Fixes - **compiler-core:** correct filter rewrite recursion ([#​14959](vuejs/core#14959)) ([be7ce31](vuejs/core@be7ce31)) - **hydration:** force patch dynamic props when hydrating ([#​9083](vuejs/core#9083)) ([024cf06](vuejs/core@024cf06)), closes [#​9033](vuejs/core#9033) - **hydration:** respect data-allow-mismatch on conditional branches ([#​12801](vuejs/core#12801)) ([164af63](vuejs/core@164af63)), closes [#​12782](vuejs/core#12782) - **reactivity:** avoid triggering effects when set fails ([#​14964](vuejs/core#14964)) ([e450973](vuejs/core@e450973)) - **runtime-core:** handle non-isomorphic block element update ([#​15002](vuejs/core#15002)) ([932ddd0](vuejs/core@932ddd0)), closes [#​6385](vuejs/core#6385) - **runtime-core:** normalize function children for elements and Teleport ([#​9108](vuejs/core#9108)) ([2f374cd](vuejs/core@2f374cd)), closes [#​9107](vuejs/core#9107) - **runtime-core:** pause tracking when invoking function refs ([#​14985](vuejs/core#14985)) ([3ac052b](vuejs/core@3ac052b)) - **runtime-core:** preserve once event listener name ([#​8341](vuejs/core#8341)) ([87b73b6](vuejs/core@87b73b6)), closes [#​8342](vuejs/core#8342) - **runtime-dom:** preserve option modifier event names ([#​8338](vuejs/core#8338)) ([4b659e6](vuejs/core@4b659e6)), closes [#​8334](vuejs/core#8334) - **ssr:** dedupe inherited scope ids during vnode rendering ([#​15005](vuejs/core#15005)) ([027da6b](vuejs/core@027da6b)), closes [#​12159](vuejs/core#12159) [#​12175](vuejs/core#12175) - **ssr:** resolve nested async teleport content ([#​9431](vuejs/core#9431)) ([31d0f23](vuejs/core@31d0f23)), closes [#​6207](vuejs/core#6207) - **teleport:** handle teleport unmount edge case ([#​12705](vuejs/core#12705)) ([671997a](vuejs/core@671997a)), closes [#​12702](vuejs/core#12702) - **types:** support named tuple emits ([#​12676](vuejs/core#12676)) ([232f402](vuejs/core@232f402)), closes [#​12673](vuejs/core#12673) - **types:** validate defineModel defaults ([#​14968](vuejs/core#14968)) ([747f57e](vuejs/core@747f57e)), closes [#​14966](vuejs/core#14966) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTcuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIxNy4xIiwidGFyZ2V0QnJhbmNoIjoiZXZvbHV0aW9ucy1wb3N0LTEuMS44IiwibGFiZWxzIjpbXX0=--> Co-authored-by: leuwen-lc <leuwen-lc@noreply.codeberg.org> Reviewed-on: https://codeberg.org/leuwen-lc/rhdemo/pulls/180
close #6207
the root cause is that
targetBuffermay be a two-dimensional array.core/packages/server-renderer/src/helpers/ssrRenderTeleport.ts
Lines 28 to 36 in 0a8be45
Summary by CodeRabbit
Suspenseand async components, ensuring correct teleport marker-only output where appropriate and correct resolved HTML placement.Teleport+Suspenseresolves correctly inrenderToString.