Skip to content

refactor(shared): relocate the Databricks SDK facade to shared - #534

Merged
MarioCadenas merged 3 commits into
mainfrom
feat/workspace-client-shared
Aug 14, 2026
Merged

refactor(shared): relocate the Databricks SDK facade to shared#534
MarioCadenas merged 3 commits into
mainfrom
feat/workspace-client-shared

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

What

Moves 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 @databricks/sdk-experimental through 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 from shared/workspace-client; the 6 facade files are gone. Its importers are unchanged.
  • biome.jsonnoRestrictedImports SDK allow-list repointed to the new location.
  • shared/package.json — adds @databricks/sdk-experimental + a ./workspace-client export (tsdown entry added so it's emitted independently).
  • appkit/package.json — drops the now-unused direct SDK dep.
  • Adds a profile option to WorkspaceClientOptions.

Pure relocation — no behavior change beyond the additive profile option.

Verification

  • shared + appkit typecheck clean
  • workspace-client tests pass (5)
  • appkit build clean (attw + publint: no issues)
  • biome clean; pnpm install --frozen-lockfile matches

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>
@MarioCadenas
MarioCadenas requested a review from a team as a code ownerAugust 13, 2026 14:54
@github-actions

github-actionsBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size report

Compared against bundle-size-baseline.json (main).

@databricks/appkit

npm tarball (packed): 840 KB (+161 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

distrawgzip
JS (runtime)869 KB (-569 B)303 KB (-98 B)
Type declarations315 KB (+379 B)109 KB (+221 B)
Source maps1.7 MB (+303 B)566 KB (+121 B)
Other11 KB3.7 KB
Total2.9 MB (+113 B)982 KB (+244 B)
Per-entry composition (own code — deps external (as shipped))
EntryInitial (gz)Lazy (gz)Total (gz)node_modules (min)Own code (min)
.88 KB (+8 B)2.5 KB91 KB (+8 B)external288 KB (+30 B)
./beta49 KB (-2 B)459 B (+1 B)49 KB (-1 B)external143 KB (+31 B)
./type-generator21 KB (+33 B)0 B21 KB (+33 B)external61 KB (+30 B)

Chunks:

EntryChunkLoadSize (gz)
.index.jsinitial84 KB
.utils.jsinitial4.0 KB
.remote-tunnel-manager.jslazy2.5 KB
./betabeta.jsinitial33 KB
./betastream-manager.jsinitial5.8 KB
./betawide-event-emitter.jsinitial3.2 KB
./betadatabricks.jsinitial3.0 KB
./betaconfiguration.jsinitial2.1 KB
./betaservice-context.jsinitial1.3 KB
./betaclient.jsinitial425 B
./betaclient-options.jsinitial219 B
./betasupervisor-api.jslazy194 B
./betadatabricks.jslazy142 B
./betaindex.jslazy123 B
./type-generatorindex.jsinitial21 KB

@databricks/appkit-ui

npm tarball (packed): 342 KB (+351 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

distrawgzip
JS (runtime)390 KB130 KB
Type declarations228 KB (+412 B)83 KB (+360 B)
Source maps753 KB248 KB
CSS16 KB3.3 KB
Total1.4 MB (+412 B)465 KB (+360 B)
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
EntryInitial (gz)Lazy (gz)Total (gz)node_modules (min)Own code (min)
./js5.3 KB49 KB55 KB208 KB14 KB
./js/beta20 B0 B20 B0 B0 B
./react432 KB49 KB480 KB1.3 MB175 KB
./react/beta1.0 KB0 B1.0 KB0 B1.9 KB

Chunks:

EntryChunkLoadSize (gz)
./jsindex.jsinitial5.2 KB
./jschunkinitial120 B
./jsapache-arrowlazy49 KB
./js/betabeta.jsinitial20 B
./reactindex.jsinitial430 KB
./reacttslibinitial2.1 KB
./reactapache-arrowlazy49 KB
./react/betabeta.jsinitial1.0 KB

@github-actions

github-actionsBot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks 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 @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

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>
@MarioCadenas
MarioCadenas merged commit a20b992 into mainAug 14, 2026
10 checks passed
@MarioCadenas
MarioCadenas deleted the feat/workspace-client-shared branch August 14, 2026 07:36
MarioCadenas added a commit that referenced this pull request Aug 18, 2026
Post-rebase integration with main's biome->oxc migration (#538) and the
SDK-facade boundary rule (#534):
- Route the mlflow connector's auth through createWorkspaceClient instead
of importing @databricks/sdk-experimental directly (oxlint
no-restricted-imports); behaviour is unchanged.
- Apply oxfmt import grouping to the evals + connector files authored
before the migration.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@MarioCadenas@atilafassina