-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(teleport): handle deferred teleport updates before and after mount #13350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
""" WalkthroughThis change refines the handling of the Changes
Assessment against linked issues
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
d4d1990
to
8c0d9e9
Compare
8c0d9e9
to
034d1fc
Compare
/ecosystem-ci run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/runtime-core/src/components/Teleport.ts (1)
170-170
: Consider using assignment to undefined instead of delete.The
delete
operator can have performance implications, as flagged by the static analysis tool. Consider usingn2.el!.__isMounted = undefined
instead, which achieves similar semantics but with better performance characteristics.- delete n2.el!.__isMounted + n2.el!.__isMounted = undefined🧰 Tools
🪛 Biome (1.9.4)
[error] 170-170: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
packages/runtime-core/__tests__/components/Teleport.spec.ts
(2 hunks)packages/runtime-core/src/components/Teleport.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/runtime-core/tests/components/Teleport.spec.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/runtime-core/src/components/Teleport.ts (1)
packages/runtime-core/src/renderer.ts (1)
queuePostRenderEffect
(286-295)
🪛 Biome (1.9.4)
packages/runtime-core/src/components/Teleport.ts
[error] 170-170: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Redirect rules
- GitHub Check: Header rules
- GitHub Check: Pages changed
- GitHub Check: test / e2e-test
🔇 Additional comments (2)
packages/runtime-core/src/components/Teleport.ts (2)
167-167
: Good addition of explicit initialization flag.This explicitly sets the
__isMounted
flag to false before queueing the post-render effect, making the mounting state tracking clearer. This helps ensure the deferred teleport knows its initial state before any updates occur.
176-176
: Improved condition for deferred teleport processing.The updated condition now explicitly checks both that the teleport is deferred AND that it hasn't been mounted yet (
__isMounted === false
). This correctly handles the case where updates might occur before the teleport has fully mounted.I recommend adding a comment explaining this logic for future maintainers:
+ // Only process deferred teleports that haven't been mounted yet if (isTeleportDeferred(n2.props) && n1.el!.__isMounted === false) {
📝 Ran ecosystem CI: Open
|
close #13349
Summary by CodeRabbit