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

Support for hyphenated component names #301

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

diarmidmackenzie
Copy link
Contributor

@diarmidmackenzie diarmidmackenzie commented Nov 19, 2021

A candidate fix for:
#296

Not sure if you'll like this solution, as it's pragmatic rather than being 100% robust...

Other solutions I considered:

  • Duplicating the entire styleParser code out of A-Frame utils into event-set, except for the camel casing. That seemed unwieldy.
  • Changing the A-Frame utils API to either export the styleParse function or have an optional parameter on styleParse.parse to control whether or not camel casing happened. I was hoping for a fix that was contained within this repo, rather than having dependencies on another repo, with all the version issues that would ensue...

So having ruled out those two approaches, I ended up using A-Frame utils styleParser.parse, and then patching up the results as best I could.

As per the comments in the index.js file, that's not a 100% robust solution, but much better than the current implemetation. The problematic cases are all fairly pathological...

@diarmidmackenzie
Copy link
Contributor Author

@dmarcos - Any comments on this?

@isaac-pj
Copy link

isaac-pj commented May 6, 2023

Maybe the better solution will be fix this on aframe changing the AFRAME.utils.styleParser.stringify() to return with dash. So, with this, the aframe-event-set-component could to use stringify on props to return. The parser transforms to camel case and stringify dosn't come back to kebab case is a strange behavior.

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

Successfully merging this pull request may close these issues.

None yet

2 participants