Based on the talk from NG-CONF. Check it out by yourself, here is just my own take away :)

Differential loading:

The basic idea is that, Angular will build tow version of Javascript bundle. One is ES5 version to support all browsers, another one is ES2015 version, with latest JS features, it results out smaller bundler size, faster execution.

Then for the browser, it will based on the script type to choose which version to download:

<script type="module" src="app-es2015.js"></script>
<script nomodule src="app-es5.js"></script>

To achieve that, we need to update 'target' in tsconfig.json to 'es2015'. This helps to support morden browsers.

And set the minimum support browsers in 'browserlist'.

Code splitting:

1. Dynamic import for Route level lazy load:

2. Component level lazy load:

https://www.npmjs.com/package/ngx-loadable

or

https://www.npmjs.com/package/@herodevs/lazy-af

Personally, I like ngx-loadable API more.

3. Pre-fetching:

4. Performance Budgets:

You can set a budgets for entire app or some centern parts:  https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/budgets.md

{
...
"configurations": {
"production": {
...
budgets: [
{
"type": "bundle",
"name": "vendor",
"minimumWarning": "300kb",
"minimumError": "400kb",
}
]
}
}
}

  

[Angular 8] Take away: Tools for Fast Angular Applications的更多相关文章

  1. 从Java角度理解Angular之入门篇:npm, yarn, Angular CLI

    本系列从Java程序员的角度,带大家理解前端Angular框架. 本文重点介绍Angular的开发.编译工具:npm, yarn, Angular CLI,它们就像Java在中的Maven,同时顺便介 ...

  2. Angular 个人深究(一)【Angular中的Typescript 装饰器】

    Angular 个人深究[Angular中的Typescript 装饰器] 最近进入一个新的前端项目,为了能够更好地了解Angular框架,想到要研究底层代码. 注:本人前端小白一枚,文章旨在记录自己 ...

  3. (转载)从Java角度理解Angular之入门篇:npm, yarn, Angular CLI

    本系列从Java程序员的角度,带大家理解前端Angular框架. 本文是入门篇.笔者认为亲自动手写代码做实验,是最有效最扎实的学习途径,而搭建开发环境是学习一门新技术最需要先学会的技能,是入门的前提. ...

  4. angular.module()创建、获取、注册angular中的模块

    // 传递参数不止一个,代表新建模块;空数组代表该模块不依赖其他模块 var createModule = angular.module("myModule", []); // 只 ...

  5. Angular入门,开发环境搭建,使用Angular CLI创建你的第一个Angular项目

    前言: 最近一直在使用阿里的NG-ZORRO(Angular组件库)开发公司后端的管理系统,写了一段时间的Angular以后发现对于我们.NET后端开发而言真是非常的友善.因此这篇文章主要是对这段时间 ...

  6. [Angular 2] Order Dynamic Components Inside an Angular 2 ViewContainer

    By default, when you generate components, they will simply be added to the page in order, one after ...

  7. [Angular 2] Set Properties on Dynamically Created Angular 2 Components

    When you generate Angular 2 components, you’re still able to access the component instance to set pr ...

  8. [转]angular官网 及 Ant Design of Angular

    https://angular.io/cli https://www.angular.cn/guide/quickstart https://ng.ant.design/docs/introduce/ ...

  9. [AngularJS] Angular 1.3 $submitted for Form in Angular

    AngularJS 1.3 add $submitted for form, so you can use  $submitted  to track whether the submit event ...

随机推荐

  1. PAT A1036 Boys vs Girls(25)

    AC代码 #include <cstdio> #include <algorithm> using namespace std; const int max_n = 11000 ...

  2. dash shell 的一些总结

    最近写个一些dash shell 相关的代码,中间遇到了一些坑以及需要注意的地方,记录一下 1 参数 numberofargmuments(){ echo "The number of ar ...

  3. MGR+Consul+ProxySQL

    ---------------------------------------------------------------------------------------------------- ...

  4. T100——不绑定数据表字段,做查询条件(待改进)

    此例子使用的方法有待改善,不是很好的方法. 范例:aimm200: 作用:查询时默认不显示无效料件:新增参数控制查询是否显示无效料件.(只作用查询,不影响新增.修改等)

  5. mysql解决fail to open file的方法

    由于没有安装有mysql的可视化工具,在使用cmd导入sql文件时,使用source 命令时出现 fail to open file的错误,各种查找后使用以下方法解决了: 1.首先进入mysql数据库 ...

  6. 解决MyEclipse发布按钮无效的办法

    删除Workspaces目录(存放您MyEclipse项目的地方)下的 “/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genu ...

  7. Bootstrap页面响应式设计

    关键词:viewport.栅格布局.媒体查询(Media Queries) 一.关于栅格布局的说明: 1.基本图解 extra small devices phones  超小型设备手机small d ...

  8. O050、Create Volume 操作 (Part I)

    参考https://www.cnblogs.com/CloudMan6/p/5603312.html   前面已经学习了Cinder的架构和相关组件,从本节开始详细分析 Cinder 的各种操作,首先 ...

  9. 微信小程序中button去除默认的边框

    button { position:relative; display:block; margin-left:auto; margin-right:auto; padding-left:14px; p ...

  10. useradd 报Creating mailbox file: File exists

    问题描述:增加一个用户时,报下面的错误:[root@master ~]# useradd hadoopuseradd: warning: the home directory already exis ...