Skip to content

html-minifier-terser#9990

Merged
juj merged 7 commits intoemscripten-core:masterfrom
juj:html-minifier-terser
Feb 8, 2020
Merged

html-minifier-terser#9990
juj merged 7 commits intoemscripten-core:masterfrom
juj:html-minifier-terser

Conversation

@juj
Copy link
Collaborator

@juj juj commented Dec 8, 2019

html-minifier was buggy in minifying JS code, and author decided to drop support for minifying JS code in it altogether, so migrate to using html-minifier-terser that can minify <script> content inside HTML files.

PR #9989 should land first, this is easier to rebase on top of that.

juj added a commit to juj/emscripten that referenced this pull request Dec 8, 2019
@juj juj mentioned this pull request Dec 8, 2019
@juj
Copy link
Collaborator Author

juj commented Dec 8, 2019

Hmm, I think CI needs to be updated to run npm install before the test suite runs? Not sure where would be the best place to add that in the CI config though.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

yes, we need to to do a couple of things before landing this:

  1. Have emsdk automatically run npm install post installation.
  2. Teach our CI to run npm install
  3. Inform git users / developers that we now have this post-clone step.

I wonder if we are going have other steps (such as pip install or git submodule update), in which case it might make sense to wrap them in single ./bootstrap.sh/bootstrap.bat. Maybe that is thinking too far ahead and we should see how it goes with just npm install?

@juj
Copy link
Collaborator Author

juj commented Dec 9, 2019

1. Have emsdk automatically run `npm install` post installation.

emscripten-core/emsdk#404 will resolve that.

@juj
Copy link
Collaborator Author

juj commented Dec 9, 2019

3\. Inform git users / developers that we now have this post-clone step.

Added an error message explaining to run npm install to set up dependencies.

@juj juj force-pushed the html-minifier-terser branch 3 times, most recently from cf3fd29 to c31dd42 Compare December 9, 2019 09:31
juj added a commit to juj/emscripten that referenced this pull request Dec 11, 2019
juj added a commit that referenced this pull request Dec 11, 2019
* Complete migration of stack overflow checks to library function in MINIMAL_RUNTIME, and add support for --separate-asm, MODULARIZE and ALLOW_MEMORY_GROWTH with MINIMAL_RUNTIME.

* Use acorn-optimizer to minify <script> tags in .html code (TODO: Migrate to a better minifier, but needs one installed alongside the repository)

* Remove manual JS code minification in HTML5, to use html-minifier-terser in PR #9990.

* Update minimal_runtime test
@juj juj changed the base branch from incoming to master January 14, 2020 18:57
@juj juj force-pushed the html-minifier-terser branch 3 times, most recently from 3595e2f to efb8d87 Compare January 26, 2020 08:16
@juj
Copy link
Collaborator Author

juj commented Jan 26, 2020

Brought this up to latest, and tests passing now - this is good for review and landing.

@juj juj force-pushed the html-minifier-terser branch 2 times, most recently from cfcac9f to f990de3 Compare January 26, 2020 16:05
@juj
Copy link
Collaborator Author

juj commented Jan 26, 2020

There seems to be a test failures with test_cubegeom_normal_dap_far_glda_quad (test_browser.browser) in Firefox but not in Chrome that pops up, I wonder if Firefox had regressed on something. Although the failure occurs only on CI, unable to reproduce locally.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Nice! lgtm with a couple of comments.

Should we wait a little bit, and maybe do an emscripten release that contains #9989 before we land this to make sure the any npm issues are shaken out?

@sbc100
Copy link
Collaborator

sbc100 commented Jan 27, 2020

Re-running failing tests on circle to see if those flakes

@juj
Copy link
Collaborator Author

juj commented Jan 28, 2020

Should we wait a little bit, and maybe do an emscripten release that contains #9989 before we land this to make sure the any npm issues are shaken out?

How important do you feel that is? I am working a bit tight now against our code freeze for 2020.01 release to try to squeeze new Emscripten compiler update in with as many features as I can.

@sbc100
Copy link
Collaborator

sbc100 commented Jan 28, 2020

Should we wait a little bit, and maybe do an emscripten release that contains #9989 before we land this to make sure the any npm issues are shaken out?

How important do you feel that is? I am working a bit tight now against our code freeze for 2020.01 release to try to squeeze new Emscripten compiler update in with as many features as I can.

Well I guess we have decided to go down this route, but we are having issue with npm on the emscripten-releases builders right now, so perhaps at least wait until the dust settles there and we can cut a new emscripten release (I hope that will be today).

@juj juj force-pushed the html-minifier-terser branch 4 times, most recently from 1de47f4 to ff6bb27 Compare February 1, 2020 17:29
@juj
Copy link
Collaborator Author

juj commented Feb 3, 2020

Iiuc the Closure related issues have all been resolved now? I wonder if this would be good to land? @kripken @sbc100 ?

@sbc100
Copy link
Collaborator

sbc100 commented Feb 3, 2020

Yes the closure related issues have now (hopefully) been solved. But I did causes a lot of issues, mostly related to window. We just cut and emscripten release containing this change so we can see how it effects actual users.

I suspect that closure will be the outlier here in terms of the fallout, since it has the native and java and js versions in there, and other dependencies should be pure JS. However, I would still rather let the dust settle a little before landing more npm dependencies. Could we at least wait a couple of days?

juj added 5 commits February 6, 2020 19:32
…rop support for minifying JS code in it altogether, so migrate to using html-minifier-terser that can minify <script> content inside HTML files.
@juj juj force-pushed the html-minifier-terser branch from ff6bb27 to 3cf4a65 Compare February 6, 2020 17:33
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Sorry.. I had this comment sitting there unsent..

@sbc100
Copy link
Collaborator

sbc100 commented Feb 7, 2020

Have we seen any issues with the use of npm in the wild @kripken? Are we ready to land this change which extends the npm usage do you think?

@kripken
Copy link
Member

kripken commented Feb 8, 2020

This issue worries me: #10385 - something changed in closure compiler it seems, causing that project to break.

But perhaps that doesn't need to block this. Worst case we can disable minification inside HTML files if problems occur (which is a risk I wouldn't suggest for core minification of the main JS).

@sbc100
Copy link
Collaborator

sbc100 commented Feb 8, 2020

Right, that issue seems to be related to the closure upgrade rather than that fact that we used npm to install it. Good news that we can probably go ahead and land this when its ready.

@juj
Copy link
Collaborator Author

juj commented Feb 8, 2020

I don't think those errors are related to Closure update, but something has changed around __syscall3 function.

@juj juj force-pushed the html-minifier-terser branch from 9e107bd to f02717d Compare February 8, 2020 17:28
@juj juj merged commit 479300e into emscripten-core:master Feb 8, 2020
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
* Complete migration of stack overflow checks to library function in MINIMAL_RUNTIME, and add support for --separate-asm, MODULARIZE and ALLOW_MEMORY_GROWTH with MINIMAL_RUNTIME.

* Use acorn-optimizer to minify <script> tags in .html code (TODO: Migrate to a better minifier, but needs one installed alongside the repository)

* Remove manual JS code minification in HTML5, to use html-minifier-terser in PR emscripten-core#9990.

* Update minimal_runtime test
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