fix(suspense): update suspense vnode's el during branch self-update#12922
fix(suspense): update suspense vnode's el during branch self-update#12922edison1105 merged 9 commits intomainfrom
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: |
…mponent self-update
61ebab0 to
1b01b0f
Compare
1b01b0f to
c52332a
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughPropagates host element identity through HOC chains into Suspense vnodes by updating updateHOCHostEl to consider a parent’s suspense.activeBranch; adds regression tests exercising Suspense unmount and host-el identity after async child self-updates. Changes
Sequence Diagram(s)sequenceDiagram
participant AsyncComp as AsyncComponent
participant Suspense as SuspenseBoundary
participant HOC as HOC/ParentChain
participant Host as HostDOM
AsyncComp->>Suspense: resolve & mount (becomes activeBranch)
Suspense->>HOC: activeBranch referenced in parent chain
HOC->>Host: host el assigned (updateHOCHostEl invoked)
note right of HOC: walker detects root.suspense.activeBranch === vnode
HOC->>Suspense: propagate el to suspension vnode (suspense.vnode.el = el)
Suspense->>Host: suspense vnode aligned with host el
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/runtime-core/__tests__/components/Suspense.spec.ts`:
- Around line 2246-2255: The test's async setup() helpers create a Promise p and
push its resolution into deps, but setup() does not await p so the component's
Suspense dependency resolves immediately; modify the async setup functions (the
async setup() helpers that define const p = new Promise(...) and push to deps)
to await p before returning so the component truly remains pending, and keep
pushing the same p (or its chained Promise) into deps to preserve the extra tick
for Node12; apply the same change to both occurrences referenced around the
async setup blocks at the two spots noted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0fa9e763-4900-4e3c-8f27-e5edc26286cf
📒 Files selected for processing (2)
packages/runtime-core/__tests__/components/Suspense.spec.tspackages/runtime-core/src/componentRenderUtils.ts
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
close #12920
Summary by CodeRabbit
Bug Fixes
Tests