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

Commit 81209a1

Browse files
Foxandxsswardbell
authored andcommitted
docs(quickstart): update to new world
1 parent b4f5674 commit 81209a1

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

public/docs/_examples/quickstart/ts/systemjs.config.1.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
// #docregion
2-
/**
3-
* System configuration for Angular 2 samples
4-
* Adjust as necessary for your application needs.
5-
* Override at the last minute with global.filterSystemConfig (as plunkers do)
6-
*/
7-
// #docregion
82
(function(global) {
93

104
// map tells the System loader where to look for things
@@ -30,6 +24,7 @@
3024
'@angular/platform-browser',
3125
'@angular/platform-browser-dynamic',
3226
'@angular/router',
27+
'@angular/router-deprecated',
3328
'@angular/testing',
3429
'@angular/upgrade',
3530
];

public/docs/ts/latest/quickstart.jade

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ a(id="devenv")
5757
* add a [tsconfig.json](#tsconfig) to guide the TypeScript compiler
5858
* add a [typings.json](#typings) that identifies missing TypeScript definition files
5959
* add a [package.json](#package-json) that defines the packages and scripts we need
60+
* add a [systemjs.config.js](#systemjs) that configures system.js
6061
* install the npm packages and typings files
6162

6263
a(id="install-npm")
@@ -318,12 +319,13 @@ code-example(format="").
318319
+makeExample('quickstart/ts/index.html', null, 'index.html')(format=".")
319320
.l-verbose-section
320321
:marked
321-
There are three noteworthy sections of HTML
322+
There are four noteworthy sections of HTML
322323

323324
1. The JavaScript [libraries](#libraries)
324325

325-
2. Configuration of [SystemJS](#systemjs) where we also import and run the
326-
`main` file that we just wrote. //TODO reword this a bit
326+
2. Configuration file for [SystemJS](#systemjs).
327+
328+
3. Where we import and run the `main` file that we just wrote.
327329

328330
3. The [&lt;my-app>](#my-app) tag in the `<body>` which is *where our app lives!*
329331

@@ -333,21 +335,11 @@ code-example(format="").
333335
We loaded the following scripts
334336
+makeExample('quickstart/ts/index.html', 'libraries', 'index.html')(format=".")
335337
:marked
336-
We began with Internet Explorer polyfills.
337-
IE requires polyfills to run
338-
an application that relies on ES2015 promises and dynamic module loading.
339-
Most applications need those capabilities and most applications
340-
should run in Internet Explorer. //TODO es6-shim are not IE polyfills or they are?
338+
We began with es6-shim which monkey patches the global context (window) with essential features of ES2015 (ES6).
341339

342340
Next are the polyfills for Angular2, `zone.js` and `reflect-metadata`.
343341

344342
Then the [SystemJS](#systemjs) library for module loading.
345-
.l-sub-section
346-
:marked
347-
Our QuickStart doesn't use the Reactive Extensions
348-
but any substantial application will want them
349-
when working with observables.
350-
We added the library here in QuickStart so we don't forget later.//TODO this subsection needs to be moved for when we cover the systemjs.config.js
351343
:marked
352344
We'll make different choices as we gain experience and
353345
become more concerned about production qualities such as
@@ -374,12 +366,27 @@ code-example(format="").
374366
With those cautions in mind, what are we doing in this QuickStart configuration?
375367
+makeExample('quickstart/ts/systemjs.config.1.js', null, 'systemjs.config.js')(format=".")
376368
:marked
369+
First, we create a map to tell SystemJS where to look when we import some module.
370+
371+
Then, we give all our packages to SystemJS. That means all the project dependencies and our application package, `app`.
372+
373+
.l-sub-section
374+
:marked
375+
Our QuickStart doesn't use the Reactive Extensions
376+
but any substantial application will want them
377+
when working with observables.
378+
We added the library here in QuickStart so we don't forget later.
379+
380+
:marked
381+
The `app` package tells SystemJS what to do when it sees a request for a
382+
module from the `app/` folder.
383+
377384
Our QuickStart makes such requests when one of its
378385
application TypeScript files has an import statement like this:
379386
+makeExample('quickstart/ts/app/main.ts', 'app-component', 'main.ts (excerpt)')(format=".")
380387
:marked
381388
Notice that the module name (after `from`) does not mention a filename extension.
382-
The `packages:` configuration tells SystemJS to default the extension to 'js', a JavaScript file.
389+
In the configuration we tell SystemJS to default the extension to 'js', a JavaScript file.
383390

384391
That makes sense because we transpile TypeScript to JavaScript
385392
<i>before</i> running the application</a>.

0 commit comments

Comments
 (0)