-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(vapor): v-model and v-model:model co-usage #13070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: minor
Are you sure you want to change the base?
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 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we can extract a shared function
// explain why this is needed and link to this PR
function getModifierPropName(key) {
return `${key}Modifiers${key === 'model' ? '$' : ''}`
}
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