Skip to content
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

feat!: support streaming connection and initialization fixes #418

Merged
merged 7 commits into from
Jul 13, 2023

Conversation

sago2k8
Copy link
Contributor

@sago2k8 sago2k8 commented Jun 16, 2023

This PR

  • Updates the use of launch darkly client in the browser.
  • Fixes couple of bugs when changing the context and fetching the variations.
  • Updates the dependecies so the initalizaiton of the LD client. happens in the provider.
  • expose events for the client to be consumed

Notes

This is used for our team at Redpanda, we use open feature across the stack and we want to use it in our frontend apps too.

Follow-up Tasks

  • update client references so the web-sdk can listen to events to propagate real time changes: I might have missed it but I didn't find a way to make the web-sdk react to real time events from the provider.

Related issues:

How to test

@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch 2 times, most recently from cc843ac to f5541a1 Compare July 3, 2023 00:44
@sago2k8 sago2k8 changed the title WIP: update packages fix: launch darkly client support streaming connection and initialization fixes Jul 3, 2023
@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch from f5541a1 to 557e6c5 Compare July 4, 2023 07:55
@sago2k8 sago2k8 marked this pull request as ready for review July 4, 2023 07:55
@sago2k8 sago2k8 requested a review from a team as a code owner July 4, 2023 07:55
@sago2k8 sago2k8 changed the title fix: launch darkly client support streaming connection and initialization fixes fix!: launch darkly client support streaming connection and initialization fixes Jul 4, 2023
@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch from b1484c6 to afaebca Compare July 4, 2023 10:53
@toddbaert toddbaert requested a review from kinyoklion July 4, 2023 14:50
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look like solid improvements to me. I have a few small concerns, particularly this.

@sago2k8 Based on these policies, we will soon be adding a CODEOWNERs file for each sub component in these monorepos. It's clear you understand the SDK as well as this provider. Would you like to be added to the CODEOWNERS for this component?

I'm awaiting additional reviews, particularly from @kinyoklion and @Mateoc

@sago2k8
Copy link
Contributor Author

sago2k8 commented Jul 4, 2023

These look like solid improvements to me. I have a few small concerns, particularly this.

@sago2k8 Based on these policies, we will soon be adding a CODEOWNERs file for each sub component in these monorepos. It's clear you understand the SDK as well as this provider. Would you like to be added to the CODEOWNERS for this component?

I'm awaiting additional reviews, particularly from @kinyoklion and @Mateoc

Sure, Happy to be part of the CODEOWERS

@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch 2 times, most recently from 685ff58 to 30312b6 Compare July 4, 2023 18:32
@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch 3 times, most recently from 215625b to b86e050 Compare July 5, 2023 08:42
@sago2k8
Copy link
Contributor Author

sago2k8 commented Jul 5, 2023

Thanks for the review @toddbaert, I addressed your comments. Waiting for the extra review

I can safely say @Mateoc will be ok with the constructor changes, but better if we get confirmation.

@toddbaert toddbaert self-requested a review July 5, 2023 15:28
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

I'm not sure if you have any strong opinion on this, but though this does fix some behavior, it also adds significant new features. I wonder if feat! would be a better commit type?

I have removed "launch darkly client" from the title since our release flow automatically updates the readmes/release in such a way it's clear which component the commit applies to.

@toddbaert toddbaert changed the title fix!: launch darkly client support streaming connection and initialization fixes fix!: support streaming connection and initialization fixes Jul 5, 2023
@sago2k8
Copy link
Contributor Author

sago2k8 commented Jul 10, 2023

Looks great.

I'm not sure if you have any strong opinion on this, but though this does fix some behavior, it also adds significant new features. I wonder if feat! would be a better commit type?

I have removed "launch darkly client" from the title since our release flow automatically updates the readmes/release in such a way it's clear which component the commit applies to.

Agree, set title to feat!

@toddbaert
Copy link
Member

@sago2k8 It seems like @kinyoklion still has a concern, but the CI failure is unrelated to your changes. I will fix those in another PR.

@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch 2 times, most recently from 096e895 to 4333a85 Compare July 10, 2023 20:12
@toddbaert
Copy link
Member

@sago2k8 I'm merging main into this to fix the CI issue.

Copy link
Member

@kinyoklion kinyoklion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, but I think things look good.

@toddbaert
Copy link
Member

I'll give @sago2k8 some time to address any nits or make final changes. Will merge tomorrow EOD unless I hear otherwise.

- Update launch darkly sdk to latest and update the semantic definition
  in the package.json
- Allow any version of open feature sdk, I would encourage to use latest
  but until it's stable it make sense to use any '*'

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
Update documentation on the provider options

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch from 022c38a to 04ef788 Compare July 13, 2023 15:53
BREAKING CHANGE: now the arguments of the constructor match the Launch
Darkly initialization arguments, plus an extra argument for setting
different loggers.

- fix initialize function to simplify the usage of the provider.
- Implements streaming flag evaluation.

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
Replace imports from js-sdk to web-sdk, to reduce required dependencies

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
apply single quote style guide

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
Add description to readme, explain new initialization.

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
Update tests to match the result variations spec

Signed-off-by: Santiago Jimenez Giraldo <[email protected]>
@sago2k8 sago2k8 force-pushed the sj/launch-darkly-provider-fixes branch from 04ef788 to f429eb3 Compare July 13, 2023 15:58
@toddbaert toddbaert merged commit 7520092 into open-feature:main Jul 13, 2023
6 checks passed
@toddbaert
Copy link
Member

toddbaert commented Jul 18, 2023

@sago2k8 @Mateoc you guys should have org invites in your inbox. Please accept them so that you can be notified about releases/deps/changes in this component.

See also: #467

@sago2k8
Copy link
Contributor Author

sago2k8 commented Jul 19, 2023

Hey @toddbaert I don't think I have received and invitation to an org yet.

@toddbaert
Copy link
Member

Hey @toddbaert I don't think I have received and invitation to an org yet.

Very sorry @sago2k8 ! I added you and then removed you again when I alphabetized 🤦 .

I've opened another PR to add you. When this is merged, you will get an invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants