Skip to content

Commit

Permalink
experiment: use R3F v9 unreleased
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Jan 10, 2025
1 parent c8ed068 commit 816e93b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 55 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@playwright/test": "^1.45.2",
"@react-three/fiber": "9.0.0-rc.1",
"@react-three/fiber": "./react-three-fiber-v9.0.0-rc.2-drei-0.tgz",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-json": "^4.1.0",
Expand Down
Binary file added react-three-fiber-v9.0.0-rc.2-drei-0.tgz
Binary file not shown.
2 changes: 0 additions & 2 deletions src/core/Gltf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ export const useGLTF = <T extends Path>(
useMeshopt?: UseMeshopt,
extendLoader?: ExtendLoader
): T extends any[] ? (GLTF & ObjectMap)[] : GLTF & ObjectMap =>
// @ts-expect-error
useLoader(GLTFLoader, path, extensions(useDraco, useMeshopt, extendLoader))

useGLTF.preload = (path: Path, useDraco?: UseDraco, useMeshopt?: UseMeshopt, extendLoader?: ExtendLoader) =>
// @ts-expect-error
useLoader.preload(GLTFLoader, path, extensions(useDraco, useMeshopt, extendLoader))

useGLTF.clear = (path: Path) => useLoader.clear(GLTFLoader, path)
Expand Down
4 changes: 1 addition & 3 deletions src/core/Splat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as THREE from 'three'
import * as React from 'react'
import { extend, useThree, useFrame, useLoader, LoaderProto, ThreeElements } from '@react-three/fiber'
import { extend, useThree, useFrame, useLoader, ThreeElements } from '@react-three/fiber'
import { shaderMaterial } from './shaderMaterial'
import { version } from '../helpers/constants'

Expand Down Expand Up @@ -636,9 +636,7 @@ export function Splat({

// Shared state, globally memoized, the same url re-uses the same daza
const shared = useLoader(SplatLoader, src, (loader) => {
// @ts-expect-error
loader.gl = gl
// @ts-expect-error
loader.chunkSize = chunkSize
}) as SharedState

Expand Down
3 changes: 2 additions & 1 deletion test/e2e/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -ex

PORT=5188
DIST=../../dist
R3FT=../../react-three-fiber-v9.0.0-rc.2-drei-0.tgz
tmp=$(mktemp -d)

# Build the package
Expand Down Expand Up @@ -39,7 +40,7 @@ appdir="$tmp/$appname"
(cd $tmp; npm create -y vite@latest $appname -- --template react-ts)

# drei
(cd $appdir; npm i @types/react@latest @types/react-dom@latest react@latest react-dom@latest @react-three/fiber@rc $TGZ --legacy-peer-deps)
(cd $appdir; npm i @types/react@latest @types/react-dom@latest react@latest react-dom@latest R3FT $TGZ --legacy-peer-deps)

# App.tsx
cp App.tsx $appdir/src/App.tsx
Expand Down
65 changes: 17 additions & 48 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1734,10 +1734,9 @@
resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.7.5.tgz#e5dd180f3ed985b44fd2cd2f32aa9203752ef3e8"
integrity sha512-HVj7LrZ4ReHWBimBvu2SKND3cDVUPWKLqRTmWe/fNY6o1owGOX0cAHbdPDTMelgBlVbrTKrre6lFkhqGZErK/g==

"@react-three/[email protected]":
version "9.0.0-rc.1"
resolved "https://registry.yarnpkg.com/@react-three/fiber/-/fiber-9.0.0-rc.1.tgz#d0e386e89790d47ad1bdb69acbeb9befdac7b59c"
integrity sha512-3x/y/ZmW6PPC3yb7/pZBEmAT957xhkVGUplO1ez5qKOFw9hNGL2xkBszkiNsCTJ2/stSnTSHuD68yy0xBYwu/Q==
"@react-three/fiber@./react-three-fiber-v9.0.0-rc.2-drei-0.tgz":
version "9.0.0-rc.2-drei-0"
resolved "./react-three-fiber-v9.0.0-rc.2-drei-0.tgz#f5f83c807afe2beda8d5334d4ad55003ae9ac697"
dependencies:
"@babel/runtime" "^7.17.8"
"@types/debounce" "^1.2.1"
Expand All @@ -1747,8 +1746,8 @@
buffer "^6.0.3"
debounce "^1.2.1"
its-fine "^1.2.5"
react-reconciler "0.31.0-rc.1"
scheduler "0.25.0-rc.1"
react-reconciler "0.31.0"
scheduler "0.25.0"
suspend-react "^0.1.3"
zustand "^4.1.2"

Expand Down Expand Up @@ -6882,12 +6881,12 @@ react-is@^16.13.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

[email protected]-rc.1:
version "0.31.0-rc.1"
resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.31.0-rc.1.tgz#39e9fdbe57dfb0a9310f48720b8a5180756ed3a1"
integrity sha512-00zcXpgYtum76DyrmzDWyg6MeyWWputWTHQUQO22P3rbtUfK1fWll4aZhS9jp215aCicM98TANJ88ITeyh8aZQ==
[email protected]:
version "0.31.0"
resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.31.0.tgz#6b7390fe8fab59210daf523d7400943973de1458"
integrity sha512-7Ob7Z+URmesIsIVRjnLoDGwBEG/tVitidU0nMsqX/eeJaLY89RISO/10ERe0MqmzuKUUB1rmY+h1itMbUHg9BQ==
dependencies:
scheduler "0.25.0-rc.1"
scheduler "^0.25.0"

react-refresh@^0.14.2:
version "0.14.2"
Expand Down Expand Up @@ -7259,10 +7258,10 @@ safe-regex-test@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

[email protected]-rc.1:
version "0.25.0-rc.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0-rc.1.tgz#93cce5f24d1c4e7193fb21d953bbc05aad5bfab2"
integrity sha512-fVinv2lXqYpKConAMdergOl5owd0rY1O4P/QTe0aWKCqGtu7VsCt1iqQFxSJtqK4Lci/upVSBpGwVC7eWcuS9Q==
[email protected], scheduler@^0.25.0:
version "0.25.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015"
integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==

scheduler@^0.23.2:
version "0.23.2"
Expand All @@ -7271,11 +7270,6 @@ scheduler@^0.23.2:
dependencies:
loose-envify "^1.1.0"

scheduler@^0.25.0:
version "0.25.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015"
integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==

schema-utils@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0"
Expand Down Expand Up @@ -7650,16 +7644,7 @@ stream-shift@^1.0.0:
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.3.tgz#85b8fab4d71010fc3ba8772e8046cc49b8a3864b"
integrity sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -7748,14 +7733,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -8471,16 +8449,7 @@ wordwrap@^1.0.0:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit 816e93b

Please sign in to comment.