Closed baseten closed 1 year ago
@Zyie once we release this I think perhaps we should write a note about what we officially support? We can obviously encourage users to write whatever pixi component packages they need for whichever versions of PIXI, but the combinations could get complicated quickly.
So far we've talked about supporting React 17+ and PIXI 6+, does that mean we support:
Combinations could obviously get complex quickly especially as more versions are released in the future.
I'm wondering whether on top of the user injectable API I've proposed above, we should also provide pre-configured pixi-react
version(s) packaged as a single module. So for example @pixi/react
v8.0.0
becomes a wrapper for the above API including React 18 and PIXI 7?
@Zyie once we release this I think perhaps we should write a note about what we officially support? We can obviously encourage users to write whatever pixi component packages they need for whichever versions of PIXI, but the combinations could get complicated quickly.
So far we've talked about supporting React 17+ and PIXI 6+, does that mean we support:
- React 17 + PIXI 6
- React 18 + PIXI 6
- React 17 + PIXI 7
- React 18 + PIXI 7
Yeah i think these should be what we support
So for example
@pixi/react
v8.0.0
becomes a wrapper for the above API including React 18 and PIXI 7?
Yeah this is a good approach. Makes it very simple for whoever wants the latest version
Spec
Rough map of current source to new modules
Notes
peer-deps
to handle React imports, but anything that relies on a PIXI import most likely needs to exist withinpixi-react-components
to maximize compatibility (since the PIXI import API has changed considerably between versions).pixi-react-components
should be thin andpixi-react
should be fat, but it likely needs to be the other way around.pixi-react
will pretty much expose only thePixiComponent
custom component API and possibly some utils.pixi-react-components
bar the React Reconciler, which comes frompixi-react-fiber
.createElement
depends onTYPES_INJECTED
which will be stored inpixi-react
but filled up inpixi-react-components
.Proposed Usage
In a user's app they should setup pixi-react something like this:
Implementation
The configuration function would look something like this: