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. linux下对服务器性能监控shell脚本

    #!/bin/bash #提取本服务器的IP地址信息 ENO1=`ifconfig | sed -n '1,1p' | awk -F ' ' '{print $1}'` IP=` -d -d &quo ...

  2. phpstudy 最新版linux 面板 web防火墙后门防护功能教程

    phpstudy linux 面板针对服务器和网站做了全面的安全防护措施,尽可能的防范网站被入侵,留置后门风险,本篇文章着重介绍phpstudy linux 面板其中的一项安全功能 [网站防火墙]之[ ...

  3. 初遇PHP(一)

    因为想给自己弄一个微信公众号,顺便提升一下自己,所以有了以下内容,本次学习的最终目标是能用php制作套微信公众号,然后转成Java.为什么要这么麻烦呢,其一是买的资料书是php的,其二是顺水推舟刚好可 ...

  4. 换发型app任性扣费?苹果app订阅任性扣费?怎么办?刚成功

    2019年9月18日17:09:27 什么黑猫举报没用 先关闭订阅 账户中心自助申请试试,不通过再进行下面这步 https://getsupport.apple.com/?caller=home&am ...

  5. \ n是将输出换行符的javascript的转义符。

    \ n是将输出换行符的javascript的转义符.<br/>是表示新文本行的HTML标签.JavaScript是一种脚本语言,而HTML是一种标记语言.如果使用javascript的文档 ...

  6. Wxpython pannel切换

    演示效果 实现panel切换思路 1.创建所有在某个区域需要切换面板对象,设置为None self.panel_Celan1 = None self.panel_Celan2 = None self. ...

  7. Dreamweaver CS6 破解安装

    安装 双击Dreamweaver.dmg文件,然后Command+N,新建一个Finder,接着将Adobe Dreamweaver CS6拖到新建Finder的应用程序中.   在Finder中应用 ...

  8. JVM类加载机制和内存模型

    一.JVM类加载机制 首先需要了解一下类加载器(ClassLoader): ClassLoader是Java的一个核心组件,它主要作用是从系统外部获得Class二进制数据流,然后将数据流装载到系统,交 ...

  9. Struts简单的实例

    一.创建Aciton类 package com.my.frame; public class HelloWordAction { private String name; public String ...

  10. VMwarevSphere Client 链接 vCenter Server中的主机,开启虚拟机提示:在主机当前连接状况下不允许执行该操作

    VMwarevSphere Client 链接 vCenter Server中的主机,开启虚拟机提示:在主机当前连接状况下不允许执行该操作很多原因都可以导致该问题出现,例如 vCenter Serve ...