You could transpile on-the-fly using Babel.js but it would destroy the user experience of your website. You could also do it manually every time before you check-in your code into source control but then you’d need to deal with merge conflicts on every commit.
A better approach is to automate the ES6 to ES5 conversion with a gulp task so that you can share it with your team and avoid the annoying merge conflicts. Additionally, your continuous integration and delivery servers could use that same gulp task, so it’s a win-win scenario.
So let’s see how you can get started using ES6 with the help of Babel and Gulp.
Modern web development is hard. Depending on your environment, your preferences, needs and goals there’s a thousand and one steps from source code to a production ready application.
These are a lot of steps that you probably don’t want to keep in your head or in a checklist somewhere. You want to make them an intrinsic part of your development workflow and automate them so that they are reproduceable and reusable by all the members within your team (and even by the continuous integration and delivery infrastructure).
That’s were Gulp and other popular task runners/managers come in. Gulp helps you automate your workflow, make it explicit and share it within your team by providing an API to create and compose tasks. These tasks could be anything from copying files to a distribution folder, to transpiling ES2015, to removing unused CSS classes, etc. You can either build your own task or take advantage of the humongous community that already exist around Gulp and provides access to any task that you can imagine via plugins.
Sounds interesting? Then let’s get started.
const keywords to get a similar behavior to C# block scoping.
Last week it was swetugg and I kind of promised everyone listening to my talk that I would prepare a video version so they could enjoy all the cool content that I had prepared and which I never got the chance to show (because I am the worst, like the very worst, at keeping things short).
And so, after much sleepless nights, early mornings, experimentation, errors, more errors I got the first video ready! Yey! Hope you like it!
My plan is to release very short focused videos, so expect more videos coming soon.