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

Should the camelCase filter be required for Lit? #202

Open
fpsvogel opened this issue May 3, 2023 · 0 comments
Open

Should the camelCase filter be required for Lit? #202

fpsvogel opened this issue May 3, 2023 · 0 comments

Comments

@fpsvogel
Copy link

fpsvogel commented May 3, 2023

Near the bottom of the Lit example page, the third-to-last bullet point reads:

customElement (or custom_element) calls are converted to customElements.define calls.

The "or custom_element" part is only true if the camelCase filter has been added.

When I create a new Bridgetown (1.3beta1) site using the bundled configurations for Lit and Ruby2JS (using its preset options), then copy the Lit example into my site's src/_components and add the element to the homepage, I get this error in the browser console when viewing any page:

Uncaught ReferenceError: custom_elements is not defined
    rb hello_world.js.rb:9
    ...

If I add the camelCase filter to the Ruby2JS config file, the error is gone and the component displays normally.

My question is, should the camelCase filter be required for Lit elements to be transpiled correctly? It seems not, based on that bullet point I quoted above, but if this is actually the way it's intended to be, then in Bridgetown 1.3 maybe the bundled configurations should add the camelCase filter automatically whenever the lit filter is added.

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

1 participant