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

Avoid bare imports other than 'three' #23625

Closed
donmccurdy opened this issue Mar 1, 2022 · 3 comments
Closed

Avoid bare imports other than 'three' #23625

donmccurdy opened this issue Mar 1, 2022 · 3 comments
Labels

Comments

@donmccurdy
Copy link
Collaborator

donmccurdy commented Mar 1, 2022

Related:

With r138 the following syntax was introduced:

import { NormalNode } from 'three-nodes/Nodes.js';

I do not think we should be using bare imports (except three) unless we are publishing it to a separate NPM package. Bundlers cannot resolve three-nodes without custom resolution configuration, and we're seeing confusion about this in Discord. By contrast, anything under the three import is fine if we configure it in package.json exports:

import { NormalNode } from 'three/nodes/Nodes.js';

/cc @sunag

@marcofugaro
Copy link
Contributor

Ah yes, about this, I'm awaiting @mrdoob's response in #23406

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 11, 2022

It seems this bug is fixed with r144, right?

@donmccurdy
Copy link
Collaborator Author

Agreed, thanks!

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

No branches or pull requests

3 participants