My plans are to use jQuery within the interface I’m developing not within Three.js development directly.
What experience(s) have you had with using the jQuery Library while running Three.js?
- Is using the jQuery library bad practice?
- Will I eventually tear out jQuery and go back to pure vanilla JS?
- What side-effects could occur while using jQuery?
- Anything else I may be missing?
For instance: https://codepen.io/francisco/pen/drbHq
I’m blown away by the sortable() method so simple but what havoc am I bringing to the Three.js library by using these stripped down methods for only interface development?
Again not using sortable() directly with Three.js.
I don’t really see how this should be related to THREE, but the jQuery realm uses the dom for application structure instead the other way, so if you would sort a list of children of a Object3D you would have to synchronize that with the actual array.
Aah yes DOM I forgot, jQuery is independent from Three.js
I was thinking somehow the presence of jQuery would do something crazy to the Three.js engine.
Understand the loop if I query over lots of things that is a potential threat.
Yeah not doing any Object3D manipulation, I have a taxonomy(classification engine) i’m running along side the Three.js engine - an independent interface from the 3D engine
I don’t think this should be a problem — using two frameworks that both want to control the DOM together can be a challenge (e.g. jQuery + React), but threejs doesn’t touch the DOM.
jQuery is a bit “less cool/modern” than other libraries for managing the DOM these days, but not bad practice, and certainly not incompatible with three.js.
Great to hear jQuery is a viable option, thank you!
Have been thinking of using React, I know this is getting off of topic. But I think our readers might run into this same problem.
Now hearing jQuery doesn’t play fairly with React is a bummer.
So I probably should be thinking of using JSX than jQuery?
I don’t have personal experience with the jQuery/React combination but generally any DOM-manipulating framework…
… will cause some headaches when used alongside another DOM-manipulating framework, unless you’re very careful how you use them. For D3 in particular there are best practices to get around those issues, but for the others I’d suggest just picking one, especially if you’re just getting started on a new project.