build: upgrade to typescript 6#1424
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
5a372d8 to
afad83f
Compare
85454a3 to
6e50860
Compare
|
@launchdarkly/js-client-sdk-common size report |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 462a5a2. Configure here.
462a5a2 to
d5e8b12
Compare
| "lib": ["es6", "dom"], | ||
| "module": "ES6", | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "node16", |
There was a problem hiding this comment.
🔴 Module resolution setting is incompatible with module format in several test and example configs, likely breaking compilation
The module resolution strategy is set to node16 (moduleResolution: "node16" at packages/sdk/react-native/tsconfig.test.json:7) while the module format remains ES6, so TypeScript will reject the configuration because node16 resolution requires the module format to also be node16 or nodenext.
Impact: TypeScript compilation will fail for React Native tests with a configuration error.
Inconsistent migration across the PR — some configs were updated correctly, others were not
The PR correctly pairs module: "node16" with moduleResolution: "node16" in several configs (e.g., packages/sdk/server-node/tsconfig.json:8, packages/shared/sdk-server/tsconfig.json:7, packages/sdk/electron/contract-tests/entity/tsconfig.json:4). However, the following configs were changed to moduleResolution: "node16" without updating module to match:
packages/sdk/react-native/tsconfig.test.json—module: "ES6"packages/sdk/react-native/example/e2e/tsconfig.json—module: "ES6"packages/sdk/svelte/tsconfig.test.json—module: "ES6"packages/sdk/akamai-edgekv/example/tsconfig.json—module: "es2015"packages/sdk/vercel/examples/complete/tsconfig.json—module: "esnext"packages/sdk/vercel/examples/route-handler/tsconfig.json—module: "esnext"packages/tooling/contract-test-utils/tsconfig.json—module: "ESNext"
Prompt for agents
Seven tsconfig.json files were changed to use moduleResolution: node16 without also updating the module setting to be compatible. The moduleResolution: node16 option requires module to be node16 or nodenext. Either change module to node16/nodenext in these files, or use moduleResolution: bundler instead (as was done in many other configs in this same PR). The affected files are:
1. packages/sdk/react-native/tsconfig.test.json (module: ES6)
2. packages/sdk/react-native/example/e2e/tsconfig.json (module: ES6)
3. packages/sdk/svelte/tsconfig.test.json (module: ES6)
4. packages/sdk/akamai-edgekv/example/tsconfig.json (module: es2015)
5. packages/sdk/vercel/examples/complete/tsconfig.json (module: esnext)
6. packages/sdk/vercel/examples/route-handler/tsconfig.json (module: esnext)
7. packages/tooling/contract-test-utils/tsconfig.json (module: ESNext)
For test configs that are only used by ts-jest, moduleResolution: bundler may be the better choice. For the Vercel Next.js examples, either bundler or updating module to nodenext would work.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "rootDir": ".", | ||
| "sourceMap": false, | ||
| "moduleResolution": "node" | ||
| "moduleResolution": "node16" |
There was a problem hiding this comment.
🔴 Module resolution setting is incompatible with module format in the Akamai EdgeKV example, likely breaking compilation
The module resolution strategy is set to node16 (moduleResolution: "node16" at packages/sdk/akamai-edgekv/example/tsconfig.json:9) while the module format remains es2015, so TypeScript will reject the configuration because node16 resolution requires the module format to also be node16 or nodenext.
Impact: TypeScript compilation will fail for the Akamai EdgeKV example project with a configuration error.
The original config used moduleResolution: node which was compatible with module: es2015
The base commit had moduleResolution: "node" paired with module: "es2015", which is a valid combination. The PR changed only moduleResolution to "node16" without updating module, breaking the pairing.
| "moduleResolution": "node16" | |
| "moduleResolution": "bundler" |
Was this helpful? React with 👍 or 👎 to provide feedback.
| "esModuleInterop": true, | ||
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "node16", |
There was a problem hiding this comment.
🔴 Module resolution setting is incompatible with module format in the Vercel complete example, likely breaking compilation
The module resolution strategy is set to node16 (moduleResolution: "node16" at packages/sdk/vercel/examples/complete/tsconfig.json:12) while the module format remains esnext, so TypeScript will reject the configuration because node16 resolution requires the module format to also be node16 or nodenext.
Impact: TypeScript compilation will fail for the Vercel complete example project with a configuration error.
The original config used moduleResolution: node which was compatible with module: esnext
The base commit had moduleResolution: "node" paired with module: "esnext", which is a valid combination. The PR changed only moduleResolution to "node16" without updating module, breaking the pairing.
| "moduleResolution": "node16", | |
| "moduleResolution": "bundler", |
Was this helpful? React with 👍 or 👎 to provide feedback.
| "module": "ESNext", | ||
| "moduleResolution": "node", | ||
| "types": ["node"], | ||
| "moduleResolution": "node16", |
There was a problem hiding this comment.
🔴 Module resolution setting is incompatible with module format in the contract-test-utils, likely breaking compilation
The module resolution strategy is set to node16 (moduleResolution: "node16" at packages/tooling/contract-test-utils/tsconfig.json:9) while the module format remains ESNext, so TypeScript will reject the configuration because node16 resolution requires the module format to also be node16 or nodenext.
Impact: TypeScript compilation will fail for the contract test utilities with a configuration error.
The original config used moduleResolution: node which was compatible with module: ESNext
The base commit had moduleResolution: "node" paired with module: "ESNext", which is a valid combination. The PR changed only moduleResolution to "node16" without updating module, breaking the pairing.
| "moduleResolution": "node16", | |
| "moduleResolution": "bundler", |
Was this helpful? React with 👍 or 👎 to provide feedback.
This PR will update all of the configuration files (
package.json,jest.config.js, andtsconfig.json) to use typescript 6.There shouldn't be any implementation changes here as all implementation at this point should conform nicely with the new typescript version.
Note
Medium Risk
Wide monorepo compiler and module-resolution changes can shift emitted JS/types and break CI builds even without source edits; risk is tooling/regression across many packages rather than product logic.
Overview
Upgrades the entire monorepo from TypeScript 5.1.6 to 6.0.3 by pinning
typescriptin the root and workspacepackage.jsonfiles. There are no SDK implementation changes—only toolchain configuration.tsconfig.jsonupdates align with TS 6’s stricter module rules: many browser/edge/bundler packages move frommoduleResolution: "node"tobundler, while Node-oriented packages (server-node,sdk-server, stores, telemetry, etc.) adoptmodule: "node16"withmoduleResolution: "node16". Several configs addignoreDeprecations: "6.0", explicittypesfor Jest/Node, andlibbumps (e.g.es6→es2020).Jest / build tweaks: root
jest.config.jspassests-jestatsconfigoverride withmodule: CommonJSfor tests; manyjest.config.jsonfiles are reformatted only.@launchdarkly/react-sdkaddstsconfig.build.jsonwithignoreDeprecationsand pointstsupat it for DTS generation. Shopify Oxygen contract-tests disabledtsin tsup. hello-react bumps@types/reactto v19 (types only).Examples: server-ai example tsconfigs gain
rootDir/outDirandbundlerresolution; Next.js examples usenode16resolution and dropbaseUrlwhere shown in the diff.Reviewed by Cursor Bugbot for commit b34e511. Bugbot is set up for automated code reviews on this repo. Configure here.