All Projects → bevry-archive → coffeescript-to-esnext

bevry-archive / coffeescript-to-esnext

Licence: CC0-1.0 license
A guide to migrate from CoffeeScript to ES6 / ES7 / ES2015

Labels

Projects that are alternatives of or similar to coffeescript-to-esnext

Bouncer Proxy
👮🏻🛰 Ethereum identity proxy contract that bounces meta transactions of etherless accounts.
Stars: ✭ 142 (+992.31%)
Mutual labels:  meta
codacy-scalameta
Codacy tool for Scalameta
Stars: ✭ 35 (+169.23%)
Mutual labels:  meta
open-source
Open Source @ Baloise
Stars: ✭ 24 (+84.62%)
Mutual labels:  meta
Knowledge
💡 document everything
Stars: ✭ 174 (+1238.46%)
Mutual labels:  meta
Meetings
WebAssembly meetings (VC or in-person), agendas, and notes
Stars: ✭ 239 (+1738.46%)
Mutual labels:  meta
where-is-resolver
Попытка ответить на вопрос о резольверах, проверяющих домены из списка РКН
Stars: ✭ 49 (+276.92%)
Mutual labels:  meta
Ahk Libs
AutoHotkey library archive.
Stars: ✭ 125 (+861.54%)
Mutual labels:  meta
vuepress-plugin-autometa
Auto meta tags plugin for VuePress 1.x
Stars: ✭ 40 (+207.69%)
Mutual labels:  meta
Arrow Meta
Functional companion to Kotlin's Compiler
Stars: ✭ 246 (+1792.31%)
Mutual labels:  meta
cometa
Lightweight, header-only C++14 metaprogramming library. Pattern matching, compile-time stuffs and algorithms (arrays, type information (CTTI), string manipulation), 'value-or-errorcode' union-like type, type for passing named arguments, useful constexpr functions and many more. (MIT license)
Stars: ✭ 56 (+330.77%)
Mutual labels:  meta
Njt
njt (npm jump to): a quick navigation tool for npm packages
Stars: ✭ 179 (+1276.92%)
Mutual labels:  meta
Laravelmetatags
The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
Stars: ✭ 226 (+1638.46%)
Mutual labels:  meta
laravel-meta
💥 Render meta tags within your Laravel application
Stars: ✭ 36 (+176.92%)
Mutual labels:  meta
Laravel Meta
HTML Meta Tags management package available for for Laravel 5.*
Stars: ✭ 150 (+1053.85%)
Mutual labels:  meta
Cometary
Roslyn extensions, with a touch of meta-programming.
Stars: ✭ 31 (+138.46%)
Mutual labels:  meta
Craft Seomatic
SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
Stars: ✭ 135 (+938.46%)
Mutual labels:  meta
ama
Ask me anything
Stars: ✭ 33 (+153.85%)
Mutual labels:  meta
wp-term-images
Images for categories, tags, and other taxonomy terms
Stars: ✭ 34 (+161.54%)
Mutual labels:  meta
phoenix meta tags
Phoenix library helps generating meta tags for website.
Stars: ✭ 25 (+92.31%)
Mutual labels:  meta
Awesome-meta-tags
📙 Awesome collection of meta tags
Stars: ✭ 18 (+38.46%)
Mutual labels:  meta

CoffeeScript to ES6

A guide to migrate from CoffeeScript to ES6 / ES7 / ES2015

Why

Classes

class A
  # Static method that uses rest parameters
  @create: (args...) -> new this(args...)
  
  # Constructor that applies first argument to this.name
  constructor: (@name) ->
  
  # Default value for name for class A
  name: 'Default name for A'

class B extends A
  # Default value for name for class B
  name: 'Default name for B'

b1 = B.create()
alert(b1.name)

b2 = B.create('ben')
alert(b2.name)
class A {
  // Static method that uses rest parameters
  static create (...args) {
    return new this(...args)
  }
  // Constructor that applies first argument to this.name
  constructor (name) {
    this._name = name
  }
  // Default value for name for class A
  get name () {
    return this._name || 'Default name for A'
  }
  // Necessary setter
  set name (value) {
    this._name = name
  }
}

class B extends A {
  // Default value for name for class B
  get name () {
    return this._name || 'Default name for B'
  }
}

let b1 = B.create()
alert(b1.name)

let b2 = B.create('ben')
alert(b2.name)

Notes:

  • arguments is discouraged, use rest parameters instead:
  • HOWEVER, if you can get away with doing (a,b,c,d,e,f,g,etc) instead of (...args), then do that, ...args currently has some profiling issues - (@pflannery will add details about the issues later)

Traversing data object

data = {name:'ben', company:'bevry'}
for own key, value of data
  alert(key+': '+value)
let data = new Map().set('name', 'ben').set('company', 'bevry')
data.forEach(function(value, key){
  alert(key+': '+value)
})

Notes:

  • using objects for data is discouraged, Map is the new data object:
  • HOWEVER, Maps aren't there yet, and unless you have a large dataset, objects are fine (especially for configuration, options, and general coding things) - (@pflannery will add details about the issues later)

Benchmarks

See bevry/es6-benchmarks for performance benchmarks between ES5, CoffeeScript and ES6

Showcase

Here is a listing of CoffeeScript projects that have switched to ES6 so you can compare their source code:

Contributing

Pull requests encouraged!

License

Public Domain via the CC0 1.0 Universal License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].