Repository navigation
fix(compiler-vapor): do not fold a constant prop the template string cannot carry - #15587
Merged
edison1105 merged 1 commit intoSep 22, 2026
Conversation
…cannot carry `innerHTML` and `textContent` write the element's content, and a `.prop` binding forces a dom property, so a constant value has to reach the runtime setter instead of being stringified into the static template as a content attribute. A number bound with `.prop` keeps its type for the same reason, and `$html` starts out undefined so the property cache does not swallow the first empty write.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
zhiyuanzmj
added a commit
to vuejs/vue-jsx-vapor
that referenced
this pull request
Sep 25, 2026
cannot carry Copied from vuejs/core#15587
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A constant
:innerHTMLor:textContentis folded into the static template string, where it lands as a content attribute and the content is never written —<div innerhtml="<b>x</b>">instead of<div><b>x</b></div>. A constant.propbinding folds the same way, so:foo.prop="'bar'"sets an attribute where it was asked for a dom property. Dynamic values were already correct, as isv-text/v-html.https://play.vuejs.org/#eNp9Ul2L1TAQ/SuHPOwq9EMQBLu1IL6I6JP7GFjS2/E2mDsJydx2F/G/S1Kv213Up4HJmfMxmR/qfQjNcibVqT4dog2CRHIOWEzwcdDctqCF4gMW486EkZxfYRMMDp6TGBbUkNlIbspM8OweILPl49Y+GRGKCTNF0ty3m8qgWXMvdArOCA2agT4MSz3LycHwhKUWupcKq4/fLR+7vg0barILNtw7ra77cRi9m/p2HK61QrvHZIKMmck5f3n9rdRZZoofb798Lmpdxn7wLMRSlRjJnAiy+j8xE2qw34JF4oliemrqkfL/xvZa/7LXhOgDPO/WXMG45C8W/iZ9S/dSBjNrrs9Ic0EJ95hppUhIEi0f7TdLEyyLL5jL38CkjM9uYUSiHc9CqULyT/jKu03gfC1YoxUhbuADcYF8+goxI8QjEW2TdxeJF1pdObnJSfa7KYu5OsqNVi+bkqFk7tvd2ahK3S0Uk/WsOvW6edO8quOheat+/gLmyfdC
isRuntimeOnlyPropalready holds back the props a template string cannot carry —valueon<textarea>, the checkbox value pair — and these two belong in the same list..propopts out of the fold entirely, while.attrkeeps folding, which is what the modifier means. Two details came out of testing it: a number bound with.prophas to stay a number, and$htmlhas to start out undefined, otherwise the property cache swallows the firstsetHtml(el, '')exactly as it used to for$txt.Two things worth naming. A
.propthat reflects back to an attribute now appears after the attributes that stayed folded, soouterHTMLassertions can move; the DOM is the same and matches vdom. And under SSR a constant:textContentnow warns about a hydration mismatch — vdom emits the same warning and the same DOM, becausecompiler-ssrbakes the value in as an attribute, so that is a separate parity gap rather than a change here.