Skip to content

Conversation

@alex-snezhko
Copy link
Contributor

Fix fallthrough attributes in Vapor mode when target component has comments in its template root level

Example
Comp.vue

<template vapor>
  <!--comment-->
  <div>Hello</div>
</template>

App.vue

<script setup vapor>
import Comp from './Comp.vue';
</script>

<template>
  <Comp style="color: red;" />
</template>
Screenshot From 2025-10-06 21-28-09

@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

❤️ Share

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

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 85.2 kB (+325 B) 29.9 kB (+106 B) 26.4 kB (+74 B)
runtime-dom.global.prod.js 108 kB 40.4 kB 36.4 kB
vue.global.prod.js 166 kB 60.4 kB 53.7 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47.9 kB 18.7 kB 17.1 kB
createApp 57 kB 21.9 kB 20 kB
createApp + vaporInteropPlugin 91.3 kB (+124 B) 34.1 kB (+42 B) 30.8 kB (+101 B)
createVaporApp 35 kB (+124 B) 13.4 kB (+42 B) 12.3 kB (+43 B)
createSSRApp 61.3 kB 23.7 kB 21.6 kB
defineCustomElement 63.1 kB 23.8 kB 21.7 kB
overall 72.1 kB 27.3 kB 24.9 kB

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 7, 2025

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@13972

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@13972

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@13972

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@13972

@vue/compiler-vapor

npm i https://pkg.pr.new/@vue/compiler-vapor@13972

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@13972

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@13972

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@13972

@vue/runtime-vapor

npm i https://pkg.pr.new/@vue/runtime-vapor@13972

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@13972

@vue/shared

npm i https://pkg.pr.new/@vue/shared@13972

vue

npm i https://pkg.pr.new/vue@13972

@vue/compat

npm i https://pkg.pr.new/@vue/compat@13972

commit: 11f2c06

@edison1105
Copy link
Member

The following scenarios need to be fixed

@alex-snezhko alex-snezhko changed the title fix(runtime-vapor): fallthrough attrs with comments in template root fix(runtime-vapor): more accurate fallthrough attr support Oct 12, 2025
@alex-snezhko
Copy link
Contributor Author

@edison1105 updated and edited the PR title!

@edison1105
Copy link
Member

Made some tweaks

  • Only return singleRoot when the root node contains comment nodes (corresponding to vdom DEV_ROOT_FRAGMENT)
  • In vapor mode, there's no need to consider manually written setup scenarios, so setup returning [n0] doesn't need to be considered. If an array is returned, it should contain at least 2 elements.

@edison1105 edison1105 merged commit 584f25f into vuejs:minor Nov 18, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Vapor to Done in Next Minor Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode version: minor

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants