Repository navigation
fix(runtime-vapor): avoid hydrating vapor slots during vdom collection - #14793
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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)
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.
🧹 Nitpick comments (1)
packages/runtime-vapor/__tests__/vdomInterop.spec.ts (1)
1555-1625: ⚡ Quick winStrengthen the
appContextassertion.This proves reactive updates, but it never resolves anything through the slot owner's
appContext, so the newowner.appContextbranch can regress without failing here. Using a component or config that is only available through that owner context would make the test match its title.🤖 Prompt for 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. In `@packages/runtime-vapor/__tests__/vdomInterop.spec.ts` around lines 1555 - 1625, The test must verify that invoking the captured slot uses the slot owner's appContext by providing something only available through that owner and asserting it resolves; update the test that assigns capturedSlot in VDomTabs so the slot content depends on an injected/provided value or a component that is registered only in the VaporChild owner context (e.g. use provide in VaporChild and inject in VDomTab, or register a helper component in the VaporChild components map and render it inside the slot), then call capturedSlot!() (as the test already does) and assert the returned vnodes reflect the injected/provided value or the owner-only component resolution both before and after changing data to ensure the owner.appContext branch is exercised (refer to capturedSlot, VDomTabs, VDomTab, VaporChild, and getLabels).
🤖 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.
Nitpick comments:
In `@packages/runtime-vapor/__tests__/vdomInterop.spec.ts`:
- Around line 1555-1625: The test must verify that invoking the captured slot
uses the slot owner's appContext by providing something only available through
that owner and asserting it resolves; update the test that assigns capturedSlot
in VDomTabs so the slot content depends on an injected/provided value or a
component that is registered only in the VaporChild owner context (e.g. use
provide in VaporChild and inject in VDomTab, or register a helper component in
the VaporChild components map and render it inside the slot), then call
capturedSlot!() (as the test already does) and assert the returned vnodes
reflect the injected/provided value or the owner-only component resolution both
before and after changing data to ensure the owner.appContext branch is
exercised (refer to capturedSlot, VDomTabs, VDomTab, VaporChild, and getLabels).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f1a10a56-1681-4cf2-8b5d-8508c8561ce7
📒 Files selected for processing (6)
packages/runtime-vapor/__tests__/hydration.spec.tspackages/runtime-vapor/__tests__/vdomInterop.spec.tspackages/runtime-vapor/src/component.tspackages/runtime-vapor/src/componentSlots.tspackages/runtime-vapor/src/vdomInterop.tspackages/runtime-vapor/src/vdomInteropState.ts
Summary by CodeRabbit
Bug Fixes
Tests