Member-only story

How to Migrate from angular 4 to 5

sendilkumarn
6 min readDec 5, 2017

--

The “Pentagonal-donut” a.k.a Angular5 is released. It is time for all ngx-* projects to start supporting angular5 and live on the edge.

This release, under the hood, brings us a lot of improvements, newer features and (as usual) some breaking changes.

One of the coolest features is build optimizer, which is applied by default in a production build. It strips down the decorators, which is apparently not needed in the runtime (saving some bytes) and then marks the pure functions in your code (which will be used by existing tools like rollup for tree shaking) saving few more precious bytes in your bundles.

The full list of angular5 changelog (including improvements, newer features, and breaking changes) are listed here and explained in detail here.

Right from Angular2, development builds are spitting out huge files, that needs extra attention when we need to ship this into production.

Similarly In Angular5, it takes 5.7s to build and 7.3MB bundle size for a basic app generated by angular-cli.

On the other hand, aot builds without minification and suppling prod flags takes around 4.9s and 4.1MB bundle size (Note: AOT compilation is much faster than the normal build)

--

--

sendilkumarn
sendilkumarn

Written by sendilkumarn

🚶explorer, learner. Docendo discimus

No responses yet