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 v20190709 #23417

Merged
merged 8 commits into from
Jul 19, 2019
Merged

🏗✨ Upgrade closure compiler to v20190709 #23417

merged 8 commits into from
Jul 19, 2019

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Jul 18, 2019

This PR upgrades the version of closure compiler used to minify the AMP runtime to v20190709.

Highlights:

Notes:

Coming up:

Partial fix for #22452, #18748, and #17120
Follow up to #18552, #18609, #18794, #19449, #20056, #21618, and #22446

@rsimha
Copy link
Contributor Author

rsimha commented Jul 19, 2019

This PR is now ready for review. I've added several folks for different pieces:

  • @erwinmombay @jridgewell @choumx: Overall review. (WDYT about no longer using compiler-and-tests.jar? Do you know of an alternative way to test our custom passes without having to rebuild the compiler?)
  • @cvializ: amp-date-picker changes (required due to these errors)
  • @dvoytenko: third_party/web-animations-externs/ changes (required because third_party/closure-compiler/ is no longer needed)

Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

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

date picker change LGTM

@dreamofabear
Copy link

Do you know of an alternative way to test our custom passes without having to rebuild the compiler?

Do we still have custom passes?

@rsimha
Copy link
Contributor Author

rsimha commented Jul 19, 2019

Do we still have custom passes?

@choumx All our old custom passes now have equivalent babel transforms. The last of them is being enabled in #23377, at which point we can delete AmpPass.java. (I'll do the clean up in a follow up PR, similar to #23378.)

With this, there are two pieces of custom code that remain:

  • The inlining code in AmpCodingConvention.java (made mostly redundant by 🏗 Replace NoInline suffix check in runner.jar with the @noinline closure annotation #23363 and 🏗 Replace hack to prevent inlining of cssText with a @noinline annotation #23373)
    @Override public boolean isExported(String name, boolean local) {
    if (local) {
    return false;
    }
    // This is a special case, of compiler generated super globals.
    // Because we otherwise use ES6 modules throughout, we don't
    // have any other similar variables.
    if (name.startsWith("JSCompiler_")) {
    return false;
    }
    // ES6 generated module names are not exported.
    if (name.contains("$")) {
    return false;
    }
    // Starting with _ explicitly exports a name.
    if (name.startsWith("_")) {
    return true;
    }
    return !name.endsWith("_") && !name.endsWith("ForTesting");
    }
  • The custom options code in AmpCommandLineRunner.java (not all of them have equivalent flags, so removing them will involve some trial and error)
    @Override protected CompilerOptions createOptions() {
    if (typecheck_only) {
    return createTypeCheckingOptions();
    }
    CompilerOptions options = super.createOptions();
    options.setCollapsePropertiesLevel(CompilerOptions.PropertyCollapseLevel.ALL);
    AmpPass ampPass = new AmpPass(getCompiler(), is_production_env, suffixTypes, amp_version);
    options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, ampPass);
    options.setDevirtualizePrototypeMethods(true);
    options.setExtractPrototypeMemberDeclarations(true);
    options.setSmartNameRemoval(true);
    options.optimizeCalls = true;
    // Have to turn this off because we cannot know whether sub classes
    // might override a method. In the future this might be doable
    // with using a more complete extern file instead.
    options.setRemoveUnusedPrototypeProperties(false);
    options.setInlineProperties(false);
    options.setComputeFunctionSideEffects(false);
    // Property renaming. Relies on AmpCodingConvention to be safe.
    options.setRenamingPolicy(VariableRenamingPolicy.ALL,
    PropertyRenamingPolicy.ALL_UNQUOTED);
    options.setDisambiguatePrivateProperties(true);
    options.setGeneratePseudoNames(pseudo_names);
    return options;
    }

Most of the tests run by ant test in build-system/runner were for AmpPass.java, so I suppose there's minimal risk in removing compiler-and-tests.jar. WDYT?

/cc @cramforce who wrote a fair bit of this code during the early days of the project

@rsimha
Copy link
Contributor Author

rsimha commented Jul 19, 2019

Verified that this PR isn't resulting in any significant changes to v0.js (the only diffs are minor style changes in string concatenation)

diff --git a/dist-master/v0.js b/dist-closure-upgrade/v0.js
index 4518ee0..d9b829b 100644
--- a/dist-master/v0.js
+++ b/dist-closure-upgrade/v0.js
@@ -147,7 +147,7 @@ r&&(h.rvu=r);v&&(h.mso=v)}dg||(dg=mg());h.jse=dg;var w=[];g=self.__AMP__EXPERIME
 ag.splice(0,ag.length-25+1);ag.push(b);return h}}}function ig(){var a=self;if(!a.document)return!1;a=a.document.querySelectorAll("script[src]");for(var b=0;b<a.length;b++)if(!K(a[b].src.toLowerCase()))return!0;return!1}
 function mg(){function a(){}a.prototype.t=function(){throw Error("message");};var b=new a;try{b.t()}catch(d){b=d.stack;if(zb(b,"t@"))return"Safari";if(-1<b.indexOf(".prototype.t@"))return"Firefox";var c=b.split("\n").pop();if(/\bat .* \(/i.test(c))return"IE";if(zb(b,"Error: message"))return"Chrome"}return"unknown"};var ng="__AMP_ACTION_MAP__"+Math.random(),og={form:["submit","clear"]},pg={button:!0,checkbox:!0,link:!0,listbox:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,option:!0,radio:!0,scrollbar:!0,slider:!0,spinbutton:!0,"switch":!0,tab:!0,treeitem:!0};
 function qg(a,b,c,d,e,g,h,k,l,m){k=void 0===k?"?":k;l=void 0===l?null:l;m=void 0===m?Math.random():m;this.node=a;this.method=b;this.args=c;this.source=d;this.caller=e;this.event=g;this.trust=h;this.actionEventType=k;this.tagOrTarget=l||a.tagName;this.sequenceId=m}
-qg.prototype.satisfiesTrust=function(a){return Wa(this.trust)?this.trust<a?(u().error("Action",'"'+this.actionEventType+'" is not allowed to invoke '+('"'+this.tagOrTarget+"."+this.method+'".')),!1):!0:(x().error("Action","Invalid trust for '"+this.method+"': "+this.trust),!1)};
+qg.prototype.satisfiesTrust=function(a){return Wa(this.trust)?this.trust<a?(u().error("Action",'"'+this.actionEventType+'" is not allowed to invoke "'+(this.tagOrTarget+"."+this.method+'".')),!1):!0:(x().error("Action","Invalid trust for '"+this.method+"': "+this.trust),!1)};
 function rg(a,b){this.ampdoc=a;this.$=b||a.getRootNode();this.Xa=Jg(this);this.Pd=A();this.Gf=A();this.addEvent("tap");this.addEvent("submit");this.addEvent("change");this.addEvent("input-debounced");this.addEvent("input-throttled");this.addEvent("valid");this.addEvent("invalid")}rg.installInEmbedWindow=function(a,b){ce(a,"action",new rg(b,a.document))};f=rg.prototype;
 f.addEvent=function(a){var b=this;if("tap"==a)this.$.addEventListener("click",function(c){c.defaultPrevented||b.trigger(c.target,a,c,100)}),this.$.addEventListener("keydown",function(c){var d=c.key,e=c.target;if("Enter"==d||" "==d){var k=e.getAttribute("role");if(d=k)d=k.toLowerCase(),d=sb.call(pg,d);var l=d;if(!c.defaultPrevented&&l){var m=b.trigger(e,a,c,100);m&&c.preventDefault()}}});else if("submit"==a)this.$.addEventListener(a,function(c){b.trigger(c.target,a,c,100)});else if("change"==a)this.$.addEventListener(a,
 function(c){var d=c.target;Kg(c);b.trigger(d,a,c,100)});else if("input-debounced"==a){var c=Xf(this.ampdoc.win,function(c){b.trigger(c.target,a,c,100)});this.$.addEventListener("input",function(a){var b=new Lg(a);Kg(b);c(b)})}else if("input-throttled"==a){var d=Wf(this.ampdoc.win,function(c){b.trigger(c.target,a,c,100)});this.$.addEventListener("input",function(a){a=new Lg(a);Kg(a);d(a)})}else"valid"!=a&&"invalid"!=a||this.$.addEventListener(a,function(c){b.trigger(c.target,a,c,100)})};
@@ -186,7 +186,7 @@ Ah.prototype.If=function(a){if(a.optOut)return Bh(this,"$OPT_OUT",31536E6),"$OPT
 Ih.prototype.get=function(a,b,c){var d=this;y(Fh.test(a.scope)&&Fh.test(a.cookieName),"The CID scope and cookie name must only use the characters [a-zA-Z0-9-_.]+\nInstead found: %s",a.scope);return b.then(function(){return W(d.ampdoc).whenFirstVisible()}).then(function(){return Jh(d.ampdoc)}).then(function(e){if(e)return"";var g=Kh(d,a,c||b);return V(d.ampdoc.win).timeoutPromise(1E4,g,'Getting cid for "'+a.scope+'" timed out').catch(function(a){ib(a)})})};Ih.prototype.optOut=function(){return Lh(this.ampdoc)};
 function Kh(a,b,c){var d=b.scope,e=I(a.ampdoc.win.location.href);if(!K(e)){var g=Mh(a,d);return g?a.Xg.getScopedCid(g,d).then(function(e){if("$OPT_OUT"==e)return null;if(e){var g=b.cookieName||d;Nh(a.ampdoc.win,g,e);return e}return Oh(a,b,c)}):Oh(a,b,c)}return a.Eg.isSupported().then(function(b){if(b){var g=Mh(a,d);return a.Eg.getScopedCid(g,d)}return a.qf.isSupported()&&Mh(a,d)?a.qf.getScopedCid(d).then(function(b){return b?b:Ph(a,c,d,e)}):Ph(a,c,d,e)})}
 function Ph(a,b,c,d){return Qh(a,b).then(function(b){return R(a.ampdoc.win,"crypto").sha384Base64(b+Rh(d)+c)})}function Mh(a,b){a.yd||(a.yd=Sh(a));return a.yd[b]}
-function Sh(a){var b={},c=a.ampdoc.win.document.head.querySelector("meta[name=amp-google-client-id-api]");c&&c.hasAttribute("content")&&c.getAttribute("content").split(",").forEach(function(a){a=a.trim();if(0<a.indexOf("=")){var d=a.split("=");a=d[0].trim();b[a]=d[1].trim()}else{var g=a;(a=Gh[g])?b[a]=Hh[g]:u().warn("CID","Unsupported client for Google CID API: "+g+"."+("Please remove or correct "+c.outerHTML))}});return b}
+function Sh(a){var b={},c=a.ampdoc.win.document.head.querySelector("meta[name=amp-google-client-id-api]");c&&c.hasAttribute("content")&&c.getAttribute("content").split(",").forEach(function(a){a=a.trim();if(0<a.indexOf("=")){var d=a.split("=");a=d[0].trim();b[a]=d[1].trim()}else{var g=a;(a=Gh[g])?b[a]=Hh[g]:u().warn("CID","Unsupported client for Google CID API: "+g+".Please remove or correct "+c.outerHTML)}});return b}
 function Lh(a){W(a).sendMessage("cidOptOut",{});return ge(a,"storage").then(function(a){return a.set("amp-cid-optout",!0)})}function Jh(a){return ge(a,"storage").then(function(a){return a.get("amp-cid-optout").then(function(a){return!!a})}).catch(function(){return!1})}function Nh(a,b,c){var d=Date.now()+31536E6;yh(a,b,c,d)}
 function Oh(a,b,c){var d=a.ampdoc.win,e=b.scope,g=b.cookieName||e,h=wh(d,g);if(!h&&!b.createCookieIfNotPresent)return Promise.resolve(null);if(a.Md[e])return a.Md[e];if(h)return/^amp-/.test(h)&&Nh(d,g,h),Promise.resolve(h);var k=Th(d).then(function(a){return"amp-"+a});Promise.all([k,c]).then(function(a){var b=a[0],c=wh(d,g);c||Nh(d,g,b)});return a.Md[e]=k}function Rh(a){y(K(a),"Expected proxy origin %s",a.origin);return Ed(a)}
 function Qh(a,b){if(a.zd)return a.zd;var c=a.ampdoc.win;return a.zd=Uh(a.ampdoc).then(function(d){var e=!1;if(d&&!Vh(d)){var g=Promise.resolve(d.cid);Wh(d)&&(e=!0)}else g=R(c,"crypto").sha384Base64(Xh(c)),e=!0;e&&g.then(function(c){Yh(a.ampdoc,b,c)});return g})}function Yh(a,b,c){var d=a.win;$b(d)?Zh(a,$h(c)):b.then(function(){try{d.localStorage.setItem("amp-cid",$h(c))}catch(e){}})}
@@ -318,7 +318,7 @@ f.getMajorVersion=function(){return this.isSafari()?this.isIos()?this.getIosMajo
 f.getIosVersionString=function(){if(!this.W.userAgent||!this.isIos())return"";var a=this.W.userAgent.match(/OS ([0-9]+[_.][0-9]+([_.][0-9]+)?)\b/);return a?a=a[1].replace(/_/g,"."):""};f.getIosMajorVersion=function(){var a=this.getIosVersionString();return""==a?null:Number(a.split(".")[0])};function Qj(a){this.H=a;this.xg=Object.create(null)}Qj.prototype.addTransition=function(a,b,c){var d=a+"|"+b;this.xg[d]=c};Qj.prototype.setState=function(a){var b=this.H;this.H=a;(a=this.xg[b+"|"+a])&&a()};function Rj(a){var b=6E4,c=this;this.win=a;this.Mh=b;this.R=[];this.Zf=new Y;this.sf=function(a){a.target&&1==a.target.nodeType&&Sj(c,a.target)};this.rf=function(){V(a).delay(function(){Sj(c,c.win.document.activeElement)},500)};this.win.document.addEventListener("focus",this.sf,!0);this.win.addEventListener("blur",this.rf)}f=Rj.prototype;f.mi=function(){this.win.document.removeEventListener("focus",this.sf,!0);this.win.removeEventListener("blur",this.rf)};f.onFocus=function(a){return this.Zf.add(a)};
 function Sj(a,b){var c=Date.now();0==a.R.length||a.R[a.R.length-1].el!=b?a.R.push({el:b,time:c}):a.R[a.R.length-1].time=c;a.purgeBefore(c-a.Mh);a.Zf.fire(b)}f.getLast=function(){return 0==this.R.length?null:this.R[this.R.length-1].el};f.purgeBefore=function(a){for(var b=this.R.length-1,c=0;c<this.R.length;c++)if(this.R[c].time>=a){b=c-1;break}-1!=b&&this.R.splice(0,b+1)};
 f.hasDescendantsOf=function(a){this.win.document.activeElement&&Sj(this,this.win.document.activeElement);for(var b=0;b<this.R.length;b++)if(a.contains(this.R[b].el))return!0;return!1};function Tj(){this.K=[];this.$b={};this.Pf=this.Qf=0}f=Tj.prototype;f.getSize=function(){return this.K.length};f.getLastEnqueueTime=function(){return this.Qf};f.getLastDequeueTime=function(){return this.Pf};f.getTaskById=function(a){return this.$b[a]||null};f.enqueue=function(a){this.K.push(a);this.$b[a.id]=a;this.Qf=Date.now()};f.dequeue=function(a){var b=this.removeAtIndex(a,this.K.indexOf(this.$b[a.id]));if(!b)return!1;this.Pf=Date.now();return!0};
-f.peek=function(a,b){for(var c=1E6,d=null,e=0;e<this.K.length;e++){var g=this.K[e],h=a(g,b);h<c&&(c=h,d=g)}return d};f.forEach=function(a){this.K.forEach(a)};f.removeAtIndex=function(a,b){var c=this.$b[a.id];if(!c||this.K[b]!=c)return!1;this.K.splice(b,1);delete this.$b[a.id];return!0};f.purge=function(a){for(var b=this.K.length;b--;)a(this.K[b])&&this.removeAtIndex(this.K[b],b)};function Uj(a){var b;return!(b||U(a)).isIe()||Vj(a)?null:new Promise(function(b){var c=Date.now()+2E3,e=a.setInterval(function(){var d=Date.now(),h=Vj(a);if(h||d>c)a.clearInterval(e),b(),h||x().error("ie-media-bug","IE media never resolved")},10)})}function Vj(a){var b="(min-width: "+(a.innerWidth-1)+"px)"+(" AND (max-width: "+(a.innerWidth+1)+"px)");try{return a.matchMedia(b).matches}catch(c){return x().error("ie-media-bug","IE matchMedia failed: ",c),!0}};function Wj(a){var b=this;this.ampdoc=a;this.win=a.win;this.h=W(a);this.wa=this.h.isRuntimeOn();this.ph=!1;this.Uh=0;this.A=[];this.nf=this.Ue=0;this.pa=this.h.isVisible();this.Ha=this.h.getPrerenderSize();this.yb=!1;this.Cf=!0;this.Ve=!1;this.Fa=-1;this.mb=!0;this.Vb=-1;this.ke=this.Cc=0;this.Uc=new oj(this.win,function(){return b.doPass()});this.hg=new oj(this.win,function(){b.mb=!0;b.schedulePass()});this.va=new Tj;this.C=new Tj;this.D=L(this.win,"layers");this.pd=L(this.win,"layers-prioritization");
+f.peek=function(a,b){for(var c=1E6,d=null,e=0;e<this.K.length;e++){var g=this.K[e],h=a(g,b);h<c&&(c=h,d=g)}return d};f.forEach=function(a){this.K.forEach(a)};f.removeAtIndex=function(a,b){var c=this.$b[a.id];if(!c||this.K[b]!=c)return!1;this.K.splice(b,1);delete this.$b[a.id];return!0};f.purge=function(a){for(var b=this.K.length;b--;)a(this.K[b])&&this.removeAtIndex(this.K[b],b)};function Uj(a){var b;return!(b||U(a)).isIe()||Vj(a)?null:new Promise(function(b){var c=Date.now()+2E3,e=a.setInterval(function(){var d=Date.now(),h=Vj(a);if(h||d>c)a.clearInterval(e),b(),h||x().error("ie-media-bug","IE media never resolved")},10)})}function Vj(a){var b="(min-width: "+(a.innerWidth-1)+"px) AND (max-width: "+(a.innerWidth+1+"px)");try{return a.matchMedia(b).matches}catch(c){return x().error("ie-media-bug","IE matchMedia failed: ",c),!0}};function Wj(a){var b=this;this.ampdoc=a;this.win=a.win;this.h=W(a);this.wa=this.h.isRuntimeOn();this.ph=!1;this.Uh=0;this.A=[];this.nf=this.Ue=0;this.pa=this.h.isVisible();this.Ha=this.h.getPrerenderSize();this.yb=!1;this.Cf=!0;this.Ve=!1;this.Fa=-1;this.mb=!0;this.Vb=-1;this.ke=this.Cc=0;this.Uc=new oj(this.win,function(){return b.doPass()});this.hg=new oj(this.win,function(){b.mb=!0;b.schedulePass()});this.va=new Tj;this.C=new Tj;this.D=L(this.win,"layers");this.pd=L(this.win,"layers-prioritization");
 var c;this.ef=c=this.D&&this.pd?this.Ug.bind(this):this.Vg.bind(this);this.la=[];this.xa=[];this.ce=!1;this.G=Ce(this.ampdoc);this.w=Be(this.win);this.Se=new Rj(this.win);this.Re=!1;this.mc=0;this.Pa=!1;this.Tc=[];this.Gg=new Qj(this.h.getVisibilityState());Xj(this,this.Gg);this.G.onChanged(function(a){b.Cc=Date.now();b.ke=a.velocity;a.relayoutAll&&(b.mb=!0,b.Pa=!0);b.schedulePass()});this.G.onScroll(function(){b.Cc=Date.now()});this.D&&(this.eb=fe(this.ampdoc,"layers"),this.Ng=this.Tg.bind(this));
 this.h.onVisibilityChanged(function(){-1==b.Fa&&b.h.isVisible()&&(b.Fa=Date.now());b.schedulePass()});this.h.onRuntimeState(function(a){b.wa=a;b.schedulePass(1)});this.Se.onFocus(function(a){Yj(b,a)});this.schedulePass();Zj(this)}
 function Zj(a){a.ampdoc.whenReady().then(function(){function b(){return a.hg.schedule()}a.yb=!0;ak(a);a.xa=null;var c=Uj(a.win);c?c.then(b):b();bk(a);Promise.race([nf(a.win),V(a.win).promise(3100)]).then(b);a.win.document.fonts&&"loaded"!=a.win.document.fonts.status&&a.win.document.fonts.ready.then(b)})}f=Wj.prototype;f.get=function(){return this.A.slice(0)};
@@ -519,7 +519,7 @@ f.Wh=function(){var a=this;this.Ub=null;this.lg++;this.Ua=this.j.getScrollLeft()
 f.Xh=function(){var a=this;this.De||(this.De=!0,this.w.measure(function(){a.De=!1;a.h.sendMessage("scroll",C({scrollTop:a.getScrollTop()}),!0)}))};f.jg=function(){var a=this;this.Ub=null;var b=this.U;this.U=null;var c=this.getSize();this.ha.update().then(function(){var d=!b||b.width!=c.width;en(a,d,0);var e=d||b.height!=c.height;e&&a.ma.fire({relayoutAll:d,width:c.width,height:c.height})})};
 function fn(a){var b=W(a),c=a.win,d;if(d=a.isSingleDoc()){d=b.getParam("viewportType")||gn;if(U(c).isIos()&&d==gn){var e=L(c,"ios-scrollable-iframe");d=!$b(c)&&(t(c).localDev||t(c).development)&&!e||$b(c)&&t(c).test||$b(c)&&b.isEmbedded()&&!e?hn:d}d=d==hn}c=d?L(c,"ios-embed-sd")&&c.Element.prototype.attachShadow&&12.2<=parseFloat(U(c).getIosVersionString())?new Cm(c):new Dm(c):new Em(a);return new Vm(a,c,b)}var gn="natural",hn="natural-ios-embed";var jn=["<div class=i-amphtml-jank-meter></div>"];function kn(a){this.o=a;this.Gc=this.Fc=this.bc=this.jc=0;this.Wb=null;this.ya=ee(a);this.Kb=this.$e=this.af=null;ln(this)}kn.prototype.onScheduled=function(){mn(this)&&null==this.Wb&&(this.Wb=this.o.Date.now())};
 kn.prototype.onRun=function(){if(mn(this)&&null!=this.Wb){var a=this.o.Date.now()-this.Wb;this.Wb=null;this.bc++;16<a&&(this.jc++,x().info("JANK","Paint latency: "+a+"ms"));if(this.ya&&200==this.bc){var b=this.o.Math.floor((this.bc-this.jc)/this.bc*100);this.ya.tickDelta("gfp",b);this.ya.tickDelta("bf",this.jc);this.Kb&&(this.ya.tickDelta("lts",this.Gc),this.ya.tickDelta("ltc",this.Fc),this.Kb.disconnect(),this.Kb=null);var c=0;this.af&&null!=this.$e&&(c=this.o.Math.max(0,this.o.Math.floor(100*this.af.level-
-this.$e)),this.ya.tickDelta("bd",c));this.ya.flush();if(L(this.o,"jank-meter")){var d=c,e=this.o.document,g=Fe(e)(jn);g.textContent="bf:"+this.jc+", lts: "+this.Gc+", "+("ltc:"+this.Fc+", bd:"+d);e.body.appendChild(g)}}}};function mn(a){return L(a.o,"jank-meter")||a.ya&&a.ya.isPerformanceTrackingOn()&&200>a.bc}
+this.$e)),this.ya.tickDelta("bd",c));this.ya.flush();if(L(this.o,"jank-meter")){var d=c,e=this.o.document,g=Fe(e)(jn);g.textContent="bf:"+this.jc+", lts: "+this.Gc+", ltc:"+(this.Fc+", bd:"+d);e.body.appendChild(g)}}}};function mn(a){return L(a.o,"jank-meter")||a.ya&&a.ya.isPerformanceTrackingOn()&&200>a.bc}
 function ln(a){mn(a)&&nn(a.o)&&(a.Kb=new a.o.PerformanceObserver(function(b){for(var c=b.getEntries(),d=0;d<c.length;d++)if("longtask"==c[d].entryType){var e=a.o.Math.floor(c[d].duration/50);"cross-origin-descendant"==c[d].name?(a.Fc+=e,u().info("LONGTASK","from child frame "+c[d].duration+"ms")):(a.Gc+=e,x().info("LONGTASK","from self frame "+c[d].duration+"ms"))}}),a.Kb.observe({entryTypes:["longtask"]}))}
 function nn(a){return!!a.PerformanceObserver&&!!a.TaskAttributionTiming&&"containerName"in a.TaskAttributionTiming.prototype};function on(a){var b=this;this.win=a;this.Za=xe(this.win);this.xb=R(this.win,"documentState");this.Oh=pn(this);this.K=[];this.se=[];this.Je=[];this.re=[];this.ta=!1;this.qe=this.Mc=null;this.Ed=this.Vh.bind(this);this.nh=new oj(this.win,this.Ed,16);this.Ze=new oj(this.win,this.Ed,40);this.Ge=null;var c=this.we.bind(this);if(this.Za.isSingleDoc())ge(this.Za.getSingleDoc(),"viewer").then(function(a){b.Ge=a;a.onVisibilityChanged(c)});else this.xb.onVisibilityChanged(c);this.Of=new kn(this.win)}f=on.prototype;
 f.we=function(){this.ta&&qn(this)};f.run=function(a,b){this.K.push(a);this.Je.push(b||void 0);this.Ta()};f.runPromise=function(a,b){this.run(a,b);if(this.Mc)return this.Mc;a=new E;this.qe=a.resolve;return this.Mc=a.promise};f.createTask=function(a){var b=this;return function(c){b.run(a,c)}};f.mutate=function(a){this.run({measure:void 0,mutate:a})};f.mutatePromise=function(a){return this.runPromise({measure:void 0,mutate:a})};f.measure=function(a){this.run({measure:a,mutate:void 0})};

@rsimha
Copy link
Contributor Author

rsimha commented Jul 19, 2019

Tested as follows:

  • Locally verified multi pass and single pass gulp dist
  • Manually tested several example pages
  • Examined diffs in v0.js and several other components, found no significant changes
  • Verified amp-date-picker changes with the help of @cvializ
  • All Travis checks are green

Merging this now.

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.

6 participants