perf(appkit): collapse per-save typegen client churn in dev [F2]#424
Draft
atilafassina wants to merge 1 commit into
Draft
perf(appkit): collapse per-save typegen client churn in dev [F2]#424atilafassina wants to merge 1 commit into
atilafassina wants to merge 1 commit into
Conversation
Hardens the non-blocking typegen redesign (PR2 of the review-fix stack): make the dev hot path build one WorkspaceClient and issue one warehouse status RPC per save, instead of one apiece for every rapid edit. - query-registry.ts: construct WorkspaceClient lazily (memoized accessor) only on the blocking preflight / DESCRIBE paths. Non-blocking and all-cached runs now build zero clients. - vite-plugin.ts: one-waiter re-arm in armWarehouseWatch — rapid .sql saves coalesce onto the single in-flight watch (whose trailing blocking regenerate re-reads the folder) rather than each aborting + recreating a watch (client + probe per save). Sticky/escalate-only pendingMode so a coalesced non-blocking save can't downgrade a queued blocking describe. Tests: vite-plugin (single client+get per save, no fan-out on 5 saves, latch release, sticky mode); generate-queries (lazy client: zero on non-blocking/all-cached, exactly one shared across preflight+describe). Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
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.
PR2 of the typegen review-fix stack. Independent of PR1 (branches off
main).Scope: make the dev hot path build one
WorkspaceClientand issue onewarehouse status RPC per save (F2).
Changes
query-registry.ts— constructWorkspaceClientlazily via a memoizedaccessor, only on the blocking preflight / DESCRIBE paths. Non-blocking and
all-cached runs build zero clients; the blocking path builds exactly one,
shared by the preflight probe and the DESCRIBE batch.
vite-plugin.ts— one-waiter re-arm inarmWarehouseWatch: rapid.sqlsaves coalesce onto the single in-flight watch (its trailing blocking
regenerate re-reads the query folder) instead of each aborting + recreating a
watch (which fanned out a client + probe per save). Sticky/escalate-only
pendingModeso a coalesced non-blocking save can't downgrade a queuedblocking describe (real types still land).
Acceptance criteria (all asserted by tests)
.sqlsave → exactly oneWorkspaceClient+ onewarehouses.get.blocking describe.
WorkspaceClient.Checks
pnpm test(type-generator + shared CLI),pnpm -r typecheck,pnpm check,pnpm --filter @databricks/appkit build:packageall green.This pull request and its description were written by Isaac.