Giter VIP home page Giter VIP logo

es6-support's Introduction

ECMAScript 6

Support Hints & Examples

This is a small collection of hints and examples to show how ECMAScript 6 can be used today in practice in various scenarios, thanks to the awesome Babel transpiling toolkit. If you want to find out more about ECMAScript 6 check out our companion project es6-features.org, too.

Code Examples

The following are code examples how to use ECMAScript 6 for your own code:

  • app-browser-onthefly
    This shows a browser application, using on-the-fly transpiling. The key points are: it includes Babel's browser.js (which is a Browserify'ed Babel distribution) and then includes the ES6 application code app.js with MIME-type text/babel instead of text/javascript. This is not recommended for production scenarios.

  • app-browser-buildproc:
    This shows a browser application, based on a Grunt-based build process. The key points are: Grunt uses Browserify which itself uses the Browserify plugin Babelify to transpile ES5 to ES6 with Babel. This is recommended for production scenarios.

  • app-node-buildproc
    This shows a Node.js/IO.js-based server application, based on a Grunt-based build process. The key points are: Grunt uses its plugin Grunt-Babel transpile ES5 to ES6 with Babel. This can be used for production scenarios.

  • app-node-onthefly
    This shows a Node.js/IO.js-based server application, using on-the-fly transpiling. The key points are: it uses an ES5-based boot script app.js which activates Babel's require hook which on subsequent require calls on-the-fly transpiles all ES6 to ES5 code. This can be used for production scenarios, as server startup times usually do not matter such much.

  • grunt-onthefly
    This shows a Grunt-based build process where ES6 is used for the build script. The key points are: it uses an ES5-based boot script Gruntfile.js which activates Babel's require hook which on subsequent require calls on-the-fly transpiles all ES6 to ES5 code. This can be used for production scenarios.

  • lib-node-browser-buildproc
    This shows a library for use within Node.js/IO.js-based server environments or within browser environments. It is based on a Grunt-based build process. The key points are: Grunt uses JSHint (with its esnext option enabled) and ESLint (with the Babel-ESLint plugin activated) to lint all ES6 sources. Then it uses Browserify, which itself uses the Browserify plugin Babelify, to transpile all ES5 library code to ES6 with Babel. Additionally, it uses the plain Grunt-Babel plugin to transpile Mocha-based ES5 test code to ES6 with Babel. This is recommended for production scenarios.

Tool Support

The following are hints for using ECMAScript 6 with various tools:

es6-support's People

Contributors

rse avatar

Stargazers

TrasherDK avatar Svitlana avatar Erik Straight avatar Scott J avatar Arnaud Lécuyer avatar Ruslan Chubatov avatar  avatar Ryan avatar Krishna Kalubandi avatar Yuri Dias avatar Kristian Magda avatar zhangbg avatar Galymzhan Abdugalimov avatar Marina Bercea avatar matrixbirds avatar Mo Henriquez avatar Ruslan avatar Max avatar ckyue avatar Rocco Schulz avatar Luana Coppio avatar Daniel Zhang avatar Florian Schmid @github avatar Evandro Cavalcante Santos avatar Nickolas Burr avatar Lucas Bento avatar Fernando Daciuk avatar Manuel Rodriguez avatar  avatar Rj Bernaldo avatar Jake Niemiec avatar David Meybohm avatar Paulo Sorrentino avatar Marco Mocca avatar Arief Fikhrie avatar Pankaj Bagwan avatar Ian De La Cruz avatar Jaroslav Urbánek avatar WangJunKai avatar Artur Parkhisenko avatar pinage404 avatar Nikita Makhov avatar Josh Pierro avatar Martín Granados García avatar Roman Dmiterko avatar Amanda Kitson avatar Hsuching avatar  avatar Eugene Zhdan avatar Chris Lynch avatar Benjamin Kohl avatar Gene Armstrong avatar Aren Patel avatar Danilo Gasques avatar Maurice Rabb avatar Suhas Deshpande avatar Developer avatar Sevak Mnatsakanyan avatar Hakan Özler avatar Vadim avatar Rémi Becheras avatar Luka Jerković avatar James Morgan avatar Konstantin Ryzhov avatar Gabriel avatar Florian Rotagnon avatar Claudia Matosa avatar Tomas Green avatar Izzet Pembeci avatar Pavel avatar

Watchers

 avatar Eduardo avatar Rafael Rodrigues avatar James Cloos avatar WangJunKai avatar Zaid Hisham avatar KenXRan avatar Roger Hoffman avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.