-
Notifications
You must be signed in to change notification settings - Fork 52
feat(launchdarkly-provider): Add new provider #343
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
Conversation
Hey @Mateoc ! Thanks for your contribution! We're currently working on updates to the OpenFeature specification to support its usage in web-clients, as well as other client contexts. See here for the progress. I don't think that the current js-sdk has the required APIs to support a proper LaunchDarkly provider for use in browser contexts. We do however have an experimental web-sdk. I won't speak for LaunchDarkly, but I'd feel more comfortable releasing an experimental provider based on that, than something based on the server-side SDK. You can check out the playground, which features a demo quality LaunchDarkly provider. |
@toddbaert Thanks for the quick response. I didn't notice this was exclusively server side specially since there are other web libraries using it (probably not meant for client usage I did not check them too much), I will check the experimental library, at a first glance the interface seems similar enough for it to be a simple change If I end up fixing it, should I open a new pr here ? or do you have a different repo for contributions on web providers ? |
This is a fine location! The flagd-web provider is another client-side example based on the experimental web-sdk. Just out of curiosity, are you intending on using this in production somewhere? Or is this more of an experiment? |
@toddbaert, production! @Mateoc works with me at @redpanda-data :D |
@toddbaert I made the refactor to use '@openfeature/web-sdk' there is a question I could not find the answer: |
libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.ts
Outdated
Show resolved
Hide resolved
@Mateoc I'll give this a thorough review today or tomorrow. |
libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.ts
Show resolved
Hide resolved
libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.spec.ts
Outdated
Show resolved
Hide resolved
libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.spec.ts
Outdated
Show resolved
Hide resolved
libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.spec.ts
Outdated
Show resolved
Hide resolved
libs/providers/launchdarkly-client/src/lib/launchdarkly-provider-options.ts
Outdated
Show resolved
Hide resolved
@Mateoc This is correct. The reason it's passed is some other solutions' SDKs don't have the equivalent of an |
@Mateoc @kinyoklion the web-sdk implements our (yet to be released) events specification. You can see a primitive example here. It's not necessary to implement it in this provider now, but I wanted to bring it to your attention, since it's likely particularly useful for web client scenarios. I should mention that because this API is not yet specified, it's certainly subject to change. |
@toddbaert thanks for all you feedback! |
I've added a few more minor comments. I haven't had a chance to test this myself, but I will do that soon. That's the last thing required for approval on my end. I'd like to have approval from at least one person from LaunchDarkly, @kinyoklion or otherwise. Particularly because this is built on an experimental SDK, I'd like the explicit approval of somebody representing their organization. I hope you can appreciate that @Mateoc . |
@toddbaert I just fix latest comments. Thanks! |
@Mateoc looks like you need to sign-off on some of your commits. |
@Mateoc you have some lint errors. Mostly around |
351d0b6
to
ed27715
Compare
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.
I think we can improve the initialization, but I think this is probably fine considering this will be experimental at this point in time.
@Mateoc I was able to test this locally and it worked as I'd expect, with the exception of the build (which also failed in the CI). You'll need to add your dependencies to the root The only thing you should have to do manually is specify peer deps, which you've done, though I recommend changing your version match for the web-sdk, since we treat minor as major under v1.0 |
}, | ||
"dependencies": { | ||
"lodash.isequal": "^4.5.0" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.isequal": "^4.5.6" | ||
} |
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.
}, | |
"dependencies": { | |
"lodash.isequal": "^4.5.0" | |
}, | |
"devDependencies": { | |
"@types/lodash.isequal": "^4.5.6" | |
} | |
} |
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.
These should compute automatically in the dist/package.json if you add them to the root package.json
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.
Done
I did not think this was going to work, is not even in the peer, how ?
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.
nx should automatically compute these and put them in the distributed module's package.json. That is how it worked until a recent bug in nx. Upgrading to nx v16 fixes it. I'll do that in a separate PR and make sure everything works again before releasing. I've rebased your branch on main and resolved some conflicts. I'm OK to merge now unless you have any objections.
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.
Signed-off-by: mateo <[email protected]>
Signed-off-by: mateo <[email protected]>
…k instead Signed-off-by: mateo <[email protected]>
…pen-feature#337) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: mateo <[email protected]>
…econd round. Signed-off-by: mateo <[email protected]>
…mprove README.md with LD specifics. Signed-off-by: mateo <[email protected]>
…ization Signed-off-by: mateo <[email protected]>
Signed-off-by: mateo <[email protected]>
…on instead Signed-off-by: mateo <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
@toddbaert awesome, thanks |
Thanks @toddbaert for all the assistance! |
This PR
Implements a provider for LaunchDarkly launchdarkly-js-client-sdk.
Is based on the provider for the node sdk