Repository navigation
Typecheck with tsrs instead of TypeScript 7 tsc - #5861
Merged
Merged
Conversation
Replace the typescript-7 (npm:typescript@^7) devDependency with tsrs 0.18.0-ts7.1.0-dev.20260929, the Rust port of the TypeScript 7 compiler, and run `tsrs --noEmit` in every typecheck script. The TypeScript 6 JS API package stays for tooling that imports `typescript`.
tsrs follows TypeScript 7.1-dev, which reports TS5115 on zod's z.json() (microsoft/TypeScript#64605) and TS7031 on a contextually typed destructured parameter with a `= {}` default (microsoft/TypeScript#64431). - Core code uses @bb/domain's jsonValueSchema/jsonObjectSchema instead of z.json(); forkable plugins define the same z.lazy schema locally, typed with the SDK's JsonValue. Runtime validation matches z.json(). - Annotate the abort-signal mock parameter in the system-config atoms test. - tsrs ships no Windows binary through 0.18.0, so the Windows CI jobs (windows-foundation, desktop build, nightly desktop) stop typechecking and the doc-examples compile test skips on win32. Linux CI still typechecks every package.
SawyerHood
marked this pull request as ready for review
October 20, 2026 16:50
Forkable plugins are copied out of the monorepo and installed alone, so a package that runs `tsrs --noEmit` must declare tsrs itself instead of relying on the workspace root.
2 tasks done
ymichael
pushed a commit
that referenced
this pull request
Oct 20, 2026
#5640 added @bb/query-tags with a typescript-7 (npm:typescript@^7.0.2) dev dependency. #5861 merged first and removed typescript@7.0.2 from the lockfile when it moved every package to tsrs. The merged lockfile kept the importer entry without a package entry, so pnpm install --frozen-lockfile fails with ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY. Move query-tags to tsrs like every other package.
This was referenced Oct 23, 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.
Human comments
What was wrong
Typechecking ran on TypeScript 7.0.2 (
typescript-7→npm:typescript@^7.0.2). tsrs, the Rust port of the TypeScript 7 compiler, is roughly twice as fast and uses half the memory on bb (numbers below). This PR moves bb's typechecking to it.tsrs 0.18.0 is a faithful port of TypeScript
7.1.0-dev.20260930.4and prints the same diagnostics. Moving to it therefore also moves bb onto a 7.1 nightly, which brings two upstream regressions. tsrs also has no Windows binary yet:z.json()("Instantiations of the following types appear infinitely circular: 'IsOptionalIn', '$ZodTypeInternals', '$InferZodRecordInput'"). Reported as TS5115 in published Zod 4.5–4.6 types after #64372 microsoft/TypeScript#64605. The first nightly that fails is7.1.0-dev.20260929.1, after Restore idempotency toresolveObjectTypeMembersmicrosoft/TypeScript#64372.= {}. Reported as TS7031 false positive for nested object binding pattern with= {}default in an annotated parameter (regression from #64043) microsoft/TypeScript#64431, with fixes proposed in Fix false implicit-any errors in annotated nested bindings microsoft/TypeScript#64440 and Do not pad binding elements that the parameter's type already types microsoft/TypeScript#64671. The first nightly that fails is7.1.0-dev.20260923.1.win32-x64package through 0.18.0. tsrs'snpm/README.mdsays its release workflow now builds one. Intel Macs remain unsupported.What changed
package.jsonthat listedtypescript-7now liststsrspinned to0.18.0-ts7.1.0-dev.20260929(exact pin because the releases are experimental), and everytypecheckscript runstsrs --noEmit.typescript(the@typescript/typescript6JS API) stays for tooling that imports it.jsonValueSchema/jsonObjectSchemafrom@bb/domaininstead ofz.json():apps/desktop(CDP + capture, plus two tests) andpackages/desktop-contract. Forkable plugins can't import@bb/domain, so account-pool, bb-account, connect, mcp and workflows each define the samez.lazyschema, typed with the SDK'sJsonValue. That schema has the same structure as zod'sz.json(), so runtime validation is unchanged. The only remainingz.json()calls are in two tests that don't trigger the error.system-config-atoms.local-access.test.tsannotates its parameter.windows-foundationjob now runslint testwithouttypecheck. The Windows typecheck steps inbuild-desktop.ymland thenightly-desktop-windowsjob are removed.plugin-authoring-doc-examples.test.tsnow launches tsrs and skips on win32. Types don't depend on the OS, and the Linuxstatic-checksjob still typechecks every package. These can come back once tsrs publisheswin32-x64.typescriptdependency for user plugins, and the bb-app tarball smoke test'snpx typescriptconsumer check. Both stand in for what plugin authors and SDK users run.How you verified
pnpm exec turbo run typecheck --force --continueon tsrs: 105/105 pass. Before the workarounds, 7 failed, with 16 TS5115 errors and 1 TS7031.Every changed package also passes
tsc --noEmiton TypeScript 7.0.2.Both regressions reproduce on tsc
7.1.0-dev.20260930.4and today's7.1.0-dev.20261020.3, and pass on 7.0.2. I found the first failing nightly for each by trying successive builds.turbo run lint testfor@bb/desktop,@bb/desktop-contract, account-pool, bb-account, connect, bb--mcp and workflows: 16/16 pass. The doc-examples test passes with tsrs, and the system-config atoms test passes (12/12).Speed, same machine, warm,
--noEmit, best of two runs:apps/serverapps/apppnpm install --frozen-lockfileis clean, andoxfmt --checkpasses.