-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix path matching types getting lost in recursive types (#354)
## Summary <!-- Succinctly describe your change, providing context, what you've changed, and why. --> Fixes a "_Type instantiation is excessively deep and possibly infinite_" bug when attempting to generate paths for events with recursive types, such as a common `JsonValue` type. ```ts type JsonObject = { [Key in string]?: JsonValue }; type JsonArray = Array<JsonValue>; type JsonValue = | string | number | boolean | JsonObject | JsonArray | null; ``` We refactor the way paths are generated a little here, most notably ensuring we skip known deep/recursive types and don't needlessly iterate those we've seen before. ## Checklist <!-- Tick these items off as you progress. --> <!-- If an item isn't applicable, ideally please strikeout the item by wrapping it in "~~"" and suffix it with "N/A My reason for skipping this." --> <!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" --> - [ ] ~~Added a [docs PR](https://github.com/inngest/website) that references this PR~~ N/A Bug fix - [x] Added unit/integration tests - [x] Added changesets if applicable
- Loading branch information
1 parent
933b998
commit e2f68d6
Showing
6 changed files
with
108 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"inngest": patch | ||
--- | ||
|
||
Fix path matching types getting lost in certain recursive event types |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.