fix(compiler-vapor): merge component v-model onUpdate handlers#14229
fix(compiler-vapor): merge component v-model onUpdate handlers#14229edison1105 merged 3 commits intominorfrom
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 You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@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: |
There was a problem hiding this comment.
Pull request overview
This PR fixes the merging of component v-model onUpdate:* handlers with explicitly provided handlers of the same name. When a component has both v-model and an explicit @update:modelValue handler, they are now correctly merged into an array of handlers instead of overwriting each other.
Key changes:
- Refactored handler generation to group handlers by key name and merge multiple handlers into arrays
- Split the
extraWrapparameter ingenEventHandlerinto two separate parameters (asComponentPropandextraWrap) for clearer semantics - Moved v-model event handler and modifier generation from
genPropintogenStaticPropsfor proper deduplication
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/compiler-vapor/src/generators/event.ts |
Split extraWrap parameter into asComponentProp and extraWrap for clarity; updated comments and logic |
packages/compiler-vapor/src/generators/component.ts |
Refactored genStaticProps to group and merge handlers by key; moved v-model handler generation; removed genModelEvent and genModelModifiers helper functions; updated genDynamicProps to handle v-model with dynamic arguments |
packages/compiler-vapor/__tests__/transforms/vModel.spec.ts |
Added test for merging v-model with explicit @update:modelValue handler; added transformVOn to test configuration; updated existing test expectations |
packages/compiler-vapor/__tests__/transforms/__snapshots__/vModel.spec.ts.snap |
Updated snapshots with improved formatting and new test case snapshot showing merged handlers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.