-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(compiler-vapor): camelize kebab-case component event handlers #14211
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the Vapor compiler to properly camelize kebab-case component event handlers, aligning its behavior with the standard Vue compiler. Previously, kebab-case event names like @update-model were incorrectly kept as "onUpdate-model" instead of being converted to onUpdateModel.
Key Changes:
- Apply
camelizetransformation to static event handler keys before converting them to handler format - Update existing test expectations to reflect the corrected behavior
- Add new test case specifically for kebab-case event handler camelization
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/compiler-vapor/src/generators/prop.ts | Imports camelize and applies it to static handler keys before toHandlerKey conversion |
| packages/compiler-vapor/tests/transforms/vOn.spec.ts | Updates test expectation for @update-model to generate camelized onUpdateModel and adds new test for kebab-case camelization |
| packages/compiler-vapor/tests/transforms/snapshots/vOn.spec.ts.snap | Updates snapshots to reflect corrected camelized output for kebab-case handlers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.