-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(runtime-core): handle patch stable fragment edge case #12411
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
base: main
Are you sure you want to change the base?
Conversation
Size ReportBundles
Usages
|
@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: |
WalkthroughThis PR addresses a bug where non-reactive arrays conditionally displayed based on reactive values cause rendering errors. It adds a length check to the fragment patching logic in the renderer to ensure dynamic children can be safely optimized, and includes a test case validating the fix. Changes
Sequence DiagramsequenceDiagram
participant Renderer
participant Fragment Patch Logic
participant Fast Path (patchBlockChildren)
participant Fallback Path (patchChildren)
Renderer->>Fragment Patch Logic: Process fragment update
Fragment Patch Logic->>Fragment Patch Logic: Check n1.dynamicChildren exists?
Fragment Patch Logic->>Fragment Patch Logic: Check length matches?
alt Both conditions true
Fragment Patch Logic->>Fast Path (patchBlockChildren): Use optimized path
Fast Path (patchBlockChildren)->>Renderer: Efficient patch applied
else Condition fails
Fragment Patch Logic->>Fallback Path (patchChildren): Use standard path
Fallback Path (patchChildren)->>Renderer: Full patch applied
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Areas requiring attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts (1)
🔇 Additional comments (3)
Comment |
close #12410
Summary by CodeRabbit
Tests
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.