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
-
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
-
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'
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
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
If three.js's CDN path changed from
to
and the examples jsm files were at
Then users could use three and all the supporting example helpers like GLTFLoader, EffectComposer, etc via ES6 modules.
As it is
three.module.jsis 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 formimport {x} from '../../../build/three.module.js'