TiForward / discuss

By the Titanium™ community, For the Titanium™ community
http://tiforward.org/
103 stars 1 forks source link

How important is ES2015 (ES6) support? #8

Open cb1kenobi opened 9 years ago

cb1kenobi commented 9 years ago

Should the next Titanium be built on ES6? In other words, should Titanium APIs, code examples, docs, tutorials, etc use ES6?

Should Alloy v2 be redesigned to be built on top of ES6?

How concerned should we be about forcing Titanium devs to learn ES6? If we start introducing ES6 into Titanium APIs, developers will need to learn ES6. For example, I could easily see Alloy controllers being ES6 classes. Extending the base controller will require knowledge of ES6.

Should ES6 support be mandatory for v1?

What ES6 features are most important?

Are you worried about JavaScriptCore's lack of ES6 implementation? It's currently about 35% coverage: https://kangax.github.io/compat-table/es6/#webkit. Firefox's Spidermonkey JS engine is almost double the support.

Are you OK with ES6 code being transcompiled down to ES5? (presumably via Babel: https://babeljs.io) Are you concerned about performance of the generated ES5 code?

mattapperson commented 9 years ago

@cb1kenobi lots of thoughts here, no real answer to your question(s) though :)

yuchi commented 9 years ago

I still have to catch up to the conversation here, but I placed both ti.current and ti.next labels because I think that’s a discussion relevant today.

yuchi commented 9 years ago

One question at a time!

Should the next Titanium be built on ES6? In other words, should Titanium APIs, code examples, docs, tutorials, etc use ES6?

IMHO yes. Thanks to Babel.js the future is now the present, and every major framework and community is jumping on it. We should embrace the future.

Should Alloy v2 be redesigned to be built on top of ES6?

Definitely yes. Even if it’s not a spec yet, using JSX would make the development of widgets way more clear. I’m not a proponent of the separation of the views in ‘too dumb’ template languages, and Alloy’s is a really dumb one.

How concerned should we be about forcing Titanium devs to learn ES6? If we start introducing ES6 into Titanium APIs, developers will need to learn ES6. For example, I could easily see Alloy controllers being ES6 classes. Extending the base controller will require knowledge of ES6.

We should not force them into ES6 for app code, but all the JS written in the core should be ES6.

Should ES6 support be mandatory for v1?

No, but transiplation must be supported, along with source maps for debugging and profiling.

What ES6 features are most important?

I don’t think that there are ES6 features we really need, a part for Promises and generators for better async code.

On the other side I’d be happy to import { Window } from 'titanium-core'.

Are you worried about JavaScriptCore's lack of ES6 implementation? […]

Yes. More precisely I’m worried about the terrible stric-mode implementation of JSC.

Are you OK with ES6 code being transcompiled down to ES5?

Not at all.

Are you concerned about performance of the generated ES5 code?

Yes and no. In Babel.js, for example, you can always opt out from a for of to a for (;;).

yuchi commented 9 years ago

Ti.Current developers can enjoy ES2015 (ES6) now with two different flavours:

yuchi commented 9 years ago

To extend the list there’s also:

yuchi commented 9 years ago

Small note: all of those above depend on Babel.js.

Also none of those support debugging/profiling. I’m sure we can solve this in Ti.Current.

What are your thoughts on this, @cb1kenobi?