question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
donmccurdycommented, Sep 22, 2019

^But yeah to be clear, Cloudflare’s CDNJS project is not maintained by us; we can only make suggestions or pull requests for what they include.

0reactions
donmccurdycommented, Sep 22, 2019

Looks like they’re managed here, with some automation:

https://github.com/cdnjs/cdnjs/tree/master/ajax/libs/three.js

Don’t know whether replicating examples/js/* and examples/jsm/* would be something the cdnjs maintainers want or not. 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Three + examples import via CDN - Questions - three.js forum
I have a React application bundled with Webpack and am trying to load threejs from a CDN on runtime in order to decrease...
Read more >
What is the URL for three.js to include it online? - Stack Overflow
The problem with these CDN URLs is that, if you replace r123 with the latest one (for example, r138), the URLs won't work....
Read more >
How to Include three.js in Your Projects
The first step in building a three.js app is importing the three.js files. There are three main ways to do this: download the...
Read more >
three.js - Libraries - cdnjs - The #1 free and open source CDN ...
JavaScript 3D library - Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over...
Read more >
Untitled
Junior Software Developer | JS | Threejs | NodeJS | Webpack | Canvas | Blender | C# | Unity ... 공식github issue examples/jsm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found