From b56e4c6fd35580b887694d78c3c5a48efa0ea0ca Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 7 Sep 2016 13:30:39 -0700 Subject: [PATCH 01/25] docs(quickstart): fix broken link to tutorial (#2278) --- public/docs/ts/latest/quickstart.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index 7e96c78d3e..fa896d1f3e 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -215,7 +215,7 @@ block install-packages application, you'd likely import [`FormsModule`](../latest/api/forms/index/FormsModule-class .html) as well as [`RouterModule`](../latest/api/router/index/RouterModule-class.html) and [`HttpModule`](../latest/api/http/index/HttpModule-class.html). These are introduced in the - [Tour of Heroes Tutorial](../tutorial/). + [Tour of Heroes Tutorial](./tutorial/). .l-main-section From 15c50d76a21147378158972ea0320117dd8b214e Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 7 Sep 2016 16:48:43 -0700 Subject: [PATCH 02/25] docs(*): fix broken links in glossary and router chapter (#2279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Glossary: `#ecmascript=2015` is not a valid fragment. - Router: `` needed to be ``. --- public/docs/ts/latest/glossary.jade | 8 ++++---- public/docs/ts/latest/guide/router-deprecated.jade | 5 ++--- public/docs/ts/latest/guide/router.jade | 5 ++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/public/docs/ts/latest/glossary.jade b/public/docs/ts/latest/glossary.jade index 08a551cf64..2abddb1a7e 100644 --- a/public/docs/ts/latest/glossary.jade +++ b/public/docs/ts/latest/glossary.jade @@ -357,17 +357,17 @@ block includes ## ES2015 .l-sub-section :marked - Short hand for "[ECMAScript 2015](#ecmascript=2015)". + Short hand for [ECMAScript](#ecmascript) 2015. :marked ## ES6 .l-sub-section :marked - Short hand for "[ECMAScript 2015](#ecmascript=2015)". + Short hand for [ECMAScript](#ecmascript) 2015. :marked ## ES5 .l-sub-section :marked - Short hand for "ECMAScript 5", the version of JavaScript run by most modern browsers. + Short hand for [ECMAScript](#ecmascript) 5, the version of JavaScript run by most modern browsers. See [ECMAScript](#ecmascript). a#F @@ -732,7 +732,7 @@ a#snake-case ## TypeScript .l-sub-section :marked - A version of JavaScript that supports most [ECMAScript 2015](#ecmascript=2015) + A version of JavaScript that supports most [ECMAScript](#ecmascript) 2015 language features and many features that may arrive in future versions of JavaScript such as [Decorators](#decorator). diff --git a/public/docs/ts/latest/guide/router-deprecated.jade b/public/docs/ts/latest/guide/router-deprecated.jade index 357ce7c10a..e46efcbea3 100644 --- a/public/docs/ts/latest/guide/router-deprecated.jade +++ b/public/docs/ts/latest/guide/router-deprecated.jade @@ -1380,9 +1380,8 @@ code-example(format="." language="bash"). We too can call that `ngOnInit` method in our tests if we wish ... after taking control of the injected `HeroService` and (perhaps) mocking it. - - -.l-main-section +a#browser-url-styles +.l-main-section#location-strategy :marked ## Appendix: *LocationStrategy* and browser URL styles diff --git a/public/docs/ts/latest/guide/router.jade b/public/docs/ts/latest/guide/router.jade index 1bce217ad6..64d712697e 100644 --- a/public/docs/ts/latest/guide/router.jade +++ b/public/docs/ts/latest/guide/router.jade @@ -1941,9 +1941,8 @@ a#fragment We too can call that `ngOnInit` method in our tests if we wish ... after taking control of the injected `HeroService` and (perhaps) mocking it. - - -.l-main-section +a#browser-url-styles +.l-main-section#location-strategy :marked ## Appendix: *LocationStrategy* and browser URL styles From ec076f842e071bbd5dca617f94395e16e53e5d12 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 7 Sep 2016 16:52:04 -0700 Subject: [PATCH 03/25] [WIP] chore(dart): update to beta.21 (#2280) --- public/docs/_examples/architecture/dart/pubspec.yaml | 2 +- public/docs/_examples/attribute-directives/dart/pubspec.yaml | 2 +- public/docs/_examples/component-styles/dart/pubspec.yaml | 2 +- public/docs/_examples/dependency-injection/dart/pubspec.yaml | 2 +- public/docs/_examples/displaying-data/dart/pubspec.yaml | 2 +- public/docs/_examples/forms/dart/pubspec.yaml | 2 +- .../hierarchical-dependency-injection/dart/pubspec.yaml | 2 +- public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml | 2 +- public/docs/_examples/pipes/dart/pubspec.yaml | 2 +- public/docs/_examples/quickstart/dart/pubspec.yaml | 2 +- public/docs/_examples/server-communication/dart/pubspec.yaml | 2 +- public/docs/_examples/structural-directives/dart/pubspec.yaml | 2 +- public/docs/_examples/template-syntax/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-1/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-2/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-3/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-4/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-5/dart/pubspec.yaml | 2 +- public/docs/_examples/toh-6/dart/pubspec.yaml | 2 +- public/docs/_examples/user-input/dart/pubspec.yaml | 2 +- public/docs/dart/latest/_data.json | 2 +- public/docs/dart/latest/quickstart.jade | 2 +- pubspec.yaml | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/public/docs/_examples/architecture/dart/pubspec.yaml b/public/docs/_examples/architecture/dart/pubspec.yaml index 84d0121f5f..e2e648537b 100644 --- a/public/docs/_examples/architecture/dart/pubspec.yaml +++ b/public/docs/_examples/architecture/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/attribute-directives/dart/pubspec.yaml b/public/docs/_examples/attribute-directives/dart/pubspec.yaml index 6cfb11ee2d..79904bff12 100644 --- a/public/docs/_examples/attribute-directives/dart/pubspec.yaml +++ b/public/docs/_examples/attribute-directives/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/component-styles/dart/pubspec.yaml b/public/docs/_examples/component-styles/dart/pubspec.yaml index 0bdc04cb83..7521cf8365 100755 --- a/public/docs/_examples/component-styles/dart/pubspec.yaml +++ b/public/docs/_examples/component-styles/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/dependency-injection/dart/pubspec.yaml b/public/docs/_examples/dependency-injection/dart/pubspec.yaml index 0ef93066be..b5958b1e07 100644 --- a/public/docs/_examples/dependency-injection/dart/pubspec.yaml +++ b/public/docs/_examples/dependency-injection/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/displaying-data/dart/pubspec.yaml b/public/docs/_examples/displaying-data/dart/pubspec.yaml index c5ef73f402..2c5961c70e 100644 --- a/public/docs/_examples/displaying-data/dart/pubspec.yaml +++ b/public/docs/_examples/displaying-data/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/forms/dart/pubspec.yaml b/public/docs/_examples/forms/dart/pubspec.yaml index 51664a3cd5..43a19366d7 100644 --- a/public/docs/_examples/forms/dart/pubspec.yaml +++ b/public/docs/_examples/forms/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml b/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml index 9575041134..d18bc10490 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml +++ b/public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml b/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml index 3624f56e05..e1bda01d28 100644 --- a/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml +++ b/public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/pipes/dart/pubspec.yaml b/public/docs/_examples/pipes/dart/pubspec.yaml index 8edddf0efa..e48db77d96 100644 --- a/public/docs/_examples/pipes/dart/pubspec.yaml +++ b/public/docs/_examples/pipes/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/quickstart/dart/pubspec.yaml b/public/docs/_examples/quickstart/dart/pubspec.yaml index ec9d8d2f81..b8ad984d4c 100644 --- a/public/docs/_examples/quickstart/dart/pubspec.yaml +++ b/public/docs/_examples/quickstart/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/server-communication/dart/pubspec.yaml b/public/docs/_examples/server-communication/dart/pubspec.yaml index 1d381b2288..a2a1b30e93 100644 --- a/public/docs/_examples/server-communication/dart/pubspec.yaml +++ b/public/docs/_examples/server-communication/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 http: ^0.11.3+3 diff --git a/public/docs/_examples/structural-directives/dart/pubspec.yaml b/public/docs/_examples/structural-directives/dart/pubspec.yaml index 3a8e521ee9..c4c0bca74a 100644 --- a/public/docs/_examples/structural-directives/dart/pubspec.yaml +++ b/public/docs/_examples/structural-directives/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/template-syntax/dart/pubspec.yaml b/public/docs/_examples/template-syntax/dart/pubspec.yaml index f27859910c..65bea5b496 100644 --- a/public/docs/_examples/template-syntax/dart/pubspec.yaml +++ b/public/docs/_examples/template-syntax/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-1/dart/pubspec.yaml b/public/docs/_examples/toh-1/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-1/dart/pubspec.yaml +++ b/public/docs/_examples/toh-1/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-2/dart/pubspec.yaml b/public/docs/_examples/toh-2/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-2/dart/pubspec.yaml +++ b/public/docs/_examples/toh-2/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-3/dart/pubspec.yaml b/public/docs/_examples/toh-3/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-3/dart/pubspec.yaml +++ b/public/docs/_examples/toh-3/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-4/dart/pubspec.yaml b/public/docs/_examples/toh-4/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-4/dart/pubspec.yaml +++ b/public/docs/_examples/toh-4/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-5/dart/pubspec.yaml b/public/docs/_examples/toh-5/dart/pubspec.yaml index da508674f5..c4826c3511 100644 --- a/public/docs/_examples/toh-5/dart/pubspec.yaml +++ b/public/docs/_examples/toh-5/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/toh-6/dart/pubspec.yaml b/public/docs/_examples/toh-6/dart/pubspec.yaml index 6f07f46995..653f7ec2f4 100644 --- a/public/docs/_examples/toh-6/dart/pubspec.yaml +++ b/public/docs/_examples/toh-6/dart/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=1.13.0 <2.0.0' # #docregion additions dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 # #enddocregion additions browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 diff --git a/public/docs/_examples/user-input/dart/pubspec.yaml b/public/docs/_examples/user-input/dart/pubspec.yaml index c56f2d27a4..a75460f74f 100644 --- a/public/docs/_examples/user-input/dart/pubspec.yaml +++ b/public/docs/_examples/user-input/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/dart/latest/_data.json b/public/docs/dart/latest/_data.json index 48138a453b..d8ae3f80c9 100644 --- a/public/docs/dart/latest/_data.json +++ b/public/docs/dart/latest/_data.json @@ -3,7 +3,7 @@ "icon": "home", "title": "Angular Docs", "menuTitle": "Docs Home", - "banner": "Welcome to angular.io/dart! The current Angular 2 Dart release is beta.20. Consult the Change Log about recent enhancements, fixes, and breaking changes." + "banner": "Welcome to angular.io/dart! The current Angular 2 Dart release is beta.21. Consult the Change Log about recent enhancements, fixes, and breaking changes." }, "quickstart": { diff --git a/public/docs/dart/latest/quickstart.jade b/public/docs/dart/latest/quickstart.jade index c9e2f66385..80528fdf7e 100644 --- a/public/docs/dart/latest/quickstart.jade +++ b/public/docs/dart/latest/quickstart.jade @@ -30,7 +30,7 @@ block package-and-config-files packages as dependencies, as well as the `angular2` transformer. It can also specify other packages and transformers for the app to use, such as [dart_to_js_script_rewriter](https://pub.dartlang.org/packages/dart_to_js_script_rewriter). - Angular 2 is still changing, so provide an exact version: **2.0.0-beta.20**. + Angular 2 is still changing, so provide an exact version: **2.0.0-beta.21**. [pubspec]: https://www.dartlang.org/tools/pub/pubspec.html diff --git a/pubspec.yaml b/pubspec.yaml index 624e03aed8..28e7ff3b13 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.20 + angular2: 2.0.0-beta.21 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: From 51bcce6b1ccb188257200e6becb62f684895f30a Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 7 Sep 2016 16:54:11 -0700 Subject: [PATCH 04/25] fix(build): correct the angular/angular source pattern for the serve-and-sync-api gulp task --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 366310ec49..c6a47063b8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1212,7 +1212,7 @@ function filterOutExcludedPatterns(fileNames, excludeMatchers) { } function apiSourceWatch(postBuildAction) { - var srcPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/@angular/src/**/*.*')]; + var srcPattern = [path.join(ANGULAR_PROJECT_PATH, 'modules/@angular/**/*.*')]; gulp.watch(srcPattern, {readDelay: 500}, function (event, done) { gutil.log('API source changed'); gutil.log('Event type: ' + event.event); // added, changed, or deleted From d24ff437280b71832817819bde5d74d3fc8e6ee6 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 8 Sep 2016 08:38:25 -0700 Subject: [PATCH 05/25] examples(lifecycle-hooks): update Dart sample to match TS (#2281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make equivalent TS code changes to Dart sample. This sync’s Dart with all #2177 changes pertinent to Dart. E2E tests pass now for Dart, Suites passed: - public/docs/_examples/lifecycle-hooks/ts --- .../dart/lib/do_check_component.dart | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart index 449b6e0092..3208a18777 100644 --- a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart +++ b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart @@ -1,6 +1,4 @@ // #docregion -import 'dart:convert'; - import 'package:angular2/core.dart'; class Hero { @@ -23,7 +21,7 @@ class Hero { '.hero {background: LightYellow; padding: 8px; margin-top: 8px}', 'p {background: Yellow; padding: 8px; margin-top: 8px}' ]) -class DoCheckComponent implements DoCheck, OnChanges { +class DoCheckComponent implements DoCheck { @Input() Hero hero; @Input() @@ -72,16 +70,6 @@ class DoCheckComponent implements DoCheck, OnChanges { } // #enddocregion ng-do-check - // Copied from OnChangesComponent - ngOnChanges(Map changes) { - changes.forEach((String propName, SimpleChange change) { - String cur = JSON.encode(change.currentValue); - String prev = - change.isFirstChange() ? "{}" : JSON.encode(change.previousValue); - changeLog.add('$propName: currentValue = $cur, previousValue = $prev'); - }); - } - void reset() { changeDetected = true; changeLog.clear(); From d59736367092e8b0aead0faeb18f4e86d2d707fe Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 8 Sep 2016 10:52:54 -0700 Subject: [PATCH 06/25] chore(README): add note - do not edit cached files (#2288) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index afc2d28fe3..9fcfd92609 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Filing issues is helpful but **pull requests** that improve the docs are even be Learn how to [contribute to Angular.io](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md). +> **IMPORTANT**: do _NOT_ make changes to cached files under `public/docs/ts/_cache`. Cached files are updated through a separate workflow. + ## Development Setup This site relies heavily on node and npm. From ad2cc5b211a7452a14a9fbd6dcc314fb9bd3a38b Mon Sep 17 00:00:00 2001 From: Kathy Walrath Date: Thu, 8 Sep 2016 10:54:00 -0700 Subject: [PATCH 07/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9fcfd92609..a9d982cd3b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Filing issues is helpful but **pull requests** that improve the docs are even be Learn how to [contribute to Angular.io](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md). -> **IMPORTANT**: do _NOT_ make changes to cached files under `public/docs/ts/_cache`. Cached files are updated through a separate workflow. +> **IMPORTANT**: Do _NOT_ make changes to cached files under `public/docs/ts/_cache`. Cached files are updated through a separate workflow. ## Development Setup This site relies heavily on node and npm. From 3e69d83e68709f20417dbed57ee797b6dd28791f Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 8 Sep 2016 13:37:22 -0700 Subject: [PATCH 08/25] chore(cheatsheet): use Jade to generate mirror page (#2289) The page `docs/ts/latest/guide/cheatsheet.html` is a mirror of `docs/ts/latest/cheatsheet.html`. Use Jade instead of Harp to create the mirror so that jade2ng can generate the corresponding file. --- public/docs/ts/latest/guide/cheatsheet.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/docs/ts/latest/guide/cheatsheet.jade b/public/docs/ts/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/ts/latest/guide/cheatsheet.jade +++ b/public/docs/ts/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet From 24db3d5b9e4c303adf567b83b5ab6438d1e17d05 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 8 Sep 2016 13:27:24 -0700 Subject: [PATCH 09/25] fix(api-builder): remove obsolete decorator type --- .../angular.io-package/processors/extractDirectiveClasses.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js index 668dfcd7d4..9bd15c53f1 100644 --- a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js +++ b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js @@ -8,7 +8,7 @@ module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { return { $runAfter: ['processing-docs'], $runBefore: ['docs-processed'], - decoratorTypes: ['Directive', 'Component', 'View'], + decoratorTypes: ['Directive', 'Component'], $process: function(docs) { var decoratorTypes = this.decoratorTypes; @@ -27,4 +27,4 @@ module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { return docs; } }; -}; \ No newline at end of file +}; From 62d6a51436eb7d01d46bed1d393367c81056dabc Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 8 Sep 2016 13:31:08 -0700 Subject: [PATCH 10/25] fix(api-builder): remove bogus 'class export' section from class template --- .../angular.io-package/templates/class.template.html | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index db2dddc495..66809d79b8 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -60,14 +60,6 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} -div(layout="row" layout-xs="column" class="row-margin ng-cloak") - div(flex="20" flex-xs="100") - h2(class="h2-api-docs") Class Export - div(flex="80" flex-xs="100") - pre.prettyprint.no-bg - code(class="api-doc-code no-pln"). - export {$ doc.docType $} {$ doc.name $} - {%- if doc.decorators.length %} {% block annotations %} div(layout="row" layout-xs="column" class="row-margin ng-cloak") @@ -147,7 +139,7 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n {% endif %} p(class="location-badge"). - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, defined in {$ githubViewLink(doc) $} {% endblock %} From d83d3bd0a022e7ceea579bd003916145d6115067 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 8 Sep 2016 13:31:52 -0700 Subject: [PATCH 11/25] fix(api-builder): add a custom template for interface before we were using the template for class which is wrong --- .../templates/interface.template.html | 74 ++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/tools/api-builder/angular.io-package/templates/interface.template.html b/tools/api-builder/angular.io-package/templates/interface.template.html index bce6547d23..9151b3a5b0 100644 --- a/tools/api-builder/angular.io-package/templates/interface.template.html +++ b/tools/api-builder/angular.io-package/templates/interface.template.html @@ -1 +1,73 @@ -{% extends 'class.template.html' %} \ No newline at end of file +{% include "lib/githubLinks.html" -%} +{% include "lib/paramList.html" -%} +{% extends 'layout/base.template.html' -%} + +{% block body %} +include {$ relativePath(doc.path, '_util-fns') $} + +{% include "layout/_what-it-does.html" %} + +{% include "layout/_security-notes.html" %} + +{% include "layout/_deprecated-notes.html" %} + +{% include "layout/_how-to-use.html" %} + +div(layout="row" layout-xs="column" class="ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Overview + div(flex="80" flex-xs="100") + code(class="no-bg api-doc-code openParens") interface {$ doc.name $} { + + {% if doc.members.length %} + div(layout="column") + {% for member in doc.members %}{% if not member.internal %} + pre(class="prettyprint no-bg-with-indent") + a(class="code-anchor" href="#{$ member.name $}-anchor") + code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} + code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {% endif %}{% endfor %} + {% endif %} + p(class="selector endParens") + code(class="api-doc-code no-bg") } + +{% block additional %} +{% endblock %} + +div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Description + div(class="code-links" flex="80" flex-xs="100") + :marked + {%- if doc.description.length > 2 %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} + +{% if doc.members.length %} +div(layout="row" layout-xs="column" class="instance-members" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Interface Details + div(class="code-links" flex="80" flex-xs="100") + {% for member in doc.members %}{% if not member.internal %} + a(name="{$ member.name $}-anchor" class="anchor-offset") + pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") + code(class="api-doc-code"). + {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + + :marked + {%- if not member.notYetDocumented %} +{$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} + {% endif -%} + + {% if not loop.last %} + .hr(class="hr-margin") + {% endif %} + + {% endif %}{% endfor %} +{% endif %} + +p(class="location-badge"). + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, + defined in {$ githubViewLink(doc) $} + +{% endblock %} From 08130d85dfe93fb458fc6553f20b618fae38232f Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 8 Sep 2016 13:32:21 -0700 Subject: [PATCH 12/25] fix(api-builder): remove line number from the github source link this info is not interesting to the reader. --- .../angular.io-package/templates/lib/githubLinks.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html index 4bf27cd15c..36ec6d0576 100644 --- a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html +++ b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html @@ -3,5 +3,5 @@ https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInf {%- endmacro %} {% macro githubViewLink(doc) -%} - {$ doc.fileInfo.projectRelativePath $} (line {$ doc.location.start.line+1 $}) -{%- endmacro %} \ No newline at end of file + {$ doc.fileInfo.projectRelativePath $} +{%- endmacro %} From 562e99463ac1b65777c10bed070a118965b798ed Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 8 Sep 2016 15:01:39 -0700 Subject: [PATCH 13/25] chore(cheatsheet): fix double banner issue (#2293) Each page is designed to have a single banner; adjust the cheatsheet to follow this convention. Also eliminate the article nested within the `l-conent` div. Propagated changes/cleanup to JS and Dart. --- public/docs/dart/latest/_data.json | 2 +- public/docs/dart/latest/cheatsheet.jade | 9 ++------- public/docs/dart/latest/guide/_data.json | 2 +- public/docs/dart/latest/guide/cheatsheet.jade | 2 +- public/docs/js/latest/_data.json | 2 +- public/docs/js/latest/cheatsheet.jade | 5 ++--- public/docs/js/latest/guide/_data.json | 2 +- public/docs/js/latest/guide/cheatsheet.jade | 2 +- public/docs/ts/latest/_data.json | 2 +- public/docs/ts/latest/cheatsheet.jade | 7 ++----- public/docs/ts/latest/guide/_data.json | 2 +- 11 files changed, 14 insertions(+), 23 deletions(-) diff --git a/public/docs/dart/latest/_data.json b/public/docs/dart/latest/_data.json index d8ae3f80c9..ed39df4605 100644 --- a/public/docs/dart/latest/_data.json +++ b/public/docs/dart/latest/_data.json @@ -38,7 +38,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/dart/latest/cheatsheet.jade b/public/docs/dart/latest/cheatsheet.jade index 77c0f11d36..eec36cfb3f 100644 --- a/public/docs/dart/latest/cheatsheet.jade +++ b/public/docs/dart/latest/cheatsheet.jade @@ -1,9 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -.banner.grid-fluid - .alert.is-important - :marked - This cheat sheet is provisional and subject to change. -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/dart/latest/guide/_data.json b/public/docs/dart/latest/guide/_data.json index 9fed0cf4fe..162d328233 100644 --- a/public/docs/dart/latest/guide/_data.json +++ b/public/docs/dart/latest/guide/_data.json @@ -59,7 +59,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "nextable": true, "basics": true }, diff --git a/public/docs/dart/latest/guide/cheatsheet.jade b/public/docs/dart/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/dart/latest/guide/cheatsheet.jade +++ b/public/docs/dart/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet diff --git a/public/docs/js/latest/_data.json b/public/docs/js/latest/_data.json index 04bb91e507..a4f0318673 100644 --- a/public/docs/js/latest/_data.json +++ b/public/docs/js/latest/_data.json @@ -38,7 +38,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/js/latest/cheatsheet.jade b/public/docs/js/latest/cheatsheet.jade index c623d14bcd..eec36cfb3f 100644 --- a/public/docs/js/latest/cheatsheet.jade +++ b/public/docs/js/latest/cheatsheet.jade @@ -1,5 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/js/latest/guide/_data.json b/public/docs/js/latest/guide/_data.json index f1dc5b57f9..42eede99f8 100644 --- a/public/docs/js/latest/guide/_data.json +++ b/public/docs/js/latest/guide/_data.json @@ -52,7 +52,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "nextable": true, "basics": true }, diff --git a/public/docs/js/latest/guide/cheatsheet.jade b/public/docs/js/latest/guide/cheatsheet.jade index ff8cc6085c..51a21522a9 100644 --- a/public/docs/js/latest/guide/cheatsheet.jade +++ b/public/docs/js/latest/guide/cheatsheet.jade @@ -1 +1 @@ -!= partial("../cheatsheet") +extends ../cheatsheet diff --git a/public/docs/ts/latest/_data.json b/public/docs/ts/latest/_data.json index ad5f75d32f..122f173344 100644 --- a/public/docs/ts/latest/_data.json +++ b/public/docs/ts/latest/_data.json @@ -45,7 +45,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/ts/latest/cheatsheet.jade b/public/docs/ts/latest/cheatsheet.jade index 11640d4f1d..eec36cfb3f 100644 --- a/public/docs/ts/latest/cheatsheet.jade +++ b/public/docs/ts/latest/cheatsheet.jade @@ -1,7 +1,4 @@ - var base = current.path[4] ? '.' : './guide'; -.banner - p.text-body This cheat sheet is provisional and may change. Angular 2 is currently in Release Candidate. -article(class="l-content-small grid-fluid docs-content") - .cheatsheet - ngio-cheatsheet(src= base + '/cheatsheet.json') +.l-content-small.grid-fluid.docs-content.cheatsheet + ngio-cheatsheet(src= base + '/cheatsheet.json') diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json index 2dc886c071..f1e24dd8aa 100644 --- a/public/docs/ts/latest/guide/_data.json +++ b/public/docs/ts/latest/guide/_data.json @@ -60,7 +60,7 @@ "cheatsheet": { "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax.", + "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "nextable": true, "basics": true }, From 672ba7f4799d0c9102b93bc25db991fcb6123c58 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 9 Sep 2016 10:16:11 +0100 Subject: [PATCH 14/25] fix(api-builder/linkDocs): don't crash if a doc has no fileInfo (#2296) Closes #2294 --- tools/api-builder/links-package/inline-tag-defs/linkDocs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/api-builder/links-package/inline-tag-defs/linkDocs.js b/tools/api-builder/links-package/inline-tag-defs/linkDocs.js index 6254fc2d2f..68bbeaede3 100644 --- a/tools/api-builder/links-package/inline-tag-defs/linkDocs.js +++ b/tools/api-builder/links-package/inline-tag-defs/linkDocs.js @@ -45,7 +45,8 @@ module.exports = function linkDocsInlineTagDef(parseArgString, createDocMessage, var vers = _self.vers; var prevUri = uri; uri = path.join(lang, vers, uri); - log.info('Ajusted linkDocs chapter-relative uri (' + doc.fileInfo.baseName + '): ' + prevUri + ' -> ' + uri); + var fileName = doc.fileInfo ? (' (' + doc.fileInfo.baseName + ')') : ''; + log.info('Ajusted linkDocs chapter-relative uri' + fileName + ': ' + prevUri + ' -> ' + uri); } var isValid = false; From 2c9e78c500cb7a0fc6f4179cf0e4beba8a674bb4 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 9 Sep 2016 10:16:54 +0100 Subject: [PATCH 15/25] fix(api-builder/addJadeDataDocs): handle newlines better (#2296) Closes #2294 --- .../processors/addJadeDataDocsProcessor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js index a7caee0555..ca79155f87 100644 --- a/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js +++ b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js @@ -95,7 +95,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - howToUse = howToUseArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + howToUse = howToUseArray[0].description.replace(/(\r\n|\n|\r)/gm," "); } var whatItDoes = ''; @@ -105,7 +105,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - whatItDoes = whatItDoesArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + whatItDoes = whatItDoesArray[0].description.replace(/(\r\n|\n|\r)/gm," "); } // SECURITY STATUS @@ -119,7 +119,7 @@ module.exports = function addJadeDataDocsProcessor() { }); // Remove line breaks, there should only be one tag - security = securityArray[0].description.replace(/(\r\n|\n|\r)/gm,""); + security = securityArray[0].description.replace(/(\r\n|\n|\r)/gm," "); exportDoc.showSecurityNotes = true; } From d4a641e5534def24967887a3c8cb823c3482c2b1 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Fri, 9 Sep 2016 19:02:02 +0200 Subject: [PATCH 16/25] docs(browser-support): document browser support and polyfills (#2244) --- .../dart/latest/guide/browser-support.jade | 1 + .../docs/js/latest/guide/browser-support.jade | 1 + public/docs/ts/latest/guide/_data.json | 5 + .../docs/ts/latest/guide/browser-support.jade | 191 ++++++++++++++++++ 4 files changed, 198 insertions(+) create mode 100644 public/docs/dart/latest/guide/browser-support.jade create mode 100644 public/docs/js/latest/guide/browser-support.jade create mode 100644 public/docs/ts/latest/guide/browser-support.jade diff --git a/public/docs/dart/latest/guide/browser-support.jade b/public/docs/dart/latest/guide/browser-support.jade new file mode 100644 index 0000000000..6778b6af28 --- /dev/null +++ b/public/docs/dart/latest/guide/browser-support.jade @@ -0,0 +1 @@ +!= partial("../../../_includes/_ts-temp") diff --git a/public/docs/js/latest/guide/browser-support.jade b/public/docs/js/latest/guide/browser-support.jade new file mode 100644 index 0000000000..6778b6af28 --- /dev/null +++ b/public/docs/js/latest/guide/browser-support.jade @@ -0,0 +1 @@ +!= partial("../../../_includes/_ts-temp") diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json index f1e24dd8aa..ee6a11e51b 100644 --- a/public/docs/ts/latest/guide/_data.json +++ b/public/docs/ts/latest/guide/_data.json @@ -86,6 +86,11 @@ "intro": "Attribute directives attach behavior to elements." }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "Component Styles", "intro": "Learn how to apply CSS styles to components." diff --git a/public/docs/ts/latest/guide/browser-support.jade b/public/docs/ts/latest/guide/browser-support.jade new file mode 100644 index 0000000000..0b8d9bcb7a --- /dev/null +++ b/public/docs/ts/latest/guide/browser-support.jade @@ -0,0 +1,191 @@ +:marked + # Browser support # + Angular supports most recent browsers. This includes the following specific versions: + +table + tr + th Chrome + th Firefox + th Edge + th IE + th Safari + th iOS + th Android + th IE mobile + tr + td latest + td latest + td 14 + td 11 + td 9 + td 9 + td Marshmallow (6.0) + td 11 + tr + td + td + td 13 + td 10 + td 8 + td 8 + td Lollipop
(5.0, 5.1) + td + tr + td + td + td + td 9 + td 7 + td 7 + td KitKat
(4.4) + td + tr + td + td + td + td + td + td + td Jelly Bean
(4.1, 4.2, 4.3) + td + + +:marked + To ensure this compatibility, the unit tests of the framework are run on all of them for every pull request. + This is done as part of the continuous integration setup of the project, using [SauceLabs](https://saucelabs.com/) and [Browserstack](https://www.browserstack.com). + + # Polyfills # + Angular is built on the latest standards of the web platform. + Targeting such a wide range of browsers can be challenging as they may not support all the features of modern browsers. + + + To fill the gaps, the best solution is to use polyfills which "upgrade" old browsers by adding missing features. + For each browser, some polyfill may be required to run any application, and some may be needed only when some features are used. + +.alert.is-helpful + span As a developer, depending on the browsers you target and on the features you use, you'll need to load a set of polyfills. + span The tables below will help you making the right choices. + +.alert.is-important + span The polyfills documented here are the ones which were identified to run full Angular application. + span Others may be needed if you decide to use extra features which are not supported everywhere. + span On top of that, they will not magically transform an old and slow browser into a modern and fast one. + +:marked + ## Mandatory polyfills ## + For each supported browser, these are the polyfills which are required to run an application: + +table + tr + th Browsers (desktop & mobile) + th Polyfills required + tr + td Chrome, Firefox, Edge, Safari 9+ + td None + tr + td Safari 7 & 8, IE10 & 11, Android 4.1+ + td ES6 + tr + td IE9 + td ES6
classList + + +:marked + ## Optional browser features to polyfill ## + In addition to the mandatory polyfills, some features of Angular may require some extra polyfills. + + For example, the animations use the standard web animation API, which is only available in Chrome and Firefox today. + In order to use this feature in other browsers, the correct polyfill is needed. + + Here are the features which may require additional polyfills: + +table + tr + th Feature + th Polyfill + th Browsers (desktop & mobile) + tr + td + a(href="./animations.html") Animations + td Web Animations + td All but Chrome and Firefox
Not supported in IE9 + tr + td + a(href="../api/common/index/DatePipe-class.html") Date + span , + a(href="../api/common/index/CurrencyPipe-class.html") currency + span , + a(href="../api/common/index/DecimalPipe-class.html") decimal + span and + a(href="../api/common/index/PercentPipe-class.html") percent + span pipes + td Intl API + td All but Chrome, Firefox, Edge and IE11 + tr + td + a(href="../api/common/index/NgClass-directive.html") NgClass + span on SVG elements + td classList + td IE10, IE11 + tr + td + a(href="./server-communication.html") Http + span when sending and receiving binary data + td Typed Arrays
Blob
FormData + td IE 9 + +:marked + ## Suggested polyfills ## + Below are the polyfills which are used to test the framework itself. They are a good starting point for an application. + +table + tr + th Polyfill + th Library + th Licence + th Size* + tr + td ES6 + td + a(href="https://github.com/zloirock/core-js") https://github.com/zloirock/core-js + td MIT + td 27.4KB + tr + td classList + td + a(href="https://github.com/eligrey/classList.js") https://github.com/eligrey/classList.js + td Public domain + td 1KB + tr + td Intl + td + a(href="https://github.com/andyearnshaw/Intl.js ") https://github.com/andyearnshaw/Intl.js + td MIT / Unicode licence + td 13.5KB + tr + td Web Animations + td + a(href="https://github.com/web-animations/web-animations-js") https://github.com/web-animations/web-animations-js + td Apache + td 14.8KB + tr + td Typed Arrays + td + a(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js") https://github.com/inexorabletash/polyfill/blob/master/typedarray.js + td MIT + td 4KB + tr + td Blob + td + a(href="https://github.com/eligrey/Blob.js") https://github.com/eligrey/Blob.js + td MIT + td 1.3KB + tr + td FormData + td + a(href="https://github.com/francois2metz/html5-formdata") https://github.com/francois2metz/html5-formdata + td MIT + td 0.4KB + +:marked + *Figures are for minified and gzipped code, computed with [http://closure-compiler.appspot.com/home](http://closure-compiler.appspot.com/home) From 8c7e2a176637e7f637fbe9c5021dfb3f41c8318e Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 9 Sep 2016 12:47:20 +0100 Subject: [PATCH 17/25] chore(dgeni-packages): update to use 0.15.2 This version includes the feature to hide members that are marked private in TypeScript. --- package.json | 2 +- .../templates/class.template.html | 20 +++++++++---------- .../templates/decorator.template.html | 8 ++++---- .../templates/directive.template.html | 4 ++-- .../templates/function.template.html | 8 ++++---- .../templates/interface.template.html | 10 +++++----- .../templates/module.template.html | 4 ++-- .../templates/overview-dump.template.html | 14 ++++++------- .../templates/var.template.html | 6 +++--- .../templates/module.template.html | 4 ++-- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index f13d2126c1..a3b381cb96 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "cross-spawn": "^4.0.0", "del": "^2.2.0", "dgeni": "^0.4.0", - "dgeni-packages": "^0.13.1", + "dgeni-packages": "^0.15.2", "diff": "^2.1.3", "fs-extra": "^0.30.0", "globby": "^4.0.0", diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index 66809d79b8..bb9afaeb6b 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -25,7 +25,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") pre(class="prettyprint no-bg-with-indent") a(class="code-anchor" href="#{$ member.name $}-anchor") code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} - code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} {% if doc.constructorDoc.name %} @@ -34,7 +34,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") a(class="code-anchor" href="#constructor") code(class="code-background api-doc-code") {$ doc.constructorDoc.name $} code(class="api-doc-code"). - {$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} + {$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} {% endif %} {% if doc.members.length %} div(layout="column") @@ -42,7 +42,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") pre(class="prettyprint no-bg-with-indent") a(class="code-anchor" href="#{$ member.name $}-anchor") code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} - code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} p(class="selector endParens") @@ -69,7 +69,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") {%- for decorator in doc.decorators %} pre.prettyprint.no-bg code(class="api-doc-code"). - @{$ decorator.name $}{$ paramList(decorator.arguments) | indent(10, false) $} + @{$ decorator.name $}{$ params.paramList(decorator.arguments) | indent(10, false) $} :marked {%- if not decorator.notYetDocumented %} {$ decorator.description | indentForMarkdown(8) | trimBlankLines $} @@ -86,7 +86,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") a(name="constructor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ doc.constructorDoc.name $}') }") code(class="api-doc-code"). - {$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} + {$ doc.constructorDoc.name $}{$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} :marked {%- if not doc.constructorDoc.notYetDocumented %} {$ doc.constructorDoc.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} @@ -102,7 +102,7 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") code(class="api-doc-code"). - {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} :marked {%- if not member.notYetDocumented %} {$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} @@ -124,7 +124,7 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") code(class="api-doc-code"). - {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} :marked {%- if not member.notYetDocumented %} @@ -140,6 +140,6 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n p(class="location-badge"). exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/decorator.template.html b/tools/api-builder/angular.io-package/templates/decorator.template.html index 7c86eca94d..c055039527 100644 --- a/tools/api-builder/angular.io-package/templates/decorator.template.html +++ b/tools/api-builder/angular.io-package/templates/decorator.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' %} {% block body %} @@ -19,13 +19,13 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(class="code-links" flex="80" flex-xs="100") pre.prettyprint.no-bg code. - export {$ doc.name $}(options : {@link {$ doc.decoratorType $} {$ doc.decoratorType | escape $}}){$ returnType(doc.returnType) $} + export {$ doc.name $}(options : {@link {$ doc.decoratorType $} {$ doc.decoratorType | escape $}}){$ params.returnType(doc.returnType) $} :marked {%- if not doc.notYetDocumented %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/directive.template.html b/tools/api-builder/angular.io-package/templates/directive.template.html index 4bff9414cb..5e8a3cd24d 100644 --- a/tools/api-builder/angular.io-package/templates/directive.template.html +++ b/tools/api-builder/angular.io-package/templates/directive.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'class.template.html' -%} {% block annotations %} diff --git a/tools/api-builder/angular.io-package/templates/function.template.html b/tools/api-builder/angular.io-package/templates/function.template.html index 7cac55eb24..7cf1d85640 100644 --- a/tools/api-builder/angular.io-package/templates/function.template.html +++ b/tools/api-builder/angular.io-package/templates/function.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -19,13 +19,13 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(class="code-links" flex="80" flex-xs="100") pre.prettyprint.no-bg code. - export {$ doc.name $}{$ paramList(doc.parameters) | indent(8, true) | trim $}{$ returnType(doc.returnType) $} + export {$ doc.name $}{$ params.paramList(doc.parameters) | indent(8, true) | trim $}{$ params.returnType(doc.returnType) $} :marked {%- if not doc.notYetDocumented %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ github.githubViewLink(doc) $} {% endblock %} \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/templates/interface.template.html b/tools/api-builder/angular.io-package/templates/interface.template.html index 9151b3a5b0..59d7ae7cc5 100644 --- a/tools/api-builder/angular.io-package/templates/interface.template.html +++ b/tools/api-builder/angular.io-package/templates/interface.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -25,7 +25,7 @@ div(layout="row" layout-xs="column" class="ng-cloak") pre(class="prettyprint no-bg-with-indent") a(class="code-anchor" href="#{$ member.name $}-anchor") code(class="code-background api-doc-code") {$ member.name | indent(6, false) | trim $} - code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + code(class="api-doc-code") {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} p(class="selector endParens") @@ -52,7 +52,7 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") code(class="api-doc-code"). - {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} + {$ member.name $}{$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $} :marked {%- if not member.notYetDocumented %} @@ -68,6 +68,6 @@ div(layout="row" layout-xs="column" class="instance-members" class="row-margin n p(class="location-badge"). exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }, - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/module.template.html b/tools/api-builder/angular.io-package/templates/module.template.html index fb62f190e4..d047e67fb1 100644 --- a/tools/api-builder/angular.io-package/templates/module.template.html +++ b/tools/api-builder/angular.io-package/templates/module.template.html @@ -1,9 +1,9 @@ -{% include "lib/githubLinks.html" -%} +{% import "lib/githubLinks.html" as github -%} {% extends 'layout/base.template.html' -%} {% block body -%} include {$ relativePath(doc.path, '_util-fns') $} p.location-badge. - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} ul {% for page in doc.childPages -%} diff --git a/tools/api-builder/angular.io-package/templates/overview-dump.template.html b/tools/api-builder/angular.io-package/templates/overview-dump.template.html index 535b57be45..e02c70adff 100644 --- a/tools/api-builder/angular.io-package/templates/overview-dump.template.html +++ b/tools/api-builder/angular.io-package/templates/overview-dump.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} @@ -47,21 +47,21 @@ {% for export in module.exports %}

- + {$ export.docType $} {$ export.name $}

{%- if export.constructorDoc %}

- - {$ export.constructorDoc.name $}{$ paramList(export.constructorDoc.params) $} + + {$ export.constructorDoc.name $}{$ params.paramList(export.constructorDoc.params) $}

{% endif -%} {%- for member in export.members %}

- - {$ member.name $}{$ paramList(member.params) $} + + {$ member.name $}{$ params.paramList(member.params) $}

{% endfor %} diff --git a/tools/api-builder/angular.io-package/templates/var.template.html b/tools/api-builder/angular.io-package/templates/var.template.html index fc9851617e..6985ec43ff 100644 --- a/tools/api-builder/angular.io-package/templates/var.template.html +++ b/tools/api-builder/angular.io-package/templates/var.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' %} {% block body %} @@ -27,6 +27,6 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") p.location-badge. exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} {% endblock %} diff --git a/tools/api-builder/docs-package/templates/module.template.html b/tools/api-builder/docs-package/templates/module.template.html index 34ab0f67ab..c4b7360141 100644 --- a/tools/api-builder/docs-package/templates/module.template.html +++ b/tools/api-builder/docs-package/templates/module.template.html @@ -1,9 +1,9 @@ -{% include "lib/githubLinks.html" -%} +{% import "lib/githubLinks.html" as github -%} {% extends 'layout/base.template.html' %} {% block body %}

{$ doc.id $} module

-

defined in {$ githubViewLink(doc) $}

+

defined in {$ github.githubViewLink(doc) $}

{$ doc.description | marked $}

{% if doc.exports.length %} From 30fbd85dbcf6f99fffbae930344a554f7620adb1 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 9 Sep 2016 12:47:49 +0100 Subject: [PATCH 18/25] chore(package): remove unused dependency, grunt-sass --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a3b381cb96..c56e0d3dbf 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "diff": "^2.1.3", "fs-extra": "^0.30.0", "globby": "^4.0.0", - "grunt-sass": "^1.2.0", "gulp": "^3.5.6", "gulp-env": "0.4.0", "gulp-sass": "^2.3.2", From 40a1049d47bd1f57179883ba380ff2c6923769a3 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 8 Sep 2016 14:33:48 +0100 Subject: [PATCH 19/25] doc-gen(mergeDecoratorDocs): capture all the metadata docs Iterate through the docs and merge all the of metadata docs for each decorator doc into the decorator doc and remove it so that it is not rendered in a page of its own --- tools/api-builder/docs-package/index.js | 2 +- .../processors/createDecoratorDocs.js | 39 ---------- .../processors/mergeDecoratorDocs.js | 76 +++++++++++++++++++ ...ocs.spec.js => mergeDecoratorDocs.spec.js} | 0 4 files changed, 77 insertions(+), 40 deletions(-) delete mode 100644 tools/api-builder/docs-package/processors/createDecoratorDocs.js create mode 100644 tools/api-builder/docs-package/processors/mergeDecoratorDocs.js rename tools/api-builder/docs-package/processors/{createDecoratorDocs.spec.js => mergeDecoratorDocs.spec.js} (100%) diff --git a/tools/api-builder/docs-package/index.js b/tools/api-builder/docs-package/index.js index 52ead1ba98..c068016e09 100644 --- a/tools/api-builder/docs-package/index.js +++ b/tools/api-builder/docs-package/index.js @@ -18,7 +18,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, .processor(require('./processors/checkUnbalancedBackTicks')) .processor(require('./processors/convertBackticksToCodeBlocks')) .processor(require('./processors/addNotYetDocumentedProperty')) -.processor(require('./processors/createDecoratorDocs')) +.processor(require('./processors/mergeDecoratorDocs')) .config(function(parseTagsProcessor) { parseTagsProcessor.tagDefinitions.push({ name: 'internal', transforms: function() { return true; } }); diff --git a/tools/api-builder/docs-package/processors/createDecoratorDocs.js b/tools/api-builder/docs-package/processors/createDecoratorDocs.js deleted file mode 100644 index 4e3b70dfd5..0000000000 --- a/tools/api-builder/docs-package/processors/createDecoratorDocs.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = function mergeDecoratorDocs() { - return { - $runAfter: ['processing-docs'], - $runBefore: ['docs-processed'], - $process: function(docs) { - docs.forEach(function(doc) { - var makeDecorator = getMakeDecoratorCall(doc); - if (makeDecorator) { - doc.docType = 'decorator'; - doc.decoratorType = makeDecorator.arguments[0].text; - } - }); - } - }; -}; - -function getMakeDecoratorCall(doc, type) { - - var makeDecoratorFnName = 'make' + (type || '')+ 'Decorator'; - - var initializer = doc.exportSymbol && - doc.exportSymbol.valueDeclaration && - doc.exportSymbol.valueDeclaration.initializer; - - if (initializer) { - // There appear to be two forms of initializer: - // export var Injectable: InjectableFactory = makeDecorator(InjectableMetadata); - // and - // export var RouteConfig: (configs: RouteDefinition[]) => ClassDecorator = makeDecorator(RouteConfigAnnotation); - // In the first case, the type assertion `` causes the AST to contain an extra level of expression - // to hold the new type of the expression. - if (initializer.expression && initializer.expression.expression) { - initializer = initializer.expression; - } - if (initializer.expression && initializer.expression.text === makeDecoratorFnName) { - return initializer; - } - } -} \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js new file mode 100644 index 0000000000..dcde64b665 --- /dev/null +++ b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js @@ -0,0 +1,76 @@ +var _ = require('lodash'); + +module.exports = function mergeDecoratorDocs() { + return { + $runAfter: ['processing-docs'], + $runBefore: ['docs-processed'], + docsToMergeInfo: [ + { nameTemplate: _.template('${name}Decorator'), decoratorProperty: 'decoratorInterfaceDoc' }, + { nameTemplate: _.template('${name}Metadata'), decoratorProperty: 'metadataDoc' }, + { nameTemplate: _.template('${name}MetadataType'), decoratorProperty: 'metadataInterfaceDoc' }, + { nameTemplate: _.template('${name}MetadataFactory'), decoratorProperty: 'metadataFactoryDoc' } + ], + $process: function(docs) { + + var docsToMergeInfo = this.docsToMergeInfo; + var docsToMerge = Object.create(null); + + docs.forEach(function(doc) { + + // find all the decorators, signified by a call to `makeDecorator(metadata)` + var makeDecorator = getMakeDecoratorCall(doc); + if (makeDecorator) { + doc.docType = 'decorator'; + doc.decoratorType = makeDecorator.arguments[0].text; + + // keep track of the docs that need to be merged into this decorator doc + docsToMergeInfo.forEach(function(info) { + docsToMerge[info.nameTemplate({name: doc.name})] = { decoratorDoc: doc, property: info.decoratorProperty }; + }); + } + }); + + // merge the metadata docs into the decorator docs + docs = docs.filter(function(doc) { + if (docsToMerge[doc.name]) { + var decoratorDoc = docsToMerge[doc.name].decoratorDoc; + var property = docsToMerge[doc.name].property; + + // attach this document to its decorator + decoratorDoc[property] = doc; + + // remove doc from its module doc's exports + doc.moduleDoc.exports = doc.moduleDoc.exports.filter(function(exportDoc) { return exportDoc !== doc; }); + + // remove from the overall list of docs to be rendered + return false; + } + return true; + }); + } + }; +}; + +function getMakeDecoratorCall(doc, type) { + + var makeDecoratorFnName = 'make' + (type || '')+ 'Decorator'; + + var initializer = doc.exportSymbol && + doc.exportSymbol.valueDeclaration && + doc.exportSymbol.valueDeclaration.initializer; + + if (initializer) { + // There appear to be two forms of initializer: + // export var Injectable: InjectableFactory = makeDecorator(InjectableMetadata); + // and + // export var RouteConfig: (configs: RouteDefinition[]) => ClassDecorator = makeDecorator(RouteConfigAnnotation); + // In the first case, the type assertion `` causes the AST to contain an extra level of expression + // to hold the new type of the expression. + if (initializer.expression && initializer.expression.expression) { + initializer = initializer.expression; + } + if (initializer.expression && initializer.expression.text === makeDecoratorFnName) { + return initializer; + } + } +} \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/createDecoratorDocs.spec.js b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.spec.js similarity index 100% rename from tools/api-builder/docs-package/processors/createDecoratorDocs.spec.js rename to tools/api-builder/docs-package/processors/mergeDecoratorDocs.spec.js From 611c90da03aa51dee05480105da4e6daf49a4248 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 8 Sep 2016 22:28:45 +0100 Subject: [PATCH 20/25] chore(eslint): add eslint config file --- .eslintrc.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..d1c2c2b349 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + "globals": { + "describe": true, + "beforeEach": true, + "it": true, + "expect": true + }, + "env": { + "node": true + }, + "extends": "eslint:recommended", + "rules": { + "indent": [ + "error", + 2 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file From a2089c5b4fd9dd570ee7dab1a7211566bcd6c743 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 9 Sep 2016 10:27:11 +0100 Subject: [PATCH 21/25] api-builder: render pipes with specialised template --- public/resources/css/module/_api.scss | 4 ++ public/resources/js/directives/api-list.js | 1 + tools/api-builder/angular.io-package/index.js | 3 +- .../extractDirectiveClasses.spec.js | 51 ---------------- .../templates/pipe.template.html | 29 ++++++++++ tools/api-builder/docs-package/index.js | 2 +- .../processors/extractDecoratedClasses.js} | 11 ++-- .../extractDecoratedClasses.spec.js | 58 +++++++++++++++++++ .../processors/extractDirectiveClasses.js | 32 ---------- .../extractDirectiveClasses.spec.js | 45 -------------- tools/dart-api-builder/index.js | 4 +- 11 files changed, 101 insertions(+), 139 deletions(-) delete mode 100644 tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js create mode 100644 tools/api-builder/angular.io-package/templates/pipe.template.html rename tools/api-builder/{angular.io-package/processors/extractDirectiveClasses.js => docs-package/processors/extractDecoratedClasses.js} (63%) create mode 100644 tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js delete mode 100644 tools/api-builder/docs-package/processors/extractDirectiveClasses.js delete mode 100644 tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js diff --git a/public/resources/css/module/_api.scss b/public/resources/css/module/_api.scss index a62562df3c..00adfe2a33 100644 --- a/public/resources/css/module/_api.scss +++ b/public/resources/css/module/_api.scss @@ -8,6 +8,10 @@ content: 'D'; background: #db4437; } + &.pipe:before { + content: 'P'; + background: #78909C; + } &.class:before { content: 'C'; background: #4285f4; diff --git a/public/resources/js/directives/api-list.js b/public/resources/js/directives/api-list.js index a7cac49374..d6bc149b8d 100644 --- a/public/resources/js/directives/api-list.js +++ b/public/resources/js/directives/api-list.js @@ -31,6 +31,7 @@ angularIO.directive('apiList', function () { $ctrl.apiTypes = [ { cssClass: 'stable', title: 'Stable', matches: ['stable']}, { cssClass: 'directive', title: 'Directive', matches: ['directive'] }, + { cssClass: 'pipe', title: 'Pipe', matches: ['pipe'] }, { cssClass: 'decorator', title: 'Decorator', matches: ['decorator'] }, { cssClass: 'class', title: 'Class', matches: ['class'] }, { cssClass: 'interface', title: 'Interface', matches: ['interface'] }, diff --git a/tools/api-builder/angular.io-package/index.js b/tools/api-builder/angular.io-package/index.js index 2e3a39a90d..f81ee2e69b 100644 --- a/tools/api-builder/angular.io-package/index.js +++ b/tools/api-builder/angular.io-package/index.js @@ -16,7 +16,6 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe .factory(require('./services/renderMarkdown')) .processor(require('./processors/addJadeDataDocsProcessor')) .processor(require('./processors/filterUnwantedDecorators')) -.processor(require('./processors/extractDirectiveClasses')) .processor(require('./processors/matchUpDirectiveDecorators')) .processor(require('./processors/filterMemberDocs')) @@ -100,7 +99,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe }) -.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) { +.config(function(readFilesProcessor, generateNavigationDoc) { // Clear out unwanted processors generateNavigationDoc.$enabled = false; }) diff --git a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js deleted file mode 100644 index c6b6d6d8b9..0000000000 --- a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js +++ /dev/null @@ -1,51 +0,0 @@ -var mockPackage = require('../mocks/mockPackage'); -var Dgeni = require('dgeni'); - -describe('extractDirectiveClasses processor', function() { - var dgeni, injector, processor; - - beforeEach(function() { - dgeni = new Dgeni([mockPackage()]); - injector = dgeni.configureInjector(); - processor = injector.get('extractDirectiveClassesProcessor'); - }); - - it('should extract specified decorator arguments', function() { - var doc = { - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'class', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], - argumentInfo: [ - { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } - ] - } - ] - }; - - var docs = processor.$process([doc]); - - expect(doc).toEqual(jasmine.objectContaining({ - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'directive', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], - argumentInfo: [ - { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } - ] - } - ] - })); - - expect(doc.directiveOptions).toEqual({ - selector: '[ng-for][ng-for-of]', - properties: ['ngForOf'] - }); - }); -}); \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/templates/pipe.template.html b/tools/api-builder/angular.io-package/templates/pipe.template.html new file mode 100644 index 0000000000..4e428b2b59 --- /dev/null +++ b/tools/api-builder/angular.io-package/templates/pipe.template.html @@ -0,0 +1,29 @@ +{% include "lib/githubLinks.html" -%} +{% include "lib/paramList.html" -%} +{% extends 'layout/base.template.html' -%} + +{% block body %} +include {$ relativePath(doc.path, '_util-fns') $} + +{% include "layout/_what-it-does.html" %} + +{% include "layout/_security-notes.html" %} + +{% include "layout/_deprecated-notes.html" %} + +{% include "layout/_how-to-use.html" %} + +div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Description + div(class="code-links" flex="80" flex-xs="100") + :marked + {%- if doc.description.length > 2 %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} + +p(class="location-badge"). + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } + defined in {$ githubViewLink(doc) $} + +{% endblock %} \ No newline at end of file diff --git a/tools/api-builder/docs-package/index.js b/tools/api-builder/docs-package/index.js index c068016e09..b44b1446fc 100644 --- a/tools/api-builder/docs-package/index.js +++ b/tools/api-builder/docs-package/index.js @@ -11,7 +11,6 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, // Register the processors .processor(require('./processors/convertPrivateClassesToInterfaces')) -.processor(require('./processors/extractDirectiveClasses')) .processor(require('./processors/generateNavigationDoc')) .processor(require('./processors/extractTitleFromGuides')) .processor(require('./processors/createOverviewDump')) @@ -19,6 +18,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, .processor(require('./processors/convertBackticksToCodeBlocks')) .processor(require('./processors/addNotYetDocumentedProperty')) .processor(require('./processors/mergeDecoratorDocs')) +.processor(require('./processors/extractDecoratedClasses')) .config(function(parseTagsProcessor) { parseTagsProcessor.tagDefinitions.push({ name: 'internal', transforms: function() { return true; } }); diff --git a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js b/tools/api-builder/docs-package/processors/extractDecoratedClasses.js similarity index 63% rename from tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js rename to tools/api-builder/docs-package/processors/extractDecoratedClasses.js index 9bd15c53f1..de643aa5a5 100644 --- a/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js +++ b/tools/api-builder/docs-package/processors/extractDecoratedClasses.js @@ -1,14 +1,14 @@ var _ = require('lodash'); -module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { +module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) { // Add the "directive" docType into those that can be exported from a module - EXPORT_DOC_TYPES.push('directive'); + EXPORT_DOC_TYPES.push('directive', 'pipe'); return { $runAfter: ['processing-docs'], $runBefore: ['docs-processed'], - decoratorTypes: ['Directive', 'Component'], + decoratorTypes: ['Directive', 'Component', 'Pipe'], $process: function(docs) { var decoratorTypes = this.decoratorTypes; @@ -17,9 +17,8 @@ module.exports = function extractDirectiveClassesProcessor(EXPORT_DOC_TYPES) { _.forEach(doc.decorators, function(decorator) { if (decoratorTypes.indexOf(decorator.name) !== -1) { - doc.docType = 'directive'; - - doc[decorator.name.toLowerCase() + 'Options'] = decorator.argumentInfo[0]; + doc.docType = decorator.name.toLowerCase(); + doc[doc.docType + 'Options'] = decorator.argumentInfo[0]; } }); }); diff --git a/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js b/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js new file mode 100644 index 0000000000..ad6c30ab88 --- /dev/null +++ b/tools/api-builder/docs-package/processors/extractDecoratedClasses.spec.js @@ -0,0 +1,58 @@ +var mockPackage = require('../mocks/mockPackage'); +var Dgeni = require('dgeni'); + +describe('extractDecoratedClasses processor', function() { + var dgeni, injector, processor; + + beforeEach(function() { + dgeni = new Dgeni([mockPackage()]); + injector = dgeni.configureInjector(); + processor = injector.get('extractDecoratedClassesProcessor'); + }); + + it('should extract specified decorator arguments', function() { + var doc1 = { + id: '@angular/common/ngFor', + name: 'ngFor', + docType: 'class', + decorators: [ + { + name: 'Directive', + arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'], + argumentInfo: [ + { selector: '[ng-for][ng-for-of]', properties: ['ngForOf'] } + ] + } + ] + }; + var doc2 = { + id: '@angular/core/DecimalPipe', + name: 'DecimalPipe', + docType: 'class', + decorators: [ + { name: 'Pipe', arguments: ['{name: \'number\'}'], argumentInfo: [{ name: 'number' }]} + ] + }; + + processor.$process([doc1, doc2]); + + expect(doc1).toEqual(jasmine.objectContaining({ + id: '@angular/common/ngFor', + name: 'ngFor', + docType: 'directive', + directiveOptions: { + selector: '[ng-for][ng-for-of]', + properties: ['ngForOf'] + } + })); + + expect(doc2).toEqual(jasmine.objectContaining({ + id: '@angular/core/DecimalPipe', + name: 'DecimalPipe', + docType: 'pipe', + pipeOptions: { + name: 'number' + } + })); + }); +}); \ No newline at end of file diff --git a/tools/api-builder/docs-package/processors/extractDirectiveClasses.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.js deleted file mode 100644 index 91f83a06bd..0000000000 --- a/tools/api-builder/docs-package/processors/extractDirectiveClasses.js +++ /dev/null @@ -1,32 +0,0 @@ -var _ = require('lodash'); -var vm = require('vm'); - -module.exports = function extractDirectiveClassesProcessor() { - return { - $runAfter: ['processing-docs'], - $runBefore: ['docs-processed'], - decoratorTypes: ['Directive', 'Component', 'View'], - $process: function(docs) { - var decoratorTypes = this.decoratorTypes; - - _.forEach(docs, function(doc) { - - _.forEach(doc.decorators, function(decorator) { - - if (decoratorTypes.indexOf(decorator.name) !== -1) { - - // We use this sneaky vm trick to extract the object literal - // argument from the decorator's constructor call - var args = decorator.arguments ? - vm.runInNewContext('dummy = ' + decorator.arguments[0]) : {}; - - doc[decorator.name.toLowerCase() + 'Options'] = args; - doc.docType = 'directive'; - } - }); - }); - - return docs; - } - }; -}; diff --git a/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js deleted file mode 100644 index ed0c9ed959..0000000000 --- a/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -var mockPackage = require('../mocks/mockPackage'); -var Dgeni = require('dgeni'); - -describe('extractDirectiveClasses processor', function() { - var dgeni, injector, processor; - - beforeEach(function() { - dgeni = new Dgeni([mockPackage()]); - injector = dgeni.configureInjector(); - processor = injector.get('extractDirectiveClassesProcessor'); - }); - - it('should extract specified decorator arguments', function() { - var doc = { - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'class', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'] - } - ] - }; - - var docs = processor.$process([doc]); - - expect(doc).toEqual(jasmine.objectContaining({ - id: 'angular2/angular2.ngFor', - name: 'ngFor', - docType: 'directive', - decorators: [ - { - name: 'Directive', - arguments: ['{selector: \'[ng-for][ng-for-of]\', properties: [\'ngForOf\']}'] - } - ] - })); - - expect(doc.directiveOptions).toEqual({ - selector: '[ng-for][ng-for-of]', - properties: ['ngForOf'] - }); - }); -}); \ No newline at end of file diff --git a/tools/dart-api-builder/index.js b/tools/dart-api-builder/index.js index 0806209fa5..a84c786b6e 100644 --- a/tools/dart-api-builder/index.js +++ b/tools/dart-api-builder/index.js @@ -52,7 +52,7 @@ module.exports = new Package('dart-api-and-cheatsheet-builder', [basePackage, ta .config(function (convertPrivateClassesToInterfacesProcessor, createOverviewDump, - extractDirectiveClassesProcessor, + extractDecoratedClassesProcessor, extractJSDocCommentsProcessor, extractTitleFromGuides, generateNavigationDoc, @@ -62,7 +62,7 @@ module.exports = new Package('dart-api-and-cheatsheet-builder', [basePackage, ta // Clear out unwanted processors createOverviewDump.$enabled = false; convertPrivateClassesToInterfacesProcessor.$enabled = false; - extractDirectiveClassesProcessor.$enabled = false; + extractDecoratedClassesProcessor.$enabled = false; extractJSDocCommentsProcessor.$enabled = false; extractTitleFromGuides.$enabled = false; generateNavigationDoc.$enabled = false; From 13878efca75a5c45f07ca06d42f8e030dd6693c4 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 8 Sep 2016 23:09:55 +0100 Subject: [PATCH 22/25] api-builder: show metadata details on decorator docs --- .../templates/decorator.template.html | 28 ++++++++++++++++--- .../processors/mergeDecoratorDocs.js | 14 +++++++++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/decorator.template.html b/tools/api-builder/angular.io-package/templates/decorator.template.html index c055039527..1303ef9cd9 100644 --- a/tools/api-builder/angular.io-package/templates/decorator.template.html +++ b/tools/api-builder/angular.io-package/templates/decorator.template.html @@ -15,16 +15,36 @@ include {$ relativePath(doc.path, '_util-fns') $} div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") - h2(class="h2-api-docs") Variable Export + h2(class="h2-api-docs") Description div(class="code-links" flex="80" flex-xs="100") - pre.prettyprint.no-bg - code. - export {$ doc.name $}(options : {@link {$ doc.decoratorType $} {$ doc.decoratorType | escape $}}){$ params.returnType(doc.returnType) $} :marked {%- if not doc.notYetDocumented %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} {% endif %} +{% if doc.metadataDoc and doc.metadataDoc.members.length %} +div(layout="row" layout-xs="column" class="metadata" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Metadata Properties + div(class="code-links" flex="80" flex-xs="100") + {% for metadata in doc.metadataDoc.members %}{% if not metadata.internal %} + a(name="{$ metadata.name $}-anchor" class="anchor-offset") + pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ metadata.name $}') }") + code(class="api-doc-code"). + {$ metadata.name $}{$ params.paramList(metadata.parameters) | indent(8, false) | trim $}{$ params.returnType(metadata.returnType) $} + + :marked + {%- if not metadata.notYetDocumented %} +{$ metadata.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} + {% endif -%} + + {% if not loop.last %} + .hr(class="hr-margin") + {% endif %} + + {% endif %}{% endfor %} +{% endif %} + p.location-badge. exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ github.githubViewLink(doc) $} diff --git a/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js index dcde64b665..83c9d40d83 100644 --- a/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js +++ b/tools/api-builder/docs-package/processors/mergeDecoratorDocs.js @@ -6,7 +6,7 @@ module.exports = function mergeDecoratorDocs() { $runBefore: ['docs-processed'], docsToMergeInfo: [ { nameTemplate: _.template('${name}Decorator'), decoratorProperty: 'decoratorInterfaceDoc' }, - { nameTemplate: _.template('${name}Metadata'), decoratorProperty: 'metadataDoc' }, + { nameTemplate: _.template('${name}Metadata'), decoratorProperty: 'metadataDoc', useFields: ['howToUse', 'whatItDoes'] }, { nameTemplate: _.template('${name}MetadataType'), decoratorProperty: 'metadataInterfaceDoc' }, { nameTemplate: _.template('${name}MetadataFactory'), decoratorProperty: 'metadataFactoryDoc' } ], @@ -21,7 +21,10 @@ module.exports = function mergeDecoratorDocs() { var makeDecorator = getMakeDecoratorCall(doc); if (makeDecorator) { doc.docType = 'decorator'; + // get the type of the decorator metadata doc.decoratorType = makeDecorator.arguments[0].text; + // clear the symbol type named (e.g. ComponentMetadataFactory) since it is not needed + doc.symbolTypeName = undefined; // keep track of the docs that need to be merged into this decorator doc docsToMergeInfo.forEach(function(info) { @@ -35,13 +38,22 @@ module.exports = function mergeDecoratorDocs() { if (docsToMerge[doc.name]) { var decoratorDoc = docsToMerge[doc.name].decoratorDoc; var property = docsToMerge[doc.name].property; + var useFields = docsToMerge[doc.name].useFields; // attach this document to its decorator decoratorDoc[property] = doc; + // Copy over fields from the merged doc if specified + if (useFields) { + useFields.forEach(function(field) { + decoratorDoc[field] = doc[field]; + }); + } + // remove doc from its module doc's exports doc.moduleDoc.exports = doc.moduleDoc.exports.filter(function(exportDoc) { return exportDoc !== doc; }); + // remove from the overall list of docs to be rendered return false; } From 1e9c0724c273118880bb088a64e9d0cdfeab969b Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 9 Sep 2016 15:16:47 -0700 Subject: [PATCH 23/25] fix(api-builder): correctly import github and params helpers --- .../angular.io-package/templates/pipe.template.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/pipe.template.html b/tools/api-builder/angular.io-package/templates/pipe.template.html index 4e428b2b59..86db8582a2 100644 --- a/tools/api-builder/angular.io-package/templates/pipe.template.html +++ b/tools/api-builder/angular.io-package/templates/pipe.template.html @@ -1,5 +1,5 @@ -{% include "lib/githubLinks.html" -%} -{% include "lib/paramList.html" -%} +{% import "lib/githubLinks.html" as github -%} +{% import "lib/paramList.html" as params -%} {% extends 'layout/base.template.html' -%} {% block body %} @@ -24,6 +24,6 @@ div(layout="row" layout-xs="column" class="row-margin ng-cloak") p(class="location-badge"). exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} + defined in {$ github.githubViewLink(doc) $} -{% endblock %} \ No newline at end of file +{% endblock %} From 01b211193cdb02c716c85e910847d2aa35def2f0 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Fri, 9 Sep 2016 22:21:40 -0400 Subject: [PATCH 24/25] docs(browser-support): edits (#2299) --- .../docs/_examples/quickstart/ts/index.html | 4 +- public/docs/dart/latest/guide/_data.json | 5 + public/docs/js/latest/guide/_data.json | 5 + .../docs/ts/latest/guide/browser-support.jade | 137 ++++++++++-------- 4 files changed, 87 insertions(+), 64 deletions(-) diff --git a/public/docs/_examples/quickstart/ts/index.html b/public/docs/_examples/quickstart/ts/index.html index a0a64d1122..fef30ef98b 100644 --- a/public/docs/_examples/quickstart/ts/index.html +++ b/public/docs/_examples/quickstart/ts/index.html @@ -9,10 +9,10 @@ - + - + diff --git a/public/docs/dart/latest/guide/_data.json b/public/docs/dart/latest/guide/_data.json index 162d328233..8b9f230bd6 100644 --- a/public/docs/dart/latest/guide/_data.json +++ b/public/docs/dart/latest/guide/_data.json @@ -87,6 +87,11 @@ "intro": "Attribute directives attach behavior to elements." }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "Component Styles", "intro": "Learn how to apply CSS styles to components." diff --git a/public/docs/js/latest/guide/_data.json b/public/docs/js/latest/guide/_data.json index 42eede99f8..d687f38e3a 100644 --- a/public/docs/js/latest/guide/_data.json +++ b/public/docs/js/latest/guide/_data.json @@ -74,6 +74,11 @@ "intro": "Attribute directives attach behavior to elements." }, + "browser-support": { + "title": "Browser support", + "intro": "Browser support and polyfills guide." + }, + "component-styles": { "title": "Component Styles", "intro": "Learn how to apply CSS styles to components." diff --git a/public/docs/ts/latest/guide/browser-support.jade b/public/docs/ts/latest/guide/browser-support.jade index 0b8d9bcb7a..461aecc93c 100644 --- a/public/docs/ts/latest/guide/browser-support.jade +++ b/public/docs/ts/latest/guide/browser-support.jade @@ -1,3 +1,7 @@ +block includes + include ../_util-fns + - var _at_angular = '@angular' + :marked # Browser support # Angular supports most recent browsers. This includes the following specific versions: @@ -50,88 +54,105 @@ table td +.l-sub-section + :marked + Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request, + using SauceLabs and + Browserstack. + :marked - To ensure this compatibility, the unit tests of the framework are run on all of them for every pull request. - This is done as part of the continuous integration setup of the project, using [SauceLabs](https://saucelabs.com/) and [Browserstack](https://www.browserstack.com). - # Polyfills # Angular is built on the latest standards of the web platform. - Targeting such a wide range of browsers can be challenging as they may not support all the features of modern browsers. + Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers. - - To fill the gaps, the best solution is to use polyfills which "upgrade" old browsers by adding missing features. - For each browser, some polyfill may be required to run any application, and some may be needed only when some features are used. + You compensate by loading polyfill scripts ("polyfills") on the host web page (`index.html`) + that implement missing features in JavaScript. ++makeExample('quickstart/ts/index.html', 'polyfills')(format='.') +:marked + A particular browser may require at least one polyfill to run _any_ Angular application. + You may need additional polyfills for specific features. -.alert.is-helpful - span As a developer, depending on the browsers you target and on the features you use, you'll need to load a set of polyfills. - span The tables below will help you making the right choices. + The tables below will help you determine which polyfills to load, depending on the browsers you target and the features you use. -.alert.is-important - span The polyfills documented here are the ones which were identified to run full Angular application. - span Others may be needed if you decide to use extra features which are not supported everywhere. - span On top of that, they will not magically transform an old and slow browser into a modern and fast one. +.alert.is-important + :marked + The suggested polyfills are the ones we know will run full Angular applications. + You may need additional polyfills to support features not covered by this list. + Note that polyfills cannot magically transform an old, slow browser into a modern, fast one. :marked ## Mandatory polyfills ## - For each supported browser, these are the polyfills which are required to run an application: + These are the polyfills required to run an Angular application on each supported browser: table - tr + tr(style="vertical-align: top") th Browsers (desktop & mobile) th Polyfills required - tr + tr(style="vertical-align: top") td Chrome, Firefox, Edge, Safari 9+ td None - tr + tr(style="vertical-align: top") td Safari 7 & 8, IE10 & 11, Android 4.1+ - td ES6 - tr + td + :marked + [ES6](#core-es6) + tr(style="vertical-align: top") td IE9 - td ES6
classList - - + td + :marked + [ES6
classList](#classlist) + :marked ## Optional browser features to polyfill ## - In addition to the mandatory polyfills, some features of Angular may require some extra polyfills. + Some features of Angular may require additional polyfills. - For example, the animations use the standard web animation API, which is only available in Chrome and Firefox today. - In order to use this feature in other browsers, the correct polyfill is needed. + For example, the animations library relies on the standard web animation API, which is only available in Chrome and Firefox today. + You'll need a polyfill to use animations in other browsers. Here are the features which may require additional polyfills: table - tr + tr(style="vertical-align: top") th Feature th Polyfill - th Browsers (desktop & mobile) - tr + th(style="width: 50%") Browsers (desktop & mobile) + + tr(style="vertical-align: top") td a(href="./animations.html") Animations - td Web Animations + td + :marked + [Web Animations](#web-animations) td All but Chrome and Firefox
Not supported in IE9 - tr - td - a(href="../api/common/index/DatePipe-class.html") Date + tr(style="vertical-align: top") + td + a(href="../api/common/index/DatePipe-class.html" target="_blank") Date span , - a(href="../api/common/index/CurrencyPipe-class.html") currency + a(href="../api/common/index/CurrencyPipe-class.html" target="_blank") currency span , - a(href="../api/common/index/DecimalPipe-class.html") decimal + a(href="../api/common/index/DecimalPipe-class.html" target="_blank") decimal span and - a(href="../api/common/index/PercentPipe-class.html") percent + a(href="../api/common/index/PercentPipe-class.html" target="_blank") percent span pipes - td Intl API + td + :marked + [Intl API](#intl) td All but Chrome, Firefox, Edge and IE11 - tr + tr(style="vertical-align: top") td - a(href="../api/common/index/NgClass-directive.html") NgClass + a(href="../api/common/index/NgClass-directive.html" target="_blank") NgClass span on SVG elements - td classList + td + :marked + [classList](#classlist) td IE10, IE11 - tr + tr(style="vertical-align: top") td a(href="./server-communication.html") Http span when sending and receiving binary data - td Typed Arrays
Blob
FormData + td + :marked + [Typed Array](#typedarray)
[Blob](#blob)
[FormData](#formdata) td IE 9 :marked @@ -141,51 +162,43 @@ table table tr th Polyfill - th Library th Licence th Size* tr - td ES6 - td - a(href="https://github.com/zloirock/core-js") https://github.com/zloirock/core-js + td + a#core-es6(href="https://github.com/zloirock/core-js" target="_blank") ES6 td MIT td 27.4KB tr - td classList td - a(href="https://github.com/eligrey/classList.js") https://github.com/eligrey/classList.js + a#classlist(href="https://github.com/eligrey/classList.js" target="_blank") classList td Public domain td 1KB tr - td Intl td - a(href="https://github.com/andyearnshaw/Intl.js ") https://github.com/andyearnshaw/Intl.js + a#intl(href="https://github.com/andyearnshaw/Intl.js" target="_blank") Intl td MIT / Unicode licence td 13.5KB tr - td Web Animations - td - a(href="https://github.com/web-animations/web-animations-js") https://github.com/web-animations/web-animations-js + td + a#web-animations(href="https://github.com/web-animations/web-animations-js" target="_blank") Web Animations td Apache td 14.8KB tr - td Typed Arrays td - a(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js") https://github.com/inexorabletash/polyfill/blob/master/typedarray.js + a#typedarray(href="https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" target="_blank") Typed Array td MIT td 4KB tr - td Blob - td - a(href="https://github.com/eligrey/Blob.js") https://github.com/eligrey/Blob.js + td + a#blob(href="https://github.com/eligrey/Blob.js" target="_blank") Blob td MIT td 1.3KB tr - td FormData - td - a(href="https://github.com/francois2metz/html5-formdata") https://github.com/francois2metz/html5-formdata + td + a#formdata(href="https://github.com/francois2metz/html5-formdata" target="_blank") FormData td MIT td 0.4KB :marked - *Figures are for minified and gzipped code, computed with [http://closure-compiler.appspot.com/home](http://closure-compiler.appspot.com/home) + * Figures are for minified and gzipped code, computed with the closure compiler From 215733e3035587624de4d67a83878292615a6856 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 10 Sep 2016 03:23:25 +0100 Subject: [PATCH 25/25] chore: update to node 6 (#2301) --- .nvmrc | 2 +- .travis.yml | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.nvmrc b/.nvmrc index 7ed6ff82de..1e8b314962 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -5 +6 diff --git a/.travis.yml b/.travis.yml index 7a87796437..b30e5d12a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: trusty sudo: required language: node_js node_js: - - "5" + - "6" os: - linux env: diff --git a/package.json b/package.json index c56e0d3dbf..f8ece4dacf 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "gulp-tslint": "^5.0.0", "gulp-util": "^3.0.6", "gulp-watch": "^4.3.4", - "harp": "^0.20.3", + "harp": "0.21.0-pre.0", "html2jade": "^0.8.4", "indent-string": "^2.1.0", "jasmine-core": "^2.3.4",