Repository navigation
Conversation
Pin typescript to 7.0.2 in the root, dev-playground client, and clean-app, and move the tools that need it along: - tsdown 0.20.3 -> 0.23.1 (0.20.3 rejects TypeScript 7). With TypeScript 7.0 its dts plugin emits through the tsgo generator. - Patch rolldown-plugin-dts so the tsgo generator honors the tsconfig rootDir. It hardcoded the tsconfig directory, so the shared sources that appkit and appkit-ui inline got no .d.ts. - Set rootDir in appkit and appkit-ui to the common source directory TypeScript 5 computed, and drop baseUrl, which TypeScript 7 removed. - knip 5 -> 6, which no longer loads the TypeScript API. - Rewrite the appkit-ui type-probe tests to run the tsc binary, and delete type-generator/expand.ts, which only its test used. - Read the template's JSONC configs in template-lint-fixtures with confbox instead of the TypeScript API. - Keep docs on TypeScript 5.6.3: typedoc supports up to 6.0. Move generate-component-mdx and react-docgen-typescript into docs so they resolve that TypeScript. - Drop ESLint from the dev-playground client and clean-app; typescript-eslint does not support TypeScript 7 and the root oxlint already lints apps/. - Stop tsdown 0.23 from adding a bin field to shared. Signed-off-by: ditadi <victordperd@gmail.com>
`pnpm --filter=dev-playground check` was `tsc` over every file in the app, client included, and failed on main with 2593 errors. It also emitted JavaScript, because it ran without --noEmit. - Scope the tsconfig to server, shared, tests, and the root config files; the client keeps its own tsconfig. Add the DOM lib for the Playwright page callbacks, and run the check with --noEmit. - Import IAppRouter and StreamExecutionSettings from @databricks/appkit instead of the private shared package. - Declare @types/express, @types/pg, and apache-arrow, which the server and specs import directly. - Drop authType from the mock client options; #673 removed it. - Skip directory entries without a path in the metric-view listing. - Stop the telemetry example from constructing a CacheManager. The private constructor got (config, telemetry) instead of (storage, config), which left caching disabled; the plugin now uses the shared cache the base class binds. - Type the arguments of createMockResponse's setHeader and send in @databricks/appkit/testing, so res.setHeader(name, value) compiles. - Run the check in the Playground Integration Tests job. [#tern:check] Signed-off-by: ditadi <victordperd@gmail.com>
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 1.4 MB (+10 KB) | 501 KB (+1.5 KB) |
| Type declarations | 486 KB (+2.5 KB) | 173 KB (-817 B) |
| Source maps | 2.7 MB (-16 KB) | 914 KB (-15 KB) |
| Other | 11 KB | 3.7 KB |
| Total | 4.6 MB (-3.6 KB) | 1.6 MB (-14 KB) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
118 KB (+28 B) | 2.4 KB (+1 B) | 121 KB (+29 B) | external | 378 KB (+233 B) |
./beta |
115 KB (-93 B) | 652 B (+167 B) | 116 KB (+74 B) | external | 342 KB (+282 B) |
./testing |
47 KB (+6 B) | 38 KB (+63 B) | 85 KB (+69 B) | external | 246 KB (+219 B) |
./tsdown |
520 B | 0 B | 520 B | external | 813 B |
./type-generator |
31 KB (+28 B) | 0 B | 31 KB (+28 B) | external | 90 KB (+117 B) |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 114 KB |
. |
utils.js |
initial | 4.6 KB |
. |
remote-tunnel-manager.js |
lazy | 2.4 KB |
./beta |
beta.js |
initial | 95 KB |
./beta |
modular.js |
initial | 6.1 KB |
./beta |
stream-manager.js |
initial | 5.9 KB |
./beta |
service-context.js |
initial | 4.6 KB |
./beta |
databricks.js |
initial | 3.3 KB |
./beta |
client.js |
initial | 649 B |
./beta |
index.js |
initial | 20 B |
./beta |
index.js |
lazy | 282 B |
./beta |
supervisor-api.js |
lazy | 193 B |
./beta |
databricks.js |
lazy | 177 B |
./testing |
manifest.js |
initial | 33 KB |
./testing |
index.js |
initial | 10 KB |
./testing |
wide-event-emitter.js |
initial | 2.9 KB |
./testing |
index.js |
lazy | 34 KB |
./testing |
remote-tunnel-manager.js |
lazy | 2.4 KB |
./testing |
utils.js |
lazy | 1.8 KB |
./tsdown |
index.js |
initial | 520 B |
./type-generator |
index.js |
initial | 31 KB |
@databricks/appkit-ui
npm tarball (packed): 427 KB (-4.4 KB) — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 467 KB (+8.1 KB) | 160 KB (+2.1 KB) |
| Type declarations | 284 KB (+1.4 KB) | 103 KB (-1.4 KB) |
| Source maps | 888 KB (-24 KB) | 302 KB (-5.4 KB) |
| CSS | 16 KB | 3.2 KB |
| Total | 1.6 MB (-14 KB) | 569 KB (-4.7 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 |
3.5 KB (+7 B) | 0 B | 3.5 KB (+7 B) | 0 B | 9.4 KB (+4 B) |
./react |
441 KB (-21 B) | 49 KB | 489 KB (-21 B) | 1.4 MB | 179 KB (-6 B) |
./react/beta |
16 KB (+30 B) | 0 B | 16 KB (+30 B) | 25 KB | 23 KB (+17 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 | 3.5 KB |
./react |
index.js |
initial | 439 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 16 KB |
🤖 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 45610781505 -R databricks/appkit -n appkit-template-0.104.1-pr.75c0f4b-victor-ditadi-data-typescript-7-694 -D appkit-pr-694 \
&& unzip -o "appkit-pr-694/appkit-template-0.104.1-pr.75c0f4b-victor-ditadi-data-typescript-7-694.zip" -d "appkit-pr-694" \
&& databricks apps init --template "appkit-pr-694"The template pins |
The TypeScript 7 commit dropped ESLint from both apps, and with it their `lint` scripts. Bring the scripts back on oxlint, as #665 did for the template. Each app gets an .oxlintrc.json ported from the config ESLint applied to it on main (`eslint --print-config`): eslint:recommended as typescript-eslint adjusts it for TypeScript files, typescript-eslint recommended, react-hooks, and react-refresh vite. clean-app keeps the React Compiler rules from eslint-plugin-react-hooks 7 through an oxlint JS plugin, so eslint stays as its peer. On main's code, oxlint reports the same findings as ESLint: none in clean-app, and the same 15 in the client, 12 of them errors. The client lists TanStack Router's route factories as custom HOCs: ESLint's react-refresh took the PascalCase `Route` export for a component, and oxlint otherwise flags every route file. [#tern:check] Signed-off-by: ditadi <victordperd@gmail.com>
There was a problem hiding this comment.
|
No actionable findings. Reviewed the TypeScript 7 migration, declaration-generation patch, compiler API replacements, playground typecheck fixes, and app lint migration. Validated the SDK and docs builds, package validation, monorepo and playground typechecks, lint/format checks, knip, and 44 focused tests. All passed. |
Signed-off-by: ditadi <victordperd@gmail.com>
Signed-off-by: ditadi <victordperd@gmail.com>
What did you change, and why?
Why: #686 moves the app template to TypeScript 7, but the monorepo still builds, typechecks, and tests the SDK with 5.9.3. This moves the monorepo first, so the published packages come from the compiler that new apps use.
pnpm typecheckdrops from 9.9 s to 3.4 s locally.Change (commit 1: TypeScript 7):
typescriptto 7.0.2 in the root,apps/dev-playground/client, andapps/clean-app.tsdownfrom 0.20.3 to 0.23.1, since 0.20.3 rejects TypeScript 7. With TypeScript 7.0 installed, its dts plugin emits declarations with the nativetsc(thetsgogenerator).rolldown-plugin-dts@0.28.8with one line (patches/rolldown-plugin-dts@0.28.8.patch). Thetsgogenerator passed--rootDir <tsconfig dir>and ignored the tsconfig'srootDir. As a result, thesharedsources thatappkitandappkit-uiinline got no.d.ts, and the build failed. I'll send the fix upstream.baseUrl, which TypeScript 7 removed, and prefixpathstargets with./.rootDirinappkit(../..) andappkit-ui(..) to the common source directory that 5.9 computed. TypeScript 6+ defaultsrootDirto the tsconfig's own directory.knipfrom 5.86.0 to 6.41.0, which no longer loads the TypeScript API.knip.jsonnow ignores**/dist/**and setsignoreExportsUsedInFilefor types and interfaces, so knip 6 reports what knip 5 did.binfield toshared(exports.bin: false).appkit-uitype-probe tests now run thetscbinary on a scratch file.tools/template-lint-fixtures.tsnow reads the template's JSONC configs withconfbox/jsonc.Change (commit 2: playground typecheck):
pnpm --filter=dev-playground checkalready failed on main, with 2593 errors. It rantscover the whole app, client included, and without--noEmitit also wrote JavaScript next to the sources.server,shared,tests, and the root config files, and runtsc --noEmit. The client keeps its own tsconfig. Add the DOM lib for the Playwright page callbacks.IAppRouterandStreamExecutionSettingsfrom@databricks/appkitinstead of the privatesharedpackage.@types/express,@types/pg, andapache-arrow, which the server and specs import directly.authTypefrom the mock client options, since refactor(shared): remove the legacy @databricks/sdk-experimental SDK #673 removed it.pathin the metric-view listing.new CacheManager({ enabled, ttl }, this.telemetry), but the private constructor takes(storage, config), so caching was off. The example now uses the shared cache that the basePluginbinds.setHeaderandsendoncreateMockResponse()in@databricks/appkit/testing. Before,res.setHeader(name, value)did not compile.Change (commit 3: app lint on oxlint): Each app gets back the
lintscript it lost with ESLint, now running oxlint, as #665 did for the template..oxlintrc.jsonis ported from the config ESLint applied to it on main (eslint --print-config):eslint:recommendedas typescript-eslint adjusts it for TypeScript files, typescript-eslintrecommended, react-hooks, and react-refreshvite. That is 83 rules inclean-appand 68 in the client.no-octalhas no oxlint rule, because oxlint reports legacy octal literals as a parse error.clean-appkeeps the React Compiler rules fromeslint-plugin-react-hooks7 through an oxlint JS plugin, soeslintstays as its peer. The client used react-hooks 5, whose rules are native in oxlint.createFileRouteandcreateRootRouteundercustomHOCs. ESLint's react-refresh took the PascalCaseRouteexport for a component; without the option, oxlint flags every route file.Removed:
packages/appkit/src/type-generator/expand.tsand its test. Only the test imported it (since feat: add type-safe sql queries with query registry #11), and it calls the compiler API.apps/dev-playground/clientandapps/clean-app, matching chore: lint template apps with oxlint instead of ESLint #665 for the template:eslint.config.js,@eslint/js,typescript-eslint,eslint-plugin-react-refresh,globals, and the ESLint section of each Vite README. The client also dropseslintandeslint-plugin-react-hooks. Thelintscripts now run oxlint (commit 3).typescript-eslintrequires TypeScript < 6.1.react-docgen-typescriptfrom the root devDependencies. It now lives indocs.Still on an older TypeScript: TypeScript 7 ships no JavaScript compiler API:
import ts from "typescript"returns only the version. Tools that call that API keep their own copy:docstypedoc0.28 supports TypeScript up to 6.0, andreact-docgen-typescriptcalls the compiler API.generate-component-mdx.tsmoved fromtools/todocs/scripts/so that it resolves this copy.template/@arethetypeswrong/core,@cyclonedx/cdxgendocscan move to TypeScript 6.0 in a follow-up withtypedoc0.28.20 or later. Moving it to 7 needs atypedocrelease that supports 7.How do you know it works?
Testing: I ran every CI step locally, starting from
pnpm install --frozen-lockfileandpnpm clean:pnpm check,pnpm typecheck,pnpm knip, andcheck:licenses.pnpm test: 5898 tests.pnpm build, with attw and publint passing for all three packages.typecheck:database, the new playgroundcheck, and the playgroundbuild:app.docs:buildanddocs:check.examples.gen.ts.@ts-expect-errorlines is removed.readJsoncreturns the same objects asts.parseConfigFileTextToJson(5.6.3) for the template's.oxlintrc.jsonand all four tsconfigs, and it throws on invalid JSON.clean-apphas none. The client has the same 15, 12 of them errors, at the same severities. The only extra is one warning: anoxlint-disableforjsx-a11ythat exists for the root oxlint. The client'slintalready failed on main with those 12 errors, so neither app'slintruns in CI yet.Published packages: A newer rolldown now emits the JavaScript and TypeScript 7 emits the
.d.ts, so most files differ in text. The JavaScript changes are folded and inlined constants,/* @__PURE__ */annotations, and the rolldown CJS-interop helper. The declaration changes are inlineexportdeclarations and comment placement. To check that the meaning did not change, I packedappkit,appkit-ui, andlakebasefrom main and from this branch, and installed each into a clean consumer:typeof. I loaded them in Node (ESM, plusrequire()for lakebase), and in Vitest for/testingand/react.skipLibCheck: true. Key types (WorkspaceClient,createApp,PluginData,IAppRouter,BarChart,createLakebasePool) are notany. WithskipLibCheck: false, both sides report the same set of errors, and all of them are pre-existing.distfile lists match main except for four files that nothing imports: three empty re-export modules that rolldown now drops, andreact/file-browser/index.d.ts.verify-bundled-patches.tspasses andbundledDependenciesis unchanged. The new patch applies to a dev dependency and does not ship.Security:
typescript@7.0.2and its@typescript/typescript-<platform>binaries.tsdown@0.23.1withrolldown-plugin-dts@0.28.8.knip@6.41.0.oxlint@1.77.0in both apps, the version the root and the template pin.clean-appkeepseslint@9.39.1andeslint-plugin-react-hooks@7.0.1, unchanged from main.confbox@0.2.2: MIT, no dependencies, and already in the lockfile throughrelease-it.@types/express,@types/pg, andapache-arrow, at the versions the packages already pin.dependencieschange, andcheck:licensespasses.rolldown-plugin-dtspatch runs only at build time.apps/dev-playground/client/package-lock.jsonresolves only from registry.npmjs.org, andnpm ci --dry-runpasses.Follow-ups, not in this PR:
rolldown-plugin-dtsfix upstream.docsto TypeScript 6.0.externalbecomesdeps.neverBundle, andnoExternalbecomesdeps.alwaysBundle.testing/*.d.tsandplugins/files/types.d.tsimportindex_d_exportsfromworkspace-client/index.js, but the shared file that replaces it at packaging time does not export it.