Skip to content

Conversation

@brizental
Copy link
Contributor

This group of changes was yanked from #744 .

I took them out of there to make that PR a bit smaller, but also because this group is not immediatelly related to the fix over there. I just happened to find these issues while working on that investigation.

This is advantageous for startes because that is ECMAScript version
targeted by the QML Javascript interpreter anyways, but also because
it will not compile let/const down to vars which was causing weird
behaviour overall.

I had to turn off minification on the production library though,
because that was hitting a bug in the QML Javascript interpreter:
specifically https://bugreports.qt.io/browse/QTBUG-96631
This plugin does not create final code that hits
the Qt JS Interprter bug the default minifyier did.
importHelpers adds all polyfills necessary for the ES6 target
available on the top of the generated file, instead of defining
the necessary polyfills on top of each module and having a lot
of code repetition. This makes it easier to debug teh generated
file but also makes the final lib considerably smaller.

Since Glean.js does not _need_ all the polyfills this also
adds a bit of dead code to the top of the compiled lib, that is
still better than the redundant mess we had before.
@auto-assign auto-assign bot requested a review from mdboom September 23, 2021 16:05
@moz-glean
Copy link
Collaborator

Build size report

Merging #754 into main will:

  • Leave the size of full Web Extension bundle unchanged.
  • Decrease the size of full Qt/QML bundle build by -54%.

Current size New size Size increase
Web Extension
core only 53 KB 53 KB 📉 0 bytes
full bundle 79 KB 79 KB 📉 0 bytes
Qt/QML
core only 139 KB 64 KB 📉 75 KB
full bundle 139 KB 64 KB 📉 75 KB

Copy link
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great result!

@brizental brizental merged commit 2319252 into mozilla:main Sep 28, 2021
@brizental brizental deleted the make-qt-smaller branch September 28, 2021 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants