-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make expo-gl and expo-assets optional #3354
Comments
just for reference, this is how we've handled optional dependencies in React Native: |
Have you run into this issue with Metro facebook/metro#666? Trying my hand at it in #3355 and I'm unable to find a workaround. |
In its current form this approach as been working well for us and for https://github.com/mrousavy/react-native-vision-camera. The |
The reconciler isn't the one writing |
What you are describing is exactly our vision. We describe it at https://www.youtube.com/watch?v=i-DGY98cTjk This "generic" canvas APIs has been already used in prototypes where it spawn a Skia context and the results have yield substantial benefits. Our focus with React Native WebGPU was to enable people to copy/past example from the web and have them work immediately: https://github.com/wcandillon/react-native-webgpu?tab=readme-ov-file#similarities-and-differences-with-the-web |
I mean something that is actually compliant with the web and can be ingested in the three ecosystem—meaning it can spawn a 2D/bitmap/WebGL/WebGPU context and later integrate with W3C pointer events. Skia and OpenGL are implementation details, Filament is just a renderer; it is unrelated. The correctness is incredibly important, and React Native has realized that individually porting and maintaining modules is unsustainable, and it has to stop if we are to unify and build such high-level APIs. This was the main topic of the contributors' summit, and there are many other efforts to port WebGPU and WebGL besides our own, all duplicate and ununified. That's only going to slow us down if we can't get in the same room together or work in an open forum, especially with such ambitious goals to align with web. The stopgap I suggested is shimming what we can if you want something before this is done properly upstream, and all things considered, that could be measured in years. |
As described in #3352 and #3353, there is a need to swap the runtime under the Canvas when rendering with a WebGPU context or other alternative (e.g., Skia, ANGLE).
expo-gl
should be at minimum optional for those creating a custom canvas with their own runtime.Polyfills should exit gracefully if any expo modules they depend on are not present.
The text was updated successfully, but these errors were encountered: