Outlets array expects kebab-cased names instead of camel-cased ones (like targets do)
See original GitHub issueIf you have a target name which consists of multiple words, you’ll define your targets as follows:
static targets = [ "errorMessage" ]
An outlet name with multiple words, has to be defined the following way:
static outlets = [ "error-message" ]
If this is the intended behaviour, it would be nice to add a small notice to the documentation. Thanks!
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Issues · hotwired/stimulus
Issues list. Feature request: polymorphic outlets ... Outlets array expects kebab-cased names instead of camel-cased ones (like targets do).
Read more >stimulusjs
Outlets array expects kebab-cased names instead of camel-cased ones (like ... If I have two of the same controllers nested, the action does...
Read more >Kebab vs. camel case: How these naming conventions differ
Both kebab case and camel case are naming conventions that try make it easier to read compound words that form a single variable...
Read more >Stringy: Golang String Manipulation Helper Package - Morioh
Stringy: Golang String manipulation helper package. Convert string to camel case, snake case, kebab case / slugify, custom delimiter, pad string, ...
Read more >Convert kebab-case to camelCase with JavaScript
You can also try regex. camelize = s => s.replace(/-./g, x=>x[1].toUpperCase()). Looks only for hyphen followed by any character, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I generally agree with the alignment with the targets api. However, I have one concern. If outlets are written in CamelCase, there is no way to distinguish between
--
and-
.before:
after
Originally, outlet getter had this problem. However, it used to be discernible at the time of definition and it was predictable that the two would be mixed.
Wouldn’t it be difficult to work backwards from the outlets static property to the controller name, given the existence of
--
and-
in the first place?Would be happy to ship a quick 3.2.2 that addresses this. If there was a way to detect kebab case, still have it work with a warning of depreciation, and then document and recommend camel going forward, that would be great.