Skip to content

chore(deps): upgrade typescript 5.9.2 to 6.0.3#10326

Open
davidfirst wants to merge 3 commits intomasterfrom
upgrade-typescript-6
Open

chore(deps): upgrade typescript 5.9.2 to 6.0.3#10326
davidfirst wants to merge 3 commits intomasterfrom
upgrade-typescript-6

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Bumps typescript to the latest stable major (6.0.3). Small set of compatibility adjustments to absorb TS 6's new stricter defaults without changing behavior for downstream users on TS 5.x.

  • workspace.jsonc: bump typescript pin in root policy and in the scopes/harmony/bit variant.
  • Root tsconfig.json (repo-internal only, not shipped): add ignoreDeprecations: "6.0", set noUncheckedSideEffectImports: false, and list types: ["node", "mocha", "chai", "jest"] to restore the pre-6 auto-discovery behavior for test specs.
  • scopes/typescript/typescript/typescript.main.runtime.ts: in createCompiler, auto-inject ignoreDeprecations: "6.0" when the loaded typescript is major version ≥ 6 and the caller hasn't set it. This keeps the shipped env tsconfigs (scopes/react/react/typescript/*.json, scopes/harmony/aspect/typescript/tsconfig.json, scopes/typescript/typescript/tsconfig.default.json) untouched so they remain valid for TS 5.x consumers — TS 5.x rejects ignoreDeprecations: "6.0" with TS5103, and TS 5.x rejects moduleResolution: "bundler" + module: "commonjs".

Test plan

  • bit compile — 311/311 components compile
  • npm run lint — 0 tsc errors, 0 oxlint warnings across 2,838 files
  • CI e2e

- Bump typescript in workspace.jsonc (two locations).
- Add ignoreDeprecations, noUncheckedSideEffectImports, and explicit
  types array to root tsconfig to absorb TS 6 default changes.
- Inject ignoreDeprecations at runtime in TypescriptMain.createCompiler
  when TS 6+ is loaded, so shipped env tsconfigs stay TS 5.x-compatible.
Copilot AI review requested due to automatic review settings April 22, 2026 18:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the repo’s pinned TypeScript version to 6.0.3 and applies targeted configuration/runtime adjustments so the workspace can compile/lint cleanly under TS 6 while keeping shipped env tsconfigs compatible with TS 5.x consumers.

Changes:

  • Bump typescript pin from 5.9.2 → 6.0.3 in the root dependency policy and the scopes/harmony/bit variant.
  • Update the repo-root tsconfig.json with TS 6 compatibility settings (ignoreDeprecations, noUncheckedSideEffectImports, and explicit types).
  • Update TypescriptMain.createCompiler() to auto-inject ignoreDeprecations: "6.0" only when the loaded compiler is TS 6+ and the caller didn’t set it.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
workspace.jsonc Updates the workspace dependency policy pins to TypeScript 6.0.3 (root + scopes/harmony/bit variant).
tsconfig.json Adjusts repo-internal TypeScript compiler options to accommodate TS 6 stricter defaults.
scopes/typescript/typescript/typescript.main.runtime.ts Conditionally injects ignoreDeprecations at runtime for TS 6+ to preserve TS 5.x compatibility of shipped env configs.

…EffectImports on TS 6

Capsule builds were failing with 778 implicit-any errors because TS 6
flipped 'strict' default from false to true, turning on full strict mode
for shipped env tsconfigs that relied on the TS 5 default. Extend the
runtime injection in TypescriptMain.createCompiler to also set
strict=false and noUncheckedSideEffectImports=false when those are not
explicitly configured.
Copilot AI review requested due to automatic review settings April 22, 2026 20:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the repo’s pinned TypeScript version to 6.0.3 and adds targeted configuration/runtime shims so Bit’s shipped TypeScript env configs remain compatible with TS 5.x consumers while the repo itself builds with TS 6.

Changes:

  • Bump typescript pin to 6.0.3 in workspace.jsonc (root + harmony/bit variant).
  • Update root tsconfig.json with TS6-related options (ignoreDeprecations, noUncheckedSideEffectImports, explicit types list).
  • Patch TypescriptMain.createCompiler() to inject TS6-only compiler options at runtime when the loaded compiler is TS 6+.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
workspace.jsonc Pins TypeScript to 6.0.3 in dependency policies.
tsconfig.json Adjusts repo-internal TS compiler options for TS 6 defaults/behavior.
scopes/typescript/typescript/typescript.main.runtime.ts Adds TS 6+ runtime tsconfig patching to keep shipped env tsconfigs TS 5.x compatible.

Comment thread workspace.jsonc
Comment on lines 642 to +645
"tippy.js": "6.2.7",
"ts-graphviz": "^2.1.6",
"type-coverage": "2.15.1",
"typescript": "5.9.2",
"typescript": "6.0.3",
const compilerOptions = afterMutation.raw.tsconfig?.compilerOptions;
if (tsMajor >= 6 && compilerOptions) {
if (!compilerOptions.ignoreDeprecations) compilerOptions.ignoreDeprecations = '6.0';
if (compilerOptions.strict === undefined) compilerOptions.strict = false;
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.

2 participants