Git Product home page Git Product logo

es6-sandbox's Introduction

Mucking around with ES6 and the Babel Transpiler

(Starting point - this excellent article)

Quick notes:

  1. npm install -g babel followed by babel -d <targetdir> <sourcedir> to transpile
  2. npm has a scripts.prepublish that runs a command before publishing. Defining scripts.compile as the command above in #1 and using npm run compile as scripts.prepublish automatically transpiles before publishing
  3. Add babel under devDependencies so that npm will add the babel executable to the path before running any scripts (in particular, scripts.prepublish as described above)
  4. You'll need npm install core-js for additional features like Map, Set and String.prototype.repeat

What I've fiddled with

see ES6 Features

  1. Arrows (as MapReduce)
  2. Spread Arguments (I wish you could put them before a single argument, e.g. (...args, callback))
  3. Better Object (the ability to have dynamic keys with [ <some expression> ] : <some value> is very convenient)
  4. Destructure (it's interesting how {go: here, also: there} => { go: 'one', also: 'two'} assigns here and there)
  5. Iterators (these are seriously powerful, but you'd need to think hard for a use case. Generators are a subset of iterators)
  6. Person (classes... meh...)

What's left

  • Map, Set, WeakMap, WeakSet
  • Proxies
  • Symbols
  • Subclassable Built-Ins
  • Math + Number + String + Object APIs
  • Binary and Octal Literals
  • Promises
  • Reflect (???)
  • Tail Call Optimization (unsupported, sadly)

es6-sandbox's People

Watchers

Benjamin Goh avatar James Cloos 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.