Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 31b1f50

Browse files
committed
add consumer table
1 parent c121cb3 commit 31b1f50

File tree

1 file changed

+66
-16
lines changed

1 file changed

+66
-16
lines changed

Diff for: public/docs/ts/latest/cookbook/third-party-lib.jade

+66-16
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ include ../_util-fns
2828

2929
[Library package format](#library-package-format)
3030

31+
[Published file layout](#published-file-layout)
32+
3133
[Setup a local development environment](#setup-a-local-development-environment)
3234

3335
[What's in the QuickStart Library seed?](#what-s-in-the-quickstart-library-seed-)
@@ -57,7 +59,8 @@ include ../_util-fns
5759
or the native Node one.
5860
Bundlers, like [Webpack](https://webpack.js.org/) are very popular as well.
5961
[Typescript](typescriptlang.org) users need type definitions.
60-
[Rollup](https://github.com/rollup/rollup) users make use of ECMAScript modules for tree-shaking.
62+
[Rollup](https://github.com/rollup/rollup) users make use of ECMAScript Modules (ESM)
63+
for tree-shaking.
6164
Even though [Ahead-of-time](#appendix-supporting-aot) is preferred,
6265
[Just-in-time](#appendix-supporting-jit) compilation should be supported.
6366

@@ -69,13 +72,73 @@ include ../_util-fns
6972
The recommended set of entry points is as follows:
7073

7174
- `main` (default): an ES5 [UMD](https://github.com/umdjs/umd) bundle that can be consumed anywhere.
72-
- `module`: a flat ECMAScript module (FESM) bundle containing ES5 code.
73-
- `es2015`: a FESM containing ES2015 bundle.
75+
- `module`: a flat ECMAScript Module (ESM) bundle containing ES5 code.
76+
- `es2015`: a flat ESM containing ES2015 bundle.
7477
- `typings`: TypeScript and the AOT compiler will look at this entry for metadata.
7578

7679
In addition, a minimized version of the UMD bundle should also be provided, as well as full
7780
sourcemaps (all the way back to the source) for all JS bundles.
7881

82+
This set of entry points satisfies the following consumers:
83+
84+
style td, th {vertical-align: top}
85+
table(width="100%")
86+
col(width="40%")
87+
col(width="20%")
88+
col(width="40%")
89+
tr
90+
th Consumer
91+
th Module format
92+
th Entry point resolves to
93+
tr
94+
td Webpack (es2015) / Closure Compiler
95+
td ESM+ES2015
96+
td
97+
:marked
98+
`angular-library-name.js`
99+
tr
100+
td Angular CLI / Webpack/ Rollup
101+
td ESM+ES5
102+
td
103+
:marked
104+
`angular-library-name.es5.js`
105+
tr
106+
td Plunker / Fiddle / ES5 / script tag
107+
td UMD
108+
td
109+
:marked
110+
Requires manual resolution to `bundles/angular-library-name.umd.js`/`bundles/angular-library-name.umd.min.js`
111+
tr
112+
td Node.js
113+
td UMD
114+
td
115+
:marked
116+
`bundles/angular-library-name.umd.js`
117+
tr
118+
td TypeScript
119+
td ESM+*.d.ts
120+
td
121+
:marked
122+
`angular-library-name.d.ts`
123+
tr
124+
td AOT compilation
125+
td *.metadata.json
126+
td
127+
:marked
128+
`angular-library-name.metadata.json`
129+
130+
.l-sub-section
131+
:marked
132+
A flat ECMAScript module (FESM) is a bundled ECMAScript module where all imports were followed
133+
copied onto the same file file.
134+
It always contains ES module import/export statements but can have different levels of ES code
135+
inside.
136+
137+
138+
.l-main-section
139+
:marked
140+
## Published file layout
141+
79142
A library should have the following file layout when published:
80143

81144
.filetree
@@ -100,19 +163,6 @@ include ../_util-fns
100163
.file README.md
101164

102165

103-
:marked
104-
There is also a minified UMD bundle (`angular-quickstart-lib.umd.min.js`) for smaller payloads
105-
in Plunkers and script tags.
106-
107-
108-
.l-sub-section
109-
:marked
110-
A flat ECMAScript module (FESM) is a bundled ECMAScript module where all imports were followed
111-
copied onto the same file file.
112-
It always contains ES module import/export statements but can have different levels of ES code
113-
inside.
114-
115-
116166
.l-main-section
117167
:marked
118168
## The QuickStart Library seed

0 commit comments

Comments
 (0)