Repository navigation
enhance(rest): Faster type checking for RestEndpoint, resource() and extend() #4173
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1c9ba74
enhance(rest): Faster type checking for RestEndpoint, resource() and …
claude 698b471
docs(blog): Note faster TypeScript checking in v0.19
claude d66078d
test(rest): Commit extend/paginate/path type probes; simplify cleanups
claude e426394
docs: Update type-check numbers against latest master
claude 565035e
Merge master
claude 10d7312
docs(blog): Headline faster TypeScript in v0.19 post with charts and …
claude 063647c
docs(website): Show draft pages on Vercel preview deploys
claude 267a450
Merge remote-tracking branch 'origin/master' into claude/type-perf-q9…
claude 03b15ea
docs(blog): Use PerfChart for faster TypeScript results
claude 3fc327d
docs(website): Mark 1x in PerfChart and add visual PerfTable
claude a4be579
docs(website): Show PerfTable exact numbers on hover
claude c0cd88d
docs(website): Move PerfChart exact numbers into hover tooltips
claude c5fca9d
docs(website): Scroll PerfTable in place on narrow screens
claude 3970ebb
docs(website): Align neighboring PerfChart 1x lines and add tap tooltips
claude 4fc0411
docs(website): Decide PerfChart log scale from its own rows, not scal…
claude 53127e0
docs(blog): Compare faster TypeScript numbers with published v0.18.1
claude a1672f2
docs(website): Keep regressed rows visible on log-scale PerfCharts
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| '@data-client/rest': patch | ||
| '@data-client/endpoint': patch | ||
| '@data-client/graphql': patch | ||
| --- | ||
|
|
||
| Speed up TypeScript checking of `RestEndpoint`, `resource()` and `.extend()` | ||
|
|
||
| Editors and `tsc` check code that defines or calls endpoints faster and with less memory. In our stress tests, a file of 150 RestEndpoints with long paths, `.extend()` and `.paginated()` checked in about half the time (3.1s → 1.6s) and memory (345MB → 207MB). Files that use `resource()` with React or Vue hooks did 22-25% less type work. TypeScript reports the same errors as before. | ||
|
|
||
| On TypeScript 5.x and earlier, a `process(value, params)` method passed to `.extend()` no longer fails with "implicitly has an 'any' type" under `strict`, matching TypeScript 6+. TypeScript 4.0 also accepts a chained `.extend().extend()`. | ||
|
|
||
| ```ts | ||
| const getUser = new RestEndpoint({ path: '/users/:id', schema: User }); | ||
|
|
||
| // Before (TypeScript 5.x and earlier): error TS7006: Parameter 'value' implicitly has an 'any' type. | ||
| // After: no error | ||
| const getUserName = getUser.extend({ | ||
| process(value, params) { | ||
| return value.name; | ||
| }, | ||
| }); | ||
| ``` |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.