-
Notifications
You must be signed in to change notification settings - Fork 50
[FEAT] Update to ES6 Modules #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This will allow us to unify the Node and Browser Sources...
Something is funny with the sensitivity on TrackballControls..
…rocessing-js into feat-es6-modules
|
@zalo Thank you for putting in all this effort! This really looks great, the dependencies in the library haven't been updated in a while. We'll test it out soon! |
|
Is any thing happening with this and is there a possibility of an NPM package? |
|
Since the main library hasn’t updated since this PR, in theory, you might be able to do something like |
This PR updates
geometry-processing-jsto use the ES6 Module Syntax.ES6 Modules offer several notable benefits. They
nodecodebase by unifying both Browser and Node implementationsChangelist:
libsfolder with a three.js CDN.All of the examples still work:
https://zalo.github.io/geometry-processing-js/
https://zalo.github.io/geometry-processing-js/projects/geometric-flow/index.html
https://zalo.github.io/geometry-processing-js/projects/discrete-curvatures-and-normals/index.html
https://zalo.github.io/geometry-processing-js/projects/geodesic-distance/index.html
https://zalo.github.io/geometry-processing-js/projects/parameterization/index.html
https://zalo.github.io/geometry-processing-js/projects/vector-field-decomposition/index.html
https://zalo.github.io/geometry-processing-js/projects/poisson-problem/index.html
https://zalo.github.io/geometry-processing-js/projects/discrete-exterior-calculus/index.html
https://zalo.github.io/geometry-processing-js/projects/direction-field-design/index.html
The documentation rebuilds properly automatically inside of a Github Action:
https://zalo.github.io/geometry-processing-js/docs/index.html
And commits get a spiffy new checkmark when they pass the unit tests and documentation builds:

Note:
You'll see that
"use strict";has been removed from most files. This is because ES6 Modules are always loaded in strict mode, so it became redundant.I took special care in preserving the overall structure and intent of the code. It is my hope that you will see these changes as an unopinionated attempt towards improving the broader accessibility and maintainability of this library.
I'm a big fan of this library and the work that you guys do. Thank you for putting this all together.
@MarkGillespie @rohan-sawhney @keenancrane @GeometryCollective