Ember.js: ES6

Created on 11 Jan 2017  路  13Comments  路  Source: emberjs/ember.js

It's probably more a question rather than an issue. I have notice that you are using ES5 and ES6. Why not to choose only one of them? For example using template literals and without.

All 13 comments

Because different people write different parts of the code, and some of them are older than ES6 ;)
What's your interest? We're currently doing some updating and eslinting of the codebase that's related.

Would it be ok if I create pull request with some updated code?

I'll close this since we can track progress through your pull requests :)

I'm reopening after all, it'll be useful to have somewhere to discuss things that are relevant for all the PRs. There is a concern here about performance and size bloat due to transpilations, which we currently don't have a way to benchmark for Pull Requests.

We might want to come up with a subset of features we know to be "safe".
My suggestions:

  • template strings with interpolation
  • object property short-hand (let obj = { someProperty }).
  • let/const

Avoid array destructuring and anything, for of, and anything requiring regenerator or other babel polyfills.

@locks We could have used js-codemod scripts. instead of doing it manually everywhere.
https://github.com/cpojer/js-codemod#included-scripts

We used the same tool, for converting our old files to ES6.

@manimis902 I don't know how @artemgurzhii is doing it :P

Lebab converting code using for of loop, String.includes and some other methods which are throwing errors and tests are failing, so mostly I'm trying to do this by myself.

@artemgurzhii what is the status? Can I help you by taking one part of job in converting to ES6?

@githubSathishkumar This is the list of all packages, that I haven't refactored yet.

  • container
  • ember-glimmer
  • ember-testing
  • external-helpers
  • internal-test-helpers
  • loader

@artemgurzhii what is the state of this?

Thank you!

@Serabe ember-glimmer has nothing to refactor as it always stays up to date. I'm not sure about loader package, but as I noticed it can't be changed, as it not compiled through babel, and making any changes makes all tests fail. I was trying to refactor external-helpers but it has no tests, so I'm afraid to break something) And I just got refactored container and internal-test-helpers packages. I haven't refactored ember-testing and also, I was having problems refactoring internal-test-helpers/lib/factory.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctataryn picture ctataryn  路  33Comments

chancancode picture chancancode  路  63Comments

zidjian257 picture zidjian257  路  30Comments

MelSumner picture MelSumner  路  33Comments

olivia picture olivia  路  36Comments