Teleport 弹窗尺寸为什么会丢(5):CSS 变量回填的候选补丁与验证
- Teleport 怎样管理两个 DOM 位置
- Transition 怎样协调创建和移除
- CSS v-bind 怎样编译与更新变量
- 首次打开的变量漏填与修复
- CSS 变量回填的候选补丁与验证(当前)
第四篇的弹窗已经打开,375px 的值也还在,缺的是一次把变量写到新元素的机会。候选补丁补在内部组件换根后。它沿用 Teleport 已有的标记和写值方法。
补丁只改了两个文件
| 文件 | 改动 |
|---|---|
packages/runtime-core/src/components/Teleport.ts |
给 Teleport 范围内会独立换根的内容组件登记更新钩子。 |
packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts |
覆盖首次打开、反复打开,以及外层 Teleport 已回填时跳过额外查询。 |
下载候选补丁的基线是上游提交 0ff253b。版本核对另外比较了两边的 9 个相关文件。基线和正式 tag v3.5.44 在这些文件上的原始内容一致。完整摘要在版本与验证记录弹窗。
等新根出现,再走原来的写值路径
- Teleport 挂载时登记。 以前
updateCssVars()扫完当前范围并调用ctx.ut()就结束。补丁在这个入口继续找到内容组件,为每个实例登记一次onUpdated()。弹窗初始关闭时也能登记,因为内部组件已经挂载,它当前的根是占位注释。 - 内容组件更新后比较根。 从它的新子树找到真实 DOM,和上次记住的节点比较。注释换成元素,或者多根组件的根列表变了,就把回填排进现有的渲染后队列。只改文字且沿用原 DOM 时,这一轮会跳过新增的回填。
- 按当前范围补值。 队列执行时,原有的
updateCssVars()给锚点之间的新元素补上data-v-owner,再让ctx.ut()按实例归属写值。Teleport 移到新 target 或切换disabled后,钩子使用最新的范围回调。
真正把换根接到原有回填的是这一段。前面的 roots 和 prev 分别是本次与上次的真实根,多根时按长度和各位置的节点比较。
+ if (changed) {
+ state.roots = roots
+ queuePostRenderEffect(state.update, instance.suspense)
+ }
组件可能一层套一层,根也可能由多个节点组成,钩子会沿组件根和 Fragment 继续登记。Suspense 等待分支解析后再刷新,owner 已卸载的排队回调会跳过。逐项分支和回归放在兼容分支与源码对照弹窗。
两个旧 PR 提到的问题,这版怎么处理
#7344 经 renderer 传递上下文并新增导出。候选补丁把登记和触发放在 Teleport 自己的实现里,沿用已存在的生命周期和调度 API,因而没有新增导出引起的版本发布问题。旧评审给出了「初始显示后重开」和「初始隐藏后首次打开」两种漏值场景。当前回归覆盖这两类时序和普通插槽换根。2026-11-09 把旧评审里的两份原始模板重新编译,在正式版和本地候选补丁下分别打开、关闭。正式版仍会漏色,候选补丁下每次打开都保持红色。两份旧用例的复测数据弹窗
#7364 用目标容器的 DOM 变化触发更新。这版新增路径由内容组件的更新钩子触发,并且比较根节点,避免无关的 body 子节点变动引起额外扫描。同一 owner 下如果两个 Teleport 在一轮内各自换根,仍可能各扫一次,合并查询是单独记录的后续工作。
首次打开就应拿到 375px
浏览器回归固定宽度和颜色,只开关弹窗。首版复测把 defer 开关与「外层是否读取 open」交叉组合,四组都检查首次及后续打开。其中外层不读取 open 的两组在正式版上会漏值,补丁版四组都在首次打开时写入 owner 和 375px 的变量。
2026-11-09 的 Vue 全量单测有 3,927 项通过、5 项跳过,useCssVars.spec.ts 的 35 项全部通过。其中一条回归让外层更新子组件的 prop,同时让子组件换根。外层 Teleport 已给新根补好变量,子组件的更新钩子没有再查一次 owner。单测与浏览器记录弹窗
早期含批处理的回归摘要弹窗和逐次打开记录弹窗对应另一版实现。
早期候选版的首次打开回归摘要
打开原文件 teleport-first-open-regressions-2026-10-27.json
{
"date": "2026-10-27",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"testPath": "packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts",
"patchedRuntimeSourceSha256": "90733f857678500ce45ca882f24ecf4bbf53cc3b2a83f57d869af9519ac21aab",
"testSourceSha256": "6469ff848af9d994066b90847504f92a968b5e5bebb90d25f5bba6defc1f1bd9",
"contract": "After one nextTick on first open and each of two reopens: exact data-v-owner, --width=375px and --color=red. Width and color are never reassigned.",
"fixture": "compiler-dom compiled templates with stable Transition slots; defer x ownerReadsOpen boolean matrix; render count assertions distinguish owner updates from internal-only updates",
"upstreamControl": {
"sourceOverrideLoaded": true,
"expectedFailures": 4,
"unaffectedTestsSkipped": 30,
"regressions": [
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: false)",
"status": "failed",
"failureMessages": [
"AssertionError: expected null to be '0' // Object.is equality\n at core/packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts:462:54\n at async core/node_modules/.pnpm/@vitest+runner@4.1.11/node_modules/@vitest/runner/dist/chunk-artifact.js:1903:20"
]
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: false)",
"status": "failed",
"failureMessages": [
"AssertionError: expected null to be '3' // Object.is equality\n at core/packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts:462:54\n at async core/node_modules/.pnpm/@vitest+runner@4.1.11/node_modules/@vitest/runner/dist/chunk-artifact.js:1903:20"
]
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: true)",
"status": "failed",
"failureMessages": [
"AssertionError: expected null to be '6' // Object.is equality\n at core/packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts:462:54\n at async core/node_modules/.pnpm/@vitest+runner@4.1.11/node_modules/@vitest/runner/dist/chunk-artifact.js:1903:20"
]
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: true)",
"status": "failed",
"failureMessages": [
"AssertionError: expected null to be '9' // Object.is equality\n at core/packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts:462:54\n at async core/node_modules/.pnpm/@vitest+runner@4.1.11/node_modules/@vitest/runner/dist/chunk-artifact.js:1903:20"
]
}
]
},
"patched": {
"cssVarsFile": {
"passed": 34,
"regressions": [
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: false)",
"status": "passed"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: false)",
"status": "passed"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: true)",
"status": "passed"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: true)",
"status": "passed"
}
]
},
"relatedRuntimeSuite": {
"passed": 1793,
"failed": 0,
"skipped": 1,
"files": 77
}
},
"browser": {
"version": "155.0.8059.85",
"cases": [
{
"defer": false,
"ownerReadsOpen": false,
"variant": "upstream",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
]
},
{
"defer": false,
"ownerReadsOpen": false,
"variant": "current",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
]
},
{
"defer": false,
"ownerReadsOpen": true,
"variant": "upstream",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
]
},
{
"defer": false,
"ownerReadsOpen": true,
"variant": "current",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
]
},
{
"defer": true,
"ownerReadsOpen": false,
"variant": "upstream",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
]
},
{
"defer": true,
"ownerReadsOpen": false,
"variant": "current",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
]
},
{
"defer": true,
"ownerReadsOpen": true,
"variant": "upstream",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
]
},
{
"defer": true,
"ownerReadsOpen": true,
"variant": "current",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
]
}
]
},
"staticChecks": [
"TypeScript --incremental --noEmit",
"ESLint on the changed spec",
"Prettier --check on the changed spec",
"git diff --check"
],
"preservedPreviousTests": true,
"publicationNotes": "错误栈中的本机仓库绝对路径已替换为 core/;其余测试结果保持原样。",
"patchDownload": {
"file": "files/vue-teleport-css-vars-0ff253b.patch",
"sha256": "b35bdd57938b549f5a3c7b65d3ccfabce55358bb922c8b561f8bee726370d4d0",
"bytes": 18871
}
}早期候选版的逐次打开记录
打开原文件 teleport-first-open-browser-2026-10-27.json
{
"date": "2026-10-27",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"patchedSourceSha256": "90733f857678500ce45ca882f24ecf4bbf53cc3b2a83f57d869af9519ac21aab",
"browser": "155.0.8059.85",
"viewport": {
"width": 1000,
"height": 640
},
"bodyMargin": "36px",
"method": "Real SFC compileScript/compileStyle outputs; upstream and unchanged patched production runtimes; 3 openings per case; only open is assigned after mounting; CSS transitions disabled; width and color remain 375px/red.",
"cases": [
{
"defer": false,
"ownerReadsOpen": false,
"variant": "upstream",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n \n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "f92677225c1838500915468e4a9d29f2dbaa195428747dc17b49f6a01411679b",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": false,
"ownerReadsOpen": false,
"variant": "current",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n \n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "045a4019fd60fe97053e2f87792cc8da9cf8f5f8d7d1485b9e897305da6008bf",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": false,
"ownerReadsOpen": true,
"variant": "upstream",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n <p>{{ open }}</p>\n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"p\", null, _toDisplayString(open.value), 1 /* TEXT */),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "f92677225c1838500915468e4a9d29f2dbaa195428747dc17b49f6a01411679b",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": false,
"ownerReadsOpen": true,
"variant": "current",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n <p>{{ open }}</p>\n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"p\", null, _toDisplayString(open.value), 1 /* TEXT */),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "045a4019fd60fe97053e2f87792cc8da9cf8f5f8d7d1485b9e897305da6008bf",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": true,
"ownerReadsOpen": false,
"variant": "upstream",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n \n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_Teleport, {\n to: \"body\",\n defer: \"\"\n }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "f92677225c1838500915468e4a9d29f2dbaa195428747dc17b49f6a01411679b",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": true,
"ownerReadsOpen": false,
"variant": "current",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n \n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_Teleport, {\n to: \"body\",\n defer: \"\"\n }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "045a4019fd60fe97053e2f87792cc8da9cf8f5f8d7d1485b9e897305da6008bf",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 0,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": true,
"ownerReadsOpen": true,
"variant": "upstream",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n <p>{{ open }}</p>\n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"p\", null, _toDisplayString(open.value), 1 /* TEXT */),\n (_openBlock(), _createBlock(_Teleport, {\n to: \"body\",\n defer: \"\"\n }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "f92677225c1838500915468e4a9d29f2dbaa195428747dc17b49f6a01411679b",
"openings": [
{
"cycle": 0,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "928px",
"color": "rgb(0, 0, 0)",
"owner": null,
"expectedOwner": "0",
"inlineWidth": "",
"inlineColor": "",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
],
"pageErrors": []
},
{
"defer": true,
"ownerReadsOpen": true,
"variant": "current",
"input": "<script setup>\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n</script>\n<template>\n <div class=\"owner\">\n <p>{{ open }}</p>\n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"probe\">modal</div>\n </Transition>\n </Teleport>\n </div>\n</template>\n<style>.probe { width: v-bind(boxWidth); color: v-bind(boxColor) }</style>",
"compiledScript": "import { useCssVars as _useCssVars, unref as _unref } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"owner\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"probe\"\n}\n\nimport { ref, getCurrentInstance, onUpdated } from 'vue'\n\nexport default {\n __name: 'TeleportExtraRegression',\n setup(__props) {\n\n_useCssVars(_ctx => ({\n \"extra-boxWidth\": (boxWidth.value),\n \"extra-boxColor\": (boxColor.value)\n}))\n\nconst open = ref(false)\nconst boxWidth = ref('375px')\nconst boxColor = ref('red')\nlet updates = 0\nonUpdated(() => { updates++ })\nwindow.control = { open, boxWidth, boxColor, ownerId: getCurrentInstance().uid, getUpdates: () => updates }\n\nreturn (_ctx, _cache) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"p\", null, _toDisplayString(open.value), 1 /* TEXT */),\n (_openBlock(), _createBlock(_Teleport, {\n to: \"body\",\n defer: \"\"\n }, [\n _createVNode(_Transition, { css: false }, {\n default: _withCtx(() => [\n (open.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, \"modal\"))\n : _createCommentVNode(\"v-if\", true)\n ]),\n _: 1 /* STABLE */\n })\n ]))\n ]))\n}\n}\n\n}",
"compiledCss": ".probe { width: var(--extra-boxWidth); color: var(--extra-boxColor)\n}",
"bundleSha256": "045a4019fd60fe97053e2f87792cc8da9cf8f5f8d7d1485b9e897305da6008bf",
"openings": [
{
"cycle": 0,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 1,
"newElement": true
},
{
"cycle": 1,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 3,
"newElement": true
},
{
"cycle": 2,
"width": "375px",
"color": "rgb(255, 0, 0)",
"owner": "0",
"expectedOwner": "0",
"inlineWidth": "375px",
"inlineColor": "red",
"sourceWidth": "375px",
"sourceColor": "red",
"ownerUpdates": 5,
"newElement": true
}
],
"pageErrors": []
}
]
}候选补丁的验证与批处理记录
下载补丁的全量单测与 owner 查询对照
{
"date": "2026-11-09",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"vue": "3.5.44",
"patch": {
"file": "files/vue-teleport-css-vars-0ff253b.patch",
"sha256": "b6c1069cdb5b10194948cd92d1fa1634fac6e187a4c846ad4443c00ce328cc1b",
"files": [
"packages/runtime-core/src/components/Teleport.ts",
"packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts"
]
},
"sha256": {
"runtime": "48722d82421b0347e891e714b66b37fe5394406a0fc4973419e7aee13e3f14d0",
"tests": "527ab4d9d3ef8dda0158c8e28f12ed0c3eb09a53e7a8ec0e8e7ab7cc80e5457b"
},
"unit": {
"command": "node node_modules/vitest/vitest.mjs run --project 'unit*' --maxWorkers=4",
"platform": "win32",
"node": "v24.22.1",
"vitest": "4.1.11",
"files": 184,
"passed": 3927,
"failed": 0,
"skipped": 5,
"useCssVarsPassed": 35
},
"checks": {
"typescript": "passed",
"eslintChangedFiles": "passed",
"prettierChangedFiles": "passed",
"diffCheck": "passed"
},
"regression": {
"test": "does not refresh css vars again after teleport patches a new root",
"stimulus": "Update a child prop from the Teleport owner and replace the child DOM root from div to span in the same flush.",
"selector": "[data-v-owner=\"<owner uid>\"]",
"candidate": {
"ownerQueries": 2,
"root": "span",
"color": "red"
},
"withoutSnapshotUpdate": {
"removedLine": "existing.roots = roots",
"ownerQueries": 3,
"root": "span",
"color": "red",
"failedAssertion": "Expected 2 owner queries, got 3."
}
},
"browser": {
"engine": "Microsoft Edge 157.0.4341.42",
"viewport": [
1000,
640
],
"source": "<script setup>\nimport { ref } from 'vue'\n\nconst open = ref(false)\nconst width = ref('375px')\n</script>\n\n<template>\n <button @click=\"open = !open\">Toggle</button>\n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"panel\">Panel</div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.panel {\n width: v-bind(width);\n}\n</style>\n",
"observations": {
"release": {
"owner": false,
"width": "984px",
"availableWidth": "984px",
"bundleSha256": "32e8d2cf5034e241ccd220b42bb07042b0604839bd04607106728c338c92738b"
},
"candidate": {
"owner": true,
"width": "375px",
"availableWidth": "984px",
"bundleSha256": "4203e20624ab29a6724650e8b6a7ccac657fc9b91bb056baabb2dc81823c2cb1"
}
},
"compiler": "3.5.44",
"runtimeUnchangedSince": "teleport-first-patch-verification-2026-11-07.json"
}
}新增查询回归前的单测与浏览器记录
{
"date": "2026-11-07",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"vue": "3.5.44",
"patch": {
"file": "files/vue-teleport-css-vars-0ff253b.patch",
"sha256": "82f34facccabe223ba4b96adc2e1cf99ca161535bdd5f374d19fbd41a8b2eb5a",
"files": [
"packages/runtime-core/src/components/Teleport.ts",
"packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts"
]
},
"sha256": {
"runtime": "48722d82421b0347e891e714b66b37fe5394406a0fc4973419e7aee13e3f14d0",
"tests": "21cd1d6fd347c4057b18de9ea302f6c66c2e7114807fad9b0f615b5d50db9b45"
},
"scope": {
"retains": [
"post-update root replacement refresh",
"real DOM root comparison",
"component lifecycle and traversal guards"
],
"followUp": "teleport-css-vars-owner-batch-follow-up.json"
},
"unit": {
"command": "node node_modules/vitest/vitest.mjs run --project 'unit*' --maxWorkers=4",
"platform": "win32",
"node": "v24.22.1",
"vitest": "4.1.11",
"files": 184,
"passed": 3926,
"failed": 0,
"skipped": 5,
"useCssVarsPassed": 34
},
"checks": {
"typescript": "passed",
"eslintChangedFiles": "passed",
"prettierChangedFiles": "passed",
"diffCheck": "passed"
},
"browser": {
"engine": "Microsoft Edge 156.0.4314.58",
"compiler": "3.5.44",
"viewport": [
1000,
640
],
"observations": [
{
"defer": false,
"ownerReadsOpen": false,
"source": "<script setup>\nimport { ref } from 'vue';\n\nconst open = ref(false);\nconst boxWidth = ref('375px');\n</script>\n\n<template>\n <button @click=\"open = !open\">切换弹窗</button>\n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"modal\">弹窗</div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.modal {\n width: v-bind(boxWidth);\n}\n</style>",
"baseline": [
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
}
],
"firstPatch": [
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
}
]
},
{
"defer": false,
"ownerReadsOpen": true,
"source": "<script setup>\nimport { ref } from 'vue';\n\nconst open = ref(false);\nconst boxWidth = ref('375px');\n</script>\n\n<template>\n <button :aria-pressed=\"open\" @click=\"open = !open\">切换弹窗</button>\n <Teleport to=\"body\">\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"modal\">弹窗</div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.modal {\n width: v-bind(boxWidth);\n}\n</style>",
"baseline": [
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
}
],
"firstPatch": [
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
}
]
},
{
"defer": true,
"ownerReadsOpen": false,
"source": "<script setup>\nimport { ref } from 'vue';\n\nconst open = ref(false);\nconst boxWidth = ref('375px');\n</script>\n\n<template>\n <button @click=\"open = !open\">切换弹窗</button>\n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"modal\">弹窗</div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.modal {\n width: v-bind(boxWidth);\n}\n</style>",
"baseline": [
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
}
],
"firstPatch": [
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
}
]
},
{
"defer": true,
"ownerReadsOpen": true,
"source": "<script setup>\nimport { ref } from 'vue';\n\nconst open = ref(false);\nconst boxWidth = ref('375px');\n</script>\n\n<template>\n <button :aria-pressed=\"open\" @click=\"open = !open\">切换弹窗</button>\n <Teleport to=\"body\" defer>\n <Transition :css=\"false\">\n <div v-if=\"open\" class=\"modal\">弹窗</div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.modal {\n width: v-bind(boxWidth);\n}\n</style>",
"baseline": [
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
},
{
"owner": false,
"width": "984px",
"inlineWidth": ""
}
],
"firstPatch": [
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
},
{
"owner": true,
"width": "375px",
"inlineWidth": "375px"
}
]
}
]
},
"diagram": {
"image": "images/teleport-css-vars-first-patch.3bd01d0fa7de.svg",
"editableSource": "images/editable/teleport-css-vars-first-patch.svg",
"sha256": "3bd01d0fa7de7fdff9d034c62cf9e5bc38e9529b7af3924ec165458df715f6ad",
"textOutsideCanvas": []
}
}旧评审用例在正式版与首版补丁上的复测
{
"date": "2026-11-09",
"vue": "3.5.44",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"patchSha256": "82f34facccabe223ba4b96adc2e1cf99ca161535bdd5f374d19fbd41a8b2eb5a",
"browser": "Microsoft Edge 156.0.4314.58",
"method": "Original App.vue decoded from each review link, compiled with compiler-sfc 3.5.44. Keep color unchanged, toggle four times and wait for the expected DOM element count.",
"results": [
{
"case": 1,
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1351284795",
"variant": "release",
"states": [
{
"step": 0,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 1,
"open": false,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
}
]
},
{
"step": 2,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(0, 0, 0)",
"owner": null,
"style": null
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 3,
"open": false,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
}
]
},
{
"step": 4,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(0, 0, 0)",
"owner": null,
"style": null
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
}
]
},
{
"case": 1,
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1351284795",
"variant": "candidate",
"states": [
{
"step": 0,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 1,
"open": false,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
}
]
},
{
"step": 2,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 3,
"open": false,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
}
]
},
{
"step": 4,
"open": true,
"nodes": [
{
"text": "no transition, no teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES transition, NO teleport",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": "--review1-color: red;"
},
{
"text": "YES telport, NO transition",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review1-color: red;"
},
{
"text": "YES transition, YES teleport - with extra div wrapper",
"color": "rgb(255, 0, 0)",
"owner": null,
"style": null
}
]
}
]
},
{
"case": 2,
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1354367044",
"variant": "release",
"states": [
{
"step": 0,
"open": false,
"nodes": []
},
{
"step": 1,
"open": true,
"nodes": [
{
"text": "YES transition, YES teleport",
"color": "rgb(0, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 2,
"open": false,
"nodes": []
},
{
"step": 3,
"open": true,
"nodes": [
{
"text": "YES transition, YES teleport",
"color": "rgb(0, 0, 0)",
"owner": null,
"style": null
}
]
},
{
"step": 4,
"open": false,
"nodes": []
}
]
},
{
"case": 2,
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1354367044",
"variant": "candidate",
"states": [
{
"step": 0,
"open": false,
"nodes": []
},
{
"step": 1,
"open": true,
"nodes": [
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review2-color: red;"
}
]
},
{
"step": 2,
"open": false,
"nodes": []
},
{
"step": 3,
"open": true,
"nodes": [
{
"text": "YES transition, YES teleport",
"color": "rgb(255, 0, 0)",
"owner": "0",
"style": "--review2-color: red;"
}
]
},
{
"step": 4,
"open": false,
"nodes": []
}
]
}
]
}同 owner 批量回填的后续记录
{
"recordedOn": "2026-11-07",
"status": "deferred",
"dependency": "Re-evaluate once the Teleport CSS variable refresh path is accepted and stable.",
"trigger": "Two or more Teleports with the same CSS-variable owner replace their DOM roots in one post-render flush.",
"observed": {
"recordedOn": "2026-11-06",
"source": "teleport-patch-scope-audit-2026-11-06.json",
"perOwnerQueriesWithoutBatching": 2,
"perOwnerQueriesWithBatching": 1,
"compiledFirstOpenCasesPassedInBothVariants": 4,
"archivedCandidateSha256": "b35bdd57938b549f5a3c7b65d3ccfabce55358bb922c8b561f8bee726370d4d0"
},
"separateValidation": [
"Every new root is marked before the shared owner scan.",
"Simultaneous root replacements under one owner result in a single query.",
"Different owners, pending Suspense, target and disabled changes, and unmount keep their timing and scope.",
"Text-only updates still do not schedule an extra scan."
]
}逐项停用候选改动后的测试结果
{
"date": "2026-11-06",
"baseline": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"packageVersion": "3.5.44",
"environment": {
"platform": "Windows",
"node": "v26.12.0",
"vitest": "4.1.11",
"project": "unit-jsdom"
},
"method": "One test-time transform per variant, same test file and configuration. Each variant replaces only Teleport.ts in the Vitest transform pipeline. The tracked Vue files were left as found.",
"publishedPatchMatchesWorkingDiff": true,
"sha256": {
"patch": "b35bdd57938b549f5a3c7b65d3ccfabce55358bb922c8b561f8bee726370d4d0",
"runtime": "90733f857678500ce45ca882f24ecf4bbf53cc3b2a83f57d869af9519ac21aab",
"test": "6469ff848af9d994066b90847504f92a968b5e5bebb90d25f5bba6defc1f1bd9"
},
"reports": [
{
"id": "baseline",
"change": "Use the unmodified Teleport.ts from HEAD and run the current test file.",
"passed": 19,
"failed": 15,
"compiledFirstOpenPassed": 0,
"failures": [
{
"title": "with teleport and transition (disabled: false, defer: false)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: true, defer: false)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: false, defer: true)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: true, defer: true)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: false)",
"error": "AssertionError: expected null to be '28' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: false)",
"error": "AssertionError: expected null to be '31' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: true)",
"error": "AssertionError: expected null to be '34' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: true)",
"error": "AssertionError: expected null to be '37' // Object.is equality"
},
{
"title": "with teleport and a conditional slot root",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "with teleport component roots after changing target and disabled",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "with teleport and suspense component roots",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "only refreshes teleport css vars when component roots change (fragment: false)",
"error": "AssertionError: expected \"querySelectorAll\" to be called 1 times, but got 0 times"
},
{
"title": "only refreshes teleport css vars when component roots change (fragment: true)",
"error": "AssertionError: expected \"querySelectorAll\" to be called 1 times, but got 0 times"
},
{
"title": "with teleport transition after repeated toggles (initial: false)",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "with teleport transition after repeated toggles (initial: true)",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
}
]
},
{
"id": "candidate",
"change": "Use the complete candidate.",
"passed": 34,
"failed": 0,
"compiledFirstOpenPassed": 4,
"failures": []
},
{
"id": "no-nested-hooks",
"change": "Skip hook registration on a content component subTree.",
"passed": 23,
"failed": 11,
"compiledFirstOpenPassed": 0,
"failures": [
{
"title": "with teleport and transition (disabled: false, defer: false)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: true, defer: false)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: false, defer: true)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "with teleport and transition (disabled: true, defer: true)",
"error": "AssertionError: expected false to be true // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: false)",
"error": "AssertionError: expected null to be '28' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: false)",
"error": "AssertionError: expected null to be '31' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: false, owner reads open: true)",
"error": "AssertionError: expected null to be '34' // Object.is equality"
},
{
"title": "applies css vars on first opening with a compiled teleport (defer: true, owner reads open: true)",
"error": "AssertionError: expected null to be '37' // Object.is equality"
},
{
"title": "with teleport component roots after changing target and disabled",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "with teleport transition after repeated toggles (initial: false)",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
},
{
"title": "with teleport transition after repeated toggles (initial: true)",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
}
]
},
{
"id": "no-fragment-hooks",
"change": "Skip hook registration inside Fragments.",
"passed": 33,
"failed": 1,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "with teleport component roots after changing target and disabled",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
}
]
},
{
"id": "no-latest-callback",
"change": "Keep the callback captured on first registration.",
"passed": 33,
"failed": 1,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "with teleport component roots after changing target and disabled",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
}
]
},
{
"id": "no-suspense-pending",
"change": "Do not schedule a refresh for the pending Suspense branch.",
"passed": 33,
"failed": 1,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "with teleport and suspense component roots",
"error": "AssertionError: expected '' to be 'red' // Object.is equality"
}
]
},
{
"id": "no-array-guard",
"change": "Traverse children without the ARRAY_CHILDREN check.",
"passed": 33,
"failed": 1,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "with an empty teleport",
"error": "TypeError: Cannot read properties of null (reading 'forEach')"
}
]
},
{
"id": "no-owner-guards",
"change": "Remove both owner unmount checks.",
"passed": 33,
"failed": 1,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "does not refresh teleport css vars after the owner unmounts",
"error": "AssertionError: expected \"vi.fn()\" to not be called at all, but actually been called 1 times"
}
]
},
{
"id": "no-marking-guard",
"change": "Remove the unmount check before owner marking.",
"passed": 34,
"failed": 0,
"compiledFirstOpenPassed": 4,
"failures": []
},
{
"id": "no-flush-guard",
"change": "Remove the unmount check before the owner flush.",
"passed": 34,
"failed": 0,
"compiledFirstOpenPassed": 4,
"failures": []
},
{
"id": "no-root-comparison",
"change": "Schedule refresh for every registered component update.",
"passed": 32,
"failed": 2,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "only refreshes teleport css vars when component roots change (fragment: false)",
"error": "AssertionError: expected \"querySelectorAll\" to not be called at all, but actually been called 1 times"
},
{
"title": "only refreshes teleport css vars when component roots change (fragment: true)",
"error": "AssertionError: expected \"querySelectorAll\" to not be called at all, but actually been called 1 times"
}
]
},
{
"id": "no-roots-refresh",
"change": "Keep the stored roots when Teleport registers an existing component again.",
"passed": 34,
"failed": 0,
"compiledFirstOpenPassed": 4,
"failures": []
},
{
"id": "no-owner-batch",
"change": "Call ctx.ut() synchronously after each range refresh.",
"passed": 32,
"failed": 2,
"compiledFirstOpenPassed": 4,
"failures": [
{
"title": "only refreshes teleport css vars when component roots change (fragment: false)",
"error": "AssertionError: expected \"querySelectorAll\" to be called 1 times, but got 2 times"
},
{
"title": "only refreshes teleport css vars when component roots change (fragment: true)",
"error": "AssertionError: expected \"querySelectorAll\" to be called 1 times, but got 2 times"
}
]
}
],
"relatedRuntimeSuites": {
"projects": [
"runtime-core",
"runtime-dom",
"server-renderer"
],
"filesPassed": 77,
"testsPassed": 1793,
"skipped": 1
},
"articleSfc": {
"compiler": "3.5.44",
"browser": "Microsoft Edge headless",
"viewport": {
"width": 1000,
"height": 640
},
"baseline": {
"owner": false,
"width": "984px",
"inlineStyle": ""
},
"candidate": {
"owner": true,
"width": "375px",
"inlineStyle": "--teleport-scope-boxWidth: 375px;"
}
}
}文件比对记录(JSON)
{
"version": "3.5.44",
"tarball": "https://registry.npmjs.org/vue/-/vue-3.5.44.tgz",
"integrity": "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ==",
"sourceComparisons": [
{
"file": "packages/runtime-core/src/components/Teleport.ts",
"identical": true,
"releaseSha256": "de12ee583a7dfe264fb50dda09098815e986b98052eaa7e375305367884e059a",
"baselineSha256": "de12ee583a7dfe264fb50dda09098815e986b98052eaa7e375305367884e059a"
},
{
"file": "packages/runtime-core/src/components/BaseTransition.ts",
"identical": true,
"releaseSha256": "e5f8a1017437a67bbe027cdfb12c0870bc570322fa4f7f2ec1cb710a67895bcf",
"baselineSha256": "e5f8a1017437a67bbe027cdfb12c0870bc570322fa4f7f2ec1cb710a67895bcf"
},
{
"file": "packages/runtime-dom/src/components/Transition.ts",
"identical": true,
"releaseSha256": "076842a8687cfbd9f01f25a7407d7ccebffddacffdfa293bb2507345b3c73c57",
"baselineSha256": "076842a8687cfbd9f01f25a7407d7ccebffddacffdfa293bb2507345b3c73c57"
},
{
"file": "packages/runtime-dom/src/helpers/useCssVars.ts",
"identical": true,
"releaseSha256": "6cd218da531fbb6450f5100e0ad7ad76b27a4137aceb5d515c53dee7b620d0a2",
"baselineSha256": "6cd218da531fbb6450f5100e0ad7ad76b27a4137aceb5d515c53dee7b620d0a2"
},
{
"file": "packages/runtime-core/src/renderer.ts",
"identical": true,
"releaseSha256": "054523e2d9c2e9c0621fc6f99bc5d7a63962900344fc05effb1b69a159bae5e5",
"baselineSha256": "054523e2d9c2e9c0621fc6f99bc5d7a63962900344fc05effb1b69a159bae5e5"
},
{
"file": "packages/runtime-core/src/componentRenderContext.ts",
"identical": true,
"releaseSha256": "36596888e5e657833a41f4111405a2d8e5cd7327339e33b70c4da8e7d0625986",
"baselineSha256": "36596888e5e657833a41f4111405a2d8e5cd7327339e33b70c4da8e7d0625986"
},
{
"file": "packages/reactivity/src/effect.ts",
"identical": true,
"releaseSha256": "04a96a5ac99f9c36c88f9735a2ed7c24994c28933f8c92213466021ba551b53f",
"baselineSha256": "04a96a5ac99f9c36c88f9735a2ed7c24994c28933f8c92213466021ba551b53f"
},
{
"file": "packages/reactivity/src/dep.ts",
"identical": true,
"releaseSha256": "f728fdeb4b51bd23166730334a08fbe007a9d1205cf2b3340ff01b5938dad271",
"baselineSha256": "f728fdeb4b51bd23166730334a08fbe007a9d1205cf2b3340ff01b5938dad271"
},
{
"file": "packages/compiler-sfc/src/style/cssVars.ts",
"identical": true,
"releaseSha256": "c0840e90515b3184d528fedb9934e29c0e95f1873ba6459b792d698c2fb6c664",
"baselineSha256": "c0840e90515b3184d528fedb9934e29c0e95f1873ba6459b792d698c2fb6c664"
}
]
}早期含批处理版本的开销测量
{
"date": "2026-10-24",
"base": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
"vue": "3.5.44",
"sourceSha256": "90733f857678500ce45ca882f24ecf4bbf53cc3b2a83f57d869af9519ac21aab",
"validation": {
"unitPassed": 3922,
"unitSkipped": 5,
"eslint": "passed",
"typecheck": "passed",
"formatting": "passed",
"globalBuild": "passed",
"reviewCases": "both failed on upstream; both passed on initial and current patches"
},
"notes": [
"Primary hook overhead estimate uses same-bundle, same-page isolation on stable DOM roots. Disabling private instance.u hooks is a benchmark control, not an application workaround or a valid fix for root replacement.",
"Whole-bundle comparisons include some speedups in paths without added hooks. These differences cannot be attributed to this fix and are not claimed as performance improvements.",
"Initial 3-variant timing samples are short and were collected before explicit tab foregrounding; their deterministic query/write counts are used to identify redundant work. Use the focused samples and isolation data for timing interpretation.",
"Upstream root-replacement timings do less work because CSS variables are missing; do not treat them as a functionally equivalent performance target.",
"Timing excludes forced layout, paint, and screenshot overhead. This is one Windows desktop and one Chromium version, not a cross-device guarantee.",
"GC measurements describe retained heap after unmount, not peak allocation and not a general proof of no memory leaks."
],
"reviewCases": [
{
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1351284795",
"author": "moushicheng",
"date": "2022-12-14T12:41:17Z",
"url": "https://deploy-preview-7344--vue-sfc-playground.netlify.app/#eNqlVM1um0AQfpXpXpxIXjg0UiXXsdpDr+2huVTigmGwt4Xd1e4ARZbfvbNAMYlRoiQXpJmd72e+1XISX62NmhrFRmwJK1umhLtEA2z3NZHR8CUrVfbnPhH+aNqHo9IHuIcPU5GI3YM5HEoECuU2HmAjhYt3/SdUfSdXDWRl6j0TEv4lhoc+gDZALtVekTJ63ZdYojWOelzMwAvLZXJEL/BCI1Uxtz1JAfz69vOR2vcfj9Tmetv4iViiE+KkhmkgwxJ7k3cT+1usYBnIBh+T2oKTUXUK4kUvV0G92t91WKPjWVpzlwuJXRt/OcGL3YUV3rDE82uAhFbREZjIpRC4W5dai26mONtwYcdnLyo0ppfFpc+csgQeqbbcUVXv4QQOCzhD4UwFK36SqwGdGe0JMlMaxy+PZ25WDvPV7f+T+bsMp+RqvP0cVAedUZO6MshHIS04BeqecsO57ZXOb/oq4M49tB8XazGYk1Vqo9/eaP5N9NhkPPCJ2AxsocemQ52II5H1mzjO0Zamk9Zho7CVnz7e3UnJU9IXmeREuoMztc4jjVSqoos49JiPI1drUhVG6Cu5d6b16Fg+EeuZUszNBp10qHN0fFfvVn5CeKUexDmdszj/A/IsvhM="
},
{
"comment": "https://github.com/vuejs/core/pull/7344#issuecomment-1354367044",
"author": "edison1105",
"date": "2022-12-16T08:16:10Z",
"url": "https://deploy-preview-7344--vue-sfc-playground.netlify.app/#__DEV__eNqlkU1u2zAQha8y5cYJYEqLBijgOka76AmaTQFuZGlks6FIYjiSIxi+e4aS4hjJMloIePPzvtHTWf2OsRh6VBu1Zeyiqxh3xgNs9z1z8PCrdrZ+fjQqHcPp6Wj9AR7h21UYtXsKh4ND4Cy35by2WFC5m15ZGW9YEA5jIAYOYrkPzSgGuSvTTJVPlu2yPdUaO0DtqpRkmvGFjYJB2/b2nKtBfv79+QvvPutZL8yraSmub9DyA1UKy/hydC5cYxGZarKRISH3USq2mz7nDIQtXKCl0MFK8lzN23XwiaEOLpDEJjN3K8Jmdf/WuQ01d9vKJbz/mbEzaIHy6DK/yBnAOXtPnhtJY299czepvHeZVqdxtVbzdbqrYvE/BS8/edo1SyMZtZndck2uztqoI3NMm7JsMLow6kg4WDzpH98fHrSWKZ3aWksk44FC75vCIzvbjkUVYyntgnrPtsMCU6f3FE4JSfBGrW9IpRQHJE3oGySkr5M/GH6iZ7ikc1GXV60oBH0="
}
],
"sizes": {
"upstream": {
"bytes": 173088,
"gzip": 62907,
"brotli": 55853,
"sha256": "f92677225c1838500915468e4a9d29f2dbaa195428747dc17b49f6a01411679b"
},
"hooks-v1": {
"bytes": 173445,
"gzip": 63027,
"brotli": 55962,
"sha256": "92e1123e1988260357b4fe50d07fc34d9fbad49881749acd3c9568d023748044"
},
"current": {
"bytes": 173884,
"gzip": 63179,
"brotli": 56108,
"sha256": "045a4019fd60fe97053e2f87792cc8da9cf8f5f8d7d1485b9e897305da6008bf"
}
},
"initialDiagnosticsAndSamples": {
"environment": {
"cpu": "Intel(R) Core(TM) i5-14600K",
"node": "v24.22.1",
"platform": "win32",
"cores": 20,
"browser": "151.0.7922.34",
"head": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd"
},
"method": {
"rounds": 9,
"warmups": 2,
"timing": "synchronous mutation + await Vue.nextTick for every iteration; excludes paint and forced layout",
"order": "alternating variants",
"production": true,
"diagnostics": "separate instrumented 10-iteration pass; timings are not instrumented"
},
"results": [
{
"config": {
"name": "no-css-text-100",
"css": false,
"teleports": 100,
"roots": 1,
"ticks": 200
},
"samples": {
"upstream": [
14.100000023841858,
11.700000047683716,
10.899999976158142,
11.200000047683716,
11.700000047683716,
12.700000047683716,
13.799999952316284,
11.300000071525574,
10.399999976158142
],
"hooks-v1": [
13.200000047683716,
11.299999952316284,
10.5,
11.799999952316284,
11.100000023841858,
16,
13,
13.100000023841858,
11
],
"current": [
15,
10.399999976158142,
10.799999952316284,
9.799999952316284,
12.199999928474426,
13.200000047683716,
17.5,
13,
10.200000047683716
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.5,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 0.5,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 0.6999999284744263,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
},
{
"config": {
"name": "css-text-1",
"css": true,
"teleports": 1,
"roots": 1,
"ticks": 2000
},
"samples": {
"upstream": [
4.700000047683716,
1.8000000715255737,
1.7999999523162842,
1.600000023841858,
2,
1.600000023841858,
2.100000023841858,
1.5999999046325684,
1.600000023841858
],
"hooks-v1": [
9.5,
6,
6.100000023841858,
5.600000023841858,
5.100000023841858,
5,
4.699999928474426,
4.899999976158142,
5.100000023841858
],
"current": [
5.5,
2.100000023841858,
2.200000047683716,
1.899999976158142,
2.100000023841858,
1.899999976158142,
2.100000023841858,
2.1999999284744263,
2.399999976158142
]
},
"diagnostics": {
"upstream": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 1,
"varsCorrect": true,
"hookCounts": [
0
]
},
"hooks-v1": {
"elapsed": 0.3999999761581421,
"counts": {
"queries": 10,
"owners": 10,
"cssWrites": 10
},
"nodes": 1,
"varsCorrect": true,
"hookCounts": [
1
]
},
"current": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 1,
"varsCorrect": true,
"hookCounts": [
1
]
}
}
},
{
"config": {
"name": "css-text-100-roots",
"css": true,
"teleports": 1,
"roots": 100,
"ticks": 200
},
"samples": {
"upstream": [
12.899999976158142,
11.100000023841858,
10.600000023841858,
10.899999976158142,
9.699999928474426,
12,
9.200000047683716,
12.200000047683716,
15
],
"hooks-v1": [
27.5,
21.90000009536743,
23.299999952316284,
21.699999928474426,
129.5,
21.699999928474426,
20.90000009536743,
24.600000023841858,
21.5
],
"current": [
15.100000023841858,
11.899999976158142,
11.399999976158142,
12.5,
13.100000023841858,
12.5,
11.600000023841858,
11.899999976158142,
11.900000095367432
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.6000000238418579,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 1.600000023841858,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
"current": {
"elapsed": 0.5999999046325684,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-text-100-teleports",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 100
},
"samples": {
"upstream": [
7.900000095367432,
6.5,
6.199999928474426,
5.600000023841858,
4.799999952316284,
5,
4.899999976158142,
5.200000047683716,
5
],
"hooks-v1": [
516,
430.7000000476837,
441.2000000476837,
409.89999997615814,
414.59999990463257,
430.7999999523163,
445,
446.6999999284744,
406.39999997615814
],
"current": [
10.199999928474426,
8.399999976158142,
7.799999952316284,
7.100000023841858,
6,
5.700000047683716,
5.800000071525574,
9.300000071525574,
5.5
]
},
"diagnostics": {
"upstream": {
"elapsed": 1,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 56.89999997615814,
"counts": {
"queries": 1000,
"owners": 1000,
"cssWrites": 100000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
"current": {
"elapsed": 1.100000023841858,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-text-100-teleports-large-page",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 100,
"background": 5000
},
"samples": {
"upstream": [
7.300000071525574,
6,
5.399999976158142,
8.199999928474426,
9,
5,
5.600000023841858,
5.199999928474426,
5.399999976158142
],
"hooks-v1": [
428.8000000715256,
431.7000000476837,
418.5,
402.5,
436.60000002384186,
416.5,
430.7000000476837,
410.2000000476837,
409.5
],
"current": [
9.5,
6.699999928474426,
6.300000071525574,
7,
5.800000071525574,
5.799999952316284,
5.299999952316284,
5.299999952316284,
7.100000023841858
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.6999999284744263,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 53.5,
"counts": {
"queries": 1000,
"owners": 1000,
"cssWrites": 100000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
"current": {
"elapsed": 0.7000000476837158,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-replace-100-teleports",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 40,
"replace": true
},
"samples": {
"upstream": [
4.600000023841858,
4.5,
5.399999976158142,
3.399999976158142,
4.100000023841858,
3.700000047683716,
3.299999952316284,
3.5,
4.599999904632568
],
"hooks-v1": [
89.20000004768372,
88.29999995231628,
83.79999995231628,
109.10000002384186,
94.29999995231628,
100.30000007152557,
93.79999995231628,
88.39999997615814,
83.20000004768372
],
"current": [
9.699999928474426,
9.5,
11.100000023841858,
8.600000023841858,
10.900000095367432,
8.099999904632568,
7.200000047683716,
7.799999952316284,
7.100000023841858
]
},
"diagnostics": {
"upstream": {
"elapsed": 1.4000000953674316,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 25.100000023841858,
"counts": {
"queries": 1000,
"owners": 1000,
"cssWrites": 50500
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
"current": {
"elapsed": 2.5,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-fragment-replace",
"css": true,
"teleports": 1,
"roots": 1,
"fragment": 100,
"ticks": 100,
"replace": true
},
"samples": {
"upstream": [
11.100000023841858,
10,
9.5,
10.300000071525574,
10.100000023841858,
11.5,
12.5,
9.099999904632568,
10.299999952316284
],
"hooks-v1": [
19.600000023841858,
19,
18.100000023841858,
17.699999928474426,
42.10000002384186,
21.200000047683716,
19.90000009536743,
15.5,
17.200000047683716
],
"current": [
20.199999928474426,
19.200000047683716,
17.200000047683716,
19.299999952316284,
19.5,
21.799999952316284,
17.100000023841858,
19.700000047683716,
18.800000071525574
]
},
"diagnostics": {
"upstream": {
"elapsed": 1.2000000476837158,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0
]
},
"hooks-v1": {
"elapsed": 2.3000000715255737,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1
]
},
"current": {
"elapsed": 2.100000023841858,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1
]
}
}
},
{
"config": {
"name": "css-unrelated-body-mutations",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 100,
"unrelated": true
},
"samples": {
"upstream": [
0.3999999761581421,
0,
0.10000002384185791,
0,
0.09999990463256836,
0,
0.10000002384185791,
0.10000002384185791,
0.10000002384185791
],
"hooks-v1": [
0.10000002384185791,
0.10000002384185791,
0,
0,
0,
0,
0,
0.19999992847442627,
0.10000002384185791
],
"current": [
0,
0,
0,
0.10000002384185791,
0,
0,
0,
0,
0
]
},
"diagnostics": {
"upstream": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"hooks-v1": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
},
"current": {
"elapsed": 0.10000002384185791,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
}
]
},
"focusedWholeBundleComparison": {
"environment": {
"cpu": "Intel(R) Core(TM) i5-14600K",
"node": "v24.22.1",
"platform": "win32",
"cores": 20,
"browser": "151.0.7922.34",
"head": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd"
},
"method": {
"rounds": 9,
"warmups": 2,
"timing": "synchronous mutation + await Vue.nextTick for every iteration; excludes paint and forced layout",
"order": "alternating variants; measured tab brought to foreground for each sample",
"production": true,
"diagnostics": "separate instrumented 10-iteration pass; timings are not instrumented"
},
"results": [
{
"config": {
"name": "no-css-text-100",
"css": false,
"teleports": 100,
"roots": 1,
"ticks": 4000
},
"samples": {
"upstream": [
249.5,
210.79999995231628,
218.60000002384186,
344.40000009536743,
352.1999999284744,
364.89999997615814,
351,
374.3000000715256,
334.5
],
"current": [
205.39999997615814,
218.20000004768372,
246.20000004768372,
197.5,
224.89999997615814,
376.6999999284744,
361.1999999284744,
364.39999997615814,
350.10000002384186
]
},
"diagnostics": {
"upstream": {
"elapsed": 1.600000023841858,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 0.8999999761581421,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
},
{
"config": {
"name": "css-text-1",
"css": true,
"teleports": 1,
"roots": 1,
"ticks": 40000
},
"samples": {
"upstream": [
30.200000047683716,
26.399999976158142,
28.399999976158142,
29.299999952316284,
27.799999952316284,
26.600000023841858,
28,
25.799999952316284,
26
],
"current": [
36.5,
35.39999997615814,
35.89999997615814,
37.700000047683716,
32.10000002384186,
36.5,
31.600000023841858,
32.60000002384186,
34.799999952316284
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.09999990463256836,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 1,
"varsCorrect": true,
"hookCounts": [
0
]
},
"current": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 1,
"varsCorrect": true,
"hookCounts": [
1
]
}
}
},
{
"config": {
"name": "css-text-100-roots",
"css": true,
"teleports": 1,
"roots": 100,
"ticks": 4000
},
"samples": {
"upstream": [
212.29999995231628,
234.09999990463257,
206,
200,
327.10000002384186,
358.2000000476837,
330.7999999523163,
355.7000000476837,
336.7000000476837
],
"current": [
221.20000004768372,
221.70000004768372,
234.29999995231628,
245.90000009536743,
227.39999997615814,
415.5,
428.6999999284744,
419.5,
427.8000000715256
]
},
"diagnostics": {
"upstream": {
"elapsed": 1.8000000715255737,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 2.100000023841858,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-text-100-teleports",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 2000
},
"samples": {
"upstream": [
106.79999995231628,
118.20000004768372,
100.70000004768372,
117.60000002384186,
103,
99.09999990463257,
102.5,
99.79999995231628,
98
],
"current": [
111.69999992847443,
115.10000002384186,
121.70000004768372,
115.79999995231628,
141.5,
113.60000002384186,
125.5,
108.39999997615814,
111.10000002384186
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.40000009536743164,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 0.6000000238418579,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-text-100-teleports-large-page",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 2000,
"background": 5000
},
"samples": {
"upstream": [
160.20000004768372,
114.20000004768372,
95.79999995231628,
108.29999995231628,
128.5,
104.90000009536743,
110.89999997615814,
95.29999995231628,
100.70000004768372
],
"current": [
127.90000009536743,
122.20000004768372,
110.5,
112.10000002384186,
129.80000007152557,
109.89999997615814,
119.39999997615814,
129.70000004768372,
109.19999992847443
]
},
"diagnostics": {
"upstream": {
"elapsed": 0.5,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 0.6000000238418579,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-replace-100-teleports",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 800,
"replace": true
},
"samples": {
"upstream": [
72.79999995231628,
90.5,
81.40000009536743,
84.60000002384186,
71.30000007152557,
83.89999997615814,
69.69999992847443,
68.60000002384186,
87.80000007152557
],
"current": [
144.5,
151.89999997615814,
159.20000004768372,
143.40000009536743,
144.79999995231628,
144.90000009536743,
163.29999995231628,
153.39999997615814,
139.39999997615814
]
},
"diagnostics": {
"upstream": {
"elapsed": 1.2000000476837158,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 2.600000023841858,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
},
{
"config": {
"name": "css-fragment-replace",
"css": true,
"teleports": 1,
"roots": 1,
"fragment": 100,
"ticks": 2000,
"replace": true
},
"samples": {
"upstream": [
204.29999995231628,
186.89999997615814,
194.10000002384186,
361.7000000476837,
370.5,
365.10000002384186,
371.7000000476837,
353.5,
369.2000000476837
],
"current": [
348.2999999523163,
315.7000000476837,
327.2999999523163,
320.60000002384186,
624.5,
642,
623.1000000238419,
633.6999999284744,
620.7999999523163
]
},
"diagnostics": {
"upstream": {
"elapsed": 2.799999952316284,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": false,
"hookCounts": [
0
]
},
"current": {
"elapsed": 5.600000023841858,
"counts": {
"queries": 10,
"owners": 1000,
"cssWrites": 1000
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1
]
}
}
},
{
"config": {
"name": "css-unrelated-body-mutations",
"css": true,
"teleports": 100,
"roots": 1,
"ticks": 2000,
"unrelated": true
},
"samples": {
"upstream": [
2.299999952316284,
1.100000023841858,
1.6999999284744263,
1.0999999046325684,
0.8000000715255737,
0.7999999523162842,
0.7999999523162842,
1.600000023841858,
0.6000000238418579
],
"current": [
0.8999999761581421,
1.100000023841858,
0.7999999523162842,
0.8999999761581421,
0.8000000715255737,
1,
0.7000000476837158,
0.7000000476837158,
0.7000000476837158
]
},
"diagnostics": {
"upstream": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"current": {
"elapsed": 0,
"counts": {
"queries": 0,
"owners": 0,
"cssWrites": 0
},
"nodes": 100,
"varsCorrect": true,
"hookCounts": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
}
}
}
]
},
"hookIsolation": {
"method": "same production bundle, same page and app; only injected instance.u hooks are enabled/disabled between stable-root text samples; constant-length alternating text, 2 warmups, 11 alternating pairs; no paint/layout; disabling hooks is an experiment, not a usable fix for root replacement",
"browser": "151.0.7922.34",
"results": [
{
"config": {
"name": "one-component",
"teleports": 1,
"roots": 1,
"ticks": 200000
},
"samples": {
"disabled": [
112.5,
114.60000002384186,
118.60000002384186,
119.40000009536743,
118.69999992847443,
111.39999997615814,
112.5,
109.10000002384186,
133.39999997615814,
106.5,
118.40000009536743
],
"enabled": [
146.89999997615814,
146.60000002384186,
170.10000002384186,
150.89999997615814,
150.60000002384186,
172.39999997615814,
148.39999997615814,
162.60000002384186,
147.5,
144.69999992847443,
192.19999992847443
]
},
"medians": {
"disabled": 114.60000002384186,
"enabled": 150.60000002384186
},
"addedMicrosecondsPerBatch": 0.18
},
{
"config": {
"name": "100-teleports",
"teleports": 100,
"roots": 1,
"ticks": 4000
},
"samples": {
"disabled": [
167.59999990463257,
166.29999995231628,
170.30000007152557,
167.30000007152557,
172.5,
176.5,
166.29999995231628,
164.70000004768372,
181.79999995231628,
168.70000004768372,
173.89999997615814
],
"enabled": [
203.70000004768372,
205.79999995231628,
205.90000009536743,
194,
197.60000002384186,
208.59999990463257,
205.09999990463257,
206.39999997615814,
198.5,
194.39999997615814,
194.90000009536743
]
},
"medians": {
"disabled": 168.70000004768372,
"enabled": 203.70000004768372
},
"addedMicrosecondsPerBatch": 8.75
},
{
"config": {
"name": "100-sibling-roots",
"teleports": 1,
"roots": 100,
"ticks": 4000
},
"samples": {
"disabled": [
177.29999995231628,
170.69999992847443,
172.39999997615814,
179.70000004768372,
173.89999997615814,
177,
171,
177,
179.70000004768372,
172.10000002384186,
165.80000007152557
],
"enabled": [
210.29999995231628,
215.60000002384186,
200.39999997615814,
214.39999997615814,
202.60000002384186,
196.70000004768372,
199.89999997615814,
205.70000004768372,
250.30000007152557,
202.39999997615814,
199.79999995231628
]
},
"medians": {
"disabled": 173.89999997615814,
"enabled": 202.60000002384186
},
"addedMicrosecondsPerBatch": 7.175000011920929
},
{
"config": {
"name": "100-fragment-roots",
"teleports": 1,
"roots": 1,
"fragment": 100,
"ticks": 4000
},
"samples": {
"disabled": [
133.89999997615814,
137.80000007152557,
154.60000002384186,
129.79999995231628,
133.70000004768372,
140.60000002384186,
140.10000002384186,
134.19999992847443,
130.39999997615814,
138.60000002384186,
145.10000002384186
],
"enabled": [
142.20000004768372,
137.59999990463257,
139.89999997615814,
136.5,
138.59999990463257,
139.10000002384186,
137.69999992847443,
142.89999997615814,
139.60000002384186,
137.29999995231628,
141.80000007152557
]
},
"medians": {
"disabled": 137.80000007152557,
"enabled": 139.10000002384186
},
"addedMicrosecondsPerBatch": 0.32499998807907104
}
]
},
"retainedHeap": {
"method": "100 components under one CSS-vars Teleport per mount/unmount; 100 warmup cycles, then 5 batches of 100; two explicit GC requests before each CDP Runtime.getHeapUsage reading; retained heap only, not peak allocation or a general proof of no leaks",
"results": [
{
"variant": "upstream",
"heaps": [
{
"cycles": 100,
"usedSize": 1847848,
"totalSize": 2813952,
"embedderHeapUsedSize": 347328,
"backingStorageSize": 173441
},
{
"cycles": 200,
"usedSize": 1865592,
"totalSize": 2551808,
"embedderHeapUsedSize": 386728,
"backingStorageSize": 173441
},
{
"cycles": 300,
"usedSize": 1867348,
"totalSize": 2813952,
"embedderHeapUsedSize": 414080,
"backingStorageSize": 173441
},
{
"cycles": 400,
"usedSize": 1882356,
"totalSize": 2551808,
"embedderHeapUsedSize": 414240,
"backingStorageSize": 173441
},
{
"cycles": 500,
"usedSize": 1884816,
"totalSize": 2813952,
"embedderHeapUsedSize": 414392,
"backingStorageSize": 173441
},
{
"cycles": 600,
"usedSize": 1906560,
"totalSize": 2813952,
"embedderHeapUsedSize": 414552,
"backingStorageSize": 173441
}
]
},
{
"variant": "hooks-v1",
"heaps": [
{
"cycles": 100,
"usedSize": 1984148,
"totalSize": 2686976,
"embedderHeapUsedSize": 347176,
"backingStorageSize": 173798
},
{
"cycles": 200,
"usedSize": 2000156,
"totalSize": 2949120,
"embedderHeapUsedSize": 386576,
"backingStorageSize": 173798
},
{
"cycles": 300,
"usedSize": 2002040,
"totalSize": 2686976,
"embedderHeapUsedSize": 413928,
"backingStorageSize": 173798
},
{
"cycles": 400,
"usedSize": 2017520,
"totalSize": 2949120,
"embedderHeapUsedSize": 414080,
"backingStorageSize": 173798
},
{
"cycles": 500,
"usedSize": 2020908,
"totalSize": 2949120,
"embedderHeapUsedSize": 414240,
"backingStorageSize": 173798
},
{
"cycles": 600,
"usedSize": 2041196,
"totalSize": 2949120,
"embedderHeapUsedSize": 414392,
"backingStorageSize": 173798
}
]
},
{
"variant": "current",
"heaps": [
{
"cycles": 100,
"usedSize": 1989036,
"totalSize": 2686976,
"embedderHeapUsedSize": 347176,
"backingStorageSize": 174236
},
{
"cycles": 200,
"usedSize": 2004288,
"totalSize": 2686976,
"embedderHeapUsedSize": 386576,
"backingStorageSize": 174236
},
{
"cycles": 300,
"usedSize": 2007428,
"totalSize": 2686976,
"embedderHeapUsedSize": 413928,
"backingStorageSize": 174236
},
{
"cycles": 400,
"usedSize": 2022240,
"totalSize": 2949120,
"embedderHeapUsedSize": 414080,
"backingStorageSize": 174236
},
{
"cycles": 500,
"usedSize": 2025172,
"totalSize": 2949120,
"embedderHeapUsedSize": 414240,
"backingStorageSize": 174236
},
{
"cycles": 600,
"usedSize": 2045856,
"totalSize": 2949120,
"embedderHeapUsedSize": 414392,
"backingStorageSize": 174236
}
]
}
]
}
}早期候选版用两份登记分别管理更新钩子和批量回填任务。
换根比较、兼容分支与源码对照
更新钩子比较真实 DOM,避免每次 render 都回填
setCssVarsUpdateHooks() 为每个内容组件保存当前根节点和刷新回调。首次登记时,核心钩子如下;这是候选补丁中的节选:
+ const state = { update, roots }
+ cssVarsUpdates.set(instance, state)
+ onUpdated(() => {
+ // Text and prop updates do not require CSS vars to be reapplied.
+ const roots = getCssVarsRoots(instance.subTree)
+ const prev = state.roots
+ const changed =
+ isArray(prev) && isArray(roots)
+ ? prev.length !== roots.length ||
+ prev.some((node, i) => node !== roots[i])
+ : prev !== roots
+ if (changed) {
+ state.roots = roots
+ queuePostRenderEffect(state.update, instance.suspense)
+ }
+ }, instance)
renderer.ts 已经在组件子树 patch 后把 updated 钩子排进渲染后队列,因此这时可以读取更新后的 instance.subTree。onUpdated 的第二个参数显式传入内容组件 instance,把检查挂在真正可能独立更新的实例上。只给外面的 CSS 变量 owner 挂钩子,仍然会漏掉内部更新、外层不更新的场景。
这里比较的是 DOM 节点引用,而不是 VNode 对象。只改文字,也可能生成一个新的 VNode,但原来的 <div> 仍是同一个元素,不需要重新补 owner。v-if 则可能把注释节点换成元素,或者关闭后创建新的元素,这时引用就不同了。
Fragment 有多个根,需要比较列表长度和各位置的节点引用。如果只写 prev !== roots,每次收集出的新数组都会被当成根变化,失去跳过重复工作的作用。根没有变化时,这个新增路径不查询 owner,也不写变量;变量值本身变化,仍由 useCssVars() 原来的响应式更新处理。
查找实际根的函数是:
+function getCssVarsRoots(vnode: VNode): RendererNode | RendererNode[] {
+ while (vnode.component || (__FEATURE_SUSPENSE__ && vnode.suspense)) {
+ vnode = vnode.component
+ ? vnode.component.subTree
+ : vnode.suspense!.activeBranch!
+ }
+ return vnode.type === Fragment
+ ? (vnode.children as VNode[]).flatMap(getCssVarsRoots)
+ : vnode.el!
+}
它沿组件根链和 Suspense 的当前分支下钻,展开 Fragment。遇到普通元素就停下,因为新建的后代可以从这个根继承已有的 CSS 变量。钩子也沿这些根登记,内层组件独立换根时就能触发回填。
每个内容组件只登记一次检查
同一个内容组件可能多次经过 Teleport 的更新流程。如果每次都调用 onUpdated(),就会累积重复检查。因此 cssVarsUpdates 以内容组件实例为 key,只在第一次登记时注册钩子,后续只更新状态:
+ existing.update = update
+ existing.roots = roots
existing.update 必须替换成最新回调。回调闭包中持有当前 Teleport VNode 和 isDisabled;target、disabled 或 VNode 变化后,继续使用首次登记的闭包,就可能按旧位置刷新。
existing.roots 记录的是已经回填过的根。比如外层更新 prop 时,子组件在同一轮把根从 <div> 换成 <span>。Teleport 处理完子树就会给 <span> 补好 data-v-owner 和 CSS 变量,再把这个根记下来。子组件稍后执行更新钩子时,拿到的还是同一个 <span>,因此跳过回填。如果记录仍指向旧的 <div>,钩子会再次把换根当成待处理的变化。
这条回归同时检查 <span> 上的变量和该 owner 的查询次数。Teleport 回填和 owner 原有的更新流程各查一次,共 2 次。单独移除 existing.roots = roots 后,<span> 上的变量仍然正确,查询增加到 3 次。
登记表用 WeakMap 保存状态,以内容组件实例为 key。组件实例离开运行时后,登记表本身不会继续持有它。
卸载、空内容和 Suspense 的判断各守住一个边界
入队时 owner 还在,真正执行前,其他组件的更新钩子可能已经把它卸载。首版在刷新回调进入 updateCssVars() 前检查 ctx.isUnmounted,确保 owner 仍能处理补标记和变量写入。
vnode.shapeFlag & ShapeFlags.ARRAY_CHILDREN 则保护 children 遍历。Teleport 有内容时使用数组,但空 Teleport 可以没有 children,不能无条件对它调用 forEach()。
Suspense 涉及的是「节点什么时候已经成为可处理的当前分支」。根变化刷新使用 queuePostRenderEffect(state.update, instance.suspense);存在 pending 分支时,回调会由该边界暂存,等待解析。首次登记遇到 pending Suspense,也需要安排刷新,因为异步分支首次激活不等于一个已有组件执行 updated 钩子。刷新后再为当前根结构补齐登记。
刷新回调通过已有的渲染后队列等待正确的时机。进入 updateCssVars() 后,补标记与 ctx.ut() 在同一次调用中执行。