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
Modular Packages #407
Modular Packages #407
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 504fe15:
|
380f094
to
da41a68
Compare
4793185
to
504fe15
Compare
Does this new set up work with react 17 and pixi 6? I don't see either of these packages here |
@Zyie we have initially discussed with @baseten to implement react 18 and pixi 6 in first pass, because for previous versions users can work with already published package. The solution in this PR looks good after first pass. I have not tried to run it yet. However, now my thoughts are similar to @Zyie. Since there's only react 18 and pixi 7 implemented, I wonder how much code duplication there would be when implementing other versions with how it is split up currently. I was initially questioning whether it is also better to check this now, by adding implementation for react 17 and pixi 6 or wait for the next version of either, but since people are already using this library with react 17 and pixi 6, merging this PR would be a breaking change for them. |
@michalochman @Zyie Thanks both for the comments. So at this point, there are no backwards compatible breaking changes in the React Reconciler between React 17/18 or the PIXI API between 6 and 7, so the existing implementation should work for both of them as is. We could still implement separate versions for those libraries for consistency and as proof of compatibility. For React we'd likely just remove the @michalochman I agree that were someone to want to implement PIXI components for another version then there would currently be a lot of code duplication - I'm torn about how to handle this, my intention with |
I do believe there was a breaking change in that https://github.com/facebook/react/blob/main/packages/react-reconciler/package.json#L29 So this change would affect react 17 users with strict peer dependencies |
@baseten I was mostly referring to code duplication in the following areas. React side:
PIXI side:
Additionally, we have PIXI code in the React package. For example There's probably a limit to which we should think about making the library modular, but I'm not sure yet where to draw the line. |
@Zyie Good point, perhaps this is best addressed in a follow up PR? It will also be helpful in better determining modular package boundaries |
@michalochman I totally agree and I too think there can be some increased modularity on the PIXI component side, I will likely come back to this on a second pass. In terms of PIXI code in React, for now I think having a minimal shared contract between the React Reconciler and PIXI is the simplest way to go, but yes we could write an injectable adapter in the future if necessary. I have tried to keep this as small as possible, hence the following interfaces: 960985b#diff-a775e5ddfa88527e4061b30477f579be050f33464e6df56ceb79ba1a7b9af9fdR7-R23 @Zyie @GoodBoyDigital do you envisage these minimal interfaces changing in the near future? Or have they changed from previous versions of PIXI as far as you know? |
@baseten the minimal contract looks good. I am also perfectly fine with increasing modularity in another pass. |
Resolves: #398
This PR splits out the core parts of
@pixi/react
to enable users to use the package with mix 'n' match versions ofreact-reconciler
andpixi.js