Skip to content

chore: upgrade TypeScript to 5.8.3 in v5#14852

Merged
soberm merged 1 commit into
v5-stablefrom
chore/ts-upgrade-v5
Jun 30, 2026
Merged

chore: upgrade TypeScript to 5.8.3 in v5#14852
soberm merged 1 commit into
v5-stablefrom
chore/ts-upgrade-v5

Conversation

@soberm

@soberm soberm commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Routine compiler modernization for v5-stable: upgrade TypeScript from 3.8.3 to 5.8.3 across the monorepo, bringing this branch in line with the compiler already used on main (v6).

ts-jest@24 cannot compile TypeScript 5 — it depends on ts.getMutableClone, which was removed in TS 5.0 — so the Jest toolchain is moved to the 29.x line to match the stack main already uses. All accompanying changes are the minimal, behavior-preserving adjustments the newer compiler and test runner require (no feature or logic changes; AWS SDK / Predictions dependencies untouched).

Dependency / tooling bumps

  • Root package.json: typescript 3.8.3 → 5.8.3; jest, ts-jest, @types/jest, babel-jest, jest-config29.x; add jest-environment-jsdom@29; add @babel/core to resolutions.
  • Local typescript pin 5.0.2 → 5.8.3: api, api-graphql, api-rest, core, storage.
  • tslib ^1 → ^2 (required by TS 5 helper emit): analytics, geo, predictions.
  • Per-package Jest config migrated to the ts-jest 29 transform tuple format (globals['ts-jest']transform, tsConfigtsconfig, drop removed testURL): analytics, api, api-graphql, api-rest, auth, aws-amplify, cache, core, datastore, datastore-storage-adapter, geo, interactions, predictions, pubsub, pushnotification, storage, and amazon-cognito-identity-js/jest.config.js, notifications/jest.config.js.
  • @types/jest / babel-jest line bumps in pushnotification and aws-amplify-react-native.

Source changes (behavior-preserving, required by TS 5)

  • packages/auth/src/Auth.ts — explicit new Promise<void> / resolve(undefined).
  • packages/datastore/src/predicates/sort.tsString(field) for symbol index.
  • packages/datastore/src/predicates/next.tsPersistentModel generic constraint.
  • packages/datastore/src/sync/processors/subscription.ts — explicit new Promise<void>.
  • packages/datastore/src/sync/processors/sync.tsRecord<string, any> on computed-key destructure.
  • packages/datastore/src/storage/adapter/StorageAdapterBase.tsPartial<any> cast.
  • packages/datastore/src/storage/relationship.tsPersistentModel generic constraint.
  • packages/datastore/src/types.tsExtract<…, { field: any }> for stricter indexed access.
  • packages/datastore/src/util.tsapplyPatches argument cast (immer Draft<T>).
  • packages/datastore-storage-adapter/src/common/SQLiteUtils.tsString(field) cast.
  • packages/geo/src/util.ts — build regex via new RegExp(..., 'iu') (TS 5.5 validates flags vs es5 target).
  • packages/interactions/src/Providers/AWSLexProviderHelper/utils.native.ts — build regex via new RegExp(..., 's').
  • packages/pubsub/src/Providers/AWSAppSyncRealTimeProvider/index.tsString(authenticationType).
  • packages/pubsub/src/vendor/paho-mqtt.js — JSDoc @type {any} for declaration emit.
  • packages/storage/src/providers/AWSS3Provider.ts — drop always-nullish null ?? operand.

Test changes (required by Jest 29 / TS 5)

  • __tests__ updated for Jest 29: removed jasmine.* globals (jasmine.anyexpect.any), spyOnjest.spyOn, CommonJS __esModule interop on mock factories, and setImmediatesetTimeout. Affected packages: amazon-cognito-identity-js, api-graphql, api-rest, auth, aws-amplify, cache, core, datastore, interactions, predictions, pubsub, storage.
  • packages/datastore/jest.setup.js (new) — restores Node's setImmediate/clearImmediate for fake-indexeddb under jest-environment-jsdom@29.
  • Snapshot refreshes in datastore reflecting TS 5 compiled output.
  • lockfile updated for the new resolutions.

Issue #, if available

N/A

Description of how you validated changes

Using Node 24 (the version this repo's CI uses):

  • lerna run build — all 20 packages build, declarations emitted, 0 compiler errors.
  • lerna run test — every package's existing test script runs and passes (including the tslint + coverage gates), plus yarn test:license and yarn test:github-actions.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@soberm soberm requested review from a team as code owners June 25, 2026 17:16
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4c5f4d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@soberm soberm force-pushed the chore/ts-upgrade-v5 branch from 2738cbc to 6dac097 Compare June 26, 2026 11:22
@soberm soberm requested a review from a team as a code owner June 26, 2026 11:22
@soberm soberm changed the title chore: upgrade TypeScript to 4.9.5 chore: upgrade TypeScript to 5.8.3 Jun 26, 2026
@soberm soberm force-pushed the chore/ts-upgrade-v5 branch from 6dac097 to 68c71d7 Compare June 26, 2026 12:10
Upgrade TypeScript 3.8.3 -> 5.8.3 across the monorepo, aligning the
v5-stable compiler with the version already used on main.

ts-jest 24 cannot compile TypeScript 5 (it relies on
ts.getMutableClone, removed in TS 5.0), so the jest toolchain is moved
to the 29.x line (jest, ts-jest, @types/jest, jest-environment-jsdom)
to match the stack already used on main.

Includes the minimal behavior-preserving source and test adjustments
the new compiler and test runner require.
@soberm soberm force-pushed the chore/ts-upgrade-v5 branch from 68c71d7 to 4c5f4d5 Compare June 26, 2026 12:22
@soberm soberm changed the title chore: upgrade TypeScript to 5.8.3 chore: upgrade TypeScript to 5.8.3 in v5 Jun 26, 2026
@soberm soberm merged commit da7f0e4 into v5-stable Jun 30, 2026
28 checks passed
@soberm soberm deleted the chore/ts-upgrade-v5 branch June 30, 2026 08:08
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.

3 participants