SlideShare a Scribd company logo
Nir@500tech.com
ES6 up & running
how to setup an ES6 environment
Nir@500tech.com
Nir Kaufman
+
Head of AngularJS development @ 500Tech
We develop, consult & train AngularJS
for startups & enterprises
Join us!
We’re hiring
Nir@500tech.com
grab the code
http://tinyurl.com/l5rpord
https://github.com/nirkaufman/es6-up-and-running
Nir@500tech.com
https://kangax.github.io/compat-table/es6/
ES6 current state
Edge 72%
FireFox 68%
io.js 43%
Node 23%
Babel 76%
Traceur 60%
Browsers Server Compilers
Nir@500tech.com
our goal:
minimal effort
easy tools to get us up and running fast
Nir@500tech.com
1
choose your editor
syntax highlighting, code completion etc…
Nir@500tech.com
1. go to preference -> javascript -> languages & frameworks
2. choose ECMAScript 6
Nir@500tech.com
Sublime Text
1. install package control
2. go to install packages
3. search for javascript next and install
4. switch language to javascript next
Nir@500tech.com
2
choose your compiler
make your ES6 code compatible with current browsers
Nir@500tech.com
Babel vs Traceur
two popular javascript compilers.
both of them will do the work.
you can easily switch for any reason at any stage
Nir@500tech.com
• supports 76% of ES6 features (currently)
• support all major build systems (grunt, gulp etc..)
• supports frameworks (Ember, Meteor, Sails etc…)
http://babeljs.io/docs/using-babel/
Nir@500tech.com
CLI
npm install -g babel
babel src --out-dir lib
babel src.js --out-file compiled.js
compile single file:
compile directory:
--watch
watch for changes:
--source-maps
add source maps:
+
Nir@500tech.com
WebStorm
set up a file watcher with Babel template:
+
Nir@500tech.com
Gulp
npm install --save-dev gulp-babel
var babel = require("gulp-babel");
gulp.task("default", function () {
return gulp.src(“src/**/*.js”)
.pipe(babel())
.pipe(gulp.dest("dist"));
});
es6-up-and-running/gulpfile.js
+
Nir@500tech.com
• supports 60% of ES6 features
• supports all major build systems (grunt, gulp etc..)
• maintained by Google
https://github.com/google/traceur-compiler
Nir@500tech.com
3
pick a module system
if you already use one just integrate with it..
Nir@500tech.com
JS modules
modules are now a part of the javascript language.
but until now we used other solutions to achieve modularity
UMD
each solution use it’s own patterns & syntax
Nir@500tech.com
ES6 modules
overview of the ES6 module syntax:
Named exports
(several per module)
Default exports
(one per module)
export class Logger {. . .}
export const ID = 123456;
export function sum () {. . .}
import { Logger } from ‘./utils’;
import { ID, sum } from ‘./utils’;
import * as utils from ‘./utils’;
export default class Logger {. . .}
import Logger from ‘./utils’;
Nir@500tech.com
if you already use
modules in your app
you can still use the ES6 modules syntax.
just let babel know which format to use.
https://babeljs.io/docs/usage/modules/
Nir@500tech.com
if you are starting
a new fresh project
you need to know about some tools…
Nir@500tech.com
“webpack takes modules with dependencies and
generates static assets representing those modules”.
http://webpack.github.io/
Nir@500tech.com
1. npm install -g webpack
2. npm install -g webpack-dev-server
3. npm install -D babel-loader
4. include the babel-loader in webpack.config.js
5. run webpack to bundle your files
6. run webpack-dev-server and relax…
es6-up-and-running/webpack.config.js
Nir@500tech.com
“jspm is a package manager for the SystemJS universal
module loader, built on top of the dynamic ES6 module
loader”
http://jspm.io/
Nir@500tech.com
1. npm install -g jspm
2. jspm init
3. npm install <something from anywhere>
4. load system.js & config.js in your HTML
5. import your entry file and relax..
es6-up-and-running/src/index.html
Nir@500tech.com
what to choose?
both of the tools are easy to use.
both of them offer a bundling feature for production.
webpack offers more build
features that can replace gulp or
grunt in your project
JSPM makes package management
and module loading easy and
painless, you will need gulp
for other tasks
Nir@500tech.com
4
migration to ES6
refactor your current javascript code to ES6
Nir@500tech.com
step by step
1. start with modules.
2. replace var with let & const. easy and fast.
3. convert your constructor functions to classes.
4. include more & more ES6 features with ease…
ES6 & 5.1 can be mixed without problems.
No need to refactor everything at once.!
Nir@500tech.com
Thank you!
Q&A

More Related Content

What's hot (20)

PPTX
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 
PDF
Angular2 with type script
Ravi Mone
 
PPTX
Angular 5
Bartłomiej Narożnik
 
PDF
AngularJS application architecture
Gabriele Falace
 
PDF
Top 7 Angular Best Practices to Organize Your Angular App
Katy Slemon
 
PPTX
Introduction to Angular 2
Tuan Trung Vo
 
PPTX
AngularJS2 / TypeScript / CLI
Domenico Rutigliano
 
PDF
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
PDF
AngularJS Best Practices
Betclic Everest Group Tech Team
 
ODP
Introduction to Angular 2
Knoldus Inc.
 
PDF
Tech Webinar: Angular 2, Introduction to a new framework
Codemotion
 
PDF
Angular EE - Special Workshop by Nir Kaufman
Nir Kaufman
 
PDF
Angular2 - In Action
Sebastian Pożoga
 
PDF
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
PDF
Angular2 intro
Shawn McKay
 
PDF
Angular2 with TypeScript
Rohit Bishnoi
 
PPTX
Angular js 2
Ran Wahle
 
PDF
Introduction to Angular 2
Naveen Pete
 
PDF
AngularJS best-practices
Henry Tao
 
PPTX
Angular 2.0: Getting ready
Axilis
 
Angular elements - embed your angular components EVERYWHERE
Nadav Mary
 
Angular2 with type script
Ravi Mone
 
AngularJS application architecture
Gabriele Falace
 
Top 7 Angular Best Practices to Organize Your Angular App
Katy Slemon
 
Introduction to Angular 2
Tuan Trung Vo
 
AngularJS2 / TypeScript / CLI
Domenico Rutigliano
 
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
AngularJS Best Practices
Betclic Everest Group Tech Team
 
Introduction to Angular 2
Knoldus Inc.
 
Tech Webinar: Angular 2, Introduction to a new framework
Codemotion
 
Angular EE - Special Workshop by Nir Kaufman
Nir Kaufman
 
Angular2 - In Action
Sebastian Pożoga
 
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
Angular2 intro
Shawn McKay
 
Angular2 with TypeScript
Rohit Bishnoi
 
Angular js 2
Ran Wahle
 
Introduction to Angular 2
Naveen Pete
 
AngularJS best-practices
Henry Tao
 
Angular 2.0: Getting ready
Axilis
 

Viewers also liked (20)

PDF
Webpack and angularjs
Nir Kaufman
 
PDF
Data Structures in javaScript 2015
Nir Kaufman
 
PDF
Redux with angular 2 - workshop 2016
Nir Kaufman
 
PDF
redux and angular - up and running
Nir Kaufman
 
PDF
Solid angular
Nir Kaufman
 
PDF
Angular Pipes Workshop
Nir Kaufman
 
PDF
How Angular2 Can Improve Your AngularJS Apps Today!
Nir Kaufman
 
PDF
Angularjs - Unit testing introduction
Nir Kaufman
 
PDF
Angular2 workshop
Nir Kaufman
 
PDF
Webstorm
Nir Kaufman
 
PPT
Js objects
Charles Russell
 
PPT
JavaScript Tools and Implementation
Charles Russell
 
PPT
JavaScript Variables
Charles Russell
 
KEY
JavaScript: Values, Types and Variables
LearnNowOnline
 
PDF
AngularJS - Services
Nir Kaufman
 
PPSX
Javascript variables and datatypes
Varun C M
 
PDF
Angular redux
Nir Kaufman
 
PDF
Angular js routing options
Nir Kaufman
 
PPTX
Game is ggj2017 presentation
Hanokh Aloni
 
PDF
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Webpack and angularjs
Nir Kaufman
 
Data Structures in javaScript 2015
Nir Kaufman
 
Redux with angular 2 - workshop 2016
Nir Kaufman
 
redux and angular - up and running
Nir Kaufman
 
Solid angular
Nir Kaufman
 
Angular Pipes Workshop
Nir Kaufman
 
How Angular2 Can Improve Your AngularJS Apps Today!
Nir Kaufman
 
Angularjs - Unit testing introduction
Nir Kaufman
 
Angular2 workshop
Nir Kaufman
 
Webstorm
Nir Kaufman
 
Js objects
Charles Russell
 
JavaScript Tools and Implementation
Charles Russell
 
JavaScript Variables
Charles Russell
 
JavaScript: Values, Types and Variables
LearnNowOnline
 
AngularJS - Services
Nir Kaufman
 
Javascript variables and datatypes
Varun C M
 
Angular redux
Nir Kaufman
 
Angular js routing options
Nir Kaufman
 
Game is ggj2017 presentation
Hanokh Aloni
 
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Ad

Similar to Up & running with ECMAScript6 (20)

PPTX
DotNet MVC and webpack + Babel + react
Chen-Tien Tsai
 
PDF
System webpack-jspm
Jesse Warden
 
PDF
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
Heejong Ahn
 
PPTX
React Basic and Advance || React Basic
rafaqathussainc077
 
PDF
KenRimple_ETE2015_ES6LikeNow
krimple
 
PDF
S&T What I know about Node 110817
Dan Dineen
 
PDF
Frontend JS workflow - Gulp 4 and the like
Damien Seguin
 
PDF
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Christian Heilmann
 
PDF
The ES6 Conundrum - All Things Open 2015
Christian Heilmann
 
PPTX
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
Sencha
 
PPTX
Angular JS in 2017
Ayush Sharma
 
PDF
Making ES6 available to all with ChakraCore
Christian Heilmann
 
PDF
Modern javascript
Kevin Ball
 
PDF
AngularJS Toronto: Ng babel+webpack
Alan Hietala
 
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
PDF
Making ES6 available to all with ChakraCore and Typescript
Christian Heilmann
 
PPTX
Overview of Node JS
Jacob Nelson
 
PDF
Forget Grunt and Gulp! Webpack and NPM rule them all!
Derek Willian Stavis
 
PDF
ES6 Everywhere – Adam Klein
500Tech
 
PDF
Es6 everywhere
Adam Klein
 
DotNet MVC and webpack + Babel + react
Chen-Tien Tsai
 
System webpack-jspm
Jesse Warden
 
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
Heejong Ahn
 
React Basic and Advance || React Basic
rafaqathussainc077
 
KenRimple_ETE2015_ES6LikeNow
krimple
 
S&T What I know about Node 110817
Dan Dineen
 
Frontend JS workflow - Gulp 4 and the like
Damien Seguin
 
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Christian Heilmann
 
The ES6 Conundrum - All Things Open 2015
Christian Heilmann
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
Sencha
 
Angular JS in 2017
Ayush Sharma
 
Making ES6 available to all with ChakraCore
Christian Heilmann
 
Modern javascript
Kevin Ball
 
AngularJS Toronto: Ng babel+webpack
Alan Hietala
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
Making ES6 available to all with ChakraCore and Typescript
Christian Heilmann
 
Overview of Node JS
Jacob Nelson
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Derek Willian Stavis
 
ES6 Everywhere – Adam Klein
500Tech
 
Es6 everywhere
Adam Klein
 
Ad

More from Nir Kaufman (9)

PDF
Angular Prestige: Less-known API and techniques
Nir Kaufman
 
PDF
Angular CLI custom builders
Nir Kaufman
 
PDF
Electronic music 101 for developers
Nir Kaufman
 
PDF
Nestjs MasterClass Slides
Nir Kaufman
 
PDF
Redux pattens - JSHeroes 2018
Nir Kaufman
 
PDF
Boosting Angular runtime performance
Nir Kaufman
 
PDF
Decorators in js
Nir Kaufman
 
PDF
Styling recipes for Angular components
Nir Kaufman
 
PDF
Introduction To Angular's reactive forms
Nir Kaufman
 
Angular Prestige: Less-known API and techniques
Nir Kaufman
 
Angular CLI custom builders
Nir Kaufman
 
Electronic music 101 for developers
Nir Kaufman
 
Nestjs MasterClass Slides
Nir Kaufman
 
Redux pattens - JSHeroes 2018
Nir Kaufman
 
Boosting Angular runtime performance
Nir Kaufman
 
Decorators in js
Nir Kaufman
 
Styling recipes for Angular components
Nir Kaufman
 
Introduction To Angular's reactive forms
Nir Kaufman
 

Recently uploaded (20)

PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 

Up & running with ECMAScript6