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

allow uppercase elements in strict mode #1650

Conversation

patricklx
Copy link
Contributor

@patricklx patricklx commented Nov 6, 2024

this would allow to have web components elements with upper case style.

right below the code it actually says In strict mode, values are always elements unless they are in scope
so lets make it that way. This would make it possible for non-browser env to use upper case elements, like ember-native. Maybe it could be configurable?

@NullVoxPopuli NullVoxPopuli merged commit aefd600 into glimmerjs:main Nov 6, 2024
5 checks passed
@patricklx patricklx deleted the allow-uppercase-elements-in-strict-mode branch November 6, 2024 16:20
@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Nov 6, 2024

Have to revert, apologies. This accidentally blocks <Style> from becoming a keyword -- something we are entertaining the idea of here: emberjs/rfcs#1037

@patricklx -- can you expand on why you wanted this?

It's possible my assumptions about this removal don't align with your motivations

@wycats
Copy link
Contributor

wycats commented Nov 6, 2024

@patricklx I'd be very interested to learn how you encountered this? What were you trying to do?

@patricklx
Copy link
Contributor Author

patricklx commented Nov 6, 2024

Just a web component.

<template>
  Hello, Glimmer!
  <MyWebComponent />
</template>

https://share.glimdown.com/jnNZc45SRtWdT93u7GXt5Q

Edit: just noticed that web components must start with lower case. I thought it was limited only by glimmer...
But still, for ember-native it would be useful

This affects https://github.com/ember-native/ember-native
Where all nativescript components are dom elements.
By default nativescript writes them with upper case. I wanted to have it work the same .
And it strict mode everything that is not in scope could just be rendered as html element.
Why should randomElementName work, but not RandomElementName? In strict mode. gjs.

I'm not sure how this would block the Style keyword.
It would need code changes in glimmer anyway? A element keyword looks like a new concept. Could it not be something importable? (Well, maybe this part is for the other discussion)
If it is uppercase then the usage of it is currently blocked :D, if it doesn't have an import.

@github-actions github-actions bot mentioned this pull request Nov 7, 2024
@patricklx patricklx restored the allow-uppercase-elements-in-strict-mode branch November 9, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants