refactor(runtime-vapor): simplify slot fallback and slot binding cache#14819
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
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/runtime-vapor/src/vdomInterop.ts`:
- Around line 1378-1379: markSlotFallbackDirty() can re-run an outlet without
frag.onUpdated firing, so leaving notifyFallbackValidityChange as NOOP causes
parent boundaries to remain stale; update the implementation so that when
recheckSlotFallback() detects a valid↔invalid transition it calls the same
upward notification used by frag.onUpdated (e.g., invoke inheritedBoundary's
fallback-dirty API or call
inheritedBoundary.markFallbackValidityDirty()/equivalent) instead of NOOP—locate
notifyFallbackValidityChange: NOOP and change it to call the inherited boundary
dirty/notify method when recheckSlotFallback() flips validity, preserving
existing behavior when frag.onUpdated runs.
🪄 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: a2b98b0f-9358-4a68-b2a6-43c07faf224e
📒 Files selected for processing (4)
packages/runtime-vapor/__tests__/componentSlots.spec.tspackages/runtime-vapor/src/componentSlots.tspackages/runtime-vapor/src/fragment.tspackages/runtime-vapor/src/vdomInterop.ts
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/runtime-vapor/src/fragment.ts`:
- Around line 1264-1268: The outlet lacks a disposal flag so post-flush fallback
callbacks can resurrect an unmounted SlotFragment; add a boolean property (e.g.,
isDisposed) to SlotFragment and set it true in disposeSlotFallback/removeSlot,
then guard any code that creates or re-runs fallback rendering (places
referencing activeFallback, fallbackScope, pendingRecheck, isRenderingFallback,
rerunRecheckAfterFallbackRender and the post-flush callback from
renderVaporSlot) to no-op if isDisposed is true; also ensure dispose clears any
fallbackScope and cancels queued post-flush callbacks so no new EffectScope is
allocated for disposed outlets.
🪄 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: 1a9ea9b4-1cba-4ae5-ba61-142d9576738b
📒 Files selected for processing (7)
packages/runtime-vapor/__tests__/componentSlots.spec.tspackages/runtime-vapor/__tests__/hydration.spec.tspackages/runtime-vapor/__tests__/vdomInterop.spec.tspackages/runtime-vapor/src/block.tspackages/runtime-vapor/src/componentSlots.tspackages/runtime-vapor/src/fragment.tspackages/runtime-vapor/src/vdomInterop.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/runtime-vapor/src/componentSlots.ts
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests