Skip to content

Feat/types props#136

Open
UpperCod wants to merge 4 commits into
masterfrom
feat/types-props
Open

Feat/types props#136
UpperCod wants to merge 4 commits into
masterfrom
feat/types-props

Conversation

@UpperCod

@UpperCod UpperCod commented Jul 4, 2026

Copy link
Copy Markdown
Member

We integrated property casting using type<T>() and compile-time validation for default values, ensuring type safety in runtime configurations. To resolve compiler hangs (OOMs) and restore instant IDE autocomplete, we removed expensive dynamic globalThis scans and replaced wildcard template literal checks in DOMCleanKeys with static Exclude types.

Improvements:

  • Safe, zero-boilerplate default value validation.
  • TS compilation time reduced from infinite loop hangs to < 6 seconds.
  • Instant, lightweight editor autocomplete.

Changelog - Last 3 Commits

1. perf(types): optimize DOMCleanKeys [2480fdb]

  • Replaced dynamic template literal patterns (add${string}) in DOMCleanKeys with a static Exclude over native DOM prototypes.
  • Prevents expensive string pattern matching in JSX for 150+ HTML/SVG tags.

2. feat: type support for props, TS7 & compile optimization [3a21232]

  • Integrated type<T>() to validate that value() return type matches type.
  • Replaced dynamic GlobalConstructors lookup (resolving IDE hangs and OOMs) with abstract new types.
  • Wrapped ValidateProp checks in tuples to prevent incorrect union distribution.
  • Removed deprecated compiler options (baseUrl) to support TypeScript 7.
  • Reduced test:ts compile time from infinite loop/hang to < 6 seconds.

3. feat: initial prop type support [26d1cd0]

  • Initial creation and export of the type helper at runtime and type signatures.

UpperCod added 4 commits June 14, 2026 19:47
…compilation

- Added type<T>() casting helper and validation of default property values.
- Replaced dynamic globalThis / GlobalConstructors filtering with a high-performance abstract new constructor type, resolving TS Server hangs/OOMs and restoring instant IDE type inference.
- Wrapped ValidateProp check in a tuple to prevent unwanted union type distribution.
- Updated compiler settings to support TypeScript 6/7 guidelines (removed deprecated baseUrl and legacy module options).
- Fixed static type checking tests to match strict rules.

Gains:
- Compilation time for test:ts reduced from hanging/infinite loop to ~5 seconds.
- Instant, lightweight autocomplete and type inference in IDEs.
…namic template literal unions

- Replaced the extensive list of dynamic template literal patterns in DOMCleanKeys with a single Exclude expression over standard DOM properties (HTMLElement, Element, Node, ChildNode, and DOMGenericProperties).
- Prevents expensive string pattern matching for each of the 150+ HTML and SVG tags in JSXElements.
- Restores fast static type checking and resolves compiler overhead.
…nents without props

- Removed default type parameter `= SchemaComponentConfig<Props>` from Config in C (component.d.ts). This ensures unconfigured components default to SchemaComponentGenericConfig (empty props) instead of falling back to the wide PropTypes union.
- Changed DOMUnknown index signature value from any to unknown (dom.d.ts) to prevent the intersection from turning specific properties (like onclick) into any.
- Loosened JSXProps constraint to Atomico<any> (dom.d.ts) to match custom element constructors regardless of configuration arguments.
- Removed the temporary `: any` type cast in component-without-props.tsx.

This restores correct type resolution of ev.currentTarget to the custom element instance (e.g. AtomicoThis) on components without props.
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

Successfully merging this pull request may close these issues.

1 participant