Skip to content

feat: add suspense, change demos #2

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

Merged
merged 1 commit into from
Jan 19, 2024
Merged

feat: add suspense, change demos #2

merged 1 commit into from
Jan 19, 2024

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Nov 29, 2023

Adds demos for new features here:

  • suspend until the provider is ready
  • re-render when flags values change

demo

package.json Outdated
@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@openfeature/react-sdk": "^0.0.4-experimental",
"@openfeature/react-sdk": "file:.yalc/@openfeature/react-sdk",
Copy link
Member Author

Choose a reason for hiding this comment

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

Update this before merging

@toddbaert toddbaert marked this pull request as draft November 30, 2023 20:43
github-merge-queue bot pushed a commit to open-feature/js-sdk that referenced this pull request Jan 11, 2024
#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]>
@toddbaert toddbaert marked this pull request as ready for review January 19, 2024 18:22
@toddbaert toddbaert merged commit c3c65ad into main Jan 19, 2024
@beeme1mr beeme1mr deleted the suspense branch January 19, 2024 19:09
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.

1 participant