Skip to content

Documentation missing imports #25437

Closed
Closed
@LukePenkava

Description

Description

Is there a reason why documentation examples don't include import statements? Where am I supposed to find those? So far, as a new user of threejs, anytime I want to implement something based on documentation I have to search for it on Google how to actually import it as documentation is missing basic import information. I don't understand why official documentation is missing how to import OrbitControls for example, since clearly a lot of work has been put into documentation. This seems like strange oversight.

https://threejs.org/docs/#examples/en/controls/OrbitControls

No information, that this import is required to use any of the following features in the documentation
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';

Again, not realy sure how is user expected to know this, when it's not in the documentation?

Clear example of Unity documentation including all import statements at the top. Ie the documentation provides example that can be exactly copied as is and it will work.
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager-sceneLoaded.html

For someone new to three.js, I essentially don't use your documentation, because I know it's missing things, so I have to use third party tutorials, which should not be the case, since your documentation has otherwise all the information on the class and could be all anyone really needs.

Solution

Include all import statements in your examples and make examples that can be copied as is into .js file and it will work.

Alternatives

I don't know about alternative solutions to this.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions