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

Catalyst Plugin: attribute names aren't dasherised #186

Open
1 of 2 tasks
keithamus opened this issue Sep 26, 2022 · 1 comment
Open
1 of 2 tasks

Catalyst Plugin: attribute names aren't dasherised #186

keithamus opened this issue Sep 26, 2022 · 1 comment

Comments

@keithamus
Copy link

Checklist

  • Did you run the analyzer with the --dev flag to get more information?
  • Did you create a minimal reproduction in the playground?

Playground link

Catalyst attributes are dasherised when serialised to HTML, which the Catalyst plugin does not quite properly reflect.

Expected behavior

The following code:

import { controller, attr } from '@github/catalyst'

@controller
class HelloWorldElement extends HTMLElement {
  @attr fooBar = 'hello'
}

Would result in an attribute of data-foo-bar in Catalyst 1.x and an attribute of foo-bar in 2.x and so the attributes json should be:

          "attributes": [
            {
              "name": "data-foo-bar", // just `foo-bar` in v2
              "type": {
                "text": "string"
              },
              "default": "'hello'",
              "fieldName": "fooBar"
            }
          ],

Actual behavior

The generated manifest has the following:

          "attributes": [
            {
              "name": "fooBar",
              "type": {
                "text": "string"
              },
              "default": "'hello'",
              "fieldName": "fooBar"
            }
          ],
@thepassle
Copy link
Member

@keithamus Could you take a look at this PR to make sure I got it right? 🙂 Thanks #188

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

No branches or pull requests

2 participants