Repository navigation
fix(compiler-vapor): parenthesize loose conditions in the className fast path - #15709
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 ⚙️ 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
|
|
Could we simply parenthesize every generated condition here instead of checking AST types?
Always emitting |
|
Good catch, thanks. Every condition is now parenthesized (e9c82c9), and the test covers the inline |
The
setClassNamefast path from #14803 inlines each class condition as the test ofcond ? bit : 0without parentheses. A condition that binds looser than that test, such as a ternary, an assignment or an arrow, swallows? bit : 0and the wrong class is rendered. Real case: wordle_plus App.vue with{ correct: el.correct ? true : false, hint: el.hint ? true : false, ... }, where a hint tile getscorrect. PlaygroundSuch conditions are now wrapped in parentheses. Output for other conditions is unchanged.