Conversation
Generate an HTTP-safe `api` facet per entity from the same column capability predicates the server uses to compile its CRUD contract, and bind the generated entries into both @databricks/appkit and @databricks/appkit-ui/js/beta. The status-to-category table and the list/record query encoder move to `shared` so both sides agree on them. `databaseApi.list` resolves routes from the boot payload, fails locally with NOT_EXPOSED for routes the server has not published, and throws a typed DatabaseApiError. The playground's BoardExplorer lists boards and notes through it, and CI type-checks the database components against the built appkit-ui declarations. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Complete the typed browser client with the detail route and the three write routes. `get`, `update`, and `remove` substitute the encoded id into the published `:id` route and exist only for entities with a public key. Writes send a JSON body with bigint values as decimal strings and resolve with the public row the server answers with; `remove` expects a 204. Create and update values reject private, generated, and undeclared fields at compile time, including fields a spread carries in, and JSON columns accept any object value. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Add a "Browser client (beta)" section to the database plugin page: setup through the generated database.d.ts, the five databaseApi calls and their routes, the accepted parameters and values, and the DatabaseApiError codes. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
The serving deprecation added `PluginManifest.deprecated` without regenerating docs/docs/api, so the docs build left a diff that fails CI's generated-docs check on every PR that touches packages/. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Contributor
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 1.2 MB (+3.0 KB) | 426 KB (+1.4 KB) |
| Type declarations | 443 KB | 161 KB (+3 B) |
| Source maps | 2.3 MB (+6.1 KB) | 800 KB (+2.4 KB) |
| Other | 11 KB | 3.7 KB |
| Total | 4.0 MB (+9.0 KB) | 1.4 MB (+3.8 KB) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
96 KB (+376 B) | 2.5 KB | 99 KB (+376 B) | external | 315 KB (+988 B) |
./beta |
93 KB (+100 B) | 457 B | 94 KB (+100 B) | external | 281 KB (+279 B) |
./testing |
38 KB (-1 B) | 31 KB (+347 B) | 69 KB (+346 B) | external | 202 KB (+988 B) |
./tsdown |
520 B | 0 B | 520 B | external | 813 B |
./type-generator |
23 KB (+387 B) | 0 B | 23 KB (+387 B) | external | 66 KB (+984 B) |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 92 KB |
. |
utils.js |
initial | 4.0 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 77 KB |
./beta |
stream-manager.js |
initial | 5.8 KB |
./beta |
wide-event-emitter.js |
initial | 3.2 KB |
./beta |
databricks.js |
initial | 3.2 KB |
./beta |
configuration.js |
initial | 2.3 KB |
./beta |
service-context.js |
initial | 1.3 KB |
./beta |
client.js |
initial | 434 B |
./beta |
client-options.js |
initial | 219 B |
./beta |
supervisor-api.js |
lazy | 192 B |
./beta |
databricks.js |
lazy | 142 B |
./beta |
index.js |
lazy | 123 B |
./testing |
manifest.js |
initial | 26 KB |
./testing |
index.js |
initial | 10.0 KB |
./testing |
wide-event-emitter.js |
initial | 2.9 KB |
./testing |
index.js |
lazy | 27 KB |
./testing |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./testing |
utils.js |
lazy | 1.2 KB |
./tsdown |
index.js |
initial | 520 B |
./type-generator |
index.js |
initial | 23 KB |
@databricks/appkit-ui
npm tarball (packed): 367 KB (+17 KB) — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 404 KB (+9.5 KB) | 136 KB (+3.9 KB) |
| Type declarations | 247 KB (+18 KB) | 90 KB (+6.2 KB) |
| Source maps | 796 KB (+29 KB) | 263 KB (+10.0 KB) |
| CSS | 16 KB | 3.2 KB |
| Total | 1.4 MB (+56 KB) | 493 KB (+20 KB) |
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 |
1.8 KB (+1.8 KB) | 0 B | 1.8 KB (+1.8 KB) | 0 B | 4.1 KB (+4.1 KB) |
./react |
432 KB | 49 KB | 481 KB | 1.3 MB | 177 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 | 1.8 KB |
./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 36414162330 -R databricks/appkit -n appkit-template-0.78.0-pr.983a6b7-stack-database-hooks-01-client-608 -D appkit-pr-608 \
&& unzip -o "appkit-pr-608/appkit-template-0.78.0-pr.983a6b7-stack-database-hooks-01-client-608.zip" -d "appkit-pr-608" \
&& databricks apps init --template "appkit-pr-608"The template pins |
Signed-off-by: ditadi <victordperd@gmail.com>
This branch has not been deployed
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.
Why the change
Browser code that calls the
/api/databaseroutesDatabasePlugingenerates had to hand-write URLs, query encoding, and row types, so this addsdatabaseApi, a typed client (beta) that gets its types from the same generateddatabase.d.tsthe server uses.Special things to note
database.d.tsnow also augments@databricks/appkit-ui/js/beta, even in apps that don't install appkit-ui. Those apps rely onskipLibCheck, as they already do foranalytics.d.ts, and a generator test covers that case. Apps pick up the newapifacet the next time they regenerate types.typecheck:databasestep. It type-checks the playground's database components against appkit-ui's builtdistdeclarations, which proves the generated types reach them; the playground client has no other typecheck.Interface.PluginManifest.mdthat CI's generated-docs check needs. The change is identical in both PRs, so they merge cleanly in either order.Change outline
There is still one schema and one generated file. Each entry gains an
apifacet that describes what the HTTP routes accept, and the same entries are bound into both packages (playgroundnotesshown):author_emailis private, so it appears in the trusted facets but in noapifacet. The route compiler and the type generator now read that rule from one function, so the browser types can't drift from what the server accepts:sharedholds what both sides must agree on, andappkit-uiadds the client on top of it:The new public surface. Private columns, undeclared keys, keyed calls on keyless tables, and
limiton to-one includes are all compile errors:Every call goes through the same path:
The playground's
BoardExplorerloads its board and note lists throughdatabaseApi.list. The database plugin docs gain a "Browser client (beta)" section.This pull request and its description were written by Isaac.