Skip to content

chore: init shared openfeature server provider#1329

Merged
joker23 merged 6 commits into
mainfrom
skz/sdk-2215/openfeature-server-common
May 5, 2026
Merged

chore: init shared openfeature server provider#1329
joker23 merged 6 commits into
mainfrom
skz/sdk-2215/openfeature-server-common

Conversation

@joker23

@joker23 joker23 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

This PR will initialize the migration of openfeature node server provider to js-core. Specifically, this PR will create a shared openfeature server provider base class.

REVIEWER: The logic in this should be a more generalized version of https://github.com/launchdarkly/openfeature-node-server/tree/main.

Theoretically, this would allow us to implement openfeature providers pretty easily (eg https://github.com/launchdarkly/js-core/blob/skz/sdk-2213/openfeature-migration/packages/sdk/openfeature-node-server/src/LaunchDarklyProvider.ts)

NOTE: at the moment this code won't do anything until we implement the implementing provider in the next PR.


Note

Low Risk
Low risk because this PR only adds a new, pre-release shared package and wiring (workspace/tsc/release-please) without changing behavior of existing SDKs. Main risk is limited to build/release configuration and the correctness of the new translation/provider utilities for future adopters.

Overview
Introduces a new pre-release workspace package, @launchdarkly/openfeature-js-server-common, exporting BaseOpenFeatureProvider plus utilities to translate OpenFeature evaluation contexts/results and tracking event details to LaunchDarkly equivalents.

Adds full package scaffolding (tsup/tsconfig/jest config, README/LICENSE, and unit tests) and wires it into the monorepo via package.json workspaces, root tsconfig references, and release-please manifest/config so it can be versioned and built independently.

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@joker23

joker23 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 marked this pull request as ready for review April 28, 2026 19:10
@joker23 joker23 requested a review from a team as a code owner April 28, 2026 19:10
devin-ai-integration[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-2215/openfeature-server-common branch from a0956f5 to a076b4f Compare April 29, 2026 18:35
devin-ai-integration[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-2215/openfeature-server-common branch from a390a52 to 240dd82 Compare May 4, 2026 16:41
@joker23 joker23 requested a review from kinyoklion May 4, 2026 17:06
cursor[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/sdk-2215/openfeature-server-common branch from 45279a8 to da346b2 Compare May 5, 2026 16:03
devin-ai-integration[bot]

This comment was marked as resolved.

joker23 and others added 3 commits May 5, 2026 11:35
…rovider.ts

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bf81b26. Configure here.

(convertedContext as any)[key] = value;
} else {
logger.error(`The attribute '${key}' must be of type ${LDContextBuiltIns[key]}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prototype property lookup causes incorrect attribute rejection

Low Severity

The key in LDContextBuiltIns check uses the in operator, which traverses the prototype chain. This means context attributes named after Object.prototype properties (e.g., constructor, toString, valueOf) will incorrectly match, enter the type-validation branch, and be rejected with a confusing error message. The check against LDContextBuiltIns[key] would then return a function (the inherited method) rather than a type string, guaranteeing the typeof value === comparison fails. Using Object.hasOwn(LDContextBuiltIns, key) or Object.prototype.hasOwnProperty.call(LDContextBuiltIns, key) would fix this.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bf81b26. Configure here.

@joker23 joker23 merged commit 3812c08 into main May 5, 2026
42 checks passed
@joker23 joker23 deleted the skz/sdk-2215/openfeature-server-common branch May 5, 2026 21:55
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.

2 participants