Skip to content

perf(runtime-vapor): avoid allocating the hydration boundary closure on client render - #15459

Open
edison1105 wants to merge 1 commit into
edison/fix/dispose-unmounted-instancefrom
edison/perf/hydration-boundary-closure
Open

perf(runtime-vapor): avoid allocating the hydration boundary closure on client render#15459
edison1105 wants to merge 1 commit into
edison/fix/dispose-unmounted-instancefrom
edison/perf/hydration-boundary-closure

Conversation

@edison1105

@edison1105 edison1105 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Refactor
    • Improved the handling of hydration boundaries during component creation.
    • Streamlined deferred hydration processing and boundary cleanup for more consistent runtime behavior.
    • No changes to the public API or user-facing functionality.

@edison1105 edison1105 added the scope: vapor related to vapor mode label Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c0f3c132-f4a0-46b8-90e6-649e4a521011

📥 Commits

Reviewing files that changed from the base of the PR and between 9a1aad4 and efd8481.

📒 Files selected for processing (1)
  • packages/runtime-vapor/src/component.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Vapor component runtime refactors hydration boundary handling. It claims the close anchor directly, trims boundaries through a module-level finalizer, and creates deferred finalization callbacks with the close node.

Changes

Vapor hydration boundary handling

Layer / File(s) Summary
Hydration boundary finalization
packages/runtime-vapor/src/component.ts
createComponent claims the hydration close anchor directly. Module-level helpers trim the boundary and create deferred finalization callbacks.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Merge Risk: ⚪ Minimal · up to efd84

This change removes an unnecessary client-render closure while preserving hydration-boundary claiming and finalization behavior. No current merge-blocking risk is identified.

Suggested reviewers: zhiyuanzmj, danielroe

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: avoiding hydration boundary closure allocation during client render in runtime-vapor.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edison/perf/hydration-boundary-closure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15459
npm i https://pkg.pr.new/@vue/compiler-core@15459
yarn add https://pkg.pr.new/@vue/compiler-core@15459.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15459
npm i https://pkg.pr.new/@vue/compiler-dom@15459
yarn add https://pkg.pr.new/@vue/compiler-dom@15459.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15459
npm i https://pkg.pr.new/@vue/compiler-sfc@15459
yarn add https://pkg.pr.new/@vue/compiler-sfc@15459.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15459
npm i https://pkg.pr.new/@vue/compiler-ssr@15459
yarn add https://pkg.pr.new/@vue/compiler-ssr@15459.tgz

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@15459
npm i https://pkg.pr.new/@vue/compiler-vapor@15459
yarn add https://pkg.pr.new/@vue/compiler-vapor@15459.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15459
npm i https://pkg.pr.new/@vue/reactivity@15459
yarn add https://pkg.pr.new/@vue/reactivity@15459.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15459
npm i https://pkg.pr.new/@vue/runtime-core@15459
yarn add https://pkg.pr.new/@vue/runtime-core@15459.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15459
npm i https://pkg.pr.new/@vue/runtime-dom@15459
yarn add https://pkg.pr.new/@vue/runtime-dom@15459.tgz

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@15459
npm i https://pkg.pr.new/@vue/runtime-vapor@15459
yarn add https://pkg.pr.new/@vue/runtime-vapor@15459.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15459
npm i https://pkg.pr.new/@vue/server-renderer@15459
yarn add https://pkg.pr.new/@vue/server-renderer@15459.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15459
npm i https://pkg.pr.new/@vue/shared@15459
yarn add https://pkg.pr.new/@vue/shared@15459.tgz

vue

pnpm add https://pkg.pr.new/vue@15459
npm i https://pkg.pr.new/vue@15459
yarn add https://pkg.pr.new/vue@15459.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15459
npm i https://pkg.pr.new/@vue/compat@15459
yarn add https://pkg.pr.new/@vue/compat@15459.tgz

commit: efd8481

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB 30.6 kB 26.9 kB
runtime-dom.global.prod.js 116 kB 43.8 kB 39.2 kB
vue.global.prod.js 176 kB 63.9 kB 56.9 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.2 kB 20.6 kB 18.8 kB
createApp 62.2 kB 24 kB 21.8 kB
createApp + vaporInteropPlugin 119 kB (+16 B) 42.9 kB (+11 B) 38.6 kB (+25 B)
createVaporApp 31.2 kB (+12 B) 12 kB (+5 B) 11 kB (+3 B)
createSSRApp 67.4 kB 26 kB 23.6 kB
createVaporSSRApp 37.4 kB (-19 B) 14.2 kB (-23 B) 13.1 kB (-15 B)
defineCustomElement 68.7 kB 25.9 kB 23.6 kB
defineVaporCustomElement 46.6 kB (+12 B) 16.9 kB (+8 B) 15.6 kB (+6 B)
overall 77.6 kB 29.5 kB 26.7 kB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant