Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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" async></script> tag as the last element in the <head>. I find it amusing that the JavaScript library itself is 137KB big (38KB gzipped).


<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.


However 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.


Also: We can use a Service Worker for reliable caching of the JS.


Now compare this to Instant Articles spec: https://developers.facebook.com/docs/instant-articles/refere... No JS, no Custom Elements, just pure HTML.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: