Skip to content
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

fix(runtime-core): fix warning for missing event handler #8268

Closed
wants to merge 9 commits into from

Conversation

benkroeger
Copy link

fixes #4803
is a successor to #4804 due to the original fork not being available anymore

benkroeger and others added 9 commits November 8, 2021 09:22
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
This reverts commit d465288da200b79c198d5c50a2bf0347c99a36b7.
event handler props can be defined in camel and kebab cases

Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com>
Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com>
Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com>
Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com>
Comment on lines +104 to +105
`Component emitted event "${event}" but didn't declare a "${toHandlerKey(camelize(event))}" prop ` +
`or a "${camelize(event)}" emit option.`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this wording came from #4804 (comment), but I think the previous wording (with just the addition of camelize to the prop name) was better. In particular:

  1. The suggestion to use a prop should come last, as using emits is a much more common solution than using a prop.
  2. The suggested name for the emits option in this warning is currently incorrect. e.g. See Playground, which claims that updateFoo should be added to emits, even though it is already included. The check for event in emitsOptions a few lines up isn't using camelize, so the warning needs to be consistent with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

Warning when emitting kebab-cased custom event
2 participants