forked from rdkcentral/Lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue that affected the original tag() implementation and hence a…
…lso the new getByRef() implementation... Using tag() on a Component that has a lower-case property of instance type `Element` or `Component` in its TemplateSpec resulted in tag() causing a very strange error due to "circular references". The new getByRef() implementation is based on how tag() originally worked and saw the same exact issue. The error was tracked back to IsTerminus<T> returning `false` for any instance type of `Element` or `Component` and the fact that SpecToTagPaths<T> did not filter out lower-case properties. This resulted in SpecToTagPaths<T> recursively entering a lower-case `Element`/`Component` property (which is where it should have actually terminated recursion at) and then further recursively enter the instance's `stage`, `application`, `ctx`, etc properties ultimately resulting in a circular reference. SpecToTagPaths<T> now only returns paths for upper case ValidRef properties. And IsTerminus<T> returns true for `Element` and `Component`. I've also moved many of the internal type functions that existed in Element.d.mts into internalTypes.d.mts and added comprehensive unit tests for each of them. I've also added a test for the fixed scenario that was originally untested in components-strong-typing.test-d.ts. This has also been tested with the TypeScript version of TMDB which is how I originally found the issue.
- Loading branch information
1 parent
69152bb
commit dc5a168
Showing
6 changed files
with
596 additions
and
213 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.