Skip to content

chore: follow-ups to the TypeScript 7 migration - #701

Open
fjakobs wants to merge 5 commits into
victor-ditadi_data/typescript-7from
chore/typescript-7
Open

fjakobs wants to merge 5 commits into
victor-ditadi_data/typescript-7from
chore/typescript-7

Conversation

@fjakobs

@fjakobs fjakobs commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #694 (base: victor-ditadi_data/typescript-7). Merge #694 first. This PR was originally a full TypeScript 7 migration; I rebuilt it on top of #694 and kept only what #694 doesn't do.

Changes

  • Bump tsdown to 0.23.2 and drop chore: build and typecheck with TypeScript 7 #694's rolldown-plugin-dts patch. tsdown 0.23.2 ships rolldown-plugin-dts 0.29. Its tsgo generator emits declarations through the TypeScript Go API and honors the tsconfig's rootDir, which is what the patch fixed in 0.28.8.
    • Needs TypeScript 7.1 for .d.ts emit. That API (getDeclarationEmit) exists only in TypeScript 7.1, and 7.0.2 lacks it. The package configs select generator: "tsgo" and point tsgo.moduleUrl at a pinned typescript@7.1.0-beta. Everything else (tsc, typecheck, tests) stays on 7.0.2.
    • Separate workspace package. The beta lives in a private tools/typescript-next workspace package. As a root dependency, its tsc bin replaced 7.0.2's in node_modules/.bin.
    • dev-playground declares typescript 7.0.2 itself, so tsdown's optional typescript peer can't auto-resolve to the beta.
    • Same output. Across all 900 emitted .d.ts/JS files, the output matches chore: build and typecheck with TypeScript 7 #694's patched 0.23.1 build apart from the format of rolldown's region comments.
    • Follow-up: drop the alias when TypeScript 7.1.0 is stable.
  • Strip JSDoc from the bundled JS. tsdown 0.23's rolldown keeps JSDoc comments in the JS output, which tsdown 0.20 dropped. All four package configs now set outputOptions: { comments: { jsdoc: false } }. Legal comments and @__PURE__ annotations stay, and the .d.ts files keep their JSDoc, so IDE hover docs are unchanged.
  • tsdown deps options. The package configs move from the deprecated external/noExternal to deps.neverBundle/deps.alwaysBundle, which removes the deprecation warnings from the build. shared also drops skipNodeModulesBundle, which tsdown 0.23 ignores. appkitServerConfig still emits external, so apps scaffolded with tsdown 0.20 keep externalizing node_modules.
  • fix(appkit): type the server plugin's exports(). The inferred return type references itself through extend(), so the published .d.ts elides it to any, on main and on chore: build and typecheck with TypeScript 7 #694. An explicit ServerExport interface fixes that.
  • fix(playground): typecheck the client.
    • The client tsconfig now mirrors the Vite @databricks/appkit-ui alias. Without it, the client had 114 type errors.
    • Fixed the real errors this exposed: chart props renamed to smooth, showSymbol, showLabels and showArea, nullable chart rows, and the {} params fallback.
    • The playground check, which chore: build and typecheck with TypeScript 7 #694 runs in CI, now covers the client too.
  • chore(playground): install the client with pnpm.
    • apps/dev-playground/client is a pnpm workspace member.
    • Removed: the npm package-lock.json of the client, dev-playground and clean-app, and the cd client && npm install hook.
    • deploy-playground.ts adds the hook back to the deployed copy, because Databricks Apps installs that copy with npm.
    • Root pnpm dev skips the client's standalone Vite server, which the playground doesn't use.
    • The client still resolves vite and its plugins to rolldown-vite 7.1.14.

Size

  • Package JS. Measured before the restack, from packed tarballs installed into a template app: @databricks/appkit JS shrinks from 1,648,138 to 1,260,871 B raw (−24%) and from 586,659 to 419,159 B gzipped (−29%). @databricks/appkit-ui shrinks from 766,818 to 632,548 B raw (−18%). The code is unchanged: with comments stripped, the output is within about 0.4% of main. On this branch, shared/sql/helpers.js drops from 16 KB to 8 KB, with all 22 @example blocks still in its .d.ts.
  • Template app client bundle. Unchanged, because Vite minifies it.
  • Playground client. 0.4% smaller (raw and gzip), because pnpm shares one copy of @tanstack/table-core with appkit-ui instead of bundling two.

Test plan

  • pnpm build with tsdown 0.23.2: no patch, no deprecation warnings, attw/publint clean, and every package emits types with TypeScript Go. pnpm docs:build
  • tsc -v is 7.0.2 in the root and every workspace except docs (5.6.3) and tools/typescript-next
  • pnpm typecheck, pnpm --filter=dev-playground check (server and client), typecheck:database
  • pnpm check, pnpm knip, check:licenses
  • pnpm test: 5,898 tests
  • Client pnpm build. Client lint reports the same 12 pre-existing errors as chore: build and typecheck with TypeScript 7 #694; it isn't run in CI.
  • This branch and chore: build and typecheck with TypeScript 7 #694 both merge cleanly into the latest main.

This pull request and its description were written by Isaac.

@fjakobs
fjakobs requested a review from a team as a code owner November 3, 2026 11:16
@fjakobs
fjakobs requested review from MarioCadenas, atilafassina and ditadi and removed request for ditadi November 3, 2026 11:16
Comment thread apps/dev-playground/tsconfig.json Resolved
Comment thread packages/appkit/src/tsdown/index.ts Resolved
Comment thread template/package-lock.json Resolved
fjakobs and others added 4 commits November 3, 2026 14:07
tsdown 0.23's rolldown keeps JSDoc in the JS output; set
comments.jsdoc: false (the .d.ts files keep theirs). Published JS
shrinks by about a quarter with identical code. Also move the package
configs from the deprecated external/noExternal to
deps.neverBundle/alwaysBundle, and drop skipNodeModulesBundle, which
tsdown 0.23 ignores.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Fabian Jakobs <fabian.jakobs@databricks.com>
exports() returned an inferred type whose extend() referenced itself,
so the published declaration elided it to any. Annotate it with a
ServerExport interface.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Fabian Jakobs <fabian.jakobs@databricks.com>
Mirror the vite @databricks/appkit-ui alias in the client tsconfig, fix
the type errors that surfaces (renamed chart props, nullable chart
rows, the params fallback), and include the client in the playground
check.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Fabian Jakobs <fabian.jakobs@databricks.com>
Make apps/dev-playground/client a pnpm workspace member and drop the
npm package-lock.json files of the client, dev-playground and
clean-app, plus the cd client && npm install hook. The deploy script
adds the hook back to the deployed copy, which Databricks Apps installs
with npm. Root pnpm dev skips the client's unused standalone vite
server.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Fabian Jakobs <fabian.jakobs@databricks.com>
@fjakobs
fjakobs force-pushed the chore/typescript-7 branch from ac8c4b2 to 10fa1ff Compare November 3, 2026 13:08
@fjakobs
fjakobs changed the base branch from main to victor-ditadi_data/typescript-7 November 3, 2026 13:08
@fjakobs fjakobs changed the title chore: upgrade to TypeScript 7 chore: follow-ups to the TypeScript 7 migration Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size report

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

@databricks/appkit

npm tarball (packed): 1.1 MB (-138 KB) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 982 KB (-308 KB) 326 KB (-131 KB)
Type declarations 465 KB (+1.4 KB) 167 KB (-896 B)
Source maps 2.5 MB (-23 KB) 841 KB (-15 KB)
Other 11 KB 3.7 KB
Total 3.9 MB (-330 KB) 1.3 MB (-147 KB)
Per-entry composition (own code — deps external (as shipped))
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
. 106 KB (+60 B) 2.5 KB (+1 B) 109 KB (+61 B) external 344 KB (+245 B)
./beta 103 KB (+23 B) 648 B (+163 B) 103 KB (+186 B) external 309 KB (+374 B)
./testing 45 KB 32 KB (+59 B) 77 KB (+59 B) external 224 KB (+222 B)
./tsdown 520 B 0 B 520 B external 813 B
./type-generator 26 KB (+40 B) 0 B 26 KB (+40 B) external 75 KB (+110 B)

Chunks:

Entry Chunk Load Size (gz)
. index.js initial 101 KB
. utils.js initial 4.6 KB
. remote-tunnel-manager.js lazy 2.5 KB
./beta beta.js initial 82 KB
./beta modular.js initial 6.0 KB
./beta stream-manager.js initial 5.9 KB
./beta service-context.js initial 4.5 KB
./beta databricks.js initial 3.3 KB
./beta client.js initial 648 B
./beta index.js initial 20 B
./beta index.js lazy 281 B
./beta supervisor-api.js lazy 191 B
./beta databricks.js lazy 176 B
./testing manifest.js initial 32 KB
./testing index.js initial 10 KB
./testing wide-event-emitter.js initial 2.9 KB
./testing index.js lazy 28 KB
./testing remote-tunnel-manager.js lazy 2.5 KB
./testing utils.js lazy 1.8 KB
./tsdown index.js initial 520 B
./type-generator index.js initial 26 KB

@databricks/appkit-ui

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

dist raw gzip
JS (runtime) 366 KB (-63 KB) 119 KB (-28 KB)
Type declarations 268 KB (+1.1 KB) 97 KB (-1.4 KB)
Source maps 828 KB (-25 KB) 280 KB (-5.3 KB)
CSS 16 KB 3.2 KB
Total 1.4 MB (-87 KB) 499 KB (-35 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 (-2 B) 49 KB 55 KB (-2 B) 208 KB 14 KB (-8 B)
./js/beta 2.1 KB (+4 B) 0 B 2.1 KB (+4 B) 0 B 5.0 KB (+10 B)
./react 433 KB (+43 B) 49 KB 481 KB (+43 B) 1.3 MB 177 KB (+1 B)
./react/beta 4.9 KB (+9 B) 0 B 4.9 KB (+9 B) 0 B 12 KB (+19 B)

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 2.1 KB
./react index.js initial 431 KB
./react tslib initial 2.1 KB
./react apache-arrow lazy 49 KB
./react/beta beta.js initial 4.9 KB

@github-actions

github-actions Bot commented Nov 3, 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 41643594434 -R databricks/appkit -n appkit-template-0.89.0-pr.aec5206-chore-typescript-7-701 -D appkit-pr-701 \
  && unzip -o "appkit-pr-701/appkit-template-0.89.0-pr.aec5206-chore-typescript-7-701.zip" -d "appkit-pr-701" \
  && databricks apps init --template "appkit-pr-701"

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.

…atch

tsdown 0.23.2 ships rolldown-plugin-dts 0.29, whose tsgo generator
emits declarations through the TypeScript Go API and honors the
tsconfig rootDir, so the 0.28.8 patch is no longer needed. That API
(getDeclarationEmit) exists only in TypeScript 7.1, so the package
configs select the tsgo generator with tsgo.moduleUrl pointing at a
pinned 7.1.0-beta. It lives in the private tools/typescript-next
workspace package so its tsc bin doesn't replace the workspace's
TypeScript 7.0.2, which tsc, typecheck and tests keep using.
dev-playground now declares typescript itself, so tsdown's typescript
peer can't resolve to the beta. The emitted .d.ts and JS match the
patched 0.23.1 build apart from the region-comment format.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Fabian Jakobs <fabian.jakobs@databricks.com>

This branch has not been deployed

No deployments
Sign up for free to 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.

1 participant