fix(vapor): v-model and v-model:model co-usage#13070
Conversation
@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
|
85a90cc to
9df9281
Compare
|
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 You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
yyx990803
left a comment
There was a problem hiding this comment.
This edge case isn't worth the potential breakage, especially when the changes not only affect vapor but also vdom mode.
We can do something in reverse - special case when the model name is "model"
- generate the prop key as
model$Modifiers - in
getModelModifiers, also special case it
Not as clean as aligning with modelValue, but it prevents any possible breakage.
✅ Deploy Preview for vapor-repl ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
So what if I define a model called |
|
Only hope no one to do it 😔. |
Should be avoidable if using |
|
I think that adding more technical debt here is not ideal. This is where the complexity of the codebase starts to spiral. We should bear the cost of our past design mistakes. This modification even resulted in two locations where this feature behaved inconsistently. |
|
And the dynamic modelName also has problems. |
|
It's indeed a past design mistake so we have to absorb the complexity to avoid breaking changes. |
|
Done. |
When
defineModel()anddefineModel('model')co-usage, will got duplicated modifiers.This is also effect Volar to infer modifiers type, so modelModifiers should be change to modelValueModifiers
REPL