Throughout the module (and your journey to Google enlightenment while working on IdeaBox2.0) you may notice a few different ways that JavaScript code is being written.
That might have something to do with something called ES6
and ES5
-
What is
ES6
?- Response:
ES6
is the most updated JavaScript language from ECMAScript 2015(ES5
), which hasn't been updated sinceES5
was standardized in 2009.
- Response:
-
What is Transpilation and how does it relate to
ES6
?- Response: Transpilation is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. It is a specific type of compiling, meaning it is a specific type of transformation of source code written in one language into another language. JavaScript has various transpiler libraries, leveraging notable tools such as Babel and Gulp (it seems?). It appears to be popular to transpile from
ES6
to other languages. Transpilers enables code written inES6
to be executed in every browser.
- Response: Transpilation is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. It is a specific type of compiling, meaning it is a specific type of transformation of source code written in one language into another language. JavaScript has various transpiler libraries, leveraging notable tools such as Babel and Gulp (it seems?). It appears to be popular to transpile from
-
Looking at the ES6 Features link below, discuss one update from
ES5
and if it seems useful/superfluous:
- Response: The update for modules seems really useful, even though module systems are commonplace. Simply looking at the overview and comparison between
ES5
andES6
here, what is immediately apparent are the syntactical differencse.ES6
introducesexport
andimport
keywords that appropriately express duties. Looking at theES5
language, it looks more cumbersome and less readable (almost frightening). I found this article to be really helpful in understandingES6
modules. It explains how it is actually static syntax, and will require utilizing a more dynamic, programmatic loader API such as Babel, etc. It seems because of the static syntax and ambiguously definedimport
in the standard, leveraging a dynamic loader API probably has interesting pros and cons. Any issue that arises while import processing will not give an error, but the API may provide errors. This may vary depending on which loader API is being used. Game Time will be interesting in this sense! Noted in the article is the advantage of saving network round trips, which means that this improvement will save any run-time performance costs. Neat!