Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves AppKit’s type generator performance by parallelizing query schema discovery (DESCRIBE QUERY) and moving filesystem/cache operations to async APIs, reducing end-to-end type generation time in dev.
Changes:
- Add concurrent, batched DESCRIBE execution with cache writes per batch and consolidated spinner output.
- Switch cache, query reading, and output writing to
node:fs/promises. - Extend CLI spinner with an
update()method and update unit tests for the new async/concurrent behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/appkit/src/type-generator/vite-plugin.ts | Replace fs.existsSync usage with existsSync import. |
| packages/appkit/src/type-generator/tests/generate-queries.test.ts | Update tests/mocks for async fs, spinner updates, and batching behavior. |
| packages/appkit/src/type-generator/spinner.ts | Add Spinner.update() for progress text updates during concurrent runs. |
| packages/appkit/src/type-generator/query-registry.ts | Implement parallel query file reads and batched concurrent DESCRIBE execution with cache updates. |
| packages/appkit/src/type-generator/index.ts | Use async writeFile for generated type declarations. |
| packages/appkit/src/type-generator/cache.ts | Convert cache load/save to async and use node:fs/promises. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Run all queries concurrently.
In Dev Playground app (9 queries), this speeds up typegen from ~93 seconds to ~3 seconds
That's about ~30x faster
Before
Now
Improvements breakdown
Reducing network latency
Reduce FS io
Bonus
Add a perf measurement on debug to summarize cache HIT/MISS and time spent querying.