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

fix(useLoader): loosen GLTF inference check #3105

Merged
merged 3 commits into from
Dec 3, 2023

Conversation

CodyJasonBennett
Copy link
Member

Fixes cases where different GLTF versions from @types/three and forks like three-stdlib may disagree.

Copy link

codesandbox-ci bot commented Nov 26, 2023

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:

Sandbox Source
example Configuration

// 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>[]
Copy link
Contributor

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.

Copy link
Member Author

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).

Copy link
Contributor

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?

Copy link
Member Author

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.

@CodyJasonBennett CodyJasonBennett merged commit e4bbc29 into master Dec 3, 2023
2 checks passed
@CodyJasonBennett CodyJasonBennett deleted the fix/loader-gltf-inference branch December 3, 2023 11:40
renovate bot added a commit to simonknittel/sinister-incorporated that referenced this pull request Dec 20, 2023
[![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 (@&#8203;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
[@&#8203;CodyJasonBennett](https://togithub.com/CodyJasonBennett) in
[pmndrs/react-three-fiber#3105
- fix(types): preserve deprecated XR type annotations by
[@&#8203;CodyJasonBennett](https://togithub.com/CodyJasonBennett) in
[pmndrs/react-three-fiber#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
[@&#8203;Methuselah96](https://togithub.com/Methuselah96) in
[pmndrs/react-three-fiber#3095

#### New Contributors

- [@&#8203;warrenseine](https://togithub.com/warrenseine) made their
first contribution in
[pmndrs/react-three-fiber#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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants