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
[TIMOB-24610] Support transpiling user JS code to ES5, or minimum target OS/JS engine support #9512
Conversation
a15a923
to
3132d46
Compare
9b67b1a
to
435c2cf
Compare
435c2cf
to
02d489e
Compare
TestsiOS
Android
Windows(@ewanharris / @infosia, can you help here?)
Alloy
Test-Caseclass Application {
constructor(cb) {
this.window = Ti.UI.createWindow({
backgroundColor: '#fff'
})
var btn = Ti.UI.createButton({
title: 'Trigger'
});
btn.addEventListener('click', () => {
Ti.API.info('Hello world!');
});
this.window.add(btn);
}
open(cb) {
this.window.open();
}
}
var app = new Application();
app.open(); Doing more advanced tests now. |
@sgtcoolguy Did you test against live-view so far? |
@hansemannn I did not. I did simple smoke tests to verify the test app and basic app worked on iOS/Android and that we used the correct target presets based on the platform/engine. I honestly have no idea how liveview works with something like minification/transpilation (ala Alloy). |
@hansemannn For this to be tested against Windows it will need to be added to the build there. |
Tried using the PR on studio, but using the latest studio update, it now sees the ES6 syntax as an error and the iOS build options are not available anymore.. |
Studio is still not ES6-aware, which is an entirely separate issue. I have a long-standing feature branch to replace the JS parser in Studio with Oracle's ES6-compliant parser, but I don't know when Kondal and company will be able to pick that up and get it done. (or me, if that's the next priority for me). |
Generated by 🚫 dangerJS |
@hansemannn @janvennemann ping. Are we good for QE? |
We should sync it with the Alloy- and Studio-changes, otherwise devs will be confused about our actual support, as most of them use Alloy these days. Still wasn't able to verify Alloy, so maybe @feons could help here. This PR is approved though! |
Agree with Hans, this PR looks good but i'd say we need to fix the Alloy issues first so QE can test everything at once. Also tested with Alloy on Android and that errors out with |
I understand we want all the different parts to support es6+ at once, but I strongly disagree with holding this PR (or a Studio or Alloy one) for the others if they're not explicitly required by the others. We have separate tickets for adding support for ES6 to the various tools and products. If we hold off until hey all support ES6 we won't make any progress for a long time. There's still value in getting this working for classic apps built by the CLI or the new atom plugins. |
ae3aefa
to
79baf12
Compare
It looks like tidev/alloy#852 and tidev/alloy#842 are related then? |
@sgtcoolguy You are right, it's probably better to unblock general ES6 (do we support ES7 and async / await with this as well?) here and do Alloy separately. I think it's also a good reason for an Alloy v2 to support ES6, so people will know that there are breaking changes like the above. |
@sgtcoolguy, sorry if it wasn't clear, but yeah i meant that this breaks Alloy and we should at least solve that. The PRs you mentioned should do exactly that. My intention was not hold everything off until ES6 support is available for all but at least keep things working :) |
Just tested it with Alloy and if we don't use ES6, the build seems to be fine. So we could merge this one and do Alloy v2 with the updated underdash / lowdash next? |
I've updated the lodash PR to resolve the merge conflicts, let's do this! |
…ode down to target JS engine. Start with Android, hard-code to the equivalent chrome version based on teh v8 version we currently use. Tweak logic for JS file to try and symlink if we can and there are no changes from transpiling and/or minification; otherwise just write new contents to dest.
…older, so that we can access it for transpile target info
…hnically breaks an undocumented and unofficial way to hang things off global via this binding in required scripts
… for Android, ala Node.
79baf12
to
ebc8696
Compare
JIRA: https://jira.appcelerator.org/browse/TIMOB-24610
Description: Support transpiling user JS code to ES5, or minimum target OS/JS engine support