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

Assets #1530

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Assets #1530

wants to merge 2 commits into from

Conversation

drcmda
Copy link
Member

@drcmda drcmda commented Jun 22, 2023

Why

To prevent reliance on CDNs.

  • Won't the assets be 25%> larger due to base64? All in all they are about 7-10x smaller than the originals due to clever compression
  • Will there be runtime unpack cost? Yes, that's unavoidable unfortunately.
  • Will it make the bundle bigger? It is not part of the main bundle and the overall loading impact is about 1-1.5mb less
  • Won't the assets be copied into /dist used or not? Yes, that's unavoidable, but harmless.

What

We do have https://github.com/pmndrs/assets in place already but bundlers explicitly disallow import(@pmndrs/assets/hdri/${preset}.exr) so drei must have its own asset modules.

Checklist

  • Documentation updated (example)
  • Storybook entry added (example)
  • Ready to be merged

@vercel
Copy link

vercel bot commented Jun 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
drei ❌ Failed (Inspect) Jun 22, 2023 10:04am

@drcmda drcmda marked this pull request as draft June 27, 2023 22:12
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

1 participant