chore: adding camelcase flag keys to useFlags hook#1174
Open
chore: adding camelcase flag keys to useFlags hook#1174
Conversation
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
fecd4c0 to
c26ee61
Compare
c26ee61 to
11d5dc8
Compare
Contributor
Author
|
@cursor review |
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.
depends on #1166
Note
Medium Risk
Changes the shape and key access semantics of the deprecated
useFlags()return value (including key filtering and event emission behavior), which can break consumers relying on raw flag keys or$keys. Scope is limited to deprecated hook and related client/options plumbing, but it impacts runtime flag access and analytics events viavariation()calls.Overview
useFlags()(deprecated hook) now returns camelCased flag keys by default, with an opt-out viauseCamelCaseFlagKeysexposed on the client asshouldUseCamelCaseFlagKeys()(defaulting totrueincreateClientand the server noop client). The proxy maps camelCase property reads back to the original flag key when callingclient.variation(), and filters out$system keys from the returned object.The hook also avoids an extra mount-time render by skipping a redundant
setFlagson first effect run, and updates tests/utilities accordingly (newtoCamelCasehelper + expandeduseFlagstest coverage for proxy semantics, caching, change events, context changes, and custom contexts).Written by Cursor Bugbot for commit 697f71e. This will update automatically on new commits. Configure here.