💡 refactor(flags): Harden flag access to key-scoped APIs and align fl…#175
Merged
Charles Hudson (phobetron) merged 1 commit intomainfrom Mar 12, 2026
Merged
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
1907036 to
ef3d498
Compare
…ag-view tracking - Replace bulk flag consumer access with key-scoped APIs: - Rename `getCustomFlag` to `getFlag` - Remove consumer-facing `getCustomFlags/getFlags` - Replace `states.flags` with `states.flag(name)` in stateful runtimes - Preserve advanced full-map resolution via `flagsResolver.resolve(changes)` - Make automatic flag-view emission stateful-only: - `CoreStateful.getFlag(...)` and `states.flag(name)` emit `trackFlagView` - Stateless/base `getFlag(...)` does not auto-emit - Add `FlagViewBuilderArgs` and update `trackFlagView` signatures across core/analytics - Make `viewId` and `viewDurationMs` optional for flag-view-compatible `ViewEvent` payloads - Remove exported `signals.flags` and add `toDistinctObservable(...)` for distinct key-scoped flag streams - Update downstream harnesses/implementations (node/web demos, React hook typing) to match new surfaces - Added/updated E2E tests to cover flag view events - Refresh TSDoc/README/CONTRIBUTING and SpecKit specs/research for current pre-release behavior BREAKING CHANGE: - `getCustomFlag` -> `getFlag` - `getCustomFlags/getFlags` removed from consumer-facing SDK APIs - `states.flags` -> `states.flag(name)` [[NT-2600](https://contentful.atlassian.net/browse/NT-2600)]
ef3d498 to
dc0963c
Compare
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.
…ag-view tracking
getCustomFlagtogetFlaggetCustomFlags/getFlagsstates.flagswithstates.flag(name)in stateful runtimesflagsResolver.resolve(changes)CoreStateful.getFlag(...)andstates.flag(name)emittrackFlagViewgetFlag(...)does not auto-emitFlagViewBuilderArgsand updatetrackFlagViewsignatures across core/analyticsviewIdandviewDurationMsoptional for flag-view-compatibleViewEventpayloadssignals.flagsand addtoDistinctObservable(...)for distinct key-scoped flag streamsBREAKING CHANGE:
getCustomFlag->getFlaggetCustomFlags/getFlagsremoved from consumer-facing SDK APIsstates.flags->states.flag(name)[NT-2600]