Closed
Bug 844426
Opened 13 years ago
Closed 13 years ago
[email] Limit JS syntax to legal ES5 syntax
Categories
(Firefox OS Graveyard :: Gaia::E-Mail, defect)
Firefox OS Graveyard
Gaia::E-Mail
Tracking
(b2g18 fixed, b2g18-v1.0.1 fixed)
RESOLVED
FIXED
People
(Reporter: asuth, Assigned: asuth)
Details
Attachments
(2 files)
In order to process the e-mail app through more aggressive minifiers like Google's closure compiler or uglify/uglify2, we need to remove our non-ES5-happy uses of 'const', 'let', and destructuring assignment.
Vivien did a pass at this in his branch to add worker support, nominally tracked in bug 814257. I'm porting these changes from the branch against the gaia repo to be against the gaia-email-libs-and-more and the repositories it reuses using the fantastic "meld" merge/diff tool. Changes to semantics are not being taken so the worker-related changes don't get conflated.
| Assignee | ||
Comment 1•13 years ago
|
||
This pull request is currently in progress. So far I think I've ported all the required changes from the mailapi/ dir. Will do jsas/wbxml shortly and then any files outside of mailapi/
Comment 2•13 years ago
|
||
Pointer to Github pull-request
Comment 3•13 years ago
|
||
Comment on attachment 718069 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/8306
Just removes the non-ES5 things from the front end code. The back end changes for the scripts in js/ext will be part of a separate change being done by asuth.
Attachment #718069 -
Flags: review?(bugmail)
| Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 718069 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/8306
Landed on gaia/master:
https://github.com/mozilla-b2g/gaia/pull/8306
Leaving open for the back-end changes.
Attachment #718069 -
Flags: review?(bugmail) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
Comment on attachment 717480 [details] [review]
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/130
These changes carry rs=squib, contingent upon unit tests passing. All unit tests pass that already passed; wbxml, activesync, and gaia-email-libs-and-more.
A smoke-test on an unagi device of both ActiveSync and IMAP runs happily.
The main changes required in addition to the changes ported from Vivien's gaia branch:
- There were changes in jsas that had not been taken into GELAM, so test failures mistakenly cropped up that were not due to regressions in the port.
- Some of the yield stuff for ActiveSync had been commented out rather than translated. I finished the translation.
- Some of the (var iter) declarations occurred in a scary nested fashion. In practice, these were not a big problem because 'iter' was an extremely temporary variable, but since it's the type of thing that can draw the eye and result in concern, I fixed those too.
I believe this completes the ES5-syntax-only changes because when I did "npm install uglify" and ran the uglify command line against all of our aggregations in gaia, they all produced output that looked minified and did not explode.
When I changed the gaia-email-opt.build.js file to use 'uglify' instead of 'none' and altered onBuildWrite to return the modified contents, nothing actually changed. I may have been being too naive; I didn't look into it all that deeply.
I am going to merge this now and mark fixed very shortly... REOPEN if it seems like I didn't get everything.
Attachment #717480 -
Flags: review+
| Assignee | ||
Comment 6•13 years ago
|
||
landed on gaia-email-libs-and-more/master:
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/130
landed on gaia/master:
https://github.com/mozilla-b2g/gaia/pull/8399
note: I left the mozilla-b2g/gaia-email-libs-and-more branch open in case it turns out we need some more changes to let uglify do its thing.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 7•13 years ago
|
||
For gaia-email-opt.build.js, it is used by copy-to-gaia.js, and copy-to-gaia was doing some manual concatenation in and part due to the non-ES5 code translations needed for build analysis. Once this change lands, then the gaia-email-opt.build.js and copy-to-gaia.js duality could be reduced, and the optimize: 'uglify' would then be available.
Comment 8•13 years ago
|
||
I'm having trouble getting the latest master code up to date. It has to do with the activesync submodule. This could very well be user error, but when trying to update it, I get:
Unable to checkout '55621b4e5d3a4ba01e429fb7c12eccc7cd5b79e9' in submodule path 'deps/activesync'
Looking here:
https://github.com/mozilla-b2g/jsas/commits/master
I do not see that commit hash, does that project need to have a push?
| Assignee | ||
Comment 9•13 years ago
|
||
Thanks for the heads-up James. I believe I've fixed the problem now. A recursive checkout of GELAM now works fine. I should probably write up a formal checklist for myself when the more footgun aspects of git submodules com einto play...
| Assignee | ||
Comment 10•13 years ago
|
||
I was just cleaning up some of my other repos, and it did seem like a "git submodule sync" may in fact be required in gaia-email-libs-and-more, or from within gaia-email-libs-and-more/deps/activesync.
Comment 11•12 years ago
|
||
Was landed in v1.0.1 as part of Bug 851124 big uplift.
Will land (again) in v1-train tomorrow at the latest too.
status-b2g18-v1.0.1:
--- → fixed
Comment 12•12 years ago
|
||
Landed in v1-train as part of Bug 851124 big uplift.
status-b2g18:
--- → fixed
Updated•12 years ago
|
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in
before you can comment on or make changes to this bug.
Description
•