Skip to content

build: upgrade to typescript 6 - #1424

Open
joker23 wants to merge 5 commits into
mainfrom
skz/sdk-2193/typescript-6
Open

build: upgrade to typescript 6#1424
joker23 wants to merge 5 commits into
mainfrom
skz/sdk-2193/typescript-6

Conversation

@joker23

@joker23 joker23 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This PR will update all of the configuration files (package.json, jest.config.js, and tsconfig.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 compiler and module-resolution changes can shift build output and .d.ts generation across many published packages, though the PR targets config-only fixes with no runtime code edits.

Overview
Upgrades the monorepo from TypeScript 5.1.6 to 6.0.3 across root and workspace packages, with no intended changes to SDK runtime source.

Compiler settings are adjusted for TS 6 defaults: most browser/bundler packages move from moduleResolution: "node" to bundler, while Node-oriented packages (e.g. server-node, shared server libs, DynamoDB/Redis stores, OTel) use module / moduleResolution: "node16" instead of legacy commonjs + node. Many configs add ignoreDeprecations": "6.0", refresh lib to es2020 (and sometimes dom), and explicitly set types for Jest/Node where needed.

Jest / build wiring: root jest.config.js passes ts-jest a tsconfig override forcing module: CommonJS for tests. @launchdarkly/react-sdk adds tsconfig.build.json (deprecation suppression) and points tsup at it for DTS generation. Shopify Oxygen contract-tests disable tsup dts to avoid TS 6 declaration emit issues.

Minor example tweaks include hello-react @types/react / @types/react-dom at v19 and expanded server-ai example tsconfig rootDir/outDir.

Reviewed by Cursor Bugbot for commit 73effea. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26360 bytes
Compressed size limit: 29000
Uncompressed size: 129188 bytes

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179691 bytes
Compressed size limit: 200000
Uncompressed size: 831704 bytes

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32077 bytes
Compressed size limit: 34000
Uncompressed size: 114525 bytes

@joker23
joker23 force-pushed the skz/sdk-2193/typescript-6 branch from 5a372d8 to afad83f Compare June 9, 2026 14:09
@joker23
joker23 force-pushed the skz/sdk-2193/typescript-6 branch 3 times, most recently from 85454a3 to 6e50860 Compare June 24, 2026 16:18
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 39164 bytes
Compressed size limit: 39300
Uncompressed size: 213754 bytes

@joker23

joker23 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@joker23
joker23 marked this pull request as ready for review June 25, 2026 20:37
@joker23
joker23 requested a review from a team as a code owner June 25, 2026 20:37

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@joker23
joker23 force-pushed the skz/sdk-2193/typescript-6 branch from 462a5a2 to d5e8b12 Compare July 6, 2026 13:38
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@joker23
joker23 force-pushed the skz/sdk-2193/typescript-6 branch 2 times, most recently from c294eca to 192fc07 Compare July 9, 2026 16:19

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

"resolveJsonModule": true,
"stripInternal": true,
"moduleResolution": "node",
"moduleResolution": "bundler",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 CommonJS build breaks for two packages because their module resolution setting is incompatible with CommonJS output

The module resolution is changed to "bundler" (packages/sdk/vercel/tsconfig.json:18 and packages/shared/sdk-server-edge/tsconfig.json:17), but both packages are built via scripts/build-package.sh, which invokes tsc --module commonjs. TypeScript does not allow moduleResolution: "bundler" when module is commonjs, so the CJS build will fail with a compiler error.

Impact: The vercel SDK and the server-edge shared package cannot be built, blocking all releases that depend on them.

Build script passes --module commonjs which conflicts with bundler resolution

The build script at scripts/build-package.sh:30 runs:

tsc --module commonjs --outDir dist/cjs/

This overrides the tsconfig module field to commonjs at compile time, but moduleResolution remains "bundler" from the tsconfig. TypeScript enforces that moduleResolution: "bundler" can only be used with module values of es2015 or later, node16, or nodenext — not commonjs. The previous value of moduleResolution: "node" was compatible with any module setting.

Affected tsconfigs:

  • packages/sdk/vercel/tsconfig.json:18
  • packages/shared/sdk-server-edge/tsconfig.json:17
Prompt for agents
The packages/sdk/vercel and packages/shared/sdk-server-edge packages use scripts/build-package.sh for their build, which runs tsc --module commonjs for the CJS output. Changing moduleResolution to bundler in their tsconfig.json files is incompatible with this because TypeScript does not allow moduleResolution bundler with module commonjs.

Two possible fixes:
1. Revert moduleResolution to node in these two tsconfigs (packages/sdk/vercel/tsconfig.json and packages/shared/sdk-server-edge/tsconfig.json), or use node16 which is compatible with both commonjs and es2022.
2. Update scripts/build-package.sh to also pass --moduleResolution node16 (or node) when building the CJS output, so the CLI flag overrides the tsconfig for both module and moduleResolution.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@joker23
joker23 force-pushed the skz/sdk-2193/typescript-6 branch from 192fc07 to 73effea Compare July 27, 2026 18:21
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.

1 participant