Skip to content

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Jan 16, 2026

This PR will:

  • Updates the common client typing so evaluation detail properties are optional (better compat)
  • Moved the non-optional evaluation detail type to RN only (to avoid breaking changes)

Note

  • Shared SDK types: Make reason optional in LDEvaluationDetail and LDEvaluationDetailTyped (src/api/LDEvaluationDetail.ts). Update createSuccessEvaluationDetail to omit reason when undefined (evaluation/evaluationDetail.ts).
  • Inspection flow: LDClientImpl now emits flag detail changes without reason for non-reason cases (e.g., deleted/unknown flags), and tests updated to match (removed reason: null expectations).
  • React Native override: Add hooks/variation/LDEvaluationDetail.ts defining RN-specific types with reason | null, and re-export them from index.ts to override common types.
  • Hook behavior: useTypedVariationDetail normalizes returned details to ensure reason is null when absent across typed variation methods.
  • Tests: Adjust inspector tests to reflect optional reason and updated detail shapes.

Written by Cursor Bugbot for commit 99fc7df. This will update automatically on new commits. Configure here.

@joker23 joker23 requested a review from a team as a code owner January 16, 2026 22:47
@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23329 bytes
Compressed size limit: 25000
Uncompressed size: 81328 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

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

* An optional object describing the main factor that influenced the flag evaluation value.
*/
reason: LDEvaluationReason | null;
reason?: LDEvaluationReason | null;
Copy link
Member

Choose a reason for hiding this comment

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

I would like to make null not a possibility. How problematic do we think that would be?

Can RN just ?? null it?

Copy link
Contributor Author

@joker23 joker23 Jan 16, 2026

Choose a reason for hiding this comment

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

That's actually better... I thought it was nullable in the previous sdk (which was why I made it this way)... but apparently not https://github.com/launchdarkly/js-sdk-common/blob/cb9e954d9bf6715021e169c80a6ab9862cafd226/typings.d.ts#L1030 ... I poke around more, but I would also prefer not having null as a possible value.

Copy link

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@joker23 joker23 force-pushed the skz/change-eval-typing branch from 2c4e445 to 3b6e776 Compare January 17, 2026 00:21
@joker23 joker23 force-pushed the skz/change-eval-typing branch from 3b6e776 to 99fc7df Compare January 17, 2026 00:31
@joker23 joker23 requested a review from kinyoklion January 17, 2026 00:42
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.

3 participants