Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #20098
Closed
Open
Issue created Jul 21, 2016 by Jacob Schatz@jschatz1Contributor

Easy move to ES6

Currently we use CoffeeScript to write our JS. We are hiring more and more really good pure JS devs. ES6 has many features that CS has but drastically improved. At some point in the near future ES6 will be the language of the browser and there will be no reason to use CS. While CS influenced many things in ES6, ES6 has now overtaken it in terms of functionality, and in the end ES6 is (in the end) native JS. It's getting harder and harder to convince new JS devs to write CS and in general they kind of grumble about it.

You can see in this graph that ES6 support is already pretty substantial and will only increase in the future. This is something that all major browsers are currently working on, with quite extensive support in Chrome, Firefox, Safari, and even IE(Edge).

One of our modus operandi is to be proactive and not reactive. I know that ES6 will happen, and I think it will happen sooner rather than later, so let's move now.

Here's how to do it in a super simple way.

  1. Replace all CoffeeScript files with converted JS file. The JS is already converted for us by CoffeeScript. It's just a matter of replacing the files, 1 by 1.
  2. Keep the Coffeescript Gem around because Turbolinks uses it.
  3. Add the Babel compiler.
  4. We are done.

At this point we can keep ES5 and run ES6 concurrently. This is what has been done in many other companies. Eventually the ES5 will disappear from our code as we slowly replace it with ES6. There is no issue with having ES5 and ES6 running concurrently because ES6 is backwards compatible.
I imagine this plan could happen in a couple of hours, without a hitch.

All frontend devs already know the JS that CS is creating when they type, it's just a matter of continuing that pattern when writing ES5 and new code goes into ES6.

The JS that CS creates is actually quite nice and very maintainable.

This will help us make the app more reactive and reduce code complexity. Babel is finally at a point where I feel like we can use it for real production level code.

Please voice your opinions below. Opinions are greatly appreciated.

cc @iamphill @alfredo1 @JobV @dzaporozhets @lbennett @connorshea @annabeldunstone @DouweM @rspeicher @fatihacet

Assignee
Assign to
Time tracking