-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6 usage #2252
Comments
IMO we should be directly supporting io.js@2. I don't plan to debug transpiled code :| |
Debug natively on nodejs v5 then :| |
PS main is stuck in v2 though |
When we can move, it is recomended to run the latest stable. When we can. Also I test on 4 and 5, no transpiling. |
We're currently targetting iojs 2.x, so yes to Versions of node/iojs newer than 2.x crash PS Main: nodejs/node#3072 |
I think 2.x supports |
@Zarel Ok, thanks for the clarification! |
@lucasfcosta, you said in the other pullreq:
This worries me. To go over specific ES6 features:
|
@Zarel I'll make sure to follow your considerations! You're a very instructive guy indeed, thanks. I was thinking about starting with command-parser.js, I'd use some new String manipulation related features to simplify the code. I'll research more about these new features' performance before implementing them. |
Also note that the |
Yes, switching to |
Are the new object method syntax and |
No |
So, after refactoring some things to use
So basically, we can't use ES6 classes on anything that requires inheritance. :| |
So basically this only matters for the client?
|
How often are these objects even created? Will the speed really matter? |
On average, 60 times per second. At peak, probably closer to 120 times per second. It's no inner loop, but it's not worth it for Battle and BattlePlayer objects. |
It's fine for RoomGames (which is where I plan to use it), but we shouldn't |
At only 120 times per second, making it 42x slower (for something originally already very very fast) sounds insignificant to me. This feels like premature optimisation. Have you even profiled showdown recently? |
I prefer dependency injection rather than inheritance. Always contain functionalities in classes that can be instanced and passed through the constructor to the class that then is going to use it. That way you also follow the single responsibility principle. |
We can probably close this now? |
We possibly want somewhere to track which ES6 features we can and can't use... |
Superseded by #2419 |
As I talked to @Joimer at #2251 I'd like to help you guys to use the new ES6 syntax, I'm creating this issue to keep track of this progress. If any of you have any considerations please don't be afraid to tell me.
If you guys want to keep compatibility with Node < 4.0 we can also set up Babel transpilation.
The text was updated successfully, but these errors were encountered: