You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: public/docs/ts/latest/cookbook/third-party-lib.jade
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
include../_util-fns
2
2
3
3
:marked
4
-
Traditionally, third party JavaScript libraries have been published in the form of a single minified JavaScript file.
5
-
Consumers of the library have then included the minified JavaScript file, "as is", somewhere on the page using a `script` tag.
4
+
Traditionally, third party JavaScript libraries have been published in the form of a single JavaScript file.
5
+
Consumers of the library have then included the library, "as is", somewhere on the page using a `script` tag.
6
6
7
7
Modern web development has changed this process. Instead of publishing a "one size fits all" bundle, developers want to only include the parts of the library they actually need.
8
8
9
-
This cookbook will show how to publish a third party library in a way that makes it possible to take advantage of techniques like Ahead of Time Compilation (AoT) and Tree shaking.
9
+
This cookbook shows how to publish a third party library in a way that makes it possible to take advantage of techniques like Ahead of Time Compilation (AoT) and Tree Shaking.
10
10
11
11
<aid="toc"></a>
12
12
:marked
@@ -31,7 +31,7 @@ include ../_util-fns
31
31
:marked
32
32
## Creating a Third Party Library
33
33
34
-
This cookbook will show how to create a simple Hero-Profile library and publish it with support for AoT compilation and Tree Shaking.
34
+
This cookbook shows how to create a simple Hero-Profile library and publish it with support for AoT compilation and Tree Shaking.
35
35
36
36
A version of the library intended for JiT compiled applications will also be included.
37
37
@@ -111,7 +111,7 @@ include ../_util-fns
111
111
112
112
In addition to supporting AoT, the library code should also be "Tree Shakable".
113
113
114
-
Thee Shakers work best with `ES2015` JavaScript.
114
+
Tree Shakers work best with `ES2015` JavaScript.
115
115
116
116
`ES2015` `import` and `export` statements make it easier to statically analyse the code to determine which modules are in use by the application.
117
117
@@ -127,7 +127,7 @@ include ../_util-fns
127
127
128
128
AoT compiled code is the prefered format for production builds, but due to the long compilation time, it may not be practical to use AoT during development.
129
129
130
-
To create a more flexible developer experience, a JiT compatible build of the library should be published as well. The format of the JiT bundle is `umd`, which stands for Universal Module Definition. Shipping the bundle as `umd` ensures compatability with most common module loading formats.
130
+
To create a more flexible developer experience, a JiT compatible build of the library should be published as well. The format of the JiT bundle is `umd`, which stands for Universal Module Definition. Shipping the bundle as `umd` ensures compatibility with most common module loading formats.
131
131
132
132
The `umd` bundle will ship as a single file containing the JavaScript and inlined versions of any external templates or css.
133
133
@@ -154,7 +154,7 @@ include ../_util-fns
154
154
## Publish
155
155
156
156
:marked
157
-
`Rollup` wil create the `umd` bundle, but but prior to bundling, all external templates or css files must be inlined.
157
+
`Rollup` outputs the `umd` bundle, but prior to bundling, all external templates or css files must be inlined.
158
158
159
159
There are a few options for how to do inlining. This cookbook uses an approach borrowed from `Angular Material 2`.
0 commit comments