0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 02:51:10 +08:00
discourse/frontend
Sérgio Saquetim 87fab4376c
DEV: Type the d-element dynamic-tag helper (#41687)
d-element (dynamic-tag-name helper, a userland RFC389 stand-in) was
untyped, so every consumer received its result as effectively `any`.
This converts it to .gts and gives it a real signature.

Two overloads: a tag-keyed generic over `keyof HTMLElementTagNameMap`
types the wrapper with the exact element, so consumers get per-tag
attribute checking (`href` on an anchor, `disabled` on a button). A
`string` fallback covers the empty-string pass-through and dynamic tag
names, where only global attributes are known.

Glint distributes attribute checking across a union element, so a
runtime-chosen tag such as `dElement(href ? "a" : "button")` (used by
d-button) accepts any attribute valid on either arm while still
rejecting unknown ones. Existing type-checked consumers keep compiling
and now gain real checking.

Each internal shortcut template gets an explicit `TemplateOnlyComponent`
signature. The classic-component fallback stays `@glint-nocheck` because
`@ember/component` has no Glint types. Runtime behavior is unchanged;
only an unreachable null branch was removed. Adds a compile-time
type-test under `type-tests/`.
2026-07-15 11:13:42 -03:00
..
asset-processor DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
deprecation-silencer
discourse DEV: Type the d-element dynamic-tag helper (#41687) 2026-07-15 11:13:42 -03:00
discourse-i18n DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
discourse-markdown-it DEV: Bump eslint/lint-configs, and correct violations (#41321) 2026-07-01 10:39:57 +01:00
discourse-types DEV: Use bundler module resolution for @discourse/types consumers (#41661) 2026-07-13 21:43:39 -03:00
pretty-text DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
.npmrc
polyfills.js