-
Notifications
You must be signed in to change notification settings - Fork 264
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
Convert to ES6 #272
Comments
@xeolabs Are you planning on releasing this as an npm package too btw? |
@MichaelDeBoey yip will do! |
The xeogl ES6 branch is now largely working if anyone needs to preview it. Will merge into master when I've updated the docs. Feedback is super welcome, please comment in this issue if you have any questions or feedback. Change docs (WIP): https://github.com/xeolabs/xeogl/wiki/Updates-in-xeogl-v0.9 Rollup is building two versions of xeogl: a UMD module and an EC6 module, in the build dir: https://github.com/xeolabs/xeogl/tree/es6/build The UMD version should work just like v0.8, ie. with a global |
BTW, the main breaking API change with this ES6 upgrade is that the default Scene is no longer settable/gettable via a property on the In v0.8 (EC5), it was: // Get default scene, internally creating first if needed
var theDefaultScene = xeogl.scene;
// Set the default scene
xeogl.scene = new xeogl.Scene({... });
// Subsequently created components will be within xeogl.scene
// if no scene is explicitly provided for them. ReasonIn the EC6 conversion, xeogl.js is the rollup "input" file, which effectively assembles the xeogl namespace via a bunch of exports. Unfortunately, you can't export an object property, the way Therefore, I was forced to replace that with Accordingly, I needed to update a few examples that referenced that default Scene. Maybe there's something I missed - some hacky thing I can do to keep that dynamic Not sure, if anyone has tips let me know! |
I've just released v0.9, which converts xeogl to #ECMA6 - https://github.com/xeolabs/xeogl/wiki/Updates-in-xeogl-v0.9 Next step: publish the core library as an npm package, along with some of the non-core components like GLTFModel. Just got some reading to do on all of that first. |
Also use rollup, which will build xeogl as an ES6 module in
build/xeogl.module.js
, and as a UMD module inbuild/xeogl.js
.Doing the conversion in this branch: https://github.com/xeolabs/xeogl/tree/es6
Convert xeogl core to ES6Configure rollup to build library as ES6 module and UMD moduleConvert "extras" example components to ES6 classesUse gulp instead of gruntThe text was updated successfully, but these errors were encountered: