-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fluent extensions, throws extension, gen static interfaces #1107
Merged
Conversation
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
jasonkuhrt
changed the title
perf: generate root method definitions
perf: generate a more static client interface
Sep 19, 2024
6 tasks
jasonkuhrt
changed the title
perf: generate a more static client interface
feat: fluent extensions, throws extension, gen static interfaces
Sep 23, 2024
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.
This PR is a major re-architecting of the generator system motivated by pursuing best possible (practical) IDE performance.
The major change is moving as much as possible to generation time:
One disadvantage of this approach is that extensions will not have core schema types that are fully dog-fooded internally as well. That drift may lead to core schema types being removed (because they become unused internally) or a degree toward there. Perhaps a way to make up for this is enabling extensions to tap into the CLI generator. For exampleOrThrow
emitting types instead of using in-memory type transformations.One unintentional advantage is that we now can generate awesome JSDoc. This is actually a significant benefit in its own right.
Additional work on this PR came about in order to re-realize the
OrThrow
extension. I devised a way to extend the fluent chain in a type-safe way that I'm actually rather proud of (perf seems ok too!). Internally now each fluent method is actually entirely modular and that ability now gets exposed to extensions. Therefore we changed the OrThrow extension into something much simpler that just adds a chaining method calledthrows()
. Everything about it became simpler and its IDE perf is much better too. 🤩Also closes #1104