-
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: suspense support, client scoping, context-sensitive re-rendering #698
Conversation
bf0122d
to
e8e80ba
Compare
@beeme1mr I think I disagree. Conveniently the React provider is easily associated with a OpenFeature Provider via the name... so in some respects it actually works well to blur these lines. Moreover, in React, providers are a very explicit thing, and if we don't use that name I think people would be confused. Maybe somebody else has an opinion on this point specifically. cc @lukas-reining @thomaspoignant @kinyoklion |
No strong feelings about it but you could always call it |
Ya, I'd be fine with that, but unfortunately we also use |
Also no strong feelings. |
You've convinced me. I'm fine with |
I agree with @lukas-reining |
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.
Change looks good to me and is a nice addition.
Left two comments with open questions.
This is separate PR for a similar change [here](#698). I'm hesitant to spec this at the moment. I'm only implementing it in the client because it seems particularly useful for React. Signed-off-by: Todd Baert <[email protected]>
2df0252
to
e888fd4
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.
LGTM
@toddbaert / @beeme1mr one question we had taking a look at this and thinking through the suspense behaviour, what happens when the context is updated? does the SDK go back into a "pending" state? |
That's a very interesting question... When the context is set, the SDK doesn't change the provider state (and has no such state itself) - but some providers might go into the This has a few implications, and I think we are missing some guidance and possibly some semantics around the |
ca629ba
to
b7a4236
Compare
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
OK, so I've implemented another feature which allows for re-renders with the emission of |
Co-authored-by: Michael Beemer <[email protected]> Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
#759) 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">` - re-render on context change This is an exact re-merge of: #698, without a web-sdk whitespace change that created a bunch of bad release notes. Signed-off-by: Todd Baert <[email protected]>
Adds a few react features:
<Suspense />
support: components using feature flags will trigger suspense for easy loaders/spinners<OpenFeatureProvider name="my-provider">
Important
Please see here 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: