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

By gzipped size I’m referring to the polyfill bundle itself

update: thanks for disambiguating the title, OP!



I think that was actually pretty clear from your tweet; it's just the title of this post which is misleading.

Edit: For context, previous title was "Twitter web app gzip size dropped from 16.6 KB to 2.7 KB by removing polyfills"


Do you have any information on how they achieved this?


They now have two production build variations (I’m guessing two Webpack config):

modern: ES6+, less polyfill

legacy: ES5, more polyfill

The appropriate variation is served by detecting browser’s version from the User-Agent string


Note: since v8.0, Angular comes with built-in differential loading and will do all the heavy lifting to achieve exactly that.

https://angular.io/guide/deployment#differential-loading


update: a Twitter engineer explained how they implemented it in greater detail

https://twitter.com/charliecroom/status/1291478104016289799


updated title to clarify, ty!


Jane!




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

Search: