refactor(shared): relocate the Databricks SDK facade to shared - #534
Merged
Conversation
Move the workspace-client facade from packages/appkit/src/workspace-client to packages/shared/src/workspace-client so both appkit and the CLI (which lives in shared) reach the SDK through one sanctioned import site. - appkit's workspace-client becomes a thin re-export from shared/workspace-client; its ~47 importers are unchanged. - biome noRestrictedImports allow-list repoints to the new location. - shared gains the @databricks/sdk-experimental dep and a ./workspace-client export (tsdown entry added so it's emitted independently); appkit drops the now-unused direct SDK dep. - Adds a `profile` option to WorkspaceClientOptions. Pure relocation — no behavior change beyond the additive `profile` option. Extracted from the registry-CLI work so it can land on its own. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Contributor
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 869 KB (-569 B) | 303 KB (-98 B) |
| Type declarations | 315 KB (+379 B) | 109 KB (+221 B) |
| Source maps | 1.7 MB (+303 B) | 566 KB (+121 B) |
| Other | 11 KB | 3.7 KB |
| Total | 2.9 MB (+113 B) | 982 KB (+244 B) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
88 KB (+8 B) | 2.5 KB | 91 KB (+8 B) | external | 288 KB (+30 B) |
./beta |
49 KB (-2 B) | 459 B (+1 B) | 49 KB (-1 B) | external | 143 KB (+31 B) |
./type-generator |
21 KB (+33 B) | 0 B | 21 KB (+33 B) | external | 61 KB (+30 B) |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 84 KB |
. |
utils.js |
initial | 4.0 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 33 KB |
./beta |
stream-manager.js |
initial | 5.8 KB |
./beta |
wide-event-emitter.js |
initial | 3.2 KB |
./beta |
databricks.js |
initial | 3.0 KB |
./beta |
configuration.js |
initial | 2.1 KB |
./beta |
service-context.js |
initial | 1.3 KB |
./beta |
client.js |
initial | 425 B |
./beta |
client-options.js |
initial | 219 B |
./beta |
supervisor-api.js |
lazy | 194 B |
./beta |
databricks.js |
lazy | 142 B |
./beta |
index.js |
lazy | 123 B |
./type-generator |
index.js |
initial | 21 KB |
@databricks/appkit-ui
npm tarball (packed): 342 KB (+351 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 390 KB | 130 KB |
| Type declarations | 228 KB (+412 B) | 83 KB (+360 B) |
| Source maps | 753 KB | 248 KB |
| CSS | 16 KB | 3.3 KB |
| Total | 1.4 MB (+412 B) | 465 KB (+360 B) |
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
./js |
5.3 KB | 49 KB | 55 KB | 208 KB | 14 KB |
./js/beta |
20 B | 0 B | 20 B | 0 B | 0 B |
./react |
432 KB | 49 KB | 480 KB | 1.3 MB | 175 KB |
./react/beta |
1.0 KB | 0 B | 1.0 KB | 0 B | 1.9 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
./js |
index.js |
initial | 5.2 KB |
./js |
chunk |
initial | 120 B |
./js |
apache-arrow |
lazy | 49 KB |
./js/beta |
beta.js |
initial | 20 B |
./react |
index.js |
initial | 430 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 1.0 KB |
Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 31722181182 -R databricks/appkit -n appkit-template-0.60.0-pr.cfecf1c-feat-workspace-client-shared-534 -D appkit-pr-534 \
&& unzip -o "appkit-pr-534/appkit-template-0.60.0-pr.cfecf1c-feat-workspace-client-shared-534.zip" -d "appkit-pr-534" \
&& databricks apps init --template "appkit-pr-534"The template pins |
The workspace-client facade re-exported runtime values from the `shared/workspace-client` subpath. tsdown resolves that subpath export to shared's built dist and, under unbundle, leaves it as a bare `shared/workspace-client` import; dist-appkit then drops the `shared` dependency, so the published tarball fails with ERR_MODULE_NOT_FOUND at `appkit generate-types`. Route the values through the `shared` root instead (the import style the bundler inlines). Only values move to the root — the SDK `sql` type would collide with the `sql` query helper from ./sql, so workspace-client types stay on the subpath (type-only, no runtime cost). Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Routing the workspace-client values through the `shared` root pulls @databricks/sdk-experimental (a Node-only SDK) into shared's export graph, so the docs' webpack client build failed trying to bundle fs/crypto/stream/etc. appkit is a Node package and the docs only reference its API — they never run the SDK in the browser — so stub every Node builtin via resolve.fallback and strip the node: scheme prefix. fallback only triggers on unresolvable modules, so the Node-target server bundle is unaffected. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
atilafassina
approved these changes
Aug 14, 2026
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.
What
Moves the workspace-client facade from
packages/appkit/src/workspace-clienttopackages/shared/src/workspace-client, so bothappkitand the CLI (which lives inshared) reach@databricks/sdk-experimentalthrough one sanctioned import site.Why
Split out of the registry-CLI branch (
feat/registry-cli) so this broadly-reaching relocation — it touches appkit's ~47 SDK-facade importers — can be reviewed and merged on its own, ahead of the feature work that depends on it.Changes
shared/src/workspace-client/*— the facade (moved; git shows renames).appkit/src/workspace-client/index.ts— now a thin re-export fromshared/workspace-client; the 6 facade files are gone. Its importers are unchanged.biome.json—noRestrictedImportsSDK allow-list repointed to the new location.shared/package.json— adds@databricks/sdk-experimental+ a./workspace-clientexport (tsdown entry added so it's emitted independently).appkit/package.json— drops the now-unused direct SDK dep.profileoption toWorkspaceClientOptions.Pure relocation — no behavior change beyond the additive
profileoption.Verification
shared+appkittypecheck cleanpnpm install --frozen-lockfilematches