mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 02:51:10 +08:00
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/`. |
||
|---|---|---|
| .. | ||
| asset-processor | ||
| deprecation-silencer | ||
| discourse | ||
| discourse-i18n | ||
| discourse-markdown-it | ||
| discourse-types | ||
| pretty-text | ||
| .npmrc | ||
| polyfills.js | ||