-
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
feat: add PROVIDER_CONTEXT_CHANGED event (web-sdk only) #731
Conversation
bf5c706
to
c2fb02e
Compare
Great points @beeme1mr , please re-review. |
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.
Please address the lint issues when you have a moment.
done |
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.
This looks good to me!
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
a78a0e9
to
97d32d5
Compare
Signed-off-by: Todd Baert <[email protected]>
97d32d5
to
20c812b
Compare
Signed-off-by: Todd Baert <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.0.22](core-v0.0.21...core-v0.0.22) (2024-01-08) ### ✨ New Features * add PROVIDER_CONTEXT_CHANGED event (web-sdk only) ([#731](#731)) ([7906bbe](7906bbe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: openfeature-peer-update-bot <[email protected]> Co-authored-by: openfeature-peer-update-bot <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.4.9](web-sdk-v0.4.8...web-sdk-v0.4.9) (2024-01-08) ### ✨ New Features * add named provider metadata accessor ([#715](#715)) ([23d14aa](23d14aa)) * add PROVIDER_CONTEXT_CHANGED event (web-sdk only) ([#731](#731)) ([7906bbe](7906bbe)) ### 🐛 Bug Fixes * use in memory provider for e2e suites ([#740](#740)) ([696bf4a](696bf4a)) ### 🧹 Chore * **main:** release core 0.0.21 ([#720](#720)) ([7d1aca4](7d1aca4)) * **main:** release core 0.0.22 ([#745](#745)) ([a0cc855](a0cc855)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
This PR: - adds `PROVIDER_CONTEXT_CHANGED` events, which, in the static paradigm, can be used to inform the SDK that the flags should be re-evaluated (important for UI repaints in React, for instance (note this event is only available in the web-sdk) - runs the associated `PROVIDER_CONTEXT_CHANGED` handlers if the provider's context handler function ran successfully or `PROVIDER_ERROR` handlers otherwise. - adds associated tests A decent amount of this is just typing magic to reduce duplicated code while making the new event only available in the web-sdk. See: [associated spec change](open-feature/spec#200) Fixes: #729 --------- Signed-off-by: Todd Baert <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.0.22](core-v0.0.21...core-v0.0.22) (2024-01-08) ### ✨ New Features * add PROVIDER_CONTEXT_CHANGED event (web-sdk only) ([#731](#731)) ([7906bbe](7906bbe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: openfeature-peer-update-bot <[email protected]> Co-authored-by: openfeature-peer-update-bot <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.4.9](web-sdk-v0.4.8...web-sdk-v0.4.9) (2024-01-08) ### ✨ New Features * add named provider metadata accessor ([#715](#715)) ([23d14aa](23d14aa)) * add PROVIDER_CONTEXT_CHANGED event (web-sdk only) ([#731](#731)) ([7906bbe](7906bbe)) ### 🐛 Bug Fixes * use in memory provider for e2e suites ([#740](#740)) ([696bf4a](696bf4a)) ### 🧹 Chore * **main:** release core 0.0.21 ([#720](#720)) ([7d1aca4](7d1aca4)) * **main:** release core 0.0.22 ([#745](#745)) ([a0cc855](a0cc855)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
#698) Adds a few react features: - `<Suspense />` support: components using feature flags will trigger suspense for easy loaders/spinners - Ability to specify name for provider scope: `<OpenFeatureProvider name="my-provider">` > [!IMPORTANT] > Please see [here](open-feature/react-test-app#2) for the latest changes to the demo application using these features (note that we won't be able to merge these demos until this is released). > [!IMPORTANT] > Also note I've added no tests, which is certainly not my MO. I will add them to this PR once there's an agreement on this behavior and implementation. gif from the demo app: ![demo](https://github.com/open-feature/js-sdk/assets/25272906/73007cff-0d0c-44e8-a34c-b99412556206) :warning: I want to add another feature here to support re-rendering on context changes. That requires [this](#731) to be merged. --------- Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
This PR:
PROVIDER_CONTEXT_CHANGED
events, which, in the static paradigm, can be used to inform the SDK that the flags should be re-evaluated (important for UI repaints in React, for instance (note this event is only available in the web-sdk)PROVIDER_CONTEXT_CHANGED
handlers if the provider's context handler function ran successfully orPROVIDER_ERROR
handlers otherwise.A decent amount of this is just typing magic to reduce duplicated code while making the new event only available in the web-sdk.
See: associated spec change
Fixes: #729