Repository navigation
fix(akamai-edgeworker-sdk): reduce bundles with dual ESM and CJS output - #2171
Merged
Merged
Conversation
Contributor
Author
|
A few items to verify before merging:
The measured bundle-size reduction looks useful; these checks are about confirming packaging and runtime compatibility before landing it. |
jthorupp
marked this pull request as ready for review
November 5, 2026 09:58
joker23
reviewed
Nov 5, 2026
Merged
joker23
pushed a commit
that referenced
this pull request
Nov 6, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>akamai-edgeworker-sdk-common: 2.0.49</summary> ## [2.0.49](akamai-edgeworker-sdk-common-v2.0.48...akamai-edgeworker-sdk-common-v2.0.49) (2026-11-06) ### Bug Fixes * **akamai-edgeworker-sdk:** reduce bundles with dual ESM and CJS output ([#2171](#2171)) ([1504e6c](1504e6c)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from ^2.26.3 to ^2.26.4 </details> <details><summary>akamai-server-base-sdk: 3.0.50</summary> ## [3.0.50](akamai-server-base-sdk-v3.0.49...akamai-server-base-sdk-v3.0.50) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.48 to ^2.0.49 </details> <details><summary>akamai-server-edgekv-sdk: 1.4.52</summary> ## [1.4.52](akamai-server-edgekv-sdk-v1.4.51...akamai-server-edgekv-sdk-v1.4.52) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.48 to ^2.0.49 * @launchdarkly/js-server-sdk-common bumped from ^2.26.3 to ^2.26.4 </details> <details><summary>client-testing-plugin: 1.0.31</summary> ## [1.0.31](client-testing-plugin-v1.0.30...client-testing-plugin-v1.0.31) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2 * devDependencies * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2 * @launchdarkly/react-sdk bumped from 4.2.1 to 4.2.2 * peerDependencies * @launchdarkly/js-client-sdk bumped from ^4.9.1 to ^4.14.2 * @launchdarkly/react-sdk bumped from ^4.1.4 to ^4.2.2 </details> <details><summary>cloudflare-server-sdk: 2.7.51</summary> ## [2.7.51](cloudflare-server-sdk-v2.7.50...cloudflare-server-sdk-v2.7.51) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.46 to 2.6.47 </details> <details><summary>eventsource: 0.2.4</summary> ## [0.2.4](eventsource-v0.2.3...eventsource-v0.2.4) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2 </details> <details><summary>fastly-server-sdk: 0.2.41</summary> ## [0.2.41](fastly-server-sdk-v0.2.40...fastly-server-sdk-v0.2.41) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 </details> <details><summary>jest: 1.0.41</summary> ## [1.0.41](jest-v1.0.40...jest-v1.0.41) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/react-native-client-sdk bumped from ~10.23.3 to ~10.23.4 </details> <details><summary>js-client-sdk: 4.14.2</summary> ## [4.14.2](js-client-sdk-v4.14.1...js-client-sdk-v4.14.2) (2026-11-06) ### Bug Fixes * Keep JSDoc in sdk-client declarations and show inherited LDClient docs ([#2181](#2181)) ([09b5f99](09b5f99)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2 * optionalDependencies * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4 </details> <details><summary>js-client-sdk-common: 1.35.2</summary> ## [1.35.2](js-client-sdk-common-v1.35.1...js-client-sdk-common-v1.35.2) (2026-11-06) ### Bug Fixes * Keep JSDoc in sdk-client declarations and show inherited LDClient docs ([#2181](#2181)) ([09b5f99](09b5f99)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2 </details> <details><summary>js-sdk-common: 2.32.2</summary> ## [2.32.2](js-sdk-common-v2.32.1...js-sdk-common-v2.32.2) (2026-11-06) ### Bug Fixes * Handle flag keys that are names of built-in object members ([#2170](#2170)) ([4a18699](4a18699)) </details> <details><summary>js-server-sdk-common: 2.26.4</summary> ## [2.26.4](js-server-sdk-common-v2.26.3...js-server-sdk-common-v2.26.4) (2026-11-06) ### Bug Fixes * Avoid querying a persistent store on every evaluation of an unknown flag ([#2169](#2169)) ([da1cd35](da1cd35)) * Handle flag keys that are names of built-in object members ([#2170](#2170)) ([4a18699](4a18699)) * Keep a flag named __proto__ in file data, change events and persistent store reads ([#2174](#2174)) ([1ffb29b](1ffb29b)) * Make TestData valueForAll return its value when targeting is off ([#2177](#2177)) ([fc8c1f6](fc8c1f6)) * Prevent TestData from throwing for a flag named constructor or toString ([#2173](#2173)) ([4e58d1d](4e58d1d)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2 </details> <details><summary>js-server-sdk-common-edge: 2.6.47</summary> ## [2.6.47](js-server-sdk-common-edge-v2.6.46...js-server-sdk-common-edge-v2.6.47) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 </details> <details><summary>node-client-sdk: 4.4.3</summary> ## [4.4.3](node-client-sdk-v4.4.2...node-client-sdk-v4.4.3) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4 * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2 </details> <details><summary>node-server-sdk: 9.16.4</summary> ## [9.16.4](node-server-sdk-v9.16.3...node-server-sdk-v9.16.4) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4 * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 </details> <details><summary>node-server-sdk-dynamodb: 6.4.7</summary> ## [6.4.7](node-server-sdk-dynamodb-v6.4.6...node-server-sdk-dynamodb-v6.4.7) (2026-11-06) ### Bug Fixes * Avoid querying a persistent store on every evaluation of an unknown flag ([#2169](#2169)) ([da1cd35](da1cd35)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.4 </details> <details><summary>node-server-sdk-otel: 1.3.43</summary> ## [1.3.43](node-server-sdk-otel-v1.3.42...node-server-sdk-otel-v1.3.43) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.11.3 to >=9.16.4 </details> <details><summary>node-server-sdk-redis: 4.4.7</summary> ## [4.4.7](node-server-sdk-redis-v4.4.6...node-server-sdk-redis-v4.4.7) (2026-11-06) ### Bug Fixes * Avoid querying a persistent store on every evaluation of an unknown flag ([#2169](#2169)) ([da1cd35](da1cd35)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.4 </details> <details><summary>openfeature-cloudflare-server: 1.2.0</summary> ## [1.2.0](openfeature-cloudflare-server-v1.1.3...openfeature-cloudflare-server-v1.2.0) (2026-11-06) ### Features * Add an initialization timeout option to the OpenFeature Cloudflare provider ([#2182](#2182)) ([ba6ee3a](ba6ee3a)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/openfeature-js-server-common bumped from 2.2.2 to 2.2.3 * devDependencies * @launchdarkly/cloudflare-server-sdk bumped from 2.7.50 to 2.7.51 * peerDependencies * @launchdarkly/cloudflare-server-sdk bumped from ^2.7.0 to ^2.7.51 </details> <details><summary>openfeature-js-server-common: 2.2.3</summary> ## [2.2.3](openfeature-js-server-common-v2.2.2...openfeature-js-server-common-v2.2.3) (2026-11-06) ### Bug Fixes * Align OpenFeature context conversion log levels with the provider spec ([#2183](#2183)) ([c356b22](c356b22)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2 </details> <details><summary>openfeature-node-server: 2.1.7</summary> ## [2.1.7](openfeature-node-server-v2.1.6...openfeature-node-server-v2.1.7) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/openfeature-js-server-common bumped from 2.2.2 to 2.2.3 * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4 * peerDependencies * @launchdarkly/node-server-sdk bumped from ^9.0.0 to ^9.16.4 </details> <details><summary>react-native-client-sdk: 10.23.4</summary> ## [10.23.4](react-native-client-sdk-v10.23.3...react-native-client-sdk-v10.23.4) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2 </details> <details><summary>react-sdk: 4.2.2</summary> ## [4.2.2](react-sdk-v4.2.1...react-sdk-v4.2.2) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2 * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 </details> <details><summary>server-sdk-ai: 2.0.20</summary> ## [2.0.20](server-sdk-ai-v2.0.19...server-sdk-ai-v2.0.20) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 * peerDependencies * @launchdarkly/js-server-sdk-common bumped from ^2.0.0 to ^2.26.4 </details> <details><summary>server-sdk-ai-langchain: 0.8.31</summary> ## [0.8.31](server-sdk-ai-langchain-v0.8.30...server-sdk-ai-langchain-v0.8.31) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20 </details> <details><summary>server-sdk-ai-openai: 0.7.31</summary> ## [0.7.31](server-sdk-ai-openai-v0.7.30...server-sdk-ai-openai-v0.7.31) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20 </details> <details><summary>server-sdk-ai-vercel: 0.7.31</summary> ## [0.7.31](server-sdk-ai-vercel-v0.7.30...server-sdk-ai-vercel-v0.7.31) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20 </details> <details><summary>shopify-oxygen-sdk: 0.2.6</summary> ## [0.2.6](shopify-oxygen-sdk-v0.2.5...shopify-oxygen-sdk-v0.2.6) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4 </details> <details><summary>vercel-server-sdk: 1.3.74</summary> ## [1.3.74](vercel-server-sdk-v1.3.73...vercel-server-sdk-v1.3.74) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.46 to 2.6.47 </details> <details><summary>vue-client-sdk: 3.0.11</summary> ## [3.0.11](vue-client-sdk-v3.0.10...vue-client-sdk-v3.0.11) (2026-11-06) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Cuts the Release Please rollout that bumps every published workspace package, refreshes `.release-please-manifest.json`, and backfills changelog entries with the new semver tags. > > Functional follow-ups ride along in the version drift: `js-sdk-common`/`js-server-sdk-common` pick up the flag-key edge-case fixes, persistent-store short-circuit, and TestData corrections called out in their notes; `openfeature-cloudflare-server` graduates to `1.2.0` with an explicit initialization timeout knob wired through `LaunchDarklyProvider`, while the Akamai common SDK emits slimmer dual ESM/CJS bundles. Client surfaces (`js-client-sdk`, React/Vue/React Native wrappers, testing plugin, etc.) absorb the refreshed common packages so generated typings keep inherited JSDoc. > > Everywhere else is mechanical—AI provider peers now pin `@launchdarkly/server-sdk-ai` `^2.0.20`, Cloudflare/Fastly/Vercel edge SDKs advance `js-server-sdk-common-edge`, Redis/Dynamo/OTEL integrations raise their `node-server-sdk` floor, and sample apps mirror the new dependency graph. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 52dbf7b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Requirements
Related issues
Related bundle-size and ESM work: #1877, #1972, and #1885.
Describe the solution you've provided
Build
@launchdarkly/akamai-edgeworker-sdk-commonwith tsup to publish both ESM and CommonJS JavaScript and declarations. Add conditional exports andsideEffects: falseso ESM consumers, including the Akamai EdgeKV SDK's Rollup build, can analyze named imports instead of traversing CommonJS re-export wrappers. Retain the existing CommonJSdist/index.jsentry and package type. No new runtime dependencies.Add a build-specific TypeScript configuration using bundler resolution, and update clean to remove all generated outputs. Source maps retain mappings without embedding source contents, matching the server-common build pattern.
Make CryptoJS subpath imports explicitly include
.jsand access Akamai'scryptoexport through a namespace import. These compatibility fixes preserve the shared package's previously passing Node ESM import check without changing how random values are obtained on Akamai. Add a unit test verifying that random identifier generation uses the mocked Akamaicrypto.getRandomValuesexport.Rebuilding the Akamai EdgeKV SDK with the same locally installed dependencies before and after the change produced the following sizes. After sizes include the follow-up ESM compatibility fixes:
Downstream EdgeWorker measurements
A downstream Akamai EdgeWorker application was rebuilt using the locally built SDK packages in place of published SDK version 1.4.51. Application source and bundler settings were unchanged: tsup, ESM output, ES2022 target, minification and tree shaking enabled.
The published-SDK rebuild reproduced the baseline bundle byte-for-byte, and a repeat build with the local SDK produced the same JavaScript size. Archive sizes varied by a few bytes with metadata. These are measurements from one downstream application, not a guarantee of savings for every consumer. Initialization CPU time and Akamai runtime performance were not measured.
Describe alternatives you've considered
The Akamai EdgeKV SDK already minifies with Terser. Changing its public entry point or replacing SDK functionality in the worker would be broader changes; this experiment retains its existing bundled output and uses ESM at the shared-package boundary. Publishing ESM does not guarantee unused client methods can be removed, because functionality reachable through
initstill needs to be retained.Additional context
Validation performed locally on Node v24.22.1:
yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/akamai-server-edgekv-sdk' run build— passed.yarn workspace @launchdarkly/akamai-edgeworker-sdk-common test— passed: 9 suites, 45 tests, including the new Akamai crypto regression test.yarn workspace @launchdarkly/akamai-server-edgekv-sdk test— passed: 2 suites, 9 tests.yarn workspace @launchdarkly/akamai-edgeworker-sdk-common lint— passed with existing test warnings.yarn workspace @launchdarkly/akamai-edgeworker-sdk-common format:check— passed.yarn workspace @launchdarkly/akamai-server-edgekv-sdk lint— passed with an existing unused catch-variable warning.yarn workspace @launchdarkly/akamai-server-edgekv-sdk format:check— passed.git diff --check— passed.scripts/package-config-tests/suites/types.js,runtime.js, andattw.jsthrough a session-local helper against six relevant packed packages (Akamai shared and EdgeKV, common, server-common, Node server, and eventsource), installed into isolated consumer projects. All 144 TypeScript cases, 42 runtime/import/bundling cases, and 28 declaration-analysis cases matched their checked-in baselines. This includes TypeScript 5.0.4, 5.9.3, and 6.0.3. Baselines include known failures; matching the baseline does not mean every case passes. No baselines were changed. This was a targeted subset, not the full repository-wide package-config matrix.CommonJS and ESM imports of the packed shared Akamai package now match the passing runtime baseline, and all conditional export targets exist. The EdgeKV Rollup build successfully consumes the new ESM entry. No Akamai runtime deployment or full supported-platform matrix was exercised. The PR's package-config workflow requires maintainer approval before it can run on this fork.
Note
Overview
Replaces
tscwithtsupso@launchdarkly/akamai-edgeworker-sdk-commonships ESM and CJS (dist/index.mjs/dist/index.js) plus conditionalexports,module, andsideEffects: falseso ESM consumers can tree-shake instead of pulling the whole CommonJS surface.Adds
tsconfig.build.json(bundler resolution) andtsup.config.ts(dual format, DTS, source maps without embedded sources). Clean now wipesdistentirely.Crypto compatibility for the new bundle: CryptoJS imports use explicit
.jssubpaths, and Akamai’s runtimecryptois read via a namespace import asAkamaiCrypto.crypto.getRandomValues(same random-ID behavior). A Jest mock + unit test locks that path.Reviewed by Cursor Bugbot for commit 0e971c8. Bugbot is set up for automated code reviews on this repo. Configure here.