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: cache DRACOLoader instance in useGLTF #616

Merged
merged 3 commits into from
Nov 8, 2021

Conversation

ffdead
Copy link
Contributor

@ffdead ffdead commented Nov 4, 2021

Why

Fix #615 - Multiple DRACOLoader instances are known to cause problems on iOS: mrdoob/three.js#22445

What

  • dracoLoader instance is now cached using local variable in useGLTF
  • updated draco lib CDN version to 1.4.3
  • fixed storybook types

Checklist

  • Ready to be merged

@vercel
Copy link

vercel bot commented Nov 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/drei/6uaduYALVQiiyQrJe3P2r4RCm2cM
✅ Preview: https://drei-git-fork-ffdead-pr-type-615-usegltf-cache-dr-2fa5be-pmndrs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 4, 2021

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 03aa8ae:

Sandbox Source
holy-star-8yqte Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

dracoLoader.setDecoderPath(
typeof useDraco === 'string' ? useDraco : 'https://www.gstatic.com/draco/versioned/decoders/1.4.0/'
typeof useDraco === 'string' ? useDraco : 'https://www.gstatic.com/draco/versioned/decoders/1.4.3/'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure, certain that 1.4.3 is ok? they broke practically everything in a recent update and i don't trust their patch updates. can we be sure this is safe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question! We were discussing this here google/draco#751

The versioned URLs are recommended and 1.4.3 is the latest.

I would expect useGLTF to pull the latest if not overriding it with my own local version 🤷‍♂️

@drcmda drcmda merged commit 9bf123b into pmndrs:master Nov 8, 2021
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

🎉 This PR is included in version 7.20.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@hengjiUSTC
Copy link

I am also getting multiple KTX loaders warning when using useKTX2. Should the patten allied to other loaders as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useGLTF with multiple Draco models fails to load in iOS
3 participants