3 ms·
According to the spec, AMP developers are prohibited from adding their own JS, yet they are mandated to include a <script src="https://cdn.ampproject.org/v0.js"
by antichaos 11y ago
According to the spec, AMP developers are prohibited from adding their own JS, yet they are mandated to include a <script src="https://cdn.ampproject.org/v0.js" https://cdn.ampproject.org/v0.js" async></script> tag as the last element in the <head>. I find it amusing that the JavaScript library itself is 137KB big (38KB gzipped).
- 51Cards 11y agoHowever like any CDN content, the goal would be for it to be cached if it's in common use across AMP sites. One JS module that covers a large number of content delivery sites seems like a plus to me. I can't vouch for the whole concept yet though, still reading through their spec.
- cramforce 11y agoAlso: We can use a Service Worker for reliable caching of the JS.
- callahad 11y ago<img> and <video> are also prohibited in favor of mandatory custom elements like <amp-img> and <amp-video>. ...and vendor-specific tags like <amp-youtube>, <amp-twitter>, and <amp-instagram>, the library of which is controlled by a single gatekeeper. There must be less invasive ways of achieving the same goal.
- niutech 11y agoNow compare this to Instant Articles spec: https://developers.facebook.com/docs/instant-articles/reference https://developers.facebook.com/docs/instant-articles/refere... No JS, no Custom Elements, just pure HTML.