-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(useLoader): loosen GLTF inference check #3105
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 803ee2c:
|
// Use suspense to load async assets | ||
const keys = (Array.isArray(input) ? input : [input]) as string[] | ||
const results = suspend(loadingFn<L>(extensions, onProgress), [Proto, ...keys], { equal: is.equ }) | ||
// Return the object/s | ||
return (Array.isArray(input) ? results : results[0]) as U extends any[] | ||
? BranchingReturn<R, GLTF, GLTF & ObjectMap>[] | ||
: BranchingReturn<R, GLTF, GLTF & ObjectMap> | ||
? BranchingReturn<R, GLTFLike, R & ObjectMap>[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any tests asserting the type output? Would like to see an output where we're not relying on type augmentation to access nodes / materials / etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test with TS 4 and 5 since #2723 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like he shouldn't be declaring the generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like he shouldn't be declaring the generic?
Probably, but I'll do integration tests to make sure this will "just work" when we release in R3F. It's possible we need to regenerate types in Drei.
Do we have any tests asserting the type output? Would like to see an output where we're not relying on type augmentation to access nodes / materials / etc.
Done in 803ee2c.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@react-three/fiber](https://togithub.com/pmndrs/react-three-fiber) | [`8.15.10` -> `8.15.12`](https://renovatebot.com/diffs/npm/@react-three%2ffiber/8.15.10/8.15.12) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@react-three%2ffiber/8.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@react-three%2ffiber/8.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@react-three%2ffiber/8.15.10/8.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@react-three%2ffiber/8.15.10/8.15.12?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pmndrs/react-three-fiber (@​react-three/fiber)</summary> ### [`v8.15.12`](https://togithub.com/pmndrs/react-three-fiber/releases/tag/v8.15.12) [Compare Source](https://togithub.com/pmndrs/react-three-fiber/compare/v8.15.11...v8.15.12) #### What's Changed - fix(useLoader): loosen GLTF inference check by [@​CodyJasonBennett](https://togithub.com/CodyJasonBennett) in [https://github.com/pmndrs/react-three-fiber/pull/3105](https://togithub.com/pmndrs/react-three-fiber/pull/3105) - fix(types): preserve deprecated XR type annotations by [@​CodyJasonBennett](https://togithub.com/CodyJasonBennett) in [https://github.com/pmndrs/react-three-fiber/pull/3111](https://togithub.com/pmndrs/react-three-fiber/pull/3111) **Full Changelog**: pmndrs/react-three-fiber@v8.15.11...v8.15.12 ### [`v8.15.11`](https://togithub.com/pmndrs/react-three-fiber/releases/tag/v8.15.11) [Compare Source](https://togithub.com/pmndrs/react-three-fiber/compare/v8.15.10...v8.15.11) #### What's Changed - fix(types): update import from three/examples by [@​Methuselah96](https://togithub.com/Methuselah96) in [https://github.com/pmndrs/react-three-fiber/pull/3095](https://togithub.com/pmndrs/react-three-fiber/pull/3095) #### New Contributors - [@​warrenseine](https://togithub.com/warrenseine) made their first contribution in [https://github.com/pmndrs/react-three-fiber/pull/3094](https://togithub.com/pmndrs/react-three-fiber/pull/3094) **Full Changelog**: pmndrs/react-three-fiber@v8.15.10...v8.15.11 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/simonknittel/sinister-incorporated). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9-->
Fixes cases where different
GLTF
versions from@types/three
and forks likethree-stdlib
may disagree.