core icon indicating copy to clipboard operation
core copied to clipboard

fix(vapor): use modelValueModifiers instead of modelModifiers

Open zhiyuanzmj opened this issue 8 months ago โ€ข 3 comments

When defineModel() and defineModel('model') co-usage, will got duplicated modifiers. This is also effect Volar to infer modifiers type, so modelModifiers should be change to modelValueModifiers

REPL

image image

zhiyuanzmj avatar Mar 19 '25 10:03 zhiyuanzmj

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@13070
@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@13070
@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@13070
@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@13070
@vue/compiler-vapor

npm i https://pkg.pr.new/@vue/compiler-vapor@13070
@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@13070
@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@13070
@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@13070
@vue/runtime-vapor

npm i https://pkg.pr.new/@vue/runtime-vapor@13070
@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@13070
@vue/shared

npm i https://pkg.pr.new/@vue/shared@13070
vue

npm i https://pkg.pr.new/vue@13070
@vue/compat

npm i https://pkg.pr.new/@vue/compat@13070

commit: dd15262

pkg-pr-new[bot] avatar Mar 19 '25 10:03 pkg-pr-new[bot]

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 84.9 kB (+73 B) 29.8 kB (+28 B) 26.3 kB (+8 B)
runtime-dom.global.prod.js 107 kB (+7 B) 40.2 kB (+7 B) 36.2 kB (+30 B)
vue.global.prod.js 165 kB (+9 B) 60.1 kB (+10 B) 53.5 kB (+44 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47.9 kB (+13 B) 18.7 kB (+10 B) 17.1 kB (+14 B)
createApp 57 kB (+13 B) 21.9 kB (+11 B) 20 kB (+14 B)
createApp + vaporInteropPlugin 90.4 kB (+13 B) 33.8 kB (+9 B) 30.5 kB (-51 B)
createVaporApp 34 kB (+13 B) 13 kB (+8 B) 11.9 kB (+6 B)
createSSRApp 61.3 kB (+13 B) 23.7 kB (+9 B) 21.6 kB (+10 B)
defineCustomElement 62.6 kB (+13 B) 23.6 kB (+12 B) 21.5 kB
overall 72.1 kB (+13 B) 27.3 kB (+11 B) 24.9 kB (-1 B)

github-actions[bot] avatar Mar 19 '25 10:03 github-actions[bot]

[!IMPORTANT]

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

โœจ Finishing touches
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jun 17 '25 13:06 coderabbitai[bot]

Deploy Preview for vapor-repl ready!

Name Link
Latest commit f3b3cbd6bd64c49b3227a3ada3ae237a05e7d055
Latest deploy log https://app.netlify.com/projects/vapor-repl/deploys/6866b4eb259d510008c46c95
Deploy Preview https://deploy-preview-13070--vapor-repl.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jul 03 '25 14:07 netlify[bot]

So what if I define a model called model$?

KazariEX avatar Jul 03 '25 15:07 KazariEX

Only hope no one to do it ๐Ÿ˜”.

zhiyuanzmj avatar Jul 03 '25 15:07 zhiyuanzmj

So what if I define a model called model$?

Should be avoidable if using modelModifiers$ instead?

yyx990803 avatar Jul 03 '25 15:07 yyx990803

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.

KazariEX avatar Jul 03 '25 15:07 KazariEX

And the dynamic modelName also has problems.

zhiyuanzmj avatar Jul 03 '25 15:07 zhiyuanzmj

It's indeed a past design mistake so we have to absorb the complexity to avoid breaking changes.

yyx990803 avatar Jul 03 '25 16:07 yyx990803

Done.

zhiyuanzmj avatar Jul 03 '25 16:07 zhiyuanzmj