makenai / robotnik

Drag and drop robotics educational library starring Johnny Five and Blockly (crowd goes wild)
52 stars 13 forks source link

Add support for ES6 and ES6 module syntax #22

Closed BrianGenisio closed 9 years ago

BrianGenisio commented 9 years ago

This PR just moves us more into a place where we are using Browserify to its fullest and ES6. There are three main sets of changes here:

  1. Move the source code into static/js/src and the output into static/js/dest
  2. Turn robotnik-blocks.js and robotnik-generator.js into modules and require/call from robotnik.js. This lets Browserify do its magic, and we don't need to include them in the HTML anymore
  3. Enable ES6 support and use ES6 module syntax

This really just builds upon what @lynnaloo started and gets me into a position where I can start re-working the client into Angular directives and take advantage of ES6 niceness. We still need to create the Bower bundles and everything else @lynnaloo had in mind.

lynnaloo commented 9 years ago

I'm glad you did this PR right now because I'm working in robotnik.js and we made some of the same changes :) I'm just going to merge what I did with CodeMirror in with what you did here. Are you going to be using Bower for your client-side Angular work as well?

BrianGenisio commented 9 years ago

Yes. I'd very much like to use Bower for all of the Angular dependencies.

BrianGenisio commented 9 years ago

This is my first experience with Browserify, BTW. WOW. What an easy, intuitive way to manage client-side dependencies, but still live within a world where we need to bundle. That it was so easy change over to ES6 style modules kind of blew me away. I expected some trouble, but it was so very cool.