Skip to content

Add support for typed custom-elements and web-components - #1016

Draft
NullVoxPopuli wants to merge 7 commits into
mainfrom
nvp/test-typed-custom-elements
Draft

Add support for typed custom-elements and web-components#1016
NullVoxPopuli wants to merge 7 commits into
mainfrom
nvp/test-typed-custom-elements

Conversation

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

Resolves #808

@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label Nov 3, 2025
@NullVoxPopuli NullVoxPopuli changed the title Add test for custom element types Add support for typed custom-elements and web-components Nov 3, 2025
@NullVoxPopuli
NullVoxPopuli force-pushed the nvp/test-typed-custom-elements branch from c5855c2 to 5fa525f Compare December 29, 2025 15:56
@NullVoxPopuli-ai-agent

Copy link
Copy Markdown
Contributor

Superseded by #1212, which rebuilds this on current main (name-keyed registries: GlintCustomElementTagNameMap + GlintCustomElementAttributesMap).

NullVoxPopuli-ai-agent added a commit to NullVoxPopuli-ai-agent/glint that referenced this pull request Jul 28, 2026
Adds two global registries to @glint/template:

- GlintCustomElementTagNameMap: tag name -> element instance type
  (mirroring HTMLElementTagNameMap), giving registered custom elements
  a real element type for modifiers, ...attributes, and hover info.
- GlintCustomElementAttributesMap: tag name -> accepted attributes,
  checked strictly when registered.

Plain elements now resolve their attributes from the tag name they were
written with (via a new applyTagAttributes DSL function and name/attributes
members on the emitElement result) rather than from the element instance
type, so attributes can be registered for a tag without registering the
element type. Components keep resolving attributes from their signature's
Element type, now with a reverse lookup into the custom element registry
and a graceful fallback for unregistered Element subclasses (previously
the lookup produced 'never', rejecting every attribute).

Resolves typed-ember#808
Supersedes typed-ember#1016

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[main] No type information for elements, custom-elements

2 participants