JavaScript is a whole new language to learn in 2018

EcmaScript version history: The Dark Ages

  • ES4 never even came out!
  • Long delay between initial draft and release meant a lot of browser-specific implementation
  • Things had to change

Introducing the

TC39 process

  • new way of adding new features in the language
  • yearly release, starting with ES2016

Five stages process

  • 0 - Strawman
  • 1 - Proposal
  • 2 - Draft
  • 3 - Candidate
  • 4 - Finished - The functionality is already usable!

ES2016

  • Complete feature list:
    • Array.prototype.includes
    • Exponentiation Operator
  • That's it!
  • First release with the new process: small release

ES2017: async/await

  • new way to handle promises, integrated into the language

 

<code example>

ES2017: other features

  • SharedBufferArray and Atomics
  • Object.values/Object.entries
  • String padding
  • the trailing comma!!!!

ES2018:Async Iterations

  • Iterating over an array of promises

<code example>

ES2018: Other features

  • Rest/Spread Properties
  • finally a .finally() for promises!
  • new Regexp features

And what's next?

And what's next?

  • Superset JSON (Stage 4: WILL be in ES2019)
  • Private fields and methods (Stage 3: almost certain!)
  • Decorators (Stage 2: not for now)
  • Nullish Coalescing (Stage 1: maaaaybe)
  • Pattern Matching! (Stage 0: well...)

JavaScript in 2018:
OOP flavor

  • class-like syntax (prototypes in disguise)

  • OOP keywords: static, super, extends....

  • ES Modules promoting OOP-like project structures

JavaScript in 2018:
Functional flavor

  • ES6 arrow functions are a delight to use
  • React/Flux had a huge impact on JS app design (promoting immutability & predictability)
  • Pipeline operator will be a game-changer if accepted

The era of transpilers

  • Success story of Babel
  • Polyfill as a service
  • ES2015-2018 is usable today in IE11
  • Everyone can and should use latest JS features
  • npm everything
  • Tooling gets mature and needs less config

Static typing

  • Most agree that JS needs a type system
  • Finally some viable, lasting solutions:
    • TypeScript (Microsoft) 5 y.o. birthday
    • Flow (Facebook), lighter yet powerful
  • Both are thin layers over JS, easy opt-out
    That's key to success (goodbye CoffeeScript & Dart)

Strong dynamic typing

  • Now possible in JS using ES6 Proxies
  • flow-runtime, and why it's not such a great idea
  • objectmodel.js.org short example
    (shameless self-promotion)

The rise of build tools

  • 2012: laborious (shell scripting, messy ecosystem)
  • 2015: manageable (node ecosystem, grunt/gulp)
  • 2017: powerful (hot module reload UX, webpack)
  • 2019: natural (zero config trend, parcel, fwk CLI)

Predictions about JS Future
(conclusion ?)
2020, the evergreen era

  • IE is dead (is it ?)
  • less transpiling is needed, but we got used to it
  • build tools / transpilers became smart & transparent
  • transpiling as a service and smart degradation for older devices or mobile
  • most of frameworks job is now done at build time, the runtime size penalty gets close to zero

Predictions about JS Future
(conclusion ?)
2025, the interop era

  • npm is bloated and changed its model, or has a competitor. JS is no longer the only option
  • WebAssembly arrived quietly and has great interop with JS. They are used together as a compil target
  • JS engines get optimized for subsets of the language, improving perf and compile time with the right tooling
  • JS has split in 2 parts: one as a compilation target (compressed, subsetted, prepacked, WASM-boosted), one as a language (probably close to TypeScript/ReasonML)

Techforum 2018: JavaScript is a whole new language to learn in 2018

By sylvainpv

Techforum 2018: JavaScript is a whole new language to learn in 2018

JavaScript is a whole new language to learn in 2018

  • 1,407