Pmndrs from React-three-fiber Repository

MIT License

05 Oct 2022

Shaomingquan

started

Started On 05 Oct 2022 at 06:40:41
Issue Comment

Krispya

RFC: v9 goals

Let's discuss some v9 goals here. These are all tentative right now.

Completed

  • [x] Add stage-based lifecycle, deprecate useFrame for useUpdate https://github.com/pmndrs/react-three-fiber/pull/2279
  • [x] Remove onUpdate prop https://github.com/pmndrs/react-three-fiber/pull/2480
  • [x] Remove updateStyle from Size https://github.com/pmndrs/react-three-fiber/pull/2489
  • [x] act types for testing https://github.com/pmndrs/react-three-fiber/pull/2492
  • [x] Instance descriptors, refactor JSX types & extend https://github.com/pmndrs/react-three-fiber/pull/2465
  • [x] prefer named functions, for loops in hot paths https://github.com/pmndrs/react-three-fiber/pull/2540 (backported in v8.8.7)

TODO

  • [ ] respect React.StrictMode across renderers #2547

Pending

  • [ ] Update demand frameloop mode to keep updating delta even if it skips render. Be sure to test all frameloop modes with the useUpdate changes.
  • [ ] ? Refactor color space API (see https://github.com/pmndrs/react-three-fiber/issues/2299)
  • [ ] ? Add cpuFrameTime and gpuFrameTime for performance based rendering

Forked On 05 Oct 2022 at 06:13:39

Krispya

That would be great. If you start a branch, I can do review and assist.

Commented On 05 Oct 2022 at 06:13:39

EvlynL

started

Started On 05 Oct 2022 at 04:40:33
Issue Comment

0xmax

No tree shaking with NextJS and extend syntax

Hi, when using NextJS (12.1.6) the whole Three.module gets bundled on build.

I am including it via below code into a page. If I remove the includes, Three disappears from the bundle. If I include a single module from Three directly, it gets tree-shaken correctly and only that module is included in the build.

import { Canvas, extend } from '@react-three/fiber';

import Mesh from 'three/src/objects/Mesh';
import BoxGeometry from 'three/src/geometries/BoxGeometry';
import MeshStandardMaterial from 'three/src/materials/MeshStandardMaterial';

extend({ Mesh, BoxGeometry, MeshStandardMaterial }); 

Screenshot from 2022-10-05 12-41-35

I tried Googling / searching here to no avail. The same behaviour can be observed in the official boilerplate (https://github.com/pmndrs/react-three-next). If sb can provide me with pointers on how to fix this I would be happy to create a PR.

kind regards Max

Forked On 05 Oct 2022 at 04:25:20

0xmax

Thank you @CodyJasonBennett! This was exactly the pointer I needed. Will see if I can contribute something that could streamline the packaging a bit.

Commented On 05 Oct 2022 at 04:25:20

Gloating0946

🇨🇭 A React renderer for Three.js

Forked On 05 Oct 2022 at 01:25:03

Gloating0946

started

Started On 05 Oct 2022 at 01:24:12

ValentaTomas

started

Started On 05 Oct 2022 at 11:49:35

Kaltsoon

started

Started On 05 Oct 2022 at 11:22:43

Saitonakamura

RFC: v9 goals

Let's discuss some v9 goals here. These are all tentative right now.

Completed

  • [x] Add stage-based lifecycle, deprecate useFrame for useUpdate https://github.com/pmndrs/react-three-fiber/pull/2279
  • [x] Remove onUpdate prop https://github.com/pmndrs/react-three-fiber/pull/2480
  • [x] Remove updateStyle from Size https://github.com/pmndrs/react-three-fiber/pull/2489
  • [x] act types for testing https://github.com/pmndrs/react-three-fiber/pull/2492
  • [x] Instance descriptors, refactor JSX types & extend https://github.com/pmndrs/react-three-fiber/pull/2465
  • [x] prefer named functions, for loops in hot paths https://github.com/pmndrs/react-three-fiber/pull/2540 (backported in v8.8.7)

TODO

  • [ ] respect React.StrictMode across renderers #2547

Pending

  • [ ] Update demand frameloop mode to keep updating delta even if it skips render. Be sure to test all frameloop modes with the useUpdate changes.
  • [ ] ? Refactor color space API (see https://github.com/pmndrs/react-three-fiber/issues/2299)
  • [ ] ? Add cpuFrameTime and gpuFrameTime for performance based rendering

Forked On 05 Oct 2022 at 11:03:02

Saitonakamura

Yeah, I think so. When upgrading to r3f v8 I erroneously update zustand to v4. I had to revert back of course but not until I had some fair share of migration experience

Commented On 05 Oct 2022 at 11:03:02

CodyJasonBennett

No tree shaking with NextJS and extend syntax

Hi, when using NextJS (12.1.6) the whole Three.module gets bundled on build.

I am including it via below code into a page. If I remove the includes, Three disappears from the bundle. If I include a single module from Three directly, it gets tree-shaken correctly and only that module is included in the build.

import { Canvas, extend } from '@react-three/fiber';

import Mesh from 'three/src/objects/Mesh';
import BoxGeometry from 'three/src/geometries/BoxGeometry';
import MeshStandardMaterial from 'three/src/materials/MeshStandardMaterial';

extend({ Mesh, BoxGeometry, MeshStandardMaterial }); 

Screenshot from 2022-10-05 12-41-35

I tried Googling / searching here to no avail. The same behaviour can be observed in the official boilerplate (https://github.com/pmndrs/react-three-next). If sb can provide me with pointers on how to fix this I would be happy to create a PR.

kind regards Max

Forked On 05 Oct 2022 at 10:53:33

CodyJasonBennett

See https://docs.pmnd.rs/react-three-fiber/api/canvas#tree-shaking, Canvas extends the full three namespace internally but you can can create your own canvas and hardcode extensions or use a transformer like https://github.com/pmndrs/react-three-babel to codemod Canvas.

Commented On 05 Oct 2022 at 10:53:33

Fajriwip

started

Started On 05 Oct 2022 at 09:50:21

Mavis-200

🇨🇭 A React renderer for Three.js

Forked On 05 Oct 2022 at 07:19:43

Mavis-200

started

Started On 05 Oct 2022 at 07:19:28

Carlo697

started

Started On 05 Oct 2022 at 05:23:58

Mengesh

started

Started On 05 Oct 2022 at 03:08:28

VGabby

started

Started On 05 Oct 2022 at 12:57:55

Cykrr

started

Started On 05 Oct 2022 at 12:01:09

Sadjow

started

Started On 04 Oct 2022 at 09:41:11

Phonon56

started

Started On 04 Oct 2022 at 09:24:47
Issue Comment

Krispya

RFC: v9 goals

Let's discuss some v9 goals here. These are all tentative right now.

Completed

  • [x] Add stage-based lifecycle, deprecate useFrame for useUpdate https://github.com/pmndrs/react-three-fiber/pull/2279
  • [x] Remove onUpdate prop https://github.com/pmndrs/react-three-fiber/pull/2480
  • [x] Remove updateStyle from Size https://github.com/pmndrs/react-three-fiber/pull/2489
  • [x] act types for testing https://github.com/pmndrs/react-three-fiber/pull/2492
  • [x] Instance descriptors, refactor JSX types & extend https://github.com/pmndrs/react-three-fiber/pull/2465
  • [x] prefer named functions, for loops in hot paths https://github.com/pmndrs/react-three-fiber/pull/2540 (backported in v8.8.7)

TODO

  • [ ] respect React.StrictMode across renderers #2547

Pending

  • [ ] Update demand frameloop mode to keep updating delta even if it skips render. Be sure to test all frameloop modes with the useUpdate changes.
  • [ ] ? Refactor color space API (see https://github.com/pmndrs/react-three-fiber/issues/2299)
  • [ ] ? Add cpuFrameTime and gpuFrameTime for performance based rendering

Forked On 04 Oct 2022 at 08:06:28

Krispya

I'm in favor, the typing is hugely improved and so is comparability with context. But it isn't a trivial update. Is it something you would be interested in spearheading? I can contribute.

Commented On 04 Oct 2022 at 08:06:28

Kpharvey

started

Started On 04 Oct 2022 at 07:57:03

Mjvesa

started

Started On 04 Oct 2022 at 07:48:36

Josephwinston

started

Started On 04 Oct 2022 at 07:13:06

Thomasboyt

started

Started On 04 Oct 2022 at 06:39:44

Snide

started

Started On 04 Oct 2022 at 01:26:59
Create Branch

CodyJasonBennett

🇨🇭 A React renderer for Three.js

On 04 Oct 2022 at 12:42:01

CodyJasonBennett

docs(changeset): fix(createPortal): use correct JSX type

Pushed On 04 Oct 2022 at 12:41:37

CodyJasonBennett

RELEASING: Releasing 1 package(s)

Releases: @react-three/fiber@8.8.9

[skip ci]

Pushed On 04 Oct 2022 at 12:41:37

About Repository

🇨🇭 A React renderer for Three.js
Language: TypeScript
Star: 19817
Fork: 1112
Watchers: 19817
Open Issues: 27
https://github.com/pmndrs/react-three-fiber
MIT License
Last updated: 05 Oct 2022
Tropics: