chore: upgrade TypeScript to 5.8.3 in v5#14852
Merged
Merged
Conversation
|
2738cbc to
6dac097
Compare
6dac097 to
68c71d7
Compare
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.
68c71d7 to
4c5f4d5
Compare
osama-rizk
approved these changes
Jun 29, 2026
pranavosu
approved these changes
Jun 29, 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.
Description of changes
Routine compiler modernization for
v5-stable: upgrade TypeScript from3.8.3to5.8.3across the monorepo, bringing this branch in line with the compiler already used onmain(v6).ts-jest@24cannot compile TypeScript 5 — it depends onts.getMutableClone, which was removed in TS 5.0 — so the Jest toolchain is moved to the29.xline to match the stackmainalready 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
package.json:typescript 3.8.3 → 5.8.3;jest,ts-jest,@types/jest,babel-jest,jest-config→29.x; addjest-environment-jsdom@29; add@babel/coretoresolutions.typescriptpin5.0.2 → 5.8.3:api,api-graphql,api-rest,core,storage.tslib ^1 → ^2(required by TS 5 helper emit):analytics,geo,predictions.transformtuple format (globals['ts-jest']→transform,tsConfig→tsconfig, drop removedtestURL):analytics,api,api-graphql,api-rest,auth,aws-amplify,cache,core,datastore,datastore-storage-adapter,geo,interactions,predictions,pubsub,pushnotification,storage, andamazon-cognito-identity-js/jest.config.js,notifications/jest.config.js.@types/jest/babel-jestline bumps inpushnotificationandaws-amplify-react-native.Source changes (behavior-preserving, required by TS 5)
packages/auth/src/Auth.ts— explicitnew Promise<void>/resolve(undefined).packages/datastore/src/predicates/sort.ts—String(field)forsymbolindex.packages/datastore/src/predicates/next.ts—PersistentModelgeneric constraint.packages/datastore/src/sync/processors/subscription.ts— explicitnew Promise<void>.packages/datastore/src/sync/processors/sync.ts—Record<string, any>on computed-key destructure.packages/datastore/src/storage/adapter/StorageAdapterBase.ts—Partial<any>cast.packages/datastore/src/storage/relationship.ts—PersistentModelgeneric constraint.packages/datastore/src/types.ts—Extract<…, { field: any }>for stricter indexed access.packages/datastore/src/util.ts—applyPatchesargument cast (immerDraft<T>).packages/datastore-storage-adapter/src/common/SQLiteUtils.ts—String(field)cast.packages/geo/src/util.ts— build regex vianew RegExp(..., 'iu')(TS 5.5 validates flags vses5target).packages/interactions/src/Providers/AWSLexProviderHelper/utils.native.ts— build regex vianew RegExp(..., 's').packages/pubsub/src/Providers/AWSAppSyncRealTimeProvider/index.ts—String(authenticationType).packages/pubsub/src/vendor/paho-mqtt.js— JSDoc@type {any}for declaration emit.packages/storage/src/providers/AWSS3Provider.ts— drop always-nullishnull ??operand.Test changes (required by Jest 29 / TS 5)
__tests__updated for Jest 29: removedjasmine.*globals (jasmine.any→expect.any),spyOn→jest.spyOn, CommonJS__esModuleinterop on mock factories, andsetImmediate→setTimeout. 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'ssetImmediate/clearImmediateforfake-indexeddbunderjest-environment-jsdom@29.datastorereflecting TS 5 compiled output.lockfileupdated 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 existingtestscript runs and passes (including thetslint+ coverage gates), plusyarn test:licenseandyarn test:github-actions.Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.