Skip to content
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

Upgrade Closure Compiler to v20171112 #18552

Merged
merged 17 commits into from
Oct 7, 2018

Conversation

dreamofabear
Copy link

@dreamofabear dreamofabear commented Oct 4, 2018

Upgrades CC from 20170409 to 20171112.

google/closure-compiler#2418 enables transpilation of superclass property refs e.g. super.foo, which is used by worker-dom. Earliest version after that PR is 20170626.

However, non goog.module imports are broken until 20171023 with google/closure-compiler#2641, so upgrade to that instead.

However, 20171023 changes "module not found" from warning to error (problematic for swg.js), so upgrade to 20171112 which allows demoting them back to warnings via google/closure-compiler#2694.

Remaining issues

  • Over 100 "Failed to load module" warnings in swg.js that can't be suppressed for some reason. To fix these, we should generate externs or strip bogus type annotations with relative paths. To unblock, I changed the build to not fail on warnings from swg.js search/replaced those types to * via regex. Filed Type paths to missing files in swg.js #18586.

Updating Closure Compiler

  • To update third_party/closure-compiler/compiler.jar, download desired binary.
  • To update compiler-and-tests.jar, clone closure-compiler and build it manually. Steps to make sure test classes are included:
    • Merge test classes in test/ into src/.
    • Remove <scope>test</scope> in dependencies.
    • Disable <minimizeJar>true</minimizeJar> in pom-main-shaded.xml.
    • Build the shaded binary and rename it to compiler-and-tests.jar.
  • Run ant jar and ant test. Fix stuff, cross-reference diffs in code search to dig up deprecations etc.

@dreamofabear dreamofabear changed the title Upgrade Closure Compiler to v20171023 Upgrade Closure Compiler to v20171112 Oct 4, 2018
@erwinmombay
Copy link
Member

@choumx why does compiler-and-tests.jar need to be updated?

@dreamofabear
Copy link
Author

dreamofabear commented Oct 5, 2018

/to @erwinmombay @rsimha /cc @cramforce

@dreamofabear dreamofabear force-pushed the cc-2017-10-23 branch 2 times, most recently from ef87609 to a883acd Compare October 6, 2018 01:41
Copy link
Member

@cramforce cramforce left a comment

Choose a reason for hiding this comment

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

Wow. Thanks. LGTM

@cramforce cramforce merged commit 0579b12 into ampproject:master Oct 7, 2018
@cramforce
Copy link
Member

Merged for you since this could easily get into merge conflicts.

@cramforce
Copy link
Member

How hard would it be to upgrade to something actually current?

@dreamofabear dreamofabear deleted the cc-2017-10-23 branch October 7, 2018 17:31
@dreamofabear
Copy link
Author

Thanks for the merge! It took me two days to upgrade six months with learning curve, so maybe less than a week for another year's worth (11/2017 to 10/2018).

dreamofabear pushed a commit that referenced this pull request Oct 10, 2018
* Revert "Revert CC upgrade. (#18600)"

This reverts commit 6fd3044.

* Remove node_modules/ from js_module_root.

* Fix swg.js again.

* Increase bundle size cap to 82.2.

* Inject react-dates bundle post-compile instead of importing in code.

* Typecast react-dates imports in amp-date-picker.

* Bump bundle-size.

* Restore --js_module_root for 1-pass.

* Remove obsolete 'erwinmHack'.
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Oct 18, 2018
* Revert "Revert CC upgrade. (ampproject#18600)"

This reverts commit 6fd3044.

* Remove node_modules/ from js_module_root.

* Fix swg.js again.

* Increase bundle size cap to 82.2.

* Inject react-dates bundle post-compile instead of importing in code.

* Typecast react-dates imports in amp-date-picker.

* Bump bundle-size.

* Restore --js_module_root for 1-pass.

* Remove obsolete 'erwinmHack'.
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
* Revert "Revert CC upgrade. (ampproject#18600)"

This reverts commit 6fd3044.

* Remove node_modules/ from js_module_root.

* Fix swg.js again.

* Increase bundle size cap to 82.2.

* Inject react-dates bundle post-compile instead of importing in code.

* Typecast react-dates imports in amp-date-picker.

* Bump bundle-size.

* Restore --js_module_root for 1-pass.

* Remove obsolete 'erwinmHack'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants