Releases: pmndrs/react-three-fiber
v9.6.1
v9.6.0 - Sunset X
Ever tried using <shaderMaterial uniforms={{ time: { value: time } }} /> and ran into immediate issues with desync? No more.
The uniforms objects on ShaderMaterial and its derivatives now have a stable reference. Objects passed into uniforms will instead copy into it. This is the same as behavior for math structures that have copy such as position, rotation, quaternion, etc. and ends up simplifying using the raw JSX where utilities were often introduced before.
Why does this matter?
-
Improves HMR. Even if you memoize the uniforms object it will still regenerate and desync Three. Now this won't happen. But also it makes compatibility with React compiler more complete with its auto-memoization.
-
Allows for inline uniform props and even prop uniforms directly on the material piercing.
<shaderMaterial
vertexShader={vertexShader}
fragmentShader={fragmentShader}
// The uniforms object has a stable reference so objects can be safely merged in
uniforms={{
uTime: { value: 0 },
uColor: { value: new THREE.Color('hotpink') }
}}
// Individual uniforms can also be safely updated with pierce notation
uniforms-uColor-value={hovered ? 'royalblue' : 'hotpink'}
/>Documentation can be found here: https://r3f.docs.pmnd.rs/api/objects#shader-material-uniforms
And an example can be found here: https://github.com/pmndrs/react-three-fiber/blob/master/example/src/demos/ShaderMaterial.tsx
What's Changed
- fix: Fix broken link on "Performance pitfalls" documentation page by @simonKristensen in #3700
- fix: uniforms have stable refs for ShaderMaterial by @krispya in #3715
- docs: fix typos and documentation consistency by @NssGourav in #3709
New Contributors
- @simonKristensen made their first contribution in #3700
- @NssGourav made their first contribution in #3709
Full Changelog: v9.5.0...v9.6.0
v10.0.0-alpha.1
A New Era
R3F v10 has been a long time coming. We have talked over plans for years but late last year @DennisSmolek took the initiative do it all himself. We now have an alpha release, along with an alpha release of Drei 11. You can try it out today.
npm install @react-three/fiber@alphaWe were so excited to get this out we forgot to make a release for alpha.0 and alpha.1 is already upon us. But let's quickly get you caught up on what you can expect to be new.
- R3F now supports the
WebGLRendererandWebGPURenderer. This meansstate.glis nowstate.renderer. - There is a new scheduler, allowing for
useFrameto have advanced scheduling and also allows for it to be used outside of<Canvas />. Read more here: Frame Loop Overview. - WebGPU and TSL is first-class, with new built-ins just for working with TSL:
useUniforms,useNodes,useLocalNodesandusePostProcessing. Read more here: WebGPU Hook Overview.
And for a more in-depth introduction check out the migration guide.
Alpha 1
And now comes alpha.1 with bug fixes, documentation updates, and several important feature unlocks.
Rendering
- Camera frustum access for in-frame spatial queries.
- Visibility lifecycle events:
Visible,Framed, andOccluded. - Cameras are now part of the scene graph. Children of a camera will render correctly, enabling camera-attached objects by default.
- Renderer-independent render targets, similar to
useFBO, without needing to branch on the active renderer.
Scheduler
- The scheduler no longer depends on R3F and can run standalone.
- Scheduler context can now be shared outside the R3F tree, allowing external UIs or systems to participate in the frame loop while correctly waiting on the root set.
Documentation
- New v10 features documentation.
- Updated developer documentation.
- Migration guide expanded, including details on taking over the renderer.
As always, feedback welcome. Consider all features experimental and may be changed, removed or expanded at any time. Who know,s you could be the reason π. Happy building!
What's Changed
- Start of the v10 Branch by @DennisSmolek in #3620
- Fix: Only Run Preinstall when working on actual repo by @DennisSmolek in #3624
- Feat-null-props by @DennisSmolek in #3628
- V10-fix-canvas-override by @DennisSmolek in #3629
- Feat-fire-event-3537 by @DennisSmolek in #3630
- Fix-portal-container-updates by @DennisSmolek in #3631
- Feat-useLoader-preload by @DennisSmolek in #3635
- feat: canvasDebounce by @DennisSmolek in #3636
- Docs-useframe by @DennisSmolek in #3640
- feat: react 19.2 and test clean by @DennisSmolek in #3641
- Chore-update-yarn by @DennisSmolek in #3643
- Fix-type-exports by @DennisSmolek in #3644
- Chore/migrate to pnpm by @DennisSmolek in #3645
- Fix-portal-bug by @DennisSmolek in #3649
- Docs-cleanup-circular by @DennisSmolek in #3655
- Docs-migration-guide by @DennisSmolek in #3658
- V10-shared-context by @DennisSmolek in #3663
- V10-feat-Occlusion by @DennisSmolek in #3664
Full Changelog: v9.4.2...v10.0.0-alpha.1
v9.5.0
After a bit of research and development, R3F is now compatible with React 19.2, including the Activity feature!
Why did this take some effort, you might wonder? When React bumped to version 19.2.x, they also bumped the internal reconciler up a version which was not backwards compatible with 19.1.x. This put us in an awkward position of either making a breaking change in the middle of R3F v9, bump to another major just because of an internal detail from React or get creative. We chose to get creative and R3F is compatible with all versions of React between 19.0 and 19.2. The downside is we had to bundle the reconciler with R3F, but react-dom already does this so for now it is the best solution available.
Forcing breaking changes on libraries is likely not what the React teams intended so we will be working with them to try to avoid this in the future.
Happy coding.
What's Changed
- feat: support React 19.2 by @CodyJasonBennett in #3606
Full Changelog: v9.4.2...v9.5.0
v9.4.2
What's Changed
- docs: update installation guide with iOS simulator note by @rudin in #3572
- fix: Expo SDK 54 compatibility through workaround by @alextoudic in #3599
New Contributors
- @rudin made their first contribution in #3572
- @alextoudic made their first contribution in #3599
Full Changelog: v9.4.1...v9.4.2
v9.4.1
What's Changed
- fix: pass DevTools config through createReconciler to fix React DevTools by @AlaricBaraou in #3594
Full Changelog: v9.4.0...v9.4.1
v9.4.0
What's Changed
- fix: improve resolution of dashed prop names by @tbvjaos510 in #3576
- feat: add explicit error to applyProps by @krispya in 7c6680f
New Contributors
- @borghiste made their first contribution in #3569
- @tbvjaos510 made their first contribution in #3576
- @jacksydenham made their first contribution in #3586
Full Changelog: v9.3.0...v9.4.0
v9.3.0
With this release we have two big fixes.
flushSyncnow works properly. To prove it we added an example that allows you to React props and then take a screenshot of the R3F canvas with the latest state. This is a pretty advanced use case, but one people might be interested to explore for exporting videos or images using R3F.- React Native support has been fixed for 0.79 and newer when combined with the same update to Drei: pmndrs/drei#2494. A big thanks to @thejustinwalsh for helping us with this one.
What's Changed
- chore: export flushSync by @krispya in #3551
- Update react-native deep imports for 0.79 compatibility by @huntie in #3498
- fix: update flushSync for new reconciler by @krispya in #3554
- feat: add flushSync example by @krispya in #3560
New Contributors
Full Changelog: v9.1.4...v9.3.0
v9.1.4
What's Changed
- fix(types): Accept readonly arrays for vector props by @RodrigoHamuy in #3527
New Contributors
- @RodrigoHamuy made their first contribution in #3527
Full Changelog: v9.1.3...v9.1.4
v9.1.3
What's Changed
- fix(native) fix crash on rerendering GLView with new arch by @NikitaDudin in #3539
New Contributors
- @s-rigaud made their first contribution in #3518
- @NikitaDudin made their first contribution in #3539
Full Changelog: v9.1.2...v9.1.3