Upgrading Angular 7 to 8
Note: Angular now updates major versions every six months. The last version 7 was released in October last year.
What are the main changes in Angular 8?
- Differential Loading [Different browsers can now load different JS files]
- Route Lazy Loading Implemented with Dynamic Imports
- CLI Workflow Improvements
- About Ivy and Bazel,
Ivy is the new rendering engine. Currently, Angular's bundle size and performance are still quite criticized, especially compared to React and Vue. So everyone is waiting for this Ivy, hoping to be able to really use it soon.
Personal Opinion
Version 8 has few noteworthy features. After all, it’s an even-numbered version, which is mainly about strengthening and refining rather than major changes. The long-awaited Ivy still isn’t ready, so we’ll have to wait. But keeping up with versions isn’t a bad thing.
Enough talk, let’s look at the upgrade.
Version Upgrade
Here are the version changes before and after my successful upgrade:
Note
- TypeScript needs to be upgraded to
3.4
, as stated on the official website - Node needs to be upgraded to
10
. For actual projects, it’s recommended to create a.nvmrc
configuration file in the root directory to control the project’s Node version
Size Changes
I’m afraid this might disappoint everyone - there’s currently no significant change in bundle size.
NG7
NG8
Note
- There’s an additional polyfill-es5 file here, which should be the differential loading feature mentioned above. After all, different browsers have different levels of JavaScript support.
Final Thoughts
The upgrade is quite simple with no major pitfalls. However, while upgrading, understanding why these improvements and designs are made is very meaningful. Think about it when you have time.