Always include WithABProvider
in islands
#3955
Replies: 3 comments 1 reply
-
I’d vote off by default. Somewhat for the reason of performance, but for me it more boils down to a separation of concerns:
These feel like orthogonal concerns, with their relatedness a consequence of requiring client-side data from the AB test framework. Of course,
This is a good point. Given when developing in this area you come up against concepts to do with hydration and AB testing, it's important this is easy and intuitive. I think having a reference implementation in the code, possibly pointed to from documentation, helps with this. Basically a simple example that serves as a recipe for future developers (The Cypress smoke test?) looking to setup a component that uses |
Beta Was this translation helpful? Give feedback.
-
If an Island can only have a single child, it seems like we’re breaking React Composition by forcing this one children to wrap itself in a Provider. I think there should be a standard way to do this. As it stands, in order for a component in an Island to be able to There might be alternatives to
|
Beta Was this translation helpful? Give feedback.
-
We're closing this discussion as stale. Please reopen this if you want to try gain traction on this discussion. |
Beta Was this translation helpful? Give feedback.
-
This PR introduces a pattern where we're asking developers to wrap their client side code in
WithABProvider
. But should we abstract this requirement and simply always set it on every island?Please give feedback by:
👍 for setting
WithABProvider
inIsland
- always on👎 for keeping
WithABProvider
outside - off by defaultWhat is
WithABProvider
?This is a wrapper component that sets the
ABProvider
context so that child components can then access theuseAB
custom hook without errors. This hook expects the context which is provided byABProvider
to exist.For 👍
Simpler, we don't need developers to think about this and it just works
Against 👎
Performance, we setting lots of context state and adding more code than might be used
Beta Was this translation helpful? Give feedback.
All reactions