itowns icon indicating copy to clipboard operation
itowns copied to clipboard

Ecma script version in iTowns

Open gchoqueux opened this issue 6 years ago • 3 comments

Ecma script 6 in itowns

ITowns is written in ES6 and uses almost all its new features. (See all features). ITowns is transpiled in ES5 with Babel.

Important code rules, that aren't completely applied:

  • [ ] Uses Class instead of object.
  • [ ] Uses Set and Map instead of Array, when relevant.

Little used features, don't forget them :

  • [ ] Array element finding
[ 1, 3, 4, 2 ].find(x => x > 3) // 4 
[ 1, 3, 4, 2 ].findIndex(x => x > 3) // 2
  • [ ] String Searching
"hello".startsWith("ello", 1) // true 
"hello".endsWith("hell", 4)  // true 
"hello".includes("ell")  // true
  • [ ] Number Safety Checking
Number.isSafeInteger(9007199254740992) === false

Ecma script 2016 in itowns see #932

  • [x] exponentiation operator (**).
  • [x] Array.prototype.includes.

Ecma script 2017

  • [ ] Includes async/await. (Used in tests)

Ecma script 2018

  • [ ] New features include rest/spread properties.
  • [ ] Asynchronous iteration.
  • [ ] Promise.prototype.finally() .
  • [ ] additions to RegExp.

Ecma script 2019

What's new in Ecma script 2019

  • [ ] Array.Flat()
  • [ ] Object.fromEntries()
  • [ ] Array.flatMap()
  • [ ] String.trimStart() & String.trimEnd()
  • [ ] Optional Catch Binding
  • [ ] Function.toString()
  • [ ] Well Formed JSON.Stringify()
  • [ ] Array.Sort Stability

Ecma script 2020

What's new in Ecma script 2020

  • [ ] Dynamic imports
  • [ ] Import meta data
  • [ ] New export syntax
  • [ ] BigInt and arbitrary precision integers
  • [ ] matchAll() method for regular expressions
  • [ ] globalThis object
  • [ ] Promise.allSettled() method
  • [ ] nullish coalescing operator
  • [ ] Optional chaining

Ecma script 2021

What's new in Ecma script 2021

  • [ ] string.replaceAll method
  • [ ] Private Methods
  • [ ] Private Accessors
  • [ ] Promise.any()
  • [ ] Numeric Separators
  • [ ] Logical Assignment Operator

Ecma script 2022

What's new in Ecma script 2022

  • [ ] Top-level Await Operator
  • [ ] Class Field Declarations
  • [ ] Private Methods and Fields
  • [ ] Static Class Fields and Private Static Methods
  • [ ] Regexp Match Indices
  • [ ] Ergonomic Brand Checks for Private Fields
  • [ ] Array.at() Function for Indexing
  • [ ] Scalable Object.prototype.hasOwnProperty()

gchoqueux avatar Dec 03 '18 15:12 gchoqueux

Good idea.

I think that some of this information (e.g. use class instead of object, etc.) should be added in a to be created 'developer guide' (maybe in the wiki or in the docs folder? and pointed into the CONTRIBUTING.md file).

jailln avatar Dec 03 '18 15:12 jailln

Thanks for creating this issue ! This can be a good first contribution for anyone wanting to contribute to iTowns.

@jailln yes, in fact the CONTRIBUTING file could be rewritten for a more up-to-date content. If you want to start a draft I'm all for it and then we can discuss it in a PR ?

zarov avatar Dec 04 '18 09:12 zarov

@zarov yep, I'll start a draft in a new PR with propositions that came up while starting contributing to iTowns.

jailln avatar Dec 04 '18 09:12 jailln