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 v20180101 #18794
Conversation
This PR is now ready for review. Adding @cvializ to review the change to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-utils changes look good ๐ "deferring" approval to other reviewers : )
Please ping on this PR when it's tested and ready. |
@choumx Pinging this PR. To get the runtime to work in single-pass mode, I had to do a couple things like transform common JS dependencies to ESM and remove the UMD wrapper from |
@choumx @jridgewell @erwinmombay At long last, this is ready for review. PTAL. |
Tested this PR as follows:
Merging now ๐ค |
return defaultPlugins; | ||
if (isCommonJsModule) { | ||
pluginsToApply = pluginsToApply.concat([ | ||
[require.resolve('babel-plugin-transform-commonjs-es2015-modules')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an open issue for removing this transform when possible? We should migrate over all these dependencies to ESM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a TODO in the code assigned to @erwinmombay and me. I'm working on a follow up PR to upgrade to the latest closure as we speak, and will file issues for all remaining ESM library related tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks @rsimha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent out #23106 to clean this up.
It's 2018, so this PR upgrades closure compiler to the earliest version from 2018.
Code changes:
promise-pjs
workaround introduced by @cramforce in Turn on closure compiler collapse properties.ย #2972.Property so-and-so never defined
errors ingulp check-types
by modifying a few importsprocess_common_js_modules
option for single-pass to prevent errors due to class exports being appended with.default
. To make up for it, also do the following:babel-plugin-transform-commonjs-es2015-modules
transform to common JS dependencies that are shipped with the runtime (promise-pjs
,dompurify
, andset-dom
)third_party/mustache.js
to make it an ESM style module@ampproject/animations/dist/animations
that we were using inamp-lightbox-gallery
with its ESM equivalentreact-utils.js
by renamingDeferred
toDeferredType
(Deferred
is already defined and exported bysrc/promise.js
)width
,left
, andright
inamp-image-slider.js
Coming up: More PRs to eventually upgrade to the latest version.
Partial fix for #18748
Follow up to #18552
Follow up to #18609