[FFL-2837] Expose precomputed configuration context - #353
Open
btthomas wants to merge 4 commits into
Open
Conversation
1 task
sameerank
approved these changes
Aug 5, 2026
| env: 'production', | ||
| initialFlagsConfiguration: configuration, | ||
| }) | ||
| await OpenFeature.setProvider(provider) |
Contributor
There was a problem hiding this comment.
.setProvider is not awaitable so
Suggested change
| await OpenFeature.setProvider(provider) | |
| await OpenFeature.setProviderAndWait(provider) |
or if we want to show an atomic registration of the context and initialization
Suggested change
| await OpenFeature.setProvider(provider) | |
| if (context !== undefined) { | |
| await OpenFeature.setProviderAndWait(provider, context) | |
| } else { | |
| await OpenFeature.setProviderAndWait(provider) | |
| } |
Comment on lines
+107
to
+112
| const provider = new DatadogProvider({ | ||
| clientToken: 'pub_...', | ||
| site: 'datadoghq.com', | ||
| env: 'production', | ||
| initialFlagsConfiguration: configuration, | ||
| }) |
Contributor
There was a problem hiding this comment.
I see that applicationId is optional in the public type
But DatadogProvider currently rejects its runtime configuration without it
openfeature-js-client/packages/browser/src/domain/configuration.ts
Lines 92 to 95 in afe31a7
Should we include applicationId in this example to match the current runtime behavior?
Contributor
Author
There was a problem hiding this comment.
Another PR coming soon for the optional/required bit.
Either way, fixed the README here: d0d2f51
This was referenced Aug 6, 2026
btthomas
marked this pull request as ready for review
August 7, 2026 16:02
btthomas
requested review from
pavlokhrebto and
vjfridge
and removed request for
a team
August 7, 2026 16:02
sameerank
force-pushed
the
sameerank/FFL-2835/configuration-from-string
branch
from
August 9, 2026 13:51
82bfc2e to
939da97
Compare
Contributor
sameerank
force-pushed
the
blake.thomas/FFL-2837/precomputed-context
branch
from
August 9, 2026 17:08
1eae604 to
166b5b9
Compare
This was referenced Aug 10, 2026
sameerank
force-pushed
the
blake.thomas/FFL-2837/precomputed-context
branch
from
August 11, 2026 14:21
166b5b9 to
6ca8335
Compare
sameerank
force-pushed
the
sameerank/FFL-2835/configuration-from-string
branch
from
August 11, 2026 14:21
939da97 to
03cde21
Compare
sameerank
force-pushed
the
blake.thomas/FFL-2837/precomputed-context
branch
from
August 13, 2026 22:51
6ca8335 to
74ed072
Compare
sameerank
force-pushed
the
sameerank/FFL-2835/configuration-from-string
branch
from
August 18, 2026 15:21
5a5511e to
d91771f
Compare
sameerank
force-pushed
the
blake.thomas/FFL-2837/precomputed-context
branch
from
August 18, 2026 15:21
74ed072 to
b11ce39
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.
Stack
This PR uses #344 as its base. Merge #344 first. Then retarget this PR to
main.Summary
This PR adds
getPrecomputedContext(configuration)to@datadog/flagging-core.The function returns a detached copy of the context from a valid precomputed configuration. It returns
undefinedwhen the configuration does not have a context-specific precomputed branch. The function does not change the configuration, OpenFeature, or provider state.The function is available from these entry points:
@datadog/flagging-core@datadog/flagging-core/configuration@datadog/flagging-core/precomputed@datadog/openfeature-browser@datadog/openfeature-browser/precomputedThe precomputed entry points remain free of Protobuf-ES modules.
Reason
The configuration wire and parsed configuration are opaque contracts. SDK users need a supported way to set the OpenFeature context for a context-specific precomputed configuration.
Without this function, each SDK must inspect internal configuration fields or implement the same accessor. A shared function keeps browser and React Native behavior consistent.
Behavior
undefinedfor empty, rules-only, invalid-precomputed, and context-agnostic configurations.Validation