Repository navigation
fix: update the content of a teleport stubbed with a component - #2993
Merged
cexbrayat merged 1 commit intoOct 30, 2026
Merged
Conversation
Since vuejs#2946 a component stub for Teleport keeps the same type across renders, but the stub vnode kept the patch flag compiled for the Teleport, so optimized re-renders of the parent skipped it. Give the stub vnode the BAIL patch flag so its slot and props are always diffed.
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #2946, a Teleport stubbed with a component (
TeleportStub, or e.g.{ template: '<div><slot /></div>' }) keeps the same stub type across renders, so its content is no longer remounted, but it is no longer updated either:The stub vnode keeps the patch flag compiled for the Teleport (
0with a staticto), so in an optimized re-render of the parent Vue sees "no dynamic props, no dynamic slots" and skips the stub. The transformer now gives the stub vnode theBAILpatch flag, so its slot and props are always diffed (DYNAMIC_SLOTSalone is not enough: with a render function it makes Vue skip the props update, see the second test). #2958 uses the same flag, but also for non-stubbed Teleport/KeepAlive; here it is only set on the stub vnode.Not released yet: 2.5.1 updated the content by remounting it. Real case: faveo's global
Teleport: { template: '<div><slot /></div>' }stub (jest.setup.js) — the dropdown inside the Teleport of DatatableActions.vue never appears on main after clicking the toggle.Playground (main e22514a vs 2.5.1)