-
Notifications
You must be signed in to change notification settings - Fork 156
✨ FFL-16 Precomputed flags evaluation #3571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
862769f
to
3078f1b
Compare
3078f1b
to
044fd8c
Compare
OpenFeature recommends relying on web-sdk package instead of core. The downside is that web-sdk is not side-effect free, so it's better if we don't depend on StandardResolutionReasons. The good news is that TypeScript should be able to check literals against enum and using 'DEFAULT' literal is shorter and reduces bundle size a bit.
Remove peer dependencies from `dependencies` list. Also use caret range, so users are free to select SDK version.
2db56e2
to
b4a92c6
Compare
d502696
to
6c7ab1b
Compare
```typescript | ||
// Initialize RUM with experimental feature flags tracking | ||
import { datadogRum } from '@datadog/browser-rum'; | ||
|
||
// Initialize Datadog Browser SDK | ||
datadogRum.init({ | ||
... | ||
enableExperimentalFeatures: ["feature_flags"], | ||
... | ||
}); | ||
|
||
// Add OpenFeature hook | ||
OpenFeature.addHooks({ | ||
after(_hookContext: HookContext, details: EvaluationDetails<FlagValue>) { | ||
datadogRum.addFeatureFlagEvaluation(details.flagKey, details.value) | ||
} | ||
}) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leoromanovsky here's an example of sending of sending flag evaluation to RUM using existing feature flags implementation
*/ | ||
clientToken: string | ||
|
||
baseUrl: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know what's our default base url is, so this option is required for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for getting your arms around the openfeature spec, it's great to see its semantics coming together. looking forward to building this out with events in the next iteration.
"id": "1", | ||
"data": { | ||
"attributes": { | ||
"createdAt": 1731939805123, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great start
// type safety: OpenFeature interface requires us to return a | ||
// specific T for *any* value of T (which could be any subtype of | ||
// JsonValue). We can't even theoretically implement it in a | ||
// type-sound way because there's no runtime information passed to | ||
// learn what type the user expects. So it's up to the user to | ||
// makesure they pass the appropriate type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea this is tricky and I am curious as we dogfood it how it "feels"; we'll evolve it to make it easier for our users
/** | ||
* Create configuration from a string created with `configurationToString`. | ||
*/ | ||
export function configurationFromString(s: string): Configuration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who needs classes 😇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
embracing classless life and tree-shaking 😅
/trigger-ci |
View all feedbacks in Devflow UI.
cannot get branch ffe-openfeature from github API: unexpected status code: 404 Not Found (Request ID: 98B1:3DAA79:2CB0579:5816422:68383EED) Details
If you need support, contact us on Slack #devflow with those details! |
converted to draft because it cannot run CI, branched in #3580 |
Motivation
Precomputed flags evaluation + small fixes on top of #3554.
Changes
See individual commits for more details.
Test instructions
Checklist
cc @leoromanovsky