Repository navigation
Releases: eduardoborges/react-native-filament
Release list
2.0.0-rc.6: leaks and StrictMode cleanups from the stress runs
Fixes found by a night of stress runs on the example app (every screen mounted and unmounted in loops, JS reloads, Fast Refresh, backgrounding, rotation, a 340 mount soak) and on a React Native 0.87.1 app:
useBuffernow releases a buffer that finished loading after its effect was cleaned up, even withreleaseOnUnmount: false. Nobody would ever consume it, and under fast mount and unmount loops those buffers filled the Java heap on Android until asset loads failed withOutOfMemoryError.Skyboxreleases its texture buffer on unmount as well.useLightEntitydestroys its light entity on unmount. It used to leak one per mount.FilamentViewno longer rejects a promise when the native view disappears beforefindFilamentViewresolves.- The recording example only stops the recorder when one is running, so StrictMode no longer throws from the cleanup. The test hybrid object initialises its members;
createNewHybridObject()used to hand back an invalid enum. - Docs:
enableTransparentRendering={false}stops clearing between frames, so the scene needs aSkybox. - Example:
Stressscreen gained a 20 round soak entry, andTwoScenesrenders two engines on one screen.
Verified on iOS 17 Pro simulator and an Android emulator: 3 rounds at 1.5 s and 5 rounds at 250 ms over 18 screens, 20 round soak with flat memory, 8 JS reloads, 10 background cycles, 10 rotations, 5 Fast Refreshes, all without a crash. The React Native 0.87.1 app survives 10 mount and unmount cycles with this package on both platforms.
2.0.0-rc.5: teardown crash fixes
Crash fixes found by cycling every example screen (17 scenes, 3 rounds at 1.5 s and 5 rounds at 250 ms) on iOS and Android:
- Android: Hermes GC (
hadesthread) finalizing a wrapper that held the last reference to a Filament asset called intoJDispatcherJNI without an attached thread (std::terminate, "Unable to retrieve jni environment").JDispatchernow wraps its JNI calls injni::ThreadScope::WithClassLoader. - Recorder and view swapchains kept a raw native window while Filament still had
createSwapChainqueued; releasing the recorder right after creation crashed ineglCreateWindowSurface. The swapchain deleter now owns the surface/recorder until Filament destroyed the swapchain. - Releasing a material while a renderable still used one of its instances hit a Filament precondition abort (
BackgroundImage,createPlane,createDebugCubeWireframe). Material deleters detach those renderables first, andRenderableManager.destroyEntity()lets components free their shapes explicitly (BackgroundImageandDebugBoxdo). useBufferno longer hands out a buffer that was loaded for an effect run that already cleaned up (StrictMode).useWorkletCallbackdocs: the returned function is a JS trampoline and cannot be passed into worklets or native callbacks. The PhysicsCoin example passes a plain worklet.
2.0.0-rc.4: react-native-worklets
Release candidate of the react-native-worklets migration (continues margelo#327).
Changes since rc.3: on Android the Filament runtime's queue is a worklets::AsyncQueueUI with a render-thread scheduler instead of a subclass of AsyncQueue. The subclass failed react-native-worklets' dynamic_pointer_cast whenever libworklets.so was loaded before libreact-native-filament.so (Android compares type_info by pointer and the weak AsyncQueue type_info binds per library in dlopen order), which left the runtime without a queue and aborted on the first scheduled worklet. With Reanimated in the app that was the normal load order.
Verified on React Native 0.83.1 (example app) and 0.87.1 (fresh template app with Reanimated sensors, both library load orders), New Architecture, Hermes, iOS simulator and Android emulator. Peers: react-native-worklets >= 0.12, react-native-reanimated >= 4. Requires the react-native-worklets/plugin Babel plugin.
The tarball includes the prebuilt Filament (from 1.11.0) and Bullet3 binaries, so it installs like the npm package:
"react-native-filament": "https://github.com/eduardoborges/react-native-filament/releases/download/v2.0.0-rc.4/react-native-filament-2.0.0-rc.4.tgz"