-
Notifications
You must be signed in to change notification settings - Fork 33
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
[FEATURE] In-memory provider for js (node) and web SDKs #565
Comments
I was looking at both js-contrib inMemoryProvider and the Java Provider mentioned and the structure looks pretty different. The JS one uses object literals to assign values to flags while Java's goes deeper with variants and context evaluator. This part caught my attention from the js: async resolveObjectEvaluation<U extends JsonValue>(flagKey: string): Promise<ResolutionDetails<U>> {
throw new GeneralError('support for object flags has not been implemented');
} It is not clear to me if the context aware implementation of js-sdk should be backwards compatible or not. What do you think that would be the best approach in this case @toddbaert ? |
I don't think we have too many docs specifically talking about the current in-memory provider (and if we do have blogs/docs we can update them). I think the most important thing is to have a provider that conforms to the appendix in the spec, and is robust-enough for use in testing, which is the main purpose of the in-memory provider (replace your "real" provider with in-memory in unit testing). I would not worry about the backwards compatibility. The current one will still be available on NPM regardless. (though we will likely deprecate it). |
Ok. I'd like to work on the
It can be done in the If that's ok, assign it to me please |
## This PR Implements the following features for `inMemoryProvider`: - default value for flags - reason for flag evaluation - Context based evaluation ### Related Issues It's part of #565 --------- Signed-off-by: Luiz Ribeiro <[email protected]> Co-authored-by: Todd Baert <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
Signed-off-by: Luiz Guilherme Ribeiro <[email protected]>
## This PR - Adds in memory provider implementation for client (web) sdk - Move files from server sdk to shared ### Related Issues Closes #565 ### Notes It's a first try. Any feedback and enhancement proposals are welcome :) ### How to test Automated/unit testes were implemented, but e2e tests wouldn't hurt. --------- Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
Requirements
As outlined in the specification, the js-sdk should include an in-memory provider implementation. This implementation should take a simple object that defines flags as well as simple rules in the form of lambdas (see equivalent Java implementation, and existing JS implementation in contrib) and use those to evaluate flags. This is very useful to conusmers of the SDK for testing purposes. Please carefully implement all the behaviors defined in the spec for the in-memory provider.
This is a great issue to take on if you're looking to get started in OpenFeature!
@moredip This would be pretty similar to what you implemented in the JS contrib. I think the main thing missing would be rules-based evaluation (some flag "values" would instead define lambdas to run which are passed the context). If you'd like to work on this issue, just assign it to yourself. Otherwise, I will add the
good first issue
, etc tags to it which I suspect will result in it quickly being picked up.Tasks
The text was updated successfully, but these errors were encountered: