Skip to content
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

[v9] fix(useLoader): localize url caching per loader #3243

Open
wants to merge 261 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
3892512
Fix useUpdate not properly removing subscribers
krispya May 26, 2022
3d4a93f
useFrame loop and render function integrated into the stages pipeline…
krispya May 26, 2022
19f12be
Update notes
krispya May 26, 2022
0915f0e
Update callbacks now consume their own store instead of a passed in s…
krispya May 26, 2022
0ecf0db
Add maxDelta for loops. HUD render example
krispya May 26, 2022
cce5b46
Add createPipeline for when the root is initialized
krispya May 26, 2022
8ac25db
Update packages/fiber/src/core/stages.ts
krispya May 29, 2022
d88f7f8
Rename pipeline to stages
krispya May 29, 2022
a01e9b2
Add Stages enum. Checks are runtime. Also added an example for extend…
krispya May 30, 2022
4a1a61a
Merge branch 'exp/update' of https://github.com/krispya/react-three-f…
krispya May 30, 2022
c4ffe0d
Documentation added. Standard renamed to StandardStages to be more ex…
krispya May 30, 2022
04778e4
Merge branch 'master' into pr/2279
CodyJasonBennett May 31, 2022
7776cf5
Convert FixedStage to use getters and setters
krispya Jun 4, 2022
24e25ca
Use instance objects to identify stage updates
krispya Jun 4, 2022
2e901c0
Simplify Update example
krispya Jun 4, 2022
9a72afd
Cleaned up remaining stage name code. Made sure delta cannot go below 0
krispya Jun 5, 2022
36dbefe
Made useUpdate's exception make more sense
krispya Jun 5, 2022
23cd91b
The frameloop prop now accepts an object and legacy string
krispya Jun 6, 2022
3931802
Simplify FixedState parameters
krispya Jun 6, 2022
406263a
Revert "Turn prettier off in eslint"
krispya Jun 6, 2022
5cc8be5
Clean up example
krispya Jun 6, 2022
9f921c7
useUpdate throws an Error instead of a string
krispya Jun 6, 2022
565d031
Merge branch 'master' into exp/update
krispya Jun 19, 2022
b1502e0
feat: Stages has a delta that measures how long it took to execute. F…
krispya Jun 19, 2022
b086e6a
Remove bad comment
krispya Jun 19, 2022
1775dc1
refactor(FixedStage): Remove while look failsafe. It used arbitrary v…
krispya Jun 19, 2022
9746c05
refactor(stages): Rename delta to frameTime
krispya Jun 19, 2022
aa7c81f
refactor(FixedStage): Rename substepFrameTime to substepTimes
krispya Jun 20, 2022
57829d4
chore: bump to 9.0.0-alpha.0
CodyJasonBennett Jun 21, 2022
0bdb6bd
Merge branch 'pmndrs:master' into exp/update
krispya Jun 21, 2022
8500cbd
Merge pull request #2279 from krispya/exp/update
krispya Jun 21, 2022
2e7497f
Merge branch 'master' into v9
CodyJasonBennett Jul 25, 2022
43b82f3
Merge branch 'master' into v9
CodyJasonBennett Jul 29, 2022
5c9544f
[v9] refactor(core)!: always set colormanagement, use r141 WebXR type…
CodyJasonBennett Jul 29, 2022
5860b5c
chore: fix lint
CodyJasonBennett Aug 2, 2022
f9fb114
chore: bump native deps
CodyJasonBennett Aug 2, 2022
242e76b
Merge branch 'master' into v9
CodyJasonBennett Aug 4, 2022
b88631e
refactor(Canvas)!: rename `Props` to `CanvasProps` (#2434)
hmans Aug 12, 2022
b2ffbe4
chore: update three-stdlib
krispya Aug 13, 2022
6555feb
chore(examples): Update dependencies
krispya Aug 13, 2022
8966ff8
fix: createStages would run multipel times
krispya Aug 13, 2022
9d1c21b
publish 9.0.0-alpha.1
drcmda Aug 13, 2022
97d3e1e
Merge branch 'master' into v9
CodyJasonBennett Aug 17, 2022
ca8da77
Merge branch 'master' into v9
CodyJasonBennett Aug 17, 2022
228ea82
feat: add eventtarget and eventprefix to web/canvas
drcmda Aug 20, 2022
fb22886
Merge branch 'v9' of https://github.com/pmndrs/react-three-fiber into v9
drcmda Aug 20, 2022
9661c96
fix!: remove *BufferGeometry type aliases (#2443)
CodyJasonBennett Aug 20, 2022
fa1d762
fix: check instance prototype for auto-attach (#2449)
CodyJasonBennett Aug 21, 2022
cf70b39
Merge branch 'master' into v9
CodyJasonBennett Aug 21, 2022
dcd406e
Merge branch 'master' into v9
CodyJasonBennett Aug 26, 2022
d6c93f4
Merge branch 'master' into v9
CodyJasonBennett Sep 1, 2022
9937644
refactor: remove onUpdate prop (#2480)
CodyJasonBennett Sep 1, 2022
8bb0564
[v9] refactor!: remove `updateStyle` from `Size` (#2489)
CodyJasonBennett Sep 9, 2022
7d02d65
fix!: type unstable_act (#2490)
CodyJasonBennett Sep 9, 2022
e440d08
fix(types): don't declare unstable_act (#2492)
CodyJasonBennett Sep 9, 2022
770fd0a
[v9] chore(tests): cleanup test config, harden previous renderer test…
CodyJasonBennett Sep 9, 2022
8e7a835
fix(RTTR): re-export Act type from R3F
CodyJasonBennett Sep 9, 2022
7c543c9
Merge branch 'master' into v9
CodyJasonBennett Sep 9, 2022
cb6e264
chore: fix conflict
CodyJasonBennett Sep 9, 2022
db2c1b4
chore(tests): cleanup
CodyJasonBennett Sep 9, 2022
a4415bb
chore: lint
CodyJasonBennett Sep 9, 2022
6b0c479
Merge branch 'master' into v9
CodyJasonBennett Sep 9, 2022
648a85d
Merge branch 'master' into v9
CodyJasonBennett Sep 13, 2022
3f928f5
Merge branch 'master' into v9
CodyJasonBennett Sep 13, 2022
5b1bb20
[v9] fix: don't updateStyle on offscreen canvas (#2495)
CodyJasonBennett Sep 15, 2022
8aa3a96
Merge branch 'master' into v9
CodyJasonBennett Sep 15, 2022
1e7e0a1
[v9] refactor!: instance descriptors, dynamically map ThreeElements (…
CodyJasonBennett Sep 18, 2022
1ef6515
Merge branch 'master' into v9
CodyJasonBennett Sep 21, 2022
c071328
chore: add integration tests for context bridge
CodyJasonBennett Sep 21, 2022
25d8766
Merge branch 'master' into v9
CodyJasonBennett Sep 21, 2022
0b08077
Merge branch 'master' into v9
CodyJasonBennett Sep 21, 2022
0a03489
chore: restore RTTR version
CodyJasonBennett Sep 21, 2022
8ebcdbd
Merge branch 'master' into v9
CodyJasonBennett Sep 21, 2022
3ef7086
Merge branch 'master' into v9
CodyJasonBennett Sep 21, 2022
3f57f0f
chore: remove outdated tests with master
CodyJasonBennett Sep 21, 2022
fee303a
new alpha
drcmda Sep 23, 2022
3bb9da4
[v9] fix: prefer named functions, for loops in hot paths (#2540)
AlaricBaraou Sep 29, 2022
2635187
Merge branch 'master' into v9
CodyJasonBennett Sep 29, 2022
9b30b0b
Merge branch 'master' into v9
CodyJasonBennett Oct 2, 2022
85c1e05
fix: don't memoize strict check
CodyJasonBennett Oct 2, 2022
1b2b8ce
Revert "fix: don't memoize strict check"
CodyJasonBennett Oct 2, 2022
e80b43c
Merge branch 'master' into v9
CodyJasonBennett Oct 3, 2022
968891b
Merge branch 'master' into v9
CodyJasonBennett Oct 11, 2022
d6963ca
fix: invalidate pierced props (#2563)
CodyJasonBennett Oct 11, 2022
b197712
Merge branch 'master' into v9
CodyJasonBennett Oct 11, 2022
e7804f9
chore: upgrade lockfile
CodyJasonBennett Oct 11, 2022
9e10ee7
refactor(types)!: upgrade Zustand to v4 (#2558)
CodyJasonBennett Oct 20, 2022
cb65de1
[v9] refactor(types): export public types (#2559)
CodyJasonBennett Oct 20, 2022
009f36f
Merge branch 'master' into v9
CodyJasonBennett Oct 29, 2022
b4c52ee
chore: unmangle merge
CodyJasonBennett Oct 29, 2022
e7e78bd
Merge branch 'master' into v9
CodyJasonBennett Oct 29, 2022
7c85caa
fix: separate type and js exports
CodyJasonBennett Oct 29, 2022
3668563
fix: unmangle export
CodyJasonBennett Oct 29, 2022
ce90b8f
[v9] chore(tests): add exports snapshots for targets (#2606)
CodyJasonBennett Nov 1, 2022
0b753e4
[v9] refactor: streamline core, harden exports (#2583)
CodyJasonBennett Nov 1, 2022
27295a7
experiment: create objects with container effects
CodyJasonBennett Nov 2, 2022
cec4297
fix(types): don't overwrite types of infer fallback (#2669)
CodyJasonBennett Dec 18, 2022
0df10bb
chore(types): add back ReactThreeFiber namespace, math types (#2674)
CodyJasonBennett Dec 31, 2022
9c43039
Merge branch 'master' into v9
CodyJasonBennett Dec 31, 2022
d82d9ad
fix(events): unmangle types
CodyJasonBennett Dec 31, 2022
dd1ffe8
[v9] fix(core): correctly swap map elements on invalidate (#2690)
CodyJasonBennett Dec 31, 2022
8170527
fix: Euler types and ReactProps (#2705)
krispya Jan 13, 2023
a47e48d
chore(tests): update snapshot
CodyJasonBennett Jan 14, 2023
a660cd1
fix: applyProps ignores undefined props (#2709)
krispya Jan 19, 2023
111b4a5
chore: export Overwrite (#2721)
krispya Jan 19, 2023
1b602d4
fix(types): loosen Loader type
CodyJasonBennett Jan 19, 2023
ff8dff5
chore: endOfLine auto for crossplatform dev (#2737)
krispya Jan 25, 2023
fd3e92a
Merge branch 'master' into v9
CodyJasonBennett Feb 26, 2023
39b2cfd
fix: offscreencanvas fixes
CodyJasonBennett Feb 26, 2023
7e5d450
fix: progressive color management
CodyJasonBennett Feb 26, 2023
ee510a4
fix: valid sRGB encode
CodyJasonBennett Feb 26, 2023
e67482e
fix: memoize HMR defaults
CodyJasonBennett Feb 26, 2023
b38c18f
fix: portal injects
CodyJasonBennett Feb 26, 2023
e508a79
feat: short cut for shadow type
CodyJasonBennett Feb 26, 2023
6c4e52f
chore: update HMR identity test
CodyJasonBennett Feb 26, 2023
7edff25
fix(types): accept string[][] in useLoader
CodyJasonBennett Feb 27, 2023
8ee196d
Merge branch 'v9' into fix/loosen-loader-type
CodyJasonBennett Feb 27, 2023
b255c2a
fix(types): remove excess useLoader generics
CodyJasonBennett Feb 27, 2023
f750f3a
chore(hooks): cleanup
CodyJasonBennett Feb 27, 2023
0340acd
chore(types): more cleanup, update snapshot
CodyJasonBennett Feb 27, 2023
0fc6afc
refactor(hooks): try to infer useLoader type
CodyJasonBennett Feb 27, 2023
9c5d23a
chore(hooks): prune unused types
CodyJasonBennett Feb 27, 2023
9969c6c
chore: disable ESLint in tests
CodyJasonBennett Feb 27, 2023
f479040
Merge branch 'v9' into fix/loosen-loader-type
CodyJasonBennett Feb 27, 2023
0d53ce9
fix(hooks): Loader#load signature returns any
CodyJasonBennett Feb 27, 2023
2847837
fix(hooks): remove Loader#loadAsync
CodyJasonBennett Feb 27, 2023
c25f990
[v9] fix: forward StrictMode (#2547)
CodyJasonBennett Feb 27, 2023
b22c406
fix: harden hooks tests
CodyJasonBennett Feb 27, 2023
2b3a68f
Merge branch 'v9' into experiment/object-constructor-effects
CodyJasonBennett Feb 28, 2023
d106982
fix(reconciler): handle append as container effect
CodyJasonBennett Feb 28, 2023
06234ad
chore: cleanup instance init
CodyJasonBennett Feb 28, 2023
5d61585
chore(tests): harden suspense lifecycle tests
CodyJasonBennett Feb 28, 2023
dc994ac
chore: cleanup
CodyJasonBennett Feb 28, 2023
090e497
chore: cleanup element mock
CodyJasonBennett Feb 28, 2023
254a715
fix: don't no-op primitive prepare
CodyJasonBennett Feb 28, 2023
cea29e6
chore: harden render tests
CodyJasonBennett Feb 28, 2023
c195d11
fix(reconciler): handle insert on out-of-order reconstruct
CodyJasonBennett Feb 28, 2023
4fb41a0
experiment: don't dispose on swap
CodyJasonBennett Feb 28, 2023
cf9bfc6
chore: revert swap
CodyJasonBennett Feb 28, 2023
5f376ce
fix(reconciler): remove beforeChild on replace
CodyJasonBennett Mar 4, 2023
5883610
Revert "fix(reconciler): remove beforeChild on replace"
CodyJasonBennett Mar 4, 2023
461561e
feat: `scene` render prop for custom THREE.Scene (#2803)
krispya Mar 14, 2023
fad83b2
[fix] Canvas now properly forwards scene
krispya Mar 15, 2023
76276c0
[fix] narrow scene options type
krispya Mar 15, 2023
6a873aa
Merge pull request #2805 from Nicetouchco/feat/scene-prop
krispya May 30, 2023
35333c9
[feat] relax Object3D checks in the reconciler (#2806)
krispya May 30, 2023
a83e06e
Merge branch 'v9' into experiment/object-constructor-effects
krispya Jun 5, 2023
4ae810e
fix: dispose properly binds its object
krispya Jun 5, 2023
ec1d723
fix: call instead of bind
krispya Jun 5, 2023
9e0b2d1
Revert to bind
krispya Jun 5, 2023
cab6d59
Merge pull request #2871 from Nicetouchco/fix/dispose
krispya Jun 10, 2023
02a2740
Merge branch 'master' into v9
CodyJasonBennett Jun 10, 2023
ad37b2a
chore: update tests, upstream fixes
CodyJasonBennett Jun 10, 2023
ba6aa5b
Merge branch 'master' into v9
CodyJasonBennett Jun 12, 2023
44694cc
fix: inline SSR fallbacks
CodyJasonBennett Jun 12, 2023
7088dc5
chore: prefer imperative loops for tracing
CodyJasonBennett Jun 12, 2023
dde49a5
Merge pull request #2723 from pmndrs/fix/loosen-loader-type
krispya Jun 22, 2023
66b7cb3
Merge pull request #2607 from pmndrs/experiment/object-constructor-ef…
krispya Jun 22, 2023
8449aac
fix: scene prop not being used in web canvas
krispya Jun 22, 2023
e8f2ef0
Merge pull request #2901 from Nicetouchco/fix/scene
krispya Jun 22, 2023
2e7d5d6
fix: object3d check in reconciler
krispya Jun 22, 2023
4249c39
Merge pull request #2902 from Nicetouchco/fix/object3d-check
krispya Jun 22, 2023
df2c2fd
Merge branch 'master' into v9
CodyJasonBennett Jul 12, 2023
0e45425
chore: cleanup
CodyJasonBennett Jul 12, 2023
245cd3e
Merge branch 'master' into v9
CodyJasonBennett Jul 26, 2023
bca4137
fix(types): r153 colors overload fix (#2932)
CodyJasonBennett Aug 20, 2023
1477e10
chore: merge
CodyJasonBennett Sep 4, 2023
f681076
chore: resolve conflicts
CodyJasonBennett Sep 4, 2023
795fa93
Merge branch 'master' into v9
CodyJasonBennett Sep 17, 2023
642c0ca
[v9] experiment: extend factory overload (#2785)
CodyJasonBennett Sep 17, 2023
c5694ee
Merge branch 'master' into v9
CodyJasonBennett Sep 28, 2023
4d59d9c
fix: Function formatting destroying syntax highlighting
krispya Oct 2, 2023
1ff2e32
Merge pull request #3031 from Nicetouchco/fix/syntax-highlighting
krispya Oct 5, 2023
fb0174f
Merge branch 'master' into v9
CodyJasonBennett Oct 6, 2023
221ad2d
fix(applyProps): loosen copy identity in dev
CodyJasonBennett Oct 6, 2023
97bad98
Merge branch 'master' into v9
CodyJasonBennett Oct 21, 2023
62dec65
chore: export buildGraph
CodyJasonBennett Oct 21, 2023
b126089
Merge branch 'master' into v9
CodyJasonBennett Oct 21, 2023
b362ea4
Merge branch 'master' into v9
CodyJasonBennett Oct 22, 2023
fccfd06
chore: handle conflicts
CodyJasonBennett Oct 22, 2023
8921435
Merge branch 'master' into v9
CodyJasonBennett Oct 25, 2023
a56b1ab
refactor(reconciler): remove replace
CodyJasonBennett Oct 26, 2023
e5291a0
Merge branch 'master' into v9
CodyJasonBennett Oct 26, 2023
2ec2bbc
[fix] Add missing math types
krispya Oct 29, 2023
42ccaeb
[v9] fix: add missing math types (#3072)
krispya Oct 29, 2023
1dc2b95
chore: update snapshot
CodyJasonBennett Oct 29, 2023
7ea6c52
Merge remote-tracking branch 'upstream/v9' into v9
krispya Nov 20, 2023
fa978ba
[fix] Guard against constructing without params in diffProps
krispya Nov 20, 2023
9a61979
Merge pull request #3098 from Nicetouchco/fix/primitive-diffProps
krispya Dec 4, 2023
6b3e3dc
docs: update introduction for three.js r155+ (#3134)
charliefuller Jan 1, 2024
9d11627
Update readme.md (#3135)
charliefuller Jan 1, 2024
e07fccf
fix: tests were not extending Three
krispya Mar 20, 2024
037b5f9
fix(RTTR): set initial size for NaN in viewport (#3137)
AbsharHassan Jan 2, 2024
c4e248e
chore: add triplex link
itsdouges Jan 2, 2024
bbf8657
chore: update links
itsdouges Jan 2, 2024
ebd4220
chore: center align
itsdouges Jan 2, 2024
40bfbcb
chore: remove div
itsdouges Jan 2, 2024
0b515aa
fix(native): use MSAA for antialias on iOS (#3139)
CodyJasonBennett Jan 2, 2024
ed81989
docs(changeset): fix(native): use MSAA for antialias on iOS
CodyJasonBennett Jan 2, 2024
03d832a
fix: portal events, update examples
drcmda Jan 12, 2024
a30b2e1
new examples
drcmda Jan 22, 2024
f2d8adf
docs(changeset): fix: portal events, update examples
drcmda Jan 12, 2024
db77e16
chore(ci): matrix (#3146)
satelllte Jan 22, 2024
888f213
csb: node 18 (#3157)
satelllte Jan 23, 2024
0d4011c
chore(CI): setup-node v4 (#3144)
satelllte Jan 23, 2024
4fc5cfe
fix: tonemapping config overwrites userland
krispya Mar 21, 2024
bbb3a03
chore(tests): update color management checks
krispya Mar 21, 2024
4689d0e
new sandboxes
drcmda Feb 15, 2024
0b82cdd
fix: correctly pass frames in invalidate (#3185)
krispya Mar 21, 2024
765ae04
Update readme.md
drcmda Mar 4, 2024
78cfbbd
Merge branch 'master' into v9
CodyJasonBennett Mar 27, 2024
0b4b51a
chore: resolve conflicts
CodyJasonBennett Mar 27, 2024
18a5d7b
chore: add lockfile back
CodyJasonBennett Mar 27, 2024
783f377
Merge branch 'master' into v9
CodyJasonBennett Mar 29, 2024
d7a5b31
chore: mirror #3197
CodyJasonBennett Mar 29, 2024
b4f7bbc
fix(useLoader): loosen object3d check
CodyJasonBennett Apr 22, 2024
6d2543b
chore(examples): remove styled-components
CodyJasonBennett Apr 22, 2024
be6cc23
[v9] fix!: upgrade reconciler for React 19 (#3224)
CodyJasonBennett Apr 26, 2024
36a7fc4
Merge branch 'master' into v9
CodyJasonBennett Apr 26, 2024
2c4f448
chore: resolve conflicts
CodyJasonBennett Apr 26, 2024
4c1242c
[v9] chore(tests): add array attach case (#3070)
CodyJasonBennett Apr 26, 2024
85fad8e
feat(useLoader): support loader instances (#3131)
CodyJasonBennett Apr 26, 2024
9e20942
[v9] fix!: don't automatically set texture colorSpace, colorMap fallb…
CodyJasonBennett Apr 26, 2024
f722b5d
chore(examples): use React beta
CodyJasonBennett Apr 26, 2024
d092606
chore: cleanup global access
CodyJasonBennett Apr 26, 2024
15fb1dd
chore(reconciler): cleanup switchInstance
CodyJasonBennett Apr 26, 2024
1e77613
chore: cleanup, re-enable eslint tests
CodyJasonBennett Apr 26, 2024
dd148bd
fix(updateCamera): don't update world matrices
CodyJasonBennett Apr 26, 2024
1cde392
RELEASING: Releasing 2 package(s)
CodyJasonBennett Apr 26, 2024
425b6bd
chore(tests): use names in swap cases
CodyJasonBennett Apr 26, 2024
c3a1189
chore(tests): cleanup
CodyJasonBennett Apr 26, 2024
0af41db
perf(reconciler): inline prepareUpdate
CodyJasonBennett Apr 27, 2024
f2de25c
fix(types): use new createWithEqualityFn signature
CodyJasonBennett Apr 27, 2024
ad0e822
fix(types): shim OffscreenCanvas
CodyJasonBennett Apr 27, 2024
eafb2cc
fix(findInitialRoot): restore traverse, add coverage
CodyJasonBennett Apr 27, 2024
b252c8a
chore(demos): cleanup SVGRenderer
CodyJasonBennett Apr 28, 2024
817335b
chore: cleanup
CodyJasonBennett Apr 28, 2024
b62c807
chore(demos): upgrade deps
CodyJasonBennett Apr 28, 2024
d7eb077
[v9] refactor!: remove viewport, add dpr (#2887)
CodyJasonBennett Apr 28, 2024
538a89a
chore: Use React beta typings
krispya Apr 28, 2024
a4a86c4
Merge branch 'v9' of https://github.com/pmndrs/react-three-fiber into v9
krispya Apr 28, 2024
d7f7ed4
fix: JSX namespacing for v19
krispya Apr 28, 2024
0ffa718
fix(types): use new ref type
CodyJasonBennett Apr 28, 2024
e0f8a3a
fix(types): resolve remaining type issues
CodyJasonBennett Apr 28, 2024
bcc0620
chore: replace ts-ignore with ts-expect-error
krispya Apr 28, 2024
f1a296d
chore(tests): add failing suspense case
CodyJasonBennett Apr 28, 2024
eafe554
fix(reconciler): don't implement (un)hideInstance methods (#3241)
CodyJasonBennett Apr 28, 2024
a17fe45
RELEASING: Releasing 2 package(s)
CodyJasonBennett Apr 28, 2024
0d8d270
chore(hooks): cleanup
CodyJasonBennett Apr 28, 2024
97c969f
fix(useLoader): localize url caching per loader
CodyJasonBennett Apr 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(RTTR): set initial size for NaN in viewport (#3137)
AbsharHassan authored and krispya committed Mar 20, 2024
commit 037b5f923e53d055ed8765d22dacd63c8511bbfb
4 changes: 2 additions & 2 deletions packages/test-renderer/src/__tests__/RTTR.hooks.test.tsx
Original file line number Diff line number Diff line change
@@ -27,12 +27,12 @@ describe('ReactThreeTestRenderer Hooks', () => {
return <group />
}

await ReactThreeTestRenderer.create(<Component />)
await ReactThreeTestRenderer.create(<Component />, { width: 1280, height: 800 })

expect(result.camera instanceof THREE.Camera).toBeTruthy()
expect(result.scene instanceof THREE.Scene).toBeTruthy()
expect(result.raycaster instanceof THREE.Raycaster).toBeTruthy()
expect(result.size).toEqual({ height: 0, width: 0, top: 0, left: 0 })
expect(result.size).toEqual({ height: 800, width: 1280, top: 0, left: 0 })
})

it('can handle useLoader hook', async () => {
13 changes: 12 additions & 1 deletion packages/test-renderer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -19,7 +19,18 @@ extend(THREE as any)
const create = async (element: React.ReactNode, options?: Partial<CreateOptions>): Promise<Renderer> => {
const canvas = createCanvas(options)

const _root = createRoot(canvas).configure({ frameloop: 'never', ...options, events: undefined })
const _root = createRoot(canvas).configure({
frameloop: 'never',
// TODO: remove and use default behavior
size: {
width: options?.width ?? 1280,
height: options?.height ?? 800,
top: 0,
left: 0,
},
...options,
events: undefined,
})
const _store = mockRoots.get(canvas)!.store

await act(async () => _root.render(element))