SlideShare a Scribd company logo
Ecma6 in the wild
ECMAScript 6 in the Wild
Tudor.Panescu@cynny.com
CodeCamp, 25.04.15, Iasi, Romania
Presentation online
About me
What?
● ECMAScript 6 (Harmony) will be behind the
next major version of JavaScript
● To be released in June, 2015
● ECMA5 was released in 2009
● Fun fact: ECMA6 features were initially
planned for ECMA4
5
Why?
● Considerable set of new features and
improvements
● Backwards-compatible, but unavoidable
● Google, Mozilla, Yahoo!, PayPal, airbnb
6
OOP…?
7
Classes
8
Block scope
…
…
…
9
Arrow functions
…
…
10
Spread, rest, destructuring
11
And more...
● Tail call optimisation
● Promises
● Proxies
● Generators
● Object literal extensions
● Modules
● const
12
Where?
● New project started in October 2014
● Frontend with complex logic/ algorithms
● Around 8+ teammates
● Decided to start using ECMA6 around
December
13
14
How?
● Transpilers: convert ES6 code to valid ES5
● Babel (née 6to5), Traceur, Closure
● Chosen the one with:
○ most new features implemented
○ most useful features implemented
● Fortunately easy choice, Babel: babeljs.io
15
16
ECMA6 Code ECMA5 Code
Polyfill
Babel
Browserify
Transform
BrowserifyESLint
Grunt
So simple?
● Lucky because of existing Grunt/ Browserify
setup
● Nevertheless, Babel is very easy to integrate
in any workflow
● JSHint: replaced with ESLint
● JSDoc: not working...
17
Are we human?
● Considerable learning curve
● Old habits die hard
○ Crockford: “let is the new var”
○ See “===” vs “==”
● “This doesn’t look like JavaScript anymore!”
○ See the Class syntax
○ “This is ugly!”: arrows, spread
18
We try...
● Didn’t change all code to ECMA6 idioms
● Internal workshops
● This presentation
● Suggestions during code review
● Convince, not coerce people
19
Features we use
● Arrow functions
○ More concise callbacks
○ Got rid of .bind() and other synonyms
● let
● Template strings
● Default parameter values
● for … of
● TODO: classes
20
To ∞ and ECMA7
● ECMA6 is nice
● ECMA6 is unavoidable
● We need to start being more adaptable:
○ One new standard specification per year
○ Babel already includes ECMA7 features
● Transition is not easy, but it becomes harder
with time
21
Resources
● http://kangax.github.io/compat-table/es6/
● http://es6-features.org/
● https://github.com/addyosmani/es6-tools
● https://github.com/addyosmani/es6-equivalents-in-es5
● https://babeljs.io/repl/
22
www.iasijs.com
Your move.
Ecma6 in the wild
Grunt/ Browserify/ Babel setup
ECMA7 features
● Object.observe
● Async functions (turbocharged Promises)
● Array comprehension
● Reflection
● SIMD
ECMA vs. ECMAScript
● ECMA is a standardisation body
○ ECMA-334 - C# language specification
○ ECMA-367 – Eiffel programming language
○ ECMA-404 - JSON
○ ECMA-408 - Dart programming language
● ECMA-262 - ECMAScript Language
Specification, now at 6th
(7th
?) edition
○ ECMA6 for brevity

More Related Content

PDF
NE Scala 2016 roundup
PDF
Stockholm JAM September 2018
PPTX
Typescript language
PDF
Angular2 - A story from the trenches
PPTX
React native introduction (Mobile Warsaw)
PDF
The working architecture of node js applications open tech week javascript ...
PPTX
Engineering Frontends
PDF
Introduction to javascript technologies
NE Scala 2016 roundup
Stockholm JAM September 2018
Typescript language
Angular2 - A story from the trenches
React native introduction (Mobile Warsaw)
The working architecture of node js applications open tech week javascript ...
Engineering Frontends
Introduction to javascript technologies

What's hot (19)

PDF
Running Through Typescript
PPTX
.NET compiler platform codename Roslyn
PDF
Adopting language server for apache camel feedback from a java/Eclipse plugi...
PPTX
Android makers
PDF
GraphQL Bangkok meetup 5.0
PDF
A Shallow Survey of Alternative Languages on the JVM
PDF
freeCodeCamp Tokyo meetup 19
PDF
High Availability for the LAMP Stack
PDF
Automatic image moderation in classifieds
PDF
How to approach building GUIs using PyQT
PDF
OpenPonk (formerly DynaCASE). The open modeling platform
PDF
Last Month in PHP - October 2016
PDF
Swift for back end: A new generation of full stack languages?
PDF
Polymer & PWA: Understanding the “why”
PDF
Open data for good
PPTX
Angular intro
PDF
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
PDF
Intro to Crystal Programming Language
PDF
Introducing haXe
Running Through Typescript
.NET compiler platform codename Roslyn
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Android makers
GraphQL Bangkok meetup 5.0
A Shallow Survey of Alternative Languages on the JVM
freeCodeCamp Tokyo meetup 19
High Availability for the LAMP Stack
Automatic image moderation in classifieds
How to approach building GUIs using PyQT
OpenPonk (formerly DynaCASE). The open modeling platform
Last Month in PHP - October 2016
Swift for back end: A new generation of full stack languages?
Polymer & PWA: Understanding the “why”
Open data for good
Angular intro
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
Intro to Crystal Programming Language
Introducing haXe
Ad

Viewers also liked (6)

PDF
WUK_11-1_LLC[1][1]_Wound_UK_Article[1]
PPSX
PPTX
Diana antohi me against myself or how to fail and move forward
PPTX
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
PDF
factsheet alpap
DOC
Iii sem(1)(1)
WUK_11-1_LLC[1][1]_Wound_UK_Article[1]
Diana antohi me against myself or how to fail and move forward
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
factsheet alpap
Iii sem(1)(1)
Ad

Similar to Ecma6 in the wild (20)

PDF
HelsinkiJS - Clojurescript for Javascript Developers
PDF
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
PDF
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
PDF
Making sense of the front-end, for PHP developers
PDF
The Workflow Methodology to Train Your Team on Drupal 8
PDF
OpenCms Days 2015 OpenCms X marks the spot
PDF
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
PDF
Stripe con 2021 UI stack
PDF
OpenCms Days 2013 - Start rolling with OpenCms 9
PDF
How to keep maintainability of long life Scala applications
PDF
Continuous integration is not a solved problem
PDF
Sharing (or stealing) the jewels of python with big data & the jvm (1)
PDF
How to contribute textual tooling for apache camel in several id es
PDF
EduSymp 2022 slides (The Epsilon Playground)
PPTX
Creating an experimental GraphQL formatter using Clojure, Instaparse, and Gra...
PDF
Who needs containers in a serverless world
PDF
Sprint Boot & Kotlin - Meetup.pdf
PDF
Grammarly Meetup: DevOps at Grammarly: Scaling 100x
PDF
DrupalCon Europe 2020 Low Code
PDF
24 uses for perl6
HelsinkiJS - Clojurescript for Javascript Developers
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Making sense of the front-end, for PHP developers
The Workflow Methodology to Train Your Team on Drupal 8
OpenCms Days 2015 OpenCms X marks the spot
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
Stripe con 2021 UI stack
OpenCms Days 2013 - Start rolling with OpenCms 9
How to keep maintainability of long life Scala applications
Continuous integration is not a solved problem
Sharing (or stealing) the jewels of python with big data & the jvm (1)
How to contribute textual tooling for apache camel in several id es
EduSymp 2022 slides (The Epsilon Playground)
Creating an experimental GraphQL formatter using Clojure, Instaparse, and Gra...
Who needs containers in a serverless world
Sprint Boot & Kotlin - Meetup.pdf
Grammarly Meetup: DevOps at Grammarly: Scaling 100x
DrupalCon Europe 2020 Low Code
24 uses for perl6

More from Codecamp Romania (20)

PDF
Cezar chitac the edge of experience
PPTX
Cloud powered search
PPTX
Business analysis techniques exercise your 6-pack
PPTX
Bpm company code camp - configuration or coding with pega
PPT
Andrei prisacaru takingtheunitteststothedatabase
PPTX
Agility and life
PPTX
2015 dan ardelean develop for windows 10
PDF
The bigrewrite
PDF
The case for continuous delivery
PPTX
Stefan stolniceanu spritekit, 2 d or not 2d
PPTX
Sizing epics tales from an agile kingdom
PPTX
Scale net apps in aws
PPTX
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
PPTX
Parallel & async processing using tpl dataflow
PDF
Material design screen transitions in android
PDF
Kickstart your own freelancing career
PDF
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
PDF
Ecma6 in the wild
PPTX
Diana antohi me against myself or how to fail and move forward
Cezar chitac the edge of experience
Cloud powered search
Business analysis techniques exercise your 6-pack
Bpm company code camp - configuration or coding with pega
Andrei prisacaru takingtheunitteststothedatabase
Agility and life
2015 dan ardelean develop for windows 10
The bigrewrite
The case for continuous delivery
Stefan stolniceanu spritekit, 2 d or not 2d
Sizing epics tales from an agile kingdom
Scale net apps in aws
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Parallel & async processing using tpl dataflow
Material design screen transitions in android
Kickstart your own freelancing career
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ecma6 in the wild
Diana antohi me against myself or how to fail and move forward

Ecma6 in the wild

  • 2. ECMAScript 6 in the Wild Tudor.Panescu@cynny.com CodeCamp, 25.04.15, Iasi, Romania
  • 5. What? ● ECMAScript 6 (Harmony) will be behind the next major version of JavaScript ● To be released in June, 2015 ● ECMA5 was released in 2009 ● Fun fact: ECMA6 features were initially planned for ECMA4 5
  • 6. Why? ● Considerable set of new features and improvements ● Backwards-compatible, but unavoidable ● Google, Mozilla, Yahoo!, PayPal, airbnb 6
  • 12. And more... ● Tail call optimisation ● Promises ● Proxies ● Generators ● Object literal extensions ● Modules ● const 12
  • 13. Where? ● New project started in October 2014 ● Frontend with complex logic/ algorithms ● Around 8+ teammates ● Decided to start using ECMA6 around December 13
  • 14. 14
  • 15. How? ● Transpilers: convert ES6 code to valid ES5 ● Babel (née 6to5), Traceur, Closure ● Chosen the one with: ○ most new features implemented ○ most useful features implemented ● Fortunately easy choice, Babel: babeljs.io 15
  • 16. 16 ECMA6 Code ECMA5 Code Polyfill Babel Browserify Transform BrowserifyESLint Grunt
  • 17. So simple? ● Lucky because of existing Grunt/ Browserify setup ● Nevertheless, Babel is very easy to integrate in any workflow ● JSHint: replaced with ESLint ● JSDoc: not working... 17
  • 18. Are we human? ● Considerable learning curve ● Old habits die hard ○ Crockford: “let is the new var” ○ See “===” vs “==” ● “This doesn’t look like JavaScript anymore!” ○ See the Class syntax ○ “This is ugly!”: arrows, spread 18
  • 19. We try... ● Didn’t change all code to ECMA6 idioms ● Internal workshops ● This presentation ● Suggestions during code review ● Convince, not coerce people 19
  • 20. Features we use ● Arrow functions ○ More concise callbacks ○ Got rid of .bind() and other synonyms ● let ● Template strings ● Default parameter values ● for … of ● TODO: classes 20
  • 21. To ∞ and ECMA7 ● ECMA6 is nice ● ECMA6 is unavoidable ● We need to start being more adaptable: ○ One new standard specification per year ○ Babel already includes ECMA7 features ● Transition is not easy, but it becomes harder with time 21
  • 22. Resources ● http://kangax.github.io/compat-table/es6/ ● http://es6-features.org/ ● https://github.com/addyosmani/es6-tools ● https://github.com/addyosmani/es6-equivalents-in-es5 ● https://babeljs.io/repl/ 22
  • 27. ECMA7 features ● Object.observe ● Async functions (turbocharged Promises) ● Array comprehension ● Reflection ● SIMD
  • 28. ECMA vs. ECMAScript ● ECMA is a standardisation body ○ ECMA-334 - C# language specification ○ ECMA-367 – Eiffel programming language ○ ECMA-404 - JSON ○ ECMA-408 - Dart programming language ● ECMA-262 - ECMAScript Language Specification, now at 6th (7th ?) edition ○ ECMA6 for brevity