Feat/types props#136
Open
UpperCod wants to merge 4 commits into
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 dynamicglobalThisscans and replaced wildcard template literal checks inDOMCleanKeyswith staticExcludetypes.Improvements:
Changelog - Last 3 Commits
1. perf(types): optimize DOMCleanKeys [2480fdb]
add${string}) inDOMCleanKeyswith a staticExcludeover native DOM prototypes.2. feat: type support for props, TS7 & compile optimization [3a21232]
type<T>()to validate thatvalue()return type matchestype.GlobalConstructorslookup (resolving IDE hangs and OOMs) withabstract newtypes.ValidatePropchecks in tuples to prevent incorrect union distribution.baseUrl) to support TypeScript 7.test:tscompile time from infinite loop/hang to < 6 seconds.3. feat: initial prop type support [26d1cd0]
typehelper at runtime and type signatures.