Skip to content

add examples/jsm, examples/js folders to CDN and change three.js CDN path #17522

Description

@greggman

Would it be a good idea to add the examples/jsm and examples/js folders to the CDN?

There's a few reasons this seems like it would be a good idea

  1. The offical instructions say you should always use the correct version of an example (like OrbitControls) but 1000s and 1000s of snippets/codepens/jsfiddles etc link directly to https://threejs.org/examples/js/controls/OrbitControls.js. Of course putting the example js files on the CDN won't make devs do it correctly but it will at least give them a simple option

  2. If three.js's CDN path changed from

    https://cdnjs.cloudflare.com/ajax/libs/three.js/109/three.module.js
    

    to

    https://cdnjs.cloudflare.com/ajax/libs/three.js/109/build/three.module.js
    

    and the examples jsm files were at

    https://cdnjs.cloudflare.com/ajax/libs/three.js/109/examples/jsm/...
    

    Then users could use three and all the supporting example helpers like GLTFLoader, EffectComposer, etc via ES6 modules.

    As it is three.module.js is on a CDN but AFAICT there isn't much point to that since you can't use any of the modules as internally they all have paths of the form import {x} from '../../../build/three.module.js'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions