play-co / devkit-core

11 stars 17 forks source link

ES6 Class / Module Support #18

Open bvkimball opened 9 years ago

bvkimball commented 9 years ago

Any chance we could get full es6 syntax support in devkit. It would be really cool to write:

class HomeView extends View {
    constructor() {
        //this would be your init function
     }
    // ...
}
jwilm commented 9 years ago

ES6 support would be amazing. I expect this to be a pretty big feature since all of timestep, the devkit-core source, every module ever, and every game built on devkit uses the js.io class / module syntax. It might be possible to achieve with some "use 6to5" like thing in the code, especially if that can emit files with js.io style imports. Then, we can provide it on an opt in basis and alleviate any need for a complete migration (nearly impossible to do all at once). The backwards compatible thing could be added in any minor release of devkit, and we could potentially deprecate the old js.io style syntax when devkit-v3 becomes a thing.