-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Nodes: use relative references inside examples/jsm #27381
Nodes: use relative references inside examples/jsm #27381
Conversation
Could you share a test of this import being an issue?
We recommend the users to import from |
I commented on the referenced issue. Once that is resolved happy to close this PR if really wanted. |
I think this PR follow part of work: #25904 |
Can we please reconsider this? Using relative paths feels really like a hack -- first, |
@LeviPesin see #27354 for a lot of discussion on the "why" and the current status of bundlers respecting or ignoring the virtual paths defined in package.json. I think calling relative paths "hardcoded" and virtual paths, that may or may not be resolved correctly depending on the environment, "not hardcoded" is a misnomer... For all of our projects we're using explicit import paths for that very reason, the virtual paths |
I understand that some (quite old already) browsers don't support import maps -- that what is the polyfill for them for. But if bundlers have issues with supporting them -- I would consider this more of a bundlers problem rather than a problem of using virtual paths... |
I agree but it doesn't change that three.js is not usable in these cases. It's not the "dead 0.2%" of cases unfortunately, there's quite some popular combinations that currently don't support these virtual paths (e.g. vite + svelte/sveltekit). Where I can I already open issues with these bundlers. |
Fixes (at least partically)
Description
These are the only places where importmaps are currently required when accessing code from
examples/jsm
.All other places that import from
three/nodes
are either inside example HTML files (that have importmaps) or inside the playground folder.CC @sunag; is there a specific reason for why
three/nodes
is used? I understand that the location of this code may change again but I think then the paths should be adjusted instead of in the meantime requiring users to go through hoops with various bundlers to get these references to work.