build: Upgrade TypeScript to 7.0.2 - #13743
Draft
MounirDhahri wants to merge 3 commits into
Draft
Conversation
Upgrades to the native (Go-based) TypeScript 7 compiler. Cold type-check
drops from ~39s to ~7s, incremental from ~12s to ~2.6s.
Config migration (equivalence-preserving, required by TS 7):
- baseUrl was removed in TS 7 -> the equivalent
paths: { "*": ["./src/*"] } so 'app/...' imports keep resolving
Yarn 4.10.3's builtin compat/typescript patch crashes on the TS 7 package
layout, so the bundled Yarn is bumped to 4.17.1 (same release force uses).
Code fix: scripts/check-flags/check-flags.js used CommonJS top-level
'this' (alias of module.exports), which TS 7 now flags under @ts-check;
replaced with the explicit module.exports equivalent (script output
verified unchanged).
KNOWN BLOCKER before merging: @typescript-eslint (5.57.0) crashes on load
against typescript@7 - 'yarn lint' fails repo-wide. No typescript-eslint
release supports TS 7 yet (latest 8.63.0 pins typescript <6.1.0), so
adopting TS 7 here is gated on upstream support or an ESLint stack rework.
Note: typescript 7.0.2 was published 2026-07-08; installs that re-resolve
it before it clears the 1-day npmMinimalAgeGate need
YARN_NPM_MINIMAL_AGE_GATE=0 (immutable CI installs from the lockfile are
unaffected).
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GDuwNGgkcESgEa8E1ADWJi
- .secrets.baseline still allowlisted the removed .yarn/releases/yarn-4.10.3.cjs; regenerate entries for yarn-4.17.1.cjs (bundled-release entropy strings, not real secrets) so the detect-secrets CI job passes - Danger transpiles dangerfile.ts via the legacy ts.transpileModule API, which typescript@7 no longer exposes; set DANGER_DISABLE_TSC=true so danger uses @babel/plugin-transform-typescript instead (verified the dangerfile transpiles cleanly through the babel path) Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GDuwNGgkcESgEa8E1ADWJi
DANGER_DISABLE_TSC pushed danger onto its babel transpiler, which hits a
babel-plugin-relay reentrancy cycle when the dangerfile's imports pull in
relay.config.js. Keep danger on its TypeScript path instead: preload
scripts/typescript5-shim.js so require("typescript") resolves to a TS 5
compiler API (typescript5 alias package) inside the danger process only.
Verified locally that dangerfile.ts transpiles and evaluates through this
path.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GDuwNGgkcESgEa8E1ADWJi
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.
This PR resolves []
Description
Upgrades TypeScript from 5.9.2 to 7.0.2 — the new native (Go-based) compiler — keeping the same checking semantics.
Warning
Draft — blocked on typescript-eslint.
@typescript-eslint5.57.0 crashes on load againsttypescript@7(TypeError: Cannot read properties of undefined (reading 'Undefined')), which breaksyarn lint(local lint-staged / pre-commit and editors). No typescript-eslint release supports TS 7 yet — the latest (8.63.0) pinstypescript >=4.8.4 <6.1.0. Merging is gated on upstream TS 7 support or an ESLint stack rework. Type-checking itself is fully working.Type-check performance on the same machine:
yarn tscError counts identical before/after (the one pre-existing error in both runs is the missing
EchoNew.jsonfixture in the benchmark sandbox, which couldn't reachecho.artsy.net— unrelated to TS).Config migration (equivalence-preserving):
baseUrlwas removed in TS 7 → the equivalentpaths: { "*": ["./src/*"] }, soapp/...imports keep resolving.Yarn bump 4.10.3 → 4.17.1 (same release force uses): Yarn 4.10.3's builtin
compat/typescriptpatch crashes on TS 7's package layout (ENOENT: lib/_tsc.js), makingyarn installimpossible withtypescript@7.Code fix:
scripts/check-flags/check-flags.jsused CommonJS top-levelthis(alias ofmodule.exports), which TS 7 now flags under@ts-check; replaced with the explicitmodule.exportsequivalent — script output verified byte-identical.CI fixes:
.secrets.baselineregenerated for the new.yarn/releases/yarn-4.17.1.cjs(bundled-release entropy strings, not real secrets) — fixes thedetect-secretsjob.dangerfile.tsvia the legacyts.transpileModuleAPI, gone in TS 7 — thecheck-codejob now preloadsscripts/typescript5-shim.js(NODE_OPTIONS) sorequire("typescript")resolves to a TS 5 compiler API (typescript5alias package) inside the danger process only. Deletable once danger supports TS 7. ✅ green as of 7d155ec.build-test-app-androidstill fails and needs a look at the CircleCI log (not reachable from the working sandbox). Ruled out locally under TS 7:react-native config, the full Metro android release bundle, andexpo-modules-autolinkingall succeed — and iOS, which shares that JS tooling, is green. Suspect the native/gradle stage, or simply that this PR'syarn.lock/package.jsonchanges invalidate thebuild-success.logcache so this job does a full native build that main normally skips via cache.Heads-up:
[email protected]was published 2026-07-08. Installs that re-resolve it needYARN_NPM_MINIMAL_AGE_GATE=0until it clears the 1-daynpmMinimalAgeGate; immutable CI installs from the committed lockfile are unaffected.PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Dev changes
🤖 Generated with Claude Code
https://claude.ai/code/session_01GDuwNGgkcESgEa8E1ADWJi