docs(quickstart): fix broken file-listings and reveal some systemjs when not verbose
Closes PRs #1304 and #1324 and issues #1303 and #1321
This commit is contained in:
parent
45b5053fed
commit
142ad5dd19
|
@ -346,14 +346,22 @@ code-example(format="").
|
||||||
load times and memory footprint.
|
load times and memory footprint.
|
||||||
|
|
||||||
a(id="systemjs")
|
a(id="systemjs")
|
||||||
|
.l-main-section
|
||||||
:marked
|
:marked
|
||||||
### SystemJS Configuration
|
### SystemJS Configuration
|
||||||
|
|
||||||
The QuickStart uses <a href="https://github.com/systemjs/systemjs" target="_blank">SystemJS</a>
|
The QuickStart uses <a href="https://github.com/systemjs/systemjs" target="_blank">SystemJS</a>
|
||||||
to load application and library modules.
|
to load application and library modules.
|
||||||
|
|
||||||
|
Add this `systemjs.config.js` file to the project root.
|
||||||
|
+makeExample('quickstart/ts/systemjs.config.1.js', null, 'systemjs.config.js')(format=".")
|
||||||
|
|
||||||
|
.l-verbose-section
|
||||||
|
:marked
|
||||||
There are alternatives that work just fine including the well-regarded
|
There are alternatives that work just fine including the well-regarded
|
||||||
<a href="https://webpack.github.io/" target="_blank">webpack</a>.
|
<a href="https://webpack.github.io/" target="_blank">webpack</a>.
|
||||||
SystemJS happens to be a good choice but we want to be clear that it was a choice and not a preference.
|
SystemJS happens to be a good choice.
|
||||||
|
But we want to be clear that it was a *choice* and not a *preference*.
|
||||||
|
|
||||||
All module loaders require configuration and all loader configuration
|
All module loaders require configuration and all loader configuration
|
||||||
becomes complicated rather quickly as soon as the file structure diversifies and
|
becomes complicated rather quickly as soon as the file structure diversifies and
|
||||||
|
@ -364,19 +372,18 @@ code-example(format="").
|
||||||
<a href="https://github.com/systemjs/systemjs/blob/master/docs/config-api.md" target="_blank">here</a>.
|
<a href="https://github.com/systemjs/systemjs/blob/master/docs/config-api.md" target="_blank">here</a>.
|
||||||
|
|
||||||
With those cautions in mind, what are we doing in this QuickStart configuration?
|
With those cautions in mind, what are we doing in this QuickStart configuration?
|
||||||
+makeExample('quickstart/ts/systemjs.config.1.js', null, 'systemjs.config.js')(format=".")
|
|
||||||
:marked
|
|
||||||
First, we create a map to tell SystemJS where to look when we import some module.
|
|
||||||
|
|
||||||
Then, we give all our packages to SystemJS. That means all the project dependencies and our application package, `app`.
|
First, we create a map to tell SystemJS where to look when we import some module.
|
||||||
|
Then, we register all our packages to SystemJS:
|
||||||
|
all the project dependencies and our application package, `app`.
|
||||||
|
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
:marked
|
:marked
|
||||||
Our QuickStart doesn't use the Reactive Extensions
|
Our QuickStart doesn't use all of the listed packages
|
||||||
but any substantial application will want them
|
but any substantial application will want many of them
|
||||||
when working with observables.
|
and all of the listed packages are required by at least one of the documentation samples.
|
||||||
We added the library here in QuickStart so we don't forget later.
|
|
||||||
|
|
||||||
|
There is no runtime harm in listing packages that we don't need as they will only be loaded when requested.
|
||||||
:marked
|
:marked
|
||||||
The `app` package tells SystemJS what to do when it sees a request for a
|
The `app` package tells SystemJS what to do when it sees a request for a
|
||||||
module from the `app/` folder.
|
module from the `app/` folder.
|
||||||
|
@ -489,12 +496,12 @@ figure.image-display
|
||||||
.file index.html
|
.file index.html
|
||||||
.file package.json
|
.file package.json
|
||||||
.file styles.css
|
.file styles.css
|
||||||
.file system.config.js
|
.file systemjs.config.js
|
||||||
.file tsconfig.json
|
.file tsconfig.json
|
||||||
.file typings.json
|
.file typings.json
|
||||||
:marked
|
:marked
|
||||||
And here are the files:,
|
And here are the files:
|
||||||
quickstart/ts/typings/typings.d.1.ts
|
|
||||||
+makeTabs(`
|
+makeTabs(`
|
||||||
quickstart/ts/app/app.component.ts,
|
quickstart/ts/app/app.component.ts,
|
||||||
quickstart/ts/app/main.ts,
|
quickstart/ts/app/main.ts,
|
||||||
|
@ -503,7 +510,7 @@ figure.image-display
|
||||||
quickstart/ts/tsconfig.1.json,
|
quickstart/ts/tsconfig.1.json,
|
||||||
quickstart/ts/typings.1.json,
|
quickstart/ts/typings.1.json,
|
||||||
quickstart/ts/styles.1.css,
|
quickstart/ts/styles.1.css,
|
||||||
quickstart/ts/system.config.1.js`
|
quickstart/ts/systemjs.config.1.js`
|
||||||
,null,
|
,null,
|
||||||
`app/app.component.ts,
|
`app/app.component.ts,
|
||||||
app/main.ts,
|
app/main.ts,
|
||||||
|
@ -512,7 +519,7 @@ figure.image-display
|
||||||
tsconfig.json,
|
tsconfig.json,
|
||||||
typings.json,
|
typings.json,
|
||||||
styles.css,
|
styles.css,
|
||||||
system.config.js`)
|
systemjs.config.js`)
|
||||||
:marked
|
:marked
|
||||||
|
|
||||||
.l-main-section
|
.l-main-section
|
||||||
|
|
Loading…
Reference in New Issue