Repository navigation
fix(compiler-vapor): keep static camelCase dom props out of the template - #16259
edison1105 merged 2 commits into
Conversation
|
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
|
@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
|
|
The compiler-side routing makes sense, but we also need to preserve numeric literals when these bindings are moved to runtime setters. For example: <input type="checkbox" :defaultChecked="0">At _setProp(n0, "defaultChecked", "0")transformVBind has already converted Could we reuse Please add regression coverage for the direct and |
Normalize a static `.camel` argument before the check as well.
compiler-vapor puts static props into the template string, and the HTML parser lowercases their names. A camelCase DOM property like
defaultValue,classNameorhtmlForbecomes a deaddefaultvalueattribute, while VDOM sets the property (playground). For example, the PrimeVue sakai-vue starter has<div className="card">, and a reka-ui story has<textarea defaultValue>.isRuntimeOnlyPropnow keeps such a key out of the template outside SVG, unless the lowercased name is the attribute behind the property (tabIndex), the sameisKnownHtmlAttrcheck thatstringifyStaticuses. Templates without these keys compile as before.