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 config-only change affects how every package type-checks and builds; wrong module resolution could alter emit or break CI, but no runtime logic is touched.

Overview
Upgrades the workspace from TypeScript 5.1.6 to 6.0.3 across root and package devDependencies, with no SDK/runtime source edits in this diff.

Compiler settings are aligned with TS 6 expectations: moduleResolution moves from node to bundler for most browser/ESM packages and to node16 for Node-oriented packages (e.g. server-node, shared sdk-server, DynamoDB/Redis stores). Several configs switch module from commonjs to node16 or ESNext, bump lib toward es2020, and add ignoreDeprecations": "6.0" where legacy options still apply. Explicit types for jest/node appear in multiple tsconfig.json files.

Tooling tweaks: root jest.config.js configures ts-jest with module: CommonJS; @launchdarkly/react-sdk adds tsconfig.build.json and points tsup at it for declaration emit. Shopify Oxygen contract-tests set dts: false in tsup. The hello-react example bumps @types/react / @types/react-dom to v19. Many jest.config.json files are reformatted without behavioral changes.

Reviewed by Cursor Bugbot for commit 192fc07. 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: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 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: 179504 bytes
Compressed size limit: 200000
Uncompressed size: 831427 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: 32027 bytes
Compressed size limit: 34000
Uncompressed size: 114248 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: 38781 bytes
Compressed size limit: 39000
Uncompressed size: 212361 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 from b34e511 to fae592f Compare July 9, 2026 16:02
@joker23 joker23 force-pushed the skz/sdk-2193/typescript-6 branch 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.

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