Compare commits

...

457 Commits

Author SHA1 Message Date
davidlsharp1
dbbfab3ee8 docs: changing "struture" to "structure" (#29497)
PR Close #29497
2019-03-25 09:21:11 -07:00
George Kalpakas
b87ae8e5f9 ci: add .codefresh/ to the fw-dev-infra group (#29478)
PR Close #29478
2019-03-22 13:16:17 -07:00
Piotr Tomiak
8b1d28ff48 docs(core): close tags in example (#29474)
PR Close #29474
2019-03-22 13:15:04 -07:00
Michael Prentice
463e967abb docs: update developer guide for testing and IntelliJ (#29048)
provide the command for running all test suites
- don't make new contributors read the whole Bazel doc
add info about ClangFormatIJ plugin for IntelliJ
add info about Bazel plugin for IntelliJ
fix inconsistent casing of GitHub

PR Close #29048
2019-03-22 13:05:42 -07:00
Amadou Sall
71b8bbef95 docs: fix minor typo in testing.md (#29464)
PR Close #29464
2019-03-22 10:59:22 -07:00
Siddharth Ajmera
a2cf677714 docs: add Siddharth Ajmera to GDE resources (#28456)
PR Close #28456
2019-03-21 15:58:21 -07:00
Dave
9e1ce318a8 docs: add NG-DE 2019 to events page (#29079)
PR Close #29079
2019-03-21 15:55:17 -07:00
Alan Agius
a00c2a9210 docs: add app shell guide (#28591)
PR Close #28591
2019-03-21 15:54:27 -07:00
Cameron Steffen
a677d8b330 docs(core): indicate OnPush applies to children (#28320)
Indicate the OnPush change detection strategy applies to all child directives.
Resolves confusion from #12480.
PR Close #28320
2019-03-21 15:48:47 -07:00
Brandon
7fe89ba4ea docs: drop Coding Conventions section from style guide (#29331)
Closes #24153

PR Close #29331
2019-03-21 15:40:21 -07:00
Paul Gschwendtner
a8af83bf36 ci: disable sauce-connect ssl bumping (#29447)
By default we disable SSL bumping for all requests. This is because SSL
bumping is not needed for our test setup and in order to perform the SSL
bumping, Saucelabs intercepts all HTTP requests in the tunnel VM and modifies
them. This can cause flakiness as it makes all requests dependent on the SSL bumping
middleware.

See: https://wiki.saucelabs.com/display/DOCS/Troubleshooting+Sauce+Connect#TroubleshootingSauceConnect-DisablingSSLBumping

PR Close #29447
2019-03-21 22:18:19 +00:00
luixaviles
c75e16aae8 docs: add Luis Aviles to GDE resources (#29405)
PR Close #29405
2019-03-20 19:06:24 -04:00
Brandon
1affcc63c0 docs: add docs team to Angular Team section on collaborators page (#29396) (#29434)
PR Close #29396

PR Close #29434
2019-03-20 18:33:49 -04:00
Alex Eagle
34395aeea1 docs: update contributors.json on patch branch 2019-03-20 14:48:27 -07:00
Justin Schwartzenberger
f64de2e9f3 docs: add Justin Schwartzenberger to GDE page (#29430)
PR Close #29430
2019-03-20 16:14:04 -04:00
George Kalpakas
86ad77c1b1 ci: add devversion to fw-dev-infra (#29418)
PR Close #29418
2019-03-20 13:44:31 -04:00
Alex Eagle
d5c815f1f2 docs: add alexeagle to @angular/fw-global-approvers (#29287)
This is for large-scale refactorings

PR Close #29287
2019-03-20 13:43:23 -04:00
Alex Eagle
32c6d5313a Revert "build: add a nice Angular-themed color for the vscode status bar (#29407)" (#29419)
This reverts commit efcd6af17d360d26accca7a3af5233d1696dcd7b.
Engineers on the team thought that the red color means something is
broken.
See slack discussion in #general

PR Close #29419
2019-03-20 13:31:28 -04:00
Matias Niemelä
388c1a3638 release: cut the v7.2.10 release 2019-03-19 17:46:29 -07:00
Matias Niemelä
334a3ba125 build: add a nice Angular-themed color for the vscode status bar (#29407)
PR Close #29407
2019-03-19 18:09:35 -04:00
Kapunahele Wong
fd1d161844 docs: edit $any() section and add example in Template Syntax (#28157)
PR Close #28157
2019-03-19 13:19:18 -04:00
Rob Gregorius
280ea13342 docs(core): fix typo in NgModule imports example description (#29272)
PR Close #29272
2019-03-19 13:11:35 -04:00
John Reese
3b1e539bab docs(forms): fix small typo in forms documentation (#29370)
PR Close #29370
2019-03-19 13:11:11 -04:00
Robert Tyree
8e57965e3c docs: fix typo in section introduction (#29394)
PR Close #29394
2019-03-19 13:09:08 -04:00
George Kalpakas
761bb0aafd ci: add .vscode/** to the @angular/fw-dev-infra group (#29302)
PR Close #29302
2019-03-19 02:46:36 -04:00
George Kalpakas
1b881b6ba2 build: add aio/src/generated/ to ignored files lists in settings.json (#29302)
PR Close #29302
2019-03-19 02:46:36 -04:00
Paul Gschwendtner
f03d724fea build: re-add bazel symlink prefix in patch branch (#29312)
Recently the bazelrc configuration in the patch branch
has been accidentally overwritten. In order to keep
patch and master in sync, we need to revert that small
change in the patch branch.

PR Close #29312
2019-03-18 17:38:15 -04:00
Paul Gschwendtner
cf8d934ba9 fix(compiler-cli): incorrect metadata bundle for multiple unnamed re-exports (#29360)
Currently if an Angular library has multiple unnamed module re-exports, NGC will
generate incorrect metdata if the project is using the flat-module bundle option.

e.g.

_public-api.ts_
```ts
export * from '@mypkg/secondary1';
export * from '@mypkg/secondary2';
```

There are clearly two unnamed re-exports in the `public-api.ts` file. NGC right now
accidentally overwrites all previous re-exports with the last one. Resulting in the
generated metadata only containing a reference to `@mypkg/secondary2`.

This is problematic as it is common for primary library entry-points to have
multiple re-exports (e.g. Material re-exporting all public symbols; or flex-layout
exporting all public symbols from their secondary entry-points).

Currently Angular Material works around this issue by manually creating
a metadata file that declares the re-exports from all unnamed re-exports.

(see: https://github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85)

This workaround works fine currently, but is no longer easily integrated when
building the package output with Bazel. In order to be able to build such
libraries with Bazel (Material/flex-layout), we need to make sure that NGC
generates the proper flat-module metadata bundle.

PR Close #29360
2019-03-18 15:08:43 -04:00
Eduard
67f4852acb docs: fix a typo in creating libraries guide (#29154)
PR Close #29154
2019-03-15 12:43:16 -04:00
zackarychapple
08f6a64893 docs: updating url for jsonp reference (#29247)
PR Close #29247
2019-03-15 12:41:38 -04:00
Pete Bacon Darwin
ee49bbebc7 build(docs-infra): update AIO dependencies within their current ranges (#29316)
PR Close #29316
2019-03-14 18:32:10 -04:00
Brandon Roberts
da78b02d71 docs: clarify commands to integrate routing (#26530)
PR Close #26530
2019-03-14 18:26:53 -04:00
Michael Prentice
d787925841 docs: update developer guide for use with yarn (#29044)
remove reference to npm
remove confusing optional comments and $(yarn bin) with missing /
remove reference to protractor commands which don't exist
provide yarn commands which don't require gulp installed globally

PR Close #29044
2019-03-14 17:20:58 -04:00
Jason Aden
4e6efb361d docs: remove 'PR target: review' label (#29227)
We have switched to using Github's `Review` feature to request and track if a PR needs review. Therefore this label can be removed.

PR Close #29227
2019-03-14 17:04:57 -04:00
George Kalpakas
aa371335dc docs: unify comp: upgrade/{dynamic,static} labels as comp: upgrade (#29276)
PR Close #29276
2019-03-14 16:58:53 -04:00
Brandon
090b6d92da docs: remove configuration instructions at the top of the i18n guide (#29313)
The instructions lead you to think you run this step before setting
up your locale. The command is mentioned further in the guide after
setup is complete.

Closes #26052

PR Close #29313
2019-03-14 16:58:03 -04:00
Brandon
a5cbfa2aab docs: backport fix to event-binding example for production build (#28423)
Examples are run in production mode and the methods weren't optional.

PR Close #28423
2019-03-14 16:56:13 -04:00
Sarun Intaralawan
e8ed37a0e7 docs(core): deprecate ViewEncapsulation.Native (#26361) (#28423)
PR Close #26361

PR Close #28423
2019-03-14 16:56:13 -04:00
Kayce Basques
e5cbebef0d docs: make the styles section less ambiguous (#26092) (#28423)
PR Close #26092

PR Close #28423
2019-03-14 16:56:13 -04:00
Tomas Veras
654ec1570a docs: add missing type when handling errors in hero service. (#28256) (#28423)
PR Close #28256

PR Close #28423
2019-03-14 16:56:13 -04:00
Stepan Suvorov
728d903a67 docs: fix explanation of Injectable decorator in architecture guide (#27480) (#28423)
PR Close #27480

PR Close #28423
2019-03-14 16:56:13 -04:00
ericksoen
495f8e1bc6 docs: correct minor typo (#27382) (#28423)
PR Close #27382

PR Close #28423
2019-03-14 16:56:13 -04:00
Hamza TEI
d778a65447 docs: update link to post on redirects in router guide (#27256) (#28423)
Change victor savkin's url post on redirects to:
http://vsavkin.tumblr.com/post/146722301646/angular-router-empty-paths-componentless-routes

PR Close #27256

PR Close #28423
2019-03-14 16:56:13 -04:00
Giorgos Bamparopoulos
e8dbba417d docs: rename "internal" access modifier to "protected" (#26627) (#28423)
PR Close #26627

PR Close #28423
2019-03-14 16:56:13 -04:00
Kapunahele Wong
00c145f14c docs: rewrite event binding section and add example (#26162) (#28423)
PR Close #26162

PR Close #28423
2019-03-14 16:56:13 -04:00
Brandon
8c4c9858a2 docs: fix redirect with secondary outlet in router guide example (#29267)
The URL wasn't be parsed into a UrlTree, so redirecting with a
secondary route went to a 404

Closes #28805

PR Close #29267
2019-03-14 10:51:53 -04:00
George Kalpakas
caf3a53385 build(docs-infra): automatically create previews for members of aio-auto-previews (#29293)
PR Close #29293
2019-03-14 10:51:20 -04:00
Greg Magolan
6ba1cd4365 build(bazel): fix tsconfig extends for //packages/bazel/test/protractor-2:ts_spec (#29280)
PR Close #29280
2019-03-13 10:39:22 -07:00
Paul Gschwendtner
bb18cba253 build: user bazelrc should be able to overwrite existing flags (#29279)
Currently the project `bazelrc` file imports a user bazelrc if present. This
has been added in order to allow user-specific Bazel configuration settings
when working within the Angular project. Since we currently import that
user configuration before setting the project-specific settings, it's not
possible for developers to overwrite given options (e.g. the `symlink_prefix`).

Moving the import to the end of the file solves that problem.

PR Close #29279
2019-03-13 10:38:59 -07:00
Kara Erickson
5abb9360d8 release: cut the v7.2.9 release 2019-03-12 16:36:45 -07:00
Paul Gschwendtner
16c59aecf1 ci: run legacy saucelabs for every build (#29270)
Recently we moved the Saucelabs job into a cronjob in order to avoid
heavy flakiness that we experienced due to a Saucelabs connect bug
that has been supposedly fixed by the Saucelabs team (no new version
is released yet though).

Our initial assumption was that we very rarely hit specific browser failures
and can therefore move the Saucelabs tests into a cronjob, but after some
days of having the cronjob, we realized that we actually hit browser-specific
failures quite often and that we should run the tests for every PR (like before)

PR Close #29270
2019-03-12 14:54:42 -07:00
Paul Gschwendtner
47d1216f6b ci(docs-infra): run cli docs examples concurrently (#29261)
PR Close #29261
2019-03-12 12:22:28 -07:00
Paul Gschwendtner
5e614bfda8 build(docs-infra): support running cli docs examples concurrently (#29261)
PR Close #29261
2019-03-12 12:22:28 -07:00
Brandon
efecf36eb5 docs: fix failing specs in testing example (#29256)
The tests that need the actuallyDone flag are grouped together

PR Close #29256
2019-03-12 11:58:30 -07:00
Filipe Silva
b68d29791f ci: rebase PRs on target branch (#29215)
PR Close #29215
2019-03-12 11:35:00 -07:00
Filipe Silva
136cd097c8 ci: add descriptive message for merge conflicts (#29215)
Fix #29199

PR Close #29215
2019-03-12 11:34:59 -07:00
WilliamKoza
7be198a8e3 docs: change the file name of the public API according with Angular CLI (#29200)
PR Close #29200
2019-03-12 11:17:24 -07:00
Riley Littlefield
b4ee74667b docs: fix typo in directive decorator description (#29207)
PR Close #29207
2019-03-12 10:51:13 -07:00
Ivan Tham
67444e70ab docs: update enableIvy link (#29238)
PR Close #29238
2019-03-12 10:35:00 -07:00
Sam Julien
09e55eabf3 docs: add Sam Julien to GDE group (#29190)
PR Close #29190
2019-03-12 10:34:31 -07:00
Adam Plumer
1c838eb976 docs: update Universal guide (#28956)
PR Close #28956
2019-03-11 15:33:23 -07:00
Patrick Roche
24ec9e57ad docs: add ending slash to input in TOH pt1 and pt2 examples (#29176)
PR Close #29176
2019-03-08 09:33:58 -08:00
Judy Bogart
190330a612 docs: clarify intro and examples (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
Judy Bogart
9417086f6c docs: add publicapi flag (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
Judy Bogart
535ff0564a docs: route interface and types doc example (#29012)
PR Close #29012
2019-03-07 15:34:30 -08:00
George Kalpakas
e8c8ec7075 test(docs-infra): add script for verifying all guides/examples/images have owners (#29172)
It is useful for manually checking that all guides/examples/images have
owners in `.github/CODEOWNERS`, but is not used for automatic
verification (e.g. on CI) for now.

PR Close #29172
2019-03-07 14:03:36 -08:00
George Kalpakas
03d2813c20 docs: remove unused examples and images (#29172)
PR Close #29172
2019-03-07 14:03:36 -08:00
George Kalpakas
fb5b2a89cd docs: add missing guides, examples, images to CODEOWNERS (#29172)
PR Close #29172
2019-03-07 14:03:36 -08:00
Greg Magolan
ea495d958f build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#29063)
* removed /tools/http_server and uses http_server from rules_nodejs
* updated bazel schematics to use angular bundles

PR Close #29063
2019-03-07 08:57:24 -08:00
tomastrajan
2edb87e7f8 docs: add tomas trajan to GDE resources (#29116)
PR Close #29116
2019-03-07 07:30:09 -08:00
Andrew Kushnir
903d28fe86 release: cut the v7.2.8 release 2019-03-06 09:58:26 -08:00
Paul Gschwendtner
6945f7978e build(docs-infra): ivy prebuild script should not run ngcc for all formats (#29122)
Currently when building AIO with Ivy, we run Ngcc and transform
all found formats. This potentially slows down the build (and
therefore the "test_aio_local_ivy" job). Since it's not necessary
to build all formats, and we only need "fesm5" and "fesm2015",
we can explicitly specify the required formats.

**Note**: Currently this does not have any big effect, because Angular
Material does not ship ES2015/ES5 files. The change primarily just
suppresses the Ngcc messages for Material not providing ES2015/ES5
entry-points.

Technically if new non-Ivy packages are added to AIO, this
speeds up the build as we don't build the unused formats.

PR Close #29122
2019-03-05 16:11:05 -08:00
Paul Gschwendtner
27afe01910 ci(docs-infra): "test_aio_local_ivy" job should attach ivy package output (#29122)
Currently the "test_docs_examples_ivy" job attaches
the legacy package output, while we can also attach
the Ivy NPM package output. We don't need Ngcc to downlevel
the Angular packages in order to build AIO with Ivy.

PR Close #29122
2019-03-05 16:11:05 -08:00
George Kalpakas
36b6110e7d docs: order upcoming events in chronological order (#29115)
Related to https://github.com/angular/angular/pull/29095#issuecomment-469386472.

PR Close #29115
2019-03-05 09:51:10 -08:00
WilliamKoza
24a1e146da refactor(language-service): clean up imports language-service and misspellings in public API (#29097)
PR Close #29097
2019-03-05 09:46:47 -08:00
José Toledo Navarro
2256920292 docs(router): align examples in interfaces docs (#29093)
* Use exclusively `TeamComponent` class for examples, as currently there are at least 3 different component classes being used, one of which is actually as a type argument for a `Resolve<T>` implementation.
PR Close #29093
2019-03-05 09:45:53 -08:00
Maxim Mazurok
2a25ac2ac9 fix(router): removed obsolete TODO comment (#29085)
PR Close #29085
2019-03-05 09:44:41 -08:00
George Kalpakas
56693339c2 fix(service-worker): detect new version even if files are identical to an old one (#26006)
Previously, if an app version contained the same files as an older
version (e.g. making a change, then rolling it back), the SW would not
detect it as the latest version (and update clients).

This commit fixes it by adding a `timestamp` field in `ngsw.json`, which
makes each build unique (with sufficiently high probability).

Fixes #24338

PR Close #26006
2019-03-05 09:41:45 -08:00
Judy Bogart
c976b88dcf docs: fix and add decorator api doc (#28986) (#29112)
PR Close #28986

PR Close #29112
2019-03-04 17:51:42 -08:00
Paul Gschwendtner
3e08794abf ci: print sauce-connect log output on timeout (#29105)
Currently when `sauce-connect` times out after 2min, we just
print a message saying that the SauceLabs tunnel didn't establish
within 2min. In order to make debugging easier, we now print the
full log file output on failure.

PR Close #29105
2019-03-04 13:37:41 -08:00
George Kalpakas
b598e884f6 fix(service-worker): ignore passive mixed content requests (#25994)
Although [passive mixed content][1] requests (like images) only produce
a warning without a ServiceWorker, fetching it via a ServiceWorker
results in an error. See
https://github.com/angular/angular/issues/23012#issuecomment-376430187
for more details.

This commit makes the ServiceWorker ignore such requests and let them be
handled by the browser directly to avoid breaking apps that would work
without the ServiceWorker.

[1]: https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content#passive_mixed_content

Fixes #23012

PR Close #25994
2019-03-04 11:51:06 -08:00
Pete Bacon Darwin
cf916a03d3 docs(core): tidy up the description of resolveComponentResources() (#28055) (#28736)
There were a number of typos and some of the sentences did not
read well.

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Pete Bacon Darwin
ee6498f37e refactor(compiler): remove unnecessary ! operators from lexer (#28055) (#28736)
When we added the strict null checks, the lexer had some `!`
operators added to prevent the compilation from failing.

This commit resolves this problem correctly and removes the
hacks.

Also the comment

```
// Note: this is always lowercase!
```

has been removed as it is no longer true.

See #24571

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Pete Bacon Darwin
1a0b2ff4fb refactor(compiler): use options argument for parsers (#28055) (#28736)
This commit consolidates the options that can modify the
parsing of text (e.g. HTML, Angular templates, CSS, i18n)
into an AST for further processing into a single `options`
hash.

This makes the code cleaner and more readable, but also
enables us to support further options to parsing without
triggering wide ranging changes to code that should not
be affected by these new options.  Specifically, it will let
us pass information about the placement of a template
that is being parsed in its containing file, which is essential
for accurate SourceMap processing.

PR Close #28055

PR Close #28736
2019-03-04 10:36:27 -08:00
Amadou Sall
dfb331cd18 docs: fix minor typo (#29100)
tradition -> traditional
PR Close #29100
2019-03-04 10:15:38 -08:00
Pete Bacon Darwin
11c926ce47 docs: add AngularConnect announcement for after ng-conf (#29096)
PR Close #29096
2019-03-04 10:14:42 -08:00
Pete Bacon Darwin
a0119b1144 docs(docs-infra): update where we are presenting (#29095)
PR Close #29095
2019-03-04 10:13:54 -08:00
Alex Eagle
c938fb4619 build: update to bazel 0.23 2019-03-01 15:40:50 -08:00
Matias Niemelä
2f49a23d64 test(animations): fix unit-based delays within the animation DSL (#28993)
Closes #24291

PR Close #28993
2019-03-01 15:16:49 -08:00
Alan Agius
c6eaaf5b3d docs: add how to create a minimal repo in bug report template (#29022)
PR Close #29022
2019-03-01 10:15:30 -08:00
Paul Gschwendtner
5e38ec8acc ci(docs-infra): disable failing ivy jit systemjs examples (#29046)
As a side effect of 09b34bae8655d4251516655c317b150c46cd3653,
we fixed that the docs systemjs examples currently do not run
with Ivy in JIT mode. This now uncovered new failures with the JIT
resource loading. e.g.

```
zone.js:665 Unhandled Promise rejection: Component 'PhoneListComponent' is not resolved:
 - templateUrl: ./phone-list.template.html
Did you run and wait for 'resolveComponentResources()'? ; Zone: <root> ; Task: Promise.then ; Value: Error: Component 'PhoneListComponent' is not resolved:
 - templateUrl: ./phone-list.template.html
Did you run and wait for 'resolveComponentResources()'?
    at Function.get (directive.ts:54)
    at getComponentDef (definition.ts:648)
    at verifyDeclarationsHaveDefinitions (module.ts:185)
    at Array.forEach (<anonymous>)
    at verifySemanticsOfNgModuleDef (module.ts:159)
    at Function.get (module.ts:132)
    at getInjectorDef (defs.ts:181)
    at R3Injector.processInjectorType (r3_injector.ts:230)
    at eval (r3_injector.ts:114)
    at eval (r3_injector.ts:451) Error: Component 'PhoneListComponent' is not resolved:
```

We temporarily disable these two failing SystemJS examples by adding them to the
`fixmeIvyExamples` list.

PR Close #29046
2019-02-28 17:08:52 -08:00
Paul Gschwendtner
0cd5964f67 ci: increase parallelism for "test_docs_examples" jobs (#29046)
Currently the docs example tests (`test_docs_examples_ivy`
and `test_docs_examples`) are the culprits for a slow-down
in our overall CI turnaround. We need to increase parallelism
in order to make our CI turnaround more _acceptable_. This is
temporary and the long-term goal is to move these tests to Bazel
with remote build execution.

References #28940

PR Close #29046
2019-02-28 17:08:52 -08:00
Paul Gschwendtner
f3938a6a2b ci: "test_docs_examples_ivy" should attach ivy package output (#29046)
Currently the "test_docs_examples_ivy" job attaches
the legacy package output, while we can also attach
the Ivy NPM package output. We don't need Ngcc to downlevel
the Angular packages in order to run the docs examples with Ivy.

PR Close #29046
2019-02-28 17:08:52 -08:00
Paul Gschwendtner
3baa74449c build(docs-infra): examples should not run ngcc for all formats (#29046)
Currently when adding the example boilerplate to all
examples with Ivy enabled, we run Ngcc and transform
all found formats. This potentially slows down the build and
is not necessary as we only need the "fesm5" and "fesm2015" bundles.

PR Close #29046
2019-02-28 17:08:52 -08:00
Paul Gschwendtner
df4e97c81e build: remove accidentally pushed bazel-out symlink (#29046)
https://github.com/angular/angular/pull/29019 accidentally
committed/pushed the bazel-out symlink. This removes the symlink
git "marker" from the patch branch.

PR Close #29046
2019-02-28 17:08:52 -08:00
Greg Magolan
d629f2c6a8 build(bazel): revert back to non-vendored yarn in node_repositories() (#29034)
Resolves Windows issue https://github.com/bazelbuild/rules_nodejs/issues/588

PR Close #29034
2019-02-28 10:52:24 -08:00
George Kalpakas
6ee47d5e76 ci: speed up publish_artifacts CircleCI job for PRs (#29028)
PR Close #29028
2019-02-28 10:39:19 -08:00
Wassim Chegham
9226b421e8 style: enforce buildifier lint rules (#29019)
PR Close #29019
2019-02-28 02:57:35 -08:00
Rado Kirov
b06847f43d refactor: Consistently use index access on index signature types. (#28937)
This change helps highlight certain misoptimizations with Closure
compiler. It is also stylistically preferable to consistently use index
access on index sig types.

Roughly, when one sees '.foo' they know it is always checked for typos
in the prop name by the type system (unless 'any'), while "['foo']" is
always not.

Once all angular repos are conforming this will become a tsetse.info
check, enforced by bazel.

PR Close #28937
2019-02-28 02:52:19 -08:00
George Kalpakas
a54a752147 build: add VSCode extension recommendations (#28784)
Previously, the VSCode settings for the workspace specified the
`clang-format.executable` setting to configure auto-formatting to use
`clang-format`. Yet, this setting has no effect without the extension
that provides that configuration option namely [xaver.clang-format][1]).
For people that didn't have the extension installed, VSCode would use
the default formatters, resulting in vastly different file fomatting.

This commit adds a set of [rcommended workspace extensions][2], to help
people get the right extensions when checking out the repository.

The recommended extensions are:
- [gkalpak.aio-docs-utils][3]:
  Utilities to aid in authoring/viewing Angular documentation source
  code. Currently, mainly aid in working with
  `{@example}`/`<code-example>` tags.
- [ms-vscode.vscode-typescript-tslint-plugin][4]:
  Add auto-linting for TS files using `tslint` while editing.
- [xaver.clang-format][1]:
  Add auto-formatting for JS/TS files using `clang-format`.

[1]: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
[2]: http://go.microsoft.com/fwlink/?LinkId=827846
[3]: https://marketplace.visualstudio.com/items?itemName=gkalpak.aio-docs-utils
[4]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin

PR Close #28784
2019-02-28 02:47:21 -08:00
George Kalpakas
d00a2e8920 build: update VSCode settings to limit auto-formatting on save to JS/TS files (#28784)
Previously, auto-formatting on save was enabled for all file types,
which meant also using default VSCode formatting settings for files
where this was not desirable - for example HTML files (such as
angular.io and docs examples templates) and JSON files (such as Firebase
configurations).
This was problematic for the following reasons:
- Unlike with JS/TS files, the formatting of other file types is not
  checked/enforced on CI.
- Formatting is subject to default VSCode settings and everyone's local
  VSCode settings overrides.
- Especially for docs examples files, changing the layout might require
  updating the wording in corresponding guides (e.g. when referring to
  line-numbers).

If we decide that we do want to lint those other file types as well
(which sounds like a good idea), we should do it in a way that ensures
consistent formatting and check the formatting on CI.

PR Close #28784
2019-02-28 02:47:15 -08:00
Matias Niemelä
86981b395d fix(animations): ensure position and display styles are handled outside of keyframes/web-animations (#28911)
When web-animations and/or CSS keyframes are used for animations certain
CSS style values (such as `display` and `position`) may be ignored by a
keyframe-based animation. Angular should special-case these styles to
ensure that they get applied as inline styles throughout the duration of
the animation.

Closes #24923
Closes #25635

Jira Issue: FW-1091
Jira Issue: FW-1092

PR Close #28911
2019-02-27 11:57:31 -08:00
Greg Magolan
feec963106 style: format (#28995)
PR Close #28995
2019-02-27 08:47:27 -08:00
Greg Magolan
09fc669b4f build(bazel): allow a user to control a subset of angularCompilerOption in their tsconfig file when using ng_module (#28995)
PR Close #28995
2019-02-27 08:47:27 -08:00
Ben Lesh
cb339b87f3 release: cut the v7.2.7 release 2019-02-26 16:20:57 -08:00
George Kalpakas
fdcf877f83 fix(core): traverse and sanitize content of unsafe elements (#28804)
In the past, the sanitizer would remove unsafe elements, but still
traverse and sanitize (and potentially preserve) their content. This was
problematic in the case of `<style></style>` tags, whose content would
be converted to HTML text nodes.

In order to fix this, the sanitizer's behavior was changed in #25879 to
ignore the content of _all_ unsafe elements. While this fixed the
problem with `<style></style>` tags, it unnecessarily removed the
contents for _any_ unsafe element. This was an unneeded breaking change.

This commit partially restores the old sanitizer behavior (namely
traversing content of unsafe elements), but introduces a list of
elements whose content should not be traversed if the elements
themselves are considered unsafe. Currently, this list contains `style`,
`script` and `template`.

Related to #25879 and #26007.

Fixes #28427

PR Close #28804
2019-02-26 13:32:10 -08:00
Filipe Silva
5b5b9897c9 ci: add workspace prereq job to saucelabs_tests (#28973)
Port of https://github.com/angular/angular/pull/28939, followup to https://github.com/angular/angular/pull/28965.

PR Close #28973
2019-02-26 08:40:44 -08:00
George Kalpakas
0e7365724e docs: re-phrase note in architecture guide for clarity (#28543)
PR Close #28543
2019-02-26 08:39:17 -08:00
Author Name
4ef1a3cd97 docs: add Leonardo Zizzamia to GDE resources (#25935)
PR Close #25935
2019-02-25 14:07:56 -08:00
Nikita Poltoratsky
38b5ed05ea docs: add Nebular to UI Components section in resources (#28838)
PR Close #28838
2019-02-25 12:54:58 -08:00
nchetankumar
642c015f23 docs: modify the descendant spelling and remove multiple times parent's word (#27886)
PR Close #27886
2019-02-25 12:54:29 -08:00
Brandon
0977d95802 docs(core): export the ...Decorator interfaces to ensure they are documented (#28836) (#28961)
If an interface is not exported publicly from its package, then the doc-gen
does not see it, and so cannot include it in the generated documentation.

This was the case for a number of `...Decorator` interfaces, such as
`PipeDecorator` and `InputDecorator.

This commit adds these interfaces to the public export to fix this problem.

PR Close #28836

PR Close #28961
2019-02-25 12:53:50 -08:00
Filipe Silva
d374787db6 ci: add bazel_repository_cache to CircleCI workspace (#28935) (#28965)
PR Close #28935

PR Close #28965
2019-02-25 10:24:34 -08:00
Filipe Silva
a634deb885 ci: rename install job to setup (#28935) (#28965)
Followup to https://github.com/angular/angular/pull/28928#pullrequestreview-207023800

PR Close #28935

PR Close #28965
2019-02-25 10:24:34 -08:00
Filipe Silva
bcbd7ed8f0 ci: share data between jobs using workspaces (#28928) (#28965)
PR Close #28928

PR Close #28965
2019-02-25 10:24:34 -08:00
Mikhail Tatsky
f7de2be3f3 docs: add FancyGrid to resources page (#28949)
PR Close #28949
2019-02-25 10:23:34 -08:00
Camille Roux
1e97d511c7 docs: add Human Coders trainings in resources.json (#28840)
PR Close #28840
2019-02-25 10:23:01 -08:00
softchris
7e1e00c21e docs: add ngVikings 2019 to events page (#28501)
PR Close #28501
2019-02-25 10:22:28 -08:00
Rick Katka
481f4b7412 docs: Updated TOH Heros documentation (#28347)
Updated the TOH Heros documentation to specify that the ng cli now generates 4 files
PR Close #28347
2019-02-25 10:21:45 -08:00
Sarun Intaralawan
4bc0084e5a docs(router): reword relativeLinkResolution docs to not mention version numbers (#26991)
PR Close #26991
2019-02-22 14:35:55 -08:00
Greg Magolan
b6864494a1 fix(bazel): pin browser repositories using @npm_bazel_karma//:browser_repositories.bzl in bazel schematics (#28896)
PR Close #28896
2019-02-22 12:19:00 -08:00
Greg Magolan
0021437ee1 build: fixes (#28896)
PR Close #28896
2019-02-22 12:19:00 -08:00
Greg Magolan
d91ecd2c8b build: update to rules_typescript 0.25.1 (#28896)
* build_bazel_rules_typescript renamed to npm_bazel_typescript
* build_bazel_rules_karma renamed to npm_bazel_karma
* browser_repositories.bzl removed and now using @npm_bazel_karma//:browser_repositories.bzl
* includes some fixes for future ts_library devmode es2015 support but some failure still remain when devmode is es2015 so this PR keeps it as es5 using the bazelOptions.devmodeTargetOverride tsconfig setting

PR Close #28896
2019-02-22 12:18:59 -08:00
Keen Yee Liau
d0018e6bf6 fix(language-service): Fix completions for input/output with alias (#28904)
This PR fixes a bug in autocompletion for @Input/@Output decorator with
an alias. The current implementation ignores the alias.

Credit for this work is attributed to @edgardmessias
The original work fixed the bug, but was lacking test.

PR Close #27959

PR Close #28904
2019-02-22 12:02:18 -08:00
Oscar Busk
587ca854cc docs: clarify documentation about listening to progress events (#28892)
PR Close #28892
2019-02-22 10:50:43 -08:00
Paul Gschwendtner
8b9f03d9fa ci: run saucelabs legacy tests every hour (#28903)
Initially when we introduced the cronjob for Saucelabs,
we specified that the tests should run every 4h. Since the
caretaker needs more recent results when merging PRs
or before creating a release, we should run the saucelabs
tests every hour. This still ensures that PRs are not
affected by Saucelabs flakiness or incidents, and
the caretaker can also react better to real browser
failures (and isn't blocked on a 4h time frame)

PR Close #28903
2019-02-22 09:52:06 -08:00
Daniel Ruf
40f1f94fe0 refactor: remove unused and duplicate CSS properties from styleguide examples (#28252)
PR Close #28252
2019-02-22 09:51:36 -08:00
Jeferson Duwe
2270467d60 docs: fix ngSwitch example (#28899)
docs: fix ngSwitch example

remove the predix "app-" from the confuse emotion ngSwitchCase.
PR Close #28899
2019-02-22 08:54:00 -08:00
Igor Minar
8efda5b353 feat(docs-infra): add meta[name]=Description to angular.io's index.html (#28916)
This change makes angular.io more user and SEO friendly according to web.dev.

See: https://web.dev/discoverable/write-descriptive-text

PR Close #28916
2019-02-21 23:27:29 -08:00
Igor Minar
7b7f2d9c1b fix(docs-infra): add [lang] attribute to index.html of angular.io (#28916)
It's the right thing to do, and improves accessiblity.

See: https://dequeuniversity.com/rules/axe/3.1/html-has-lang?application=lighthouse

PR Close #28916
2019-02-21 23:27:28 -08:00
Igor Minar
c469e25cf2 fix(docs-infra): set the default html title to 'Angular' (#28916)
This removes the annoying flicker while the app is loading.

Also: it's just Angular.

PR Close #28916
2019-02-21 23:27:28 -08:00
Igor Minar
a21cde2960 style(docs-infra): reformat using vscode html formatter (#28916)
Makes it easier to keep on editing and reformatting the file.

PR Close #28916
2019-02-21 23:27:28 -08:00
Filipe Silva
9b774348b3 ci: update circleci post checkout to v2 syntax (#28472)
The `post` key is part of the CircleCI 1.0 syntax is not available in the 2.0 syntax.

PR Close #28472
2019-02-21 22:18:22 -08:00
Vani
ce219ccfa2 docs(common): update docs for HttpClient methods (#26143)
PR Close #26143
2019-02-21 20:56:13 -08:00
Greg Magolan
53bbb01047 build(bazel): cleanup the jasmine bootstrap code (#28906)
PR Close #28906
2019-02-21 17:59:18 -08:00
Greg Magolan
c6741bf36a build: no //package/bazel/src/api-extractor on the patch branch (#28901)
PR Close #28901
2019-02-21 17:54:04 -08:00
Alex Eagle
cc06bf50f3 build: Add .bzl/BUILD files to @angular/bazel package (#28901)
It's now possible to use it as a hybrid package in latest rules_nodejs, so no WORKSPACE dep is needed

PR Close #28901
2019-02-21 17:53:56 -08:00
Greg Magolan
21e78ad022 build: no //package/bazel/src/api-extractor on the patch branch (#28901)
PR Close #28901
2019-02-21 16:34:37 -08:00
Alex Eagle
05e855092b build: Add .bzl/BUILD files to @angular/bazel package (#28901)
It's now possible to use it as a hybrid package in latest rules_nodejs, so no WORKSPACE dep is needed

PR Close #28901
2019-02-21 16:34:37 -08:00
George Kalpakas
2817764433 ci: make yarn globally available and independent of $BASH_ENV (#28889)
Previously, our yarn (which overwrote the pre-installed yarn on the
docker image) was only available through `$BASH_ENV` (as an exported
function). This caused it to be undefined for commands executed in other
shells (e.g. via Node.js' `child_process.spawn()` unless explicitly
configuring it to run with `bash`).

This commit fixes this by making our yarn version available globally via
a symlink (`/usr/local/bin/yarn`).

(This was accidentally broken in #28839.)

PR Close #28889
2019-02-21 12:37:53 -08:00
Kapunahele Wong
145639d0f8 docs: edit resources description (#28764)
PR Close #28764
2019-02-21 12:34:06 -08:00
Greg Magolan
3eb327b67b build(bazel): do not build rxjs from source under Bazel (#28869)
PR Close #28869
2019-02-21 08:05:25 -08:00
Paul Gschwendtner
be6af26dc1 ci: run saucelabs unit tests as cronjob (#28787)
We no longer want to run Saucelabs for every PR/commit because
Saucelabs has been very flaky recently and it blocks most of the
PRs with a flaky failing state that we cannot fix most of the time due
to upstream Saucelabs failures/incidents. Since real browsers tests
rarely catch browser-specific failures (same as in Material), we should
only run Saucelabs in a cronjob on the upstream branches. This still
ensures/guarantees our browser compatibility, but makes our CI
more stable and the PR workflow more productive.

PR Close #28787
2019-02-20 16:47:31 -08:00
Paul Gschwendtner
637e81e9bb build: remove legacy-unit-tests-local job (#28703)
Since all unit tests are now run with Bazel, we can remove
the local legacy unit tests job. We still need to keep the
Saucelabs legacy job until we can run all of these web
unit tests with Saucelabs and Bazel.

PR Close #28703
2019-02-20 16:31:50 -08:00
Paul Gschwendtner
abc3cbb33f build: run example unit tests with bazel (#28703)
With #28402 we updated the `examples` package to be
built and tested with Bazel. This PR was only intended
for the e2e integration tests, and there still seem to be
a few unit tests that need to be migrated to Bazel until
we can remove the legacy local unit tests job.

PR Close #28703
2019-02-20 16:31:50 -08:00
Igor Minar
27eb8f2723 build: update deps in ./scripts/release/post-check
The versions were off and @angular/http dep was missing.
2019-02-20 13:14:33 -08:00
Igor Minar
81671cea9a release: cut the v7.2.6 release 2019-02-20 12:15:47 -08:00
Igor Minar
843fc7df9f Revert "feat(router): add hash-based navigation option to setUpLocationSync (#28609)"
This reverts commit fc895ba1893d08813f931c8794c7db97782f1c36.

This is change is a feature and doesn't belong on the patch branch.
2019-02-20 12:07:16 -08:00
George Kalpakas
cfe4732e41 fix(docs-infra): prevent extra space at the bottom of the page in Chrome (#28864)
The supposedly visually hidden `mat-icon` creates unnecessary space at
the bottom of the page (below the footer) in recent Chrome versions.
This didn't happen before and it still doesn't happen in other browsers
(Firefox, Edge, IE).

This commit fixes it by wrapping the icon in a visually hidden `div`
container, which doesn't have other styles (such as `mat-icon` does)
that could affect the layout of the page.

Fixes #28858

PR Close #28864
2019-02-20 09:20:38 -08:00
Alex Eagle
48cabb44c7 build: use vendored yarn under Bazel (#28839)
PR Close #28839
2019-02-20 09:19:05 -08:00
Alex Eagle
9d0db2fe4b ci: Vendor yarn into our repo (#28839)
This avoids a dynamic dependency on fetching a package from the internet in our CI.
We have observed that this is not 100% reliable.

PR Close #28839
2019-02-20 09:19:05 -08:00
Igor Minar
069146e7f3 ci: exclude **/third_party/** from google3 check (#28870)
this pattern is being excluded in copybara. see cl/234807990.

PR Close #28870
2019-02-20 09:17:21 -08:00
Jason Aden
fc895ba189 feat(router): add hash-based navigation option to setUpLocationSync (#28609)
The `setUpLocationSync` function in @angular/router/upgrade didn't previously let you sync hash-based navigations. With this change, you can now pass an option to `setUpLocationSync` that will make sure location changes run in Angular in hash-based apps.

Fixes #24429 #21995

PR Close #28609
2019-02-19 16:20:36 -08:00
Sharon DiOrio
9a51528072 docs: add Sharon DiOrio to contributors (#28671)
PR Close #28671
2019-02-19 16:15:01 -08:00
Juri Strumpflohner
7fc38d4947 docs: fix wrong filename in text (#28832)
This should be `ngsw.json` not `ngsw-config.json` as the latter is only the src file that gets then compiled into the `ngsw.json` and placed into the `dist` folder
PR Close #28832
2019-02-19 13:34:10 -08:00
Igor Minar
b1f84ec78f style: reformat aio/content/marketing/contributors.json with clang-format (#28500)
without this change, it's difficult to edit this file for anyone who has IDE configured for angular/angular development.

PR Close #28500
2019-02-19 13:01:19 -08:00
sis0k0
f351e8a5b1 docs: add Stanimira Vlaeva to contributors (#28500)
PR Close #28500
2019-02-19 13:01:19 -08:00
Trevor Karjanis
ff2c342356 docs(common): fix a typo in a debounce requests example header (#28829)
Remove the extra parenthesis from a debounce requests example.

There are no associated issues.

PR Close #28829
2019-02-19 12:59:22 -08:00
Trevor Karjanis
01b05b3f7c docs(platform-browser): fix a grammatical error in the BrowserModule documentation (#28808)
The browser module is not included by defaults, it is included by default. Default should be singular.

There is no associated issue.
PR Close #28808
2019-02-19 12:54:53 -08:00
George Kalpakas
3b78f9eb0f build(compiler-cli): upgrade chokidar to latest version (#28797)
Fixes #28771

PR Close #28797
2019-02-19 12:54:12 -08:00
Paul Gschwendtner
f6ca619343 test: bazel integration test should use angular npm packages (#28762)
PR Close #28762
2019-02-19 12:53:20 -08:00
Paul Gschwendtner
ab69c31fc5 fix(compiler-cli): incorrect bundled metadata for static class member call expressions (#28762)
Currently if developers use call expressions in their static
class members ([like we do in Angular](https://github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/keyvalue_differs.ts#L121)),
the metadata that is generated for flat modules is invalid. This
is because the metadata bundler logic currently does not handle
call expressions in static class members and the symbol references
are not rewritten to avoid relative paths in the bundle.

Static class members using a call expression are not relevant for
the ViewEngine AOT compilation, but it is problematic that the
bundled metadata references modules using their original relative
path. This means that the bundled metadata is no longer encapsulated
and depends on other emitted files to be emitted in the proper place.

These incorrect relative paths can now cause issues where NGC
looks for the referenced symbols in the incorrect path. e.g.

```
src/
 | lib/
    | index.ts -> References the call expression using `../../di`
```

Now the metadata looks like that:

```
node_modules/
  | @angular/
  -- | core/
  -- -- | core.metadata.json -> Says that the call expr. is in `../../di`.
  | di/
```

Now if NGC tries to use the metadata files and create the summary files,
NGC resolves the call expression to the `node_modules/di` module. Since
the "unexpected" module does not contain the desired symbol, NGC will
error out.

We should fix this by ensuring that we don't ship corrupted metadata
to NPM which contains relative references that can cause such
failures (other imports can be affected as well; it depends on what
modules the developer has installed and how we import our call
expressions).

Fixes #28741.

PR Close #28762
2019-02-19 12:53:20 -08:00
Kara Erickson
38de40c9ec docs: clarify process surrounding merge label (#28837)
In the TRIAGE_AND_LABELS doc, it was not clear that the merge label
may be applied by the author before the PR is green (as a sort of
auto-submit). After the label is applied, it is still up to the
caretaker to determine that the PR is acceptable before merging.
This commit adds that clarification.

PR Close #28837
2019-02-19 12:43:21 -08:00
Paul Gschwendtner
53352c40c3 ci: combine "define_env_vars" and "download_yarn" anchor (#28788)
As discussed in https://github.com/angular/angular/pull/28546#discussion_r254068014, we want to combine the
`define_env_vars` and `download_yarn` anchor since downloading Yarn depends on setting up the
environment variables. In addition this simplifies our setup and reduces code-duplication.

PR Close #28788
2019-02-19 12:41:51 -08:00
George Kalpakas
dd3cab6eb1 build(docs-infra): improve caching configuration for Firebase hosting (#28785)
This will hopefully improve(/fix?) the errors discussed in #28114.
See there for a more detailed discussion.

PR Close #28785
2019-02-19 12:38:51 -08:00
George Kalpakas
ea1a3d3603 build: fix validate-commit-message on Windows (#28780)
Previously, the `validate-commit-message` gulp task was using the
`git log ... ^r1 r2` syntax to list commits between the base branch and
the current head. This didn't work as expected on Windows, because `^`
is the escape character. As a result, the command was equivalent to
`git log ... r1 r2` on Windows, which essentially logs all commits
reachable from either `r1` or `r2`.

This commit fixes it by switching to git's
[double-dot range notation][1] (`r1..r2`), which is an alias for the
`^r1 r2` syntax and works correctly on all platforms.

[1]: https://git-scm.com/docs/gitrevisions#_dotted_range_notations

Fixes #16830

PR Close #28780
2019-02-19 12:37:58 -08:00
George Kalpakas
cf1b436010 build: stop execution on error in validate-commit-message (#28780)
Stop execution when an error happens in `validate-commit-message` gulp
task and ensure the error message is printed at the bottom.

Fixes #16829

PR Close #28780
2019-02-19 12:37:58 -08:00
Amadou Sall
cdcbb53a2d docs: capitalize karma (#28775)
PR Close #28775
2019-02-19 12:36:22 -08:00
Nikita Potapenko
db2db6e7f5 docs: clarify behavior of dependency injection at root injector (#28753)
PR Close #28753
2019-02-19 12:33:49 -08:00
Filipe Silva
1df6b16263 ci: add gkalpak and filipesilva to fw-dev-infra (#28807)
PR Close #28807
2019-02-19 12:31:29 -08:00
Igor Minar
f4871212b7 ci: add /aio/content/images/bios/** to @angular/fw-docs-marketing group (#28835)
we previously missed it.

PR Close #28835
2019-02-19 12:30:38 -08:00
Jamie R. Rytlewski
2a23eca917 docs: display the beginning label in interpolation guide example (#28602)
Updating the doc to add the beginning label.

I'm not sure if this was the way it was intended, but it looked strange with just an ending </label> tag.

PR Close #28602
2019-02-19 12:24:46 -08:00
Keilla Fernandes
b5da4c6676 docs(aio): add Keilla Fernandes to GDE resources (#28437)
PR Close #28437
2019-02-19 11:24:15 -08:00
Sergej Grilborzer
b8c2f3b93f docs: warn that directives don't support namespaces (#25855)
PR Close #25855
2019-02-19 11:01:56 -08:00
Igor Minar
75cf86e70f ci: add /packages/* to the @angular/fw-dev-infra CODEOWNERS group (#28745)
It was previously missing which is a bug.

PR Close #28745
2019-02-16 20:58:48 -08:00
Cody Schroeder
bf25165354 build(bazel): specify tsconfig-test dependency (#28696)
PR Close #28696
2019-02-16 20:57:34 -08:00
Miško Hevery
a2ba4448da release: cut the v release 2019-02-15 21:13:21 +00:00
Paul Gschwendtner
ac6b2b4dc3 build: convert examples package to bazel (#28733)
* build: switch example e2e tests to bazel

* No longer builds the example e2e tests using "tsc". The examples are now built with Bazel and can therefore be built with Ivy by using the `--define=compile=aot` switch.
* No longer runs the example e2e tests using the protractor CLI. example e2e tests are executed with the Bazel protractor rule and can therefore run incrementally.

* test: disable failing ivy example e2e tests

*Note for patch branch:* We had to disable more examples in Ivy because
the patch branch does not contain all Ivy/ngtsc fixes.
2019-02-14 15:25:00 -08:00
Vani
b6dffa9763 docs: incorporate review feedback (#26827)
PR Close #26827
2019-02-14 19:33:15 +00:00
Vani
54b57def58 docs: update HttpInterceptor API docs (#26827)
PR Close #26827
2019-02-14 19:33:15 +00:00
Paul Gschwendtner
e2b3cc8118 build: remove unused rollup.config.js files (#28646)
Since we build and publish the individual packages
using Bazel and `build.sh` has been removed, we can
safely remove the `rollup.config.js` files which are no
longer needed because the `ng_package` bazel rule
automatically handles the rollup settings and globals.

PR Close #28646
2019-02-14 19:29:22 +00:00
Greg Magolan
5e701a2c88 build(bazel): rollback to chromium 69 (latest version that still works on OSX) (#28698)
PR Close #28698
2019-02-13 19:18:28 -08:00
Greg Magolan
27a3df146d build(bazel): pin chromium to 72.0.3636 and chrome-driver to 2.46 on all platforms (#28698)
PR Close #28698
2019-02-13 19:18:28 -08:00
Greg Magolan
8cce7efbb2 build(bazel): pin chrome driver to 2.45 and use newer chrome in linux to fix test in CI (#28698)
PR Close #28698
2019-02-13 19:18:28 -08:00
Greg Magolan
d225c3a6e3 build(bazel): temporarily pin browser versions while upstream is fixed as work-around for #28681 (#28698)
PR Close #28698
2019-02-13 19:18:27 -08:00
Alberto Garza
b23582d57e docs(animations): fixed some grammar (#28708)
PR Close #28708
2019-02-13 19:14:58 -08:00
Alex Eagle
d3c6e512a3 build: update jquery to latest (#28719)
Versions less than 3.0.0 have security vulnerabilities

PR Close #28719
2019-02-13 19:14:11 -08:00
George Kalpakas
a873fab10c docs-infra: backporting #28592, #28463, #28650, #28688, #28663 (#28714)
* ci(docs-infra): run docs examples tests in production mode (#28592)

PR Close #28592

* docs: remove quickstart example and copy tsconfig.1.json into TS config guide (#28592)

This example has long been replaced by the cli-quickstart, but was never deleted.

PR Close #28592

* docs: enable E2E test for setup example (#28592)

This guide is not being shown publicly, and its test is currently being ignored.
Instead of deleting this test and guide, it may be repurposed in the future for a local development guide.

PR Close #28592

* docs: ignore progression filenames from compilation (#28592)

PR Close #28592

* docs: remove unused StringSafeDatePipe from AngularJS Quick Ref example (#28592)

PR Close #28592

* docs: make parent finder functions compatible with AoT (#28592)

PR Close #28592

* docs: make toggleImage arguments optional in AngularJS quick reference (#28592)

PR Close #28592

* docs: add insert remove component to AppModule for animations example (#28592)

PR Close #28592

* docs: ignore component for app compilation for displaying data example (#28592)

PR Close #28592

* docs: ignore files from app compilation for ngmodule-faq example (#28592)

PR Close #28592

* docs: ignore initial components for app compilation in router example (#28592)

PR Close #28592

* docs: remove unused files in styleguide example (#28592)

PR Close #28592

* docs: make method arguments optional in template syntax example (#28592)

PR Close #28592

* docs: add more files to be ignored during app compilation (#28592)

PR Close #28592

* docs: run component-interaction and DI in JiT mode (#28592)

PR Close #28592

* docs: re-enable E2E tests for Http guide (#28592)

PR Close #28592

* ci(docs-infra): test docs examples with Ivy (#28463)

PR Close #28463

* fix(docs-infra): add progression files to exclude list for docs examples (#28650)

Also disables Http guide under Ivy tests with documented error

PR Close #28650

* fix(docs-infra): fix filtering in run-example-e2e.js (#28663)

PR Close #28663

* test(ivy): enable more docs examples e2e tests (#28688)

PR Close #28688
2019-02-13 16:42:39 -08:00
Miško Hevery
ecef0dd65e
Revert "test(ivy): enable more docs examples e2e tests (#28688)" (#28712)
This reverts commit 1cc74eaece6c2fdbd77a92062cceecf23460b2db.
2019-02-13 15:43:16 -08:00
Miško Hevery
1cc74eaece ci: fix bad merge 2019-02-13 14:58:22 -08:00
Greg Magolan
e2b3be87cb build(bazel): update to rules_nodejs 0.18.6 (#28699)
PR Close #28699
2019-02-13 12:13:09 -08:00
SebastienBtr
3ca6c928f9 docs(router): change slideInDownAnimation into slideInAnimation (#28640)
In the Routing & Navigation there is a typo - slideInDownAnimation, but it should be slideInAnimation

PR Close #28572

PR Close #28640
2019-02-13 12:03:46 -08:00
Paul Gschwendtner
5933d16f3e build: fix web_worker images example not working (#28562)
The web_worker images example is currently not really usable
because the rendered button that can be used to upload
an "image" to the demo is currently not working. This is because
the HTML markup for the `file-field` is not matching what `materialize-css`
expects. See: https://materializecss.com/text-inputs.html

PR Close #28562
2019-02-13 12:01:55 -08:00
Paul Gschwendtner
0f839bcfd0 build: playground examples do not explicitly specify "ng_module" assets (#28562)
Currently all playground examples are built with NGC, and most
of the HTML resources are automatically inlined. Surprisingly NGC
is able to resolve the relative component assets even though these
aren't specified in the `assets`. This seems to work because NGC
resolves the files in the execroot where the files are present
(if Bazel doesn't use sandboxing).

Issue is tracked with TOOL-667

PR Close #28562
2019-02-13 12:01:55 -08:00
Paul Gschwendtner
edda94edfa build: fix web_worker playground examples using external resources (#28562)
The `web_workers/images` example is not being tested by any e2e
spec and therefore it's technically not necessary to fix that it uses
external resources, though in order to ensure that the Bazel builds
are hermetic and that we can eventually add e2e specs for the
web_worker/image example, we should avoid any use of external
resources.

We remove the `web-animations` polyfill in the `web_workers/animations`
example because we should try to vendor as few as possible deps. Also
the animations API is already supported by browsers we run the e2e tests
against (note here: `web_workers/animations` is currently also disabled)

PR Close #28562
2019-02-13 12:01:55 -08:00
Judy Bogart
b5e36eaa3e docs: add di-related api doc (#27731)
PR Close #27731
2019-02-13 11:59:32 -08:00
Paul Gschwendtner
08a1f51704 build: remove legacy e2e tests job (#28697)
Now that all e2e integration tests within `modules/` have been
migrated to Bazel, we can remove the legacy e2e tests job.

PR Close #28697
2019-02-13 11:54:37 -08:00
Paul Gschwendtner
9690e36f78 build: update instructions to run benchmark tests (#28697)
* Updates the instructions on how to run the benchmark tests.
* Removes the unused `favicon.ico` file and the corresponding Bazel filegroup

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
68e741227b build: convert largeform benchmarks to bazel (#28697)
Switches the `largeform` benchmarks to Bazel.
This is the last remaining e2e test within `modules/`.

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
50a2327520 build: run largetable benchmark tests with bazel (#28697)
PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
b07346c8e3 build: serve largetable benchmark tests with bazel (#28697)
PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
8e95849751 build: fix routing playground example using external resource (#28697)
Currently the "routing" playground example fails the e2e tests
because it tries to load the OpenSans font using an external
HTTP request. External http requests are not allowed (unless
explicitly enabled) within Bazel in order to ensure that
all targets are built and tested in a hermetic way.

In order to work around this issue in a Bazel idiomatic way,
we just vendor the fonts in the "third_party" folder. Note
that we can technically also enable internet for the RBE
host platform, but it's not a best practice for hermeticity.

The following syntax would allow us to enable internet for
RBE (stated here for tracking)

```
properties: {
  name: "dockerNetwork"
  value: "standard"
}
```

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
cd143f67af build: disable failing ivy playground example e2e tests (#28697)
With ed1ba88ffd9d0fc266808413fa517e7a31943bc8 we switched the
examples to run with Bazel. This means that we can now also run the
e2e tests for these examples against Ivy. All playground e2e tests,
**except** the `web_worker` examples, successfully run with Ivy.

The failing webworker e2e tests have been temporarily disabled with
`fixmeIvy` and need to be investigated in a follow-up.

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
dd85351162 build: re-enable upgrade playground example (#28697)
The `upgrade` playground example has been disabled for a
long time because Protractor initially didn't support running
hybrid apps. Now that we use a more recent version of Protractor
that handles hybrid apps (also automatically), we can re-enable
this long-standing disabled test.

Additionally the e2e test logic was outdated and failed because a
CSS selector did not match the template of the upgrade example.
With this change, the CSS selector has been updated to match the
example's template, and also the test has been updated slightly
to also ensure that content projection works.

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
c1c68889de build: run playground e2e examples with bazel (#28697)
PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
866f4be782 build: fix "person_management" playground example (#28697)
Currently when someone serves the "person_management" playground
example, there will be runtime exceptions by `@angular/forms` if
someone clicks on one of the two buttons rendered in the example.

This happens because the example is outdated and the input elements
using `ngModel` do not specify a proper "name" while being inside of
a `<form>` element. A name is required inside of a form. The failure
is not specific to Ivy and is not covered by any test because the e2e
tests for this example are just asserting that the page properly loads
(the error only shows up one of the buttons has been clicked)

This is the reason why these errors were never visibile to the e2e tests.
Though in order to make this example work, we should this fix these failures
so that the example can work as expected.

```
FullNameComponent.html:7 ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form
      control must be defined as 'standalone' in ngModelOptions.

      Example 1: <input [(ngModel)]="person.firstName" name="first">
      Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">
    at Function.TemplateDrivenErrors.missingNameException (template_driven_errors.ts:40)
    at NgModel._checkName (ng_model.ts:319)
    at NgModel._checkForErrors (ng_model.ts:302)
    at NgModel.ngOnChanges (ng_model.ts:215)
    at Object.checkAndUpdateDirectiveInline (provider.ts:208)
    at checkAndUpdateNodeInline (view.ts:429)
    at checkAndUpdateNode (view.ts:389)
    at debugCheckAndUpdateNode (services.ts:431)
    at debugCheckDirectivesFn (services.ts:392)
    at Object.eval [as updateDirectives] (FullNameComponent.html:7)
```

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
80e4019c83 build: switch playground examples to bazel (#28697)
Currently all playground examples are built with `tsc`
and served with the `gulp serve` task. In order to be able
to test these examples easily with Ivy, we now build and
serve the examples using Bazel. This allows us to expand our
Ivy test coverage and additionally it allows us to move forward
with the overall Bazel migration. Building & serving individual
examples is now very easy and doesn't involve building everything
inside of `/modules`.

PR Close #28697
2019-02-13 11:54:36 -08:00
Paul Gschwendtner
d9f3316021 build: fix bazel protractor tests not capturing console output (#28697)
Currently we depend on the "rules_webtesting" version that is
installed by "rules_typescript//:package.bzl". This version of
the webtesting rules comes with a very old version of Chromium
and the `chromedriver` that does not support capturing console
errors properly (with stack traces). Since we have a few e2e
tests that depend on console output (e.g. playground/src/source-map),
we need to make sure that these tests can pass upon Bazel
migration.

**Note for patch version**: Technically this commit is no longer updating
the `rules_webtesting` version because a different PR/commit already updated
the version transitively in `master & patch` and reverted 0094b99176264b27582ab620565632788cab66c5
partially, so in order to keep master and patch in sync, we should not update the
version of `rules_webtesting`.

PR Close #28697
2019-02-13 11:54:36 -08:00
Miško Hevery
424a3b95aa ci: corrected left over merge marker 2019-02-13 10:50:36 -08:00
Miško Hevery
7e883c2319 ci: corrected left over merge marker 2019-02-13 10:41:55 -08:00
Marc Laval
6a7fd70ddf test(ivy): enable more docs examples e2e tests (#28688)
PR Close #28688
2019-02-13 09:54:29 -08:00
Paul Gschwendtner
73f9db53c2 ci: downgrade to sauce-connect v4.5.1 (#28659)
We currently face a lot of flakiness with our
Saucelabs CI jobs. These randomly exceed the 10min
CircleCI no-output limit because something throws
off `sauce-connect` in a long-lasting loop where
it tries to connect to some of their Saucelabs
servers. The initial assumption from the Saucelabs
team was that we might have some invalid firewall
rules, but this does not answer why this happens
_randomly_, so the latest update from the support
is that there have been some changes in the latest
version of `sauce-connect` version that **could**
cause this flakiness.

I've manually did multiple test runs and was only
able to reproduce the issues with v4.5.3 (latest
version), so it might be worth downgrading to
v4.5.1. This is also what the Saucelabs support
proposed us to do (though it's not guaranteed that
v4.5.1 is unaffected by the same issue)

PR Close #28659
2019-02-12 17:23:38 -08:00
Alex Eagle
2bf526bbfb docs: add a README for third_party usage (#28651)
PR Close #28651
2019-02-12 09:54:44 -08:00
Judy Bogart
8bd7d5befc docs: clarify library types integration (#28410)
PR Close #28410
2019-02-11 17:13:45 +00:00
Paul Gschwendtner
aa163bea93 refactor(compiler): allow disabling external symbol factory reexports (#28594)
Currently external static symbols which are referenced by AOT
compiler generated code, will be re-exported in the corresponding
`.ngfactory` files.

This way of handling the symbol resolution has been introduced in
favor of avoding dynamically generated module dependencies. This
behavior therefore avoids any strict dependency failures.

Read more about a particular scenario here: https://github.com/angular/angular/issues/25644#issuecomment-458354439

Now with `ngtsc`, this behavior has changed since `ngtsc` just
introduces these module dependencies in order to properly reference
the external symbol from its original location (also eliminating the need
for factories). Similarly we should provide a way to use the same
behavior with `ngc` because the downside of using the re-exported symbol
resolution is that user-code transformations (e.g. the `ngInjectableDef`
metadata which is added to the user source code), can resolve external
symbols to previous factory symbol re-exports. This is a critical issue
because it means that the actual JIT code references factory files in order
to access external symbols. This means that the generated output cannot
shipped to NPM without shipping the referenced factory files.

A specific example has been reported here: https://github.com/angular/angular/issues/25644#issue-353554070

PR Close #28594
2019-02-11 17:12:51 +00:00
Paul Gschwendtner
2f73c554c9 build: fix invalid bazel target referenced by benchmarks (#28626)
PR Close #28626
2019-02-08 15:13:53 -08:00
Paul Gschwendtner
fb2d15fda1 build: remove outdated polymer tree benchmark (#28568)
The "tree/polymer_leaves" benchmark has no benchmark tests, nor do we install
Polymer anywhere. Polymer was previously installed through `bower`, but since
we removed bower, there is no easy way to run this benchmark with Polymer.

Considering that there are no benchmark tests, nor we have an easy way to
install/vendor Polymer, we should just remove this benchmark app.

This is also based on the assumption that we want to remove the
Polymer benchmarks anyway: see: 8a05199fb9be5ef91ec8094a3c6abc0a65eb6bcd

PR Close #28568
2019-02-08 13:42:03 -08:00
Paul Gschwendtner
018507fa02 build: run tree benchmark tests with bazel (#28568)
PR Close #28568
2019-02-08 13:42:00 -08:00
Paul Gschwendtner
95bb72d322 build: serve benchmark tree examples with bazel (#28568)
PR Close #28568
2019-02-08 13:40:10 -08:00
Paul Gschwendtner
ce6e6c3f81 build: unable to run perf bazel e2e tests on windows (#28568)
Currently it's not possible to run the benchmark e2e tests with Bazel on Windows
because the logic that imports the `perf_util`'s is not using a proper Bazel script
manifest path. A script manifest path should not start with `./angular/`, but rather
with the workspace name (which is in our case `angular/`)

PR Close #28568
2019-02-08 13:37:37 -08:00
Paul Gschwendtner
e4b1bdbfa0 ci: do not install firebase-tools without cache (#28615)
Currently we install `firebase-tools` manually in the
integration tests run script. This is problematic
because it means that we cannot cache `firebase-tools`
properly and Yarn might time out downloading this
dependency. We can safely move this to the top level
`package.json` since Bazel now has a `.bazelignore` and
since we have a cache that works for PRs (with fallback
caching).

Note that the `.bazelignore` is relevant here because
`firebase-tools` has been mainly moved to the bash
script because it broke some Bazel calls.

See 4f0cae067656fa4563417542297c67030d911a36.

PR Close #28615
2019-02-08 10:23:20 -08:00
Nikita Potapenko
6477c9e04a docs(core): fixed code snippets (#28619)
PR Close #28619
2019-02-08 09:27:24 -08:00
George Kalpakas
3f380b3b78 test(upgrade): change flaky test to not be affected by other tests (#28617)
It seems that in some cases (especially on CI), global state is not
cleaned up properly causing a specific test to fail.
See #28045 and #28181 for more context.

This PR restores the global state for the affected test. This partly
defeat the purpose of the test, but is better than having flakes on CI.

Fixes #28614

PR Close #28617
2019-02-08 09:27:03 -08:00
Alex Eagle
c4c0e9dbc5 docs: update merge label meaning (#28574)
PR Close #28574
2019-02-08 09:25:05 -08:00
Igor Minar
4ddf57c58d ci: add all required statuses to the requiredStatuses list for angular-robot (#28613)
Somehow the current list ommits quite a few important targets. Especially the cla and google3.

This changes adds all the statuses that must always be present and green for this agregate state expised as "ci/angular: merge status" to be green.

PR Close #28613
2019-02-08 09:20:29 -08:00
Nikita Potapenko
624f01c311 docs(core): fixed typo (#28618)
PR Close #28618
2019-02-08 09:19:40 -08:00
Sebastian Dorn
6a713521e3 docs(aio): add Happy Angular Podcast to resources (#28407)
PR Close #28407
2019-02-07 21:57:08 -08:00
Filipe Silva
57a5ba3438 ci: use fallback caches (#28545)
This PR adds fallback cache hits for partial cache restoration.

PR Close #28545
2019-02-07 16:45:54 -08:00
Vladimir Moskva
1b6fb5bc19 refactor(common): Remove deprecated FileType (#28583)
FileType objects are deprecated. They are not required for specifying valid file types for rule attributes, a list of strings can be used instead.

PR Close #28583
2019-02-07 16:45:23 -08:00
Vani
bd9da268c1 docs: update HttpHeader documentation (#26233)
PR Close #26233
2019-02-07 16:42:13 -08:00
stoneLeaf
1e58a2194f fix(router): redirect to root url when returned as UrlTree from guard (#28271)
When a UrlTree of root url was returned by a guard as a redirection, the
navigation was not processed. The issue came from the error handler which
incorrectly marked the router as already navigated.

Fixes #27845

PR Close #28271
2019-02-06 21:23:33 -08:00
George Kalpakas
da81c9cb54 build(docs-infra): use pinned dependencies when possible in ng-packages-installer (#28510)
Previously, `ng-packages-installer` would replace the version ranges for
all dependencies that were peer dependencies of an Angular package with
the version range used in the Angular package. This effectively meant
that the pinned version (from `yarn.lock`) for that dependency was
ignored (even if the pinned version satisfied the new version range).

This commit reduces non-determinism in CI jobs using the locally built
Angular packages by always using pinned versions of dependencies for
Angular package peer dependencies if possible.

For example, assuming the following versions for the RxJS dependency:

- **aio/package.json**: `rxjs: ^6.3.0`
- **aio/yarn.lock**: `rxjs@^6.3.0: 6.3.3`
- **@angular/core#peerDependencies**: `rxjs: ^6.0.0`

...the following versions would be used with `ng-packages-installer`:

- Before this commit:
  - **aio/package.json**: `rxjs: ^6.0.0`
  - **node_modules/rxjs/**: `6.4.0` (latest version satisfying `^6.0.0`)
- After this commit:
  - **aio/package.json**: `rxjs: ^6.3.0`
  - **node_modules/rxjs/**: `6.3.3` (because it satisfies `^6.0.0`)

PR Close #28510
2019-02-06 21:23:03 -08:00
George Kalpakas
ef6d26d4fa build(docs-infra): keep other dependencies pinned when installing local Angular packages (#28510)
`ng-packages-installer` can be used to replace Angular packages with
locally built ones (from `dist/packages-dist/`) along with their peer
dependencies.

Previously, in order to achieve this, `yarn install` was called with the
`--no-lockfile` option, which resulted in installing the latest versions
of all dependencies (including transitive ones) permitted by the
corresponding version ranges in `package.json` files. As a result, newly
released versions would be picked, resulting in unexpected,
non-deterministic breakages in CI.

This commit calls `yarn install` with the `--pure-lockfile` option
instead. As a result, only the Angular packages (for which the locally
built ones are used) and their peer dependencies are unpinned; the
pinned versions from `yarn.lock` are used for all other (direct and
transitive) dependencies.

While this does not eliminate non-determinism across builds, it
significantly reduces it.

PR Close #28510
2019-02-06 21:23:03 -08:00
George Kalpakas
13bc1cd853 perf(docs-infra): avoid unnecessary I/O operation in ng-packages-installer (#28510)
PR Close #28510
2019-02-06 21:23:03 -08:00
George Kalpakas
1fa1379318 refactor(docs-infra): format package.json for readability in ng-packages-installer (#28510)
PR Close #28510
2019-02-06 21:23:03 -08:00
George Kalpakas
d9efacc07e build(docs-infra): remove unnecessary workaround for RxJS in ng-packages-installer (#28510)
Since b43f8bc7d, RxJS does not need to be patched any more in the
top-level `node_modules/`, so we don't need to special-case RxJS in
`ng-package-installer` and use `node_modules/rxjs/`.

PR Close #28510
2019-02-06 21:23:03 -08:00
cexbrayat
47f5b5f2d4 docs(service-worker): note about isStable/setInterval (#28102)
The docs don't mention that the app will never be stable if a `setInterval` is running somewhere, and that it will prevent the servcie worker to be registered too.

PR Close #28102
2019-02-06 15:13:20 -05:00
cexbrayat
019fe77f64 docs(core): document isStable traps (#28102)
PR Close #28102
2019-02-06 15:13:19 -05:00
Matias Niemelä
a0e3a8e0f7 build: fix revert issue with bitmap.ts (#28576)
PR Close #28576
2019-02-06 15:09:34 -05:00
Alex Eagle
8908156eae build: switch to typescript's es2015 typings (#28570)
Note that this allows Angular to depend on the entirety of the ES2015 API, not just our restricted subset.
This change is needed because our copy of the subset was out-of-date, and prevents us using ES2015 target in dev mode.

This is a subset of #27738

PR Close #28570
2019-02-06 14:17:56 -05:00
Greg Magolan
2ee265fb1f build: update to rules_typescript 0.23.2 and rules_nodejs 0.16.8 (#28567)
PR Close #28567
2019-02-06 14:12:42 -05:00
George Kalpakas
116512b06d ci(docs-infra): ensure aio_monitoring failure notifications do not depend on earlier steps (#28555)
Previously, in order for the `aio_monitoring` failure notifications to
work, the steps up to `define_env_vars` should have succeeded. This
meant that any failures in earlier steps would not send notifications.

This commit fixes it by making the notification step independent of the
`define_env_vars` step.

PR Close #28555
2019-02-06 06:22:00 -08:00
George Kalpakas
1d841973eb ci: save the cache in build-npm-packages job instead of test (#28555)
In most cases, it doesn't make a difference, because the cache does
already exist and is not saved. In the few cases where the dependencies
change (and the cache needs to be updated), it makes more sense to save
the cache in the `build-npm-packages` job, because most jobs depend on
it and thus will be able to take advantage of the updated cache right
away.

This seems to be an oversight in b26ac1c22.

PR Close #28555
2019-02-06 06:22:00 -08:00
George Kalpakas
3694e1a38c ci: run the yarn_install step when necessary (#28555)
PR Close #28555
2019-02-06 06:22:00 -08:00
George Kalpakas
88d8813ccc refactor: use steps consistently in CircleCI config (#28555)
PR Close #28555
2019-02-06 06:22:00 -08:00
George Kalpakas
49bfb63442 ci(docs-infra): fix download_yarn in aio_monitoring (#28555)
The `download_yarn` step depends on the `CI_YARN_VERSION` environment
variable and thus has to be run after the `define_env_vars` step.
Accidentally broken in [#28546][1].

[1]: https://github.com/angular/angular/pull/28546/files#diff-1d37e48f9ceff6d8030570cd36286a61R447

PR Close #28555
2019-02-06 06:21:59 -08:00
Matias Niemelä
48848c9ca4 build: add some debug info for yarn installs (#28553)
PR Close #28553
2019-02-06 06:21:01 -08:00
Paul Gschwendtner
a1f1ea993d build: update yarn to v1.13.0 (#28546)
Currently our version of Yarn is installed through
the "circleci/node" docker image. This is problematic
because in order to be able to update Yarn, we always
need to update the docker image to a version that
comes with the desired Yarn version. Sometimes there
is no docker image with the desired latest Yarn version,
and therefore we cannot easily update the Yarn version.

Additionally updating the docker image also means that
we need to update our version of NodeJS, as well as the
version of `openssl` might have changed (meaning that
our encrypted credential files may not be decodable with
the new version of `openssl`)

PR Close #28546
2019-02-06 06:20:50 -08:00
Stephen Fluin
be8a403bc9 feat(aio): show developer survey 2019 (#28552)
PR Close #28552
2019-02-06 02:33:39 -05:00
Paul Gschwendtner
c378402af4 build: fix failing compiler-cli tests on windows (#28550)
Note that this fixes `compiler-cli` tests within `compiler-cli/test`,
but there seem to be remaining `ngcc` tests within `compiler-cli/src`
which aren't working on Windows. This is out-of-scope for this commit.

PR Close #28550
2019-02-05 23:47:33 -05:00
Paul Gschwendtner
91ce8c17ff build: support running ngtsc tests on windows (#28550)
Currently the "ngtsc` testing helpers resolve the `fake_core` NPM
package using the `TEST_SRCDIR` variable. This is problematic on Windows
where Bazel runfiles are not symlinked into the runfiles directory.
In order to properly resolve the NPM Bazel tree artifact, we use the
`resolveTreeNpmArtifact` runfile helper that properly resolves the artifact
properly on all platforms.

PR Close #28550
2019-02-05 23:47:33 -05:00
Paul Gschwendtner
786be967fd build: support running compiler-cli tests on windows (#28550)
In order to support running "compiler-cli" tests that use the "test_support.ts"
utilities on Windows with Bazel, we need to imporve the logic that resolves NPM
packages and symlinks them into a temporary directory.

A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles
is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM
packages can be also symlinked on Windows, and tests can execute properly
on Windows. Read more about why this is needed here:

* https://github.com/bazelbuild/bazel/issues/3726#issue-257062364

PR Close #28550
2019-02-05 23:47:33 -05:00
Paul Gschwendtner
e88d5e0df2 build: remove unused "test.sh" leftover code in compiler-cli (#28550)
Since we recently removed the `test.sh` script, and now run
all tests with Bazel, we can remove the unused logic that makes
compiler-cli tests pass in non-Bazel.

This cleans up the tests, and also makes it easier to write tests
without worrying about two ways of the Angular package output
(Bazel `ng_package` rules vs. old `build.sh` logic of building)

PR Close #28550
2019-02-05 23:47:33 -05:00
Paul Gschwendtner
f39f01e00b build: remove unused "test.sh" leftover code in language-service (#28550)
Since we recently removed the `test.sh` script, and now run all
tests with Bazel, we can remove the unused logic that makes language-service
tests pass in non-Bazel.

This cleans up the tests, and also makes it easier to write tests
without worrying about two ways of the Angular package output
(Bazel `ng_package` rules vs. old `build.sh` logic of building)

PR Close #28550
2019-02-05 23:47:32 -05:00
Paul Gschwendtner
ce750e6f5b fix(compiler-cli): diagnostics should respect "newLine" compiler option (#28550)
PR Close #28550
2019-02-05 23:47:32 -05:00
WilliamKoza
beba944843 fix(docs-infra): avoid a race-condition with navigating forward/back and immediately reloading (#28368)
This can result in an inconsistent state

PR Close #28368
2019-02-05 23:44:57 -05:00
WilliamKoza
50981cbb1f fix(docs-infra): remove the try catch in the test of the browser's capacities (#28368)
PR Close #28368
2019-02-05 23:44:56 -05:00
WilliamKoza
76e40eed35 feat(docs-infra): add debouncing in storing scroll position (#28368)
There is no debouncing when we store the scroll Position.
Currently, we have a message in the console after a while:
>Throttling history state changes to prevent the browser from hanging
see: https://bugs.chromium.org/p/chromium/issues/detail?id=786211 for more informations

PR Close #28368
2019-02-05 23:44:56 -05:00
kevinphelps
d491a20f3b fix(router): set href when routerLink is used on an 'area' element (#28441)
closes #28401

PR Close #28441
2019-02-05 23:28:41 -05:00
Matias Niemelä
74c202a5cd release: cut the v7.2.4 release 2019-02-05 19:39:39 -08:00
Matias Niemelä
483e8d28ec revert: build: switch to typescript's es2015 typings (#28134)
This reverts commit a6fd118f79156cec5c7be67cc7a3e3f4553a5392.
2019-02-05 18:08:39 -05:00
Alex Eagle
a6fd118f79 build: switch to typescript's es2015 typings (#28134)
Note that this allows Angular to depend on the entirety of the ES2015 API, not just our restricted subset.
This change is needed because our copy of the subset was out-of-date, and prevents us using ES2015 target in dev mode.

This is a subset of https://github.com/angular/angular/pull/27738

PR Close #28134
2019-02-05 14:25:10 -05:00
George Kalpakas
fe6e76c1e7 ci: keep job alive when yarn request takes more than 10 minutes (#28458)
Occasionally, yarn's requests take more than 10 minutes to
complete/fail, by which time CircleCI jobs due to no output.

This commit works around the issue by periodically printing something to
stdout.

PR Close #28458
2019-02-05 13:07:41 -05:00
Paul Gschwendtner
de560019f2 build: fix bazel repositories not cached on circleci (#28515)
Previously all Bazel repositories were cached on CircleCI
because the `experimental_repository_cache` flag has been
specified and the given repository cache directory has been
included in the CircleCI cache storage.

The directory is currently still included in the CircleCI
cache storage, but the `--repository_cache` flag is no longer
specified, and the cache directory is basically empty all the
time. The flag seems to have been removed accidentally within
SHA c8b70ae8e4a878c8855249df82bf3a46ce6ea0e5.

We should specifiy this flag on the CI again, so that Bazel
doesn't need to install the Bazel managed node modules
all the time. This would slow down analysis phase on CI; and also
makes us dependent on the Yarn/NPM registry which often times out
if we fetch a lot of dependencies.

Also in order to make sure that cached Bazel repositories are
also most of the time in sync with what's currently defined in
the workspace, we need to update the cache key.

PR Close #28515
2019-02-05 13:06:24 -05:00
George Kalpakas
52ed53d071 build(docs-infra): upgrade cli command docs sources to b5e796a03 (#28467)
Updating [angular#7.2.x](https://github.com/angular/angular/tree/7.2.x) from [cli-builds#7.3.x](https://github.com/angular/cli-builds/tree/7.3.x).
Relevant changes in [commit range](699743282...b5e796a03):

**Modified**
- help/add.json
- help/build.json
- help/generate.json
- help/new.json

PR Close #28467
2019-02-05 13:05:39 -05:00
Jeremy Elbourn
5b72d4d676 ci: refactoring from adding material tests to master ci (#28496)
This cherry-picks changes from #28197 to minimize the difference in
the ci infrastructure between master the the current patch branch

PR Close #28496
2019-02-05 01:52:59 -05:00
Jeremy Elbourn
c1aa1bf872 build: gulp format only changed lines by default (#28411)
Changes `gulp format` to format only changed lines by default
(`gulp format:changed`) and introduces a new task, `gulp format:all` to
format all source files. Since formatting only changed lines should be
the more common action, it makes more sense as the shorter default.

PR Close #28411
2019-02-04 16:49:16 -05:00
Adam Plumer
dad1bc7ca3 build: bump year (#28220)
PR Close #28220
2019-02-04 16:41:00 -05:00
LHearen
2109c30afe docs: fix shadow variable in tutorial example (#28499)
PR Close #28499
2019-02-04 14:54:53 -05:00
WilliamKoza
874919a25b fix(docs-infra): remove polyfill web-animations since we use Angular > 6 and we don't use AnimationBuilder (#28514)
PR Close #28514
2019-02-04 14:54:26 -05:00
George Kalpakas
c64e666755 test: log cli version in cli-hello-world[-ivy] integration projects (#28421)
This helps debug issues on CI.

PR Close #28421
2019-02-04 11:02:41 -05:00
George Kalpakas
1da403d8f3 refactor: correctly name cli-hello-world-ivy project to distinguish from cli-hello-world in logs (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
George Kalpakas
60c5ebd46a ci(docs-infra): compile with Ivy (#28421)
Jira: FW-552

PR Close #28421
2019-02-04 11:02:40 -05:00
George Kalpakas
b71d1987cd build(docs-infra): upgrade @angular/cli to 7.2.1 (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
George Kalpakas
e6325eb9ef refactor(docs-infra): get rid of on component input (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
George Kalpakas
114519ab6a fix(ivy): add missing private render3 exports (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
George Kalpakas
a9a095d44a refactor(core): remove duplicate check in defaultStyleSanitizer (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
Filipe Silva
5f9d574d4d build(docs-infra): update terser version in lockfile (#28512)
See https://github.com/angular/angular-cli/issues/13582#issuecomment-460261055.

PR Close #28512
2019-02-04 10:52:07 -05:00
Minko Gechev
baeb446392 ci: add mgechev to tools & tools-bazel codeowners (#28384)
PR Close #28384
2019-02-04 03:31:29 -08:00
Paul Gschwendtner
0d1bfdc505 build: fix circleci not restoring cache for PRs (#28480)
Currently whenever someone creates a pull request, the NPM dependencies
are downloaded and installed. This is problematic because we have a lot
NPM dependencies with potentially large files that would need to be
downloaded (e.g. the Bazel binaries).

The caches are currently not being restored because we added the
`{Branch}` variable to the CircleCI cache key. Since every PR has a different
branch name (e.g. `devversion/refs/heads/my-banch`), the cache keys would
never match an existing cache key, and the PR would start fresh by
downloading everything.

We can safely remove the `{Branch}` variable from the cache key because
it does not provide any value since the cached files are based on the state
of the `yarn.lock` file and not based on the current branch name. This reduces
our dependency on the slow and sometimes **flaky** Yarn registry. We should
try to depend as few as possible on external services (e.g. see how Saucelabs
flakiness can cause trouble for the caretaker; same applies to flaky Yarn installs)

PR Close #28480
2019-02-04 02:48:49 -08:00
George Kalpakas
fa130e9445 ci: pin ChromeDriver to a version compatible with docker image's Chrome (#28494)
By default, `webdriver-manager update` will download the latest
ChromeDriver version, which might not be compatible with the Chrome
version included in the [docker image used on CI], causing CI failures.
Previously, we used to pin the ChromeDriver version on CI in
[ngcontainer's Dockerfile][2]. This was accidentally broken in #26691,
while moving from ngcontainer to default CircleCI docker images.

This commit fixes the issue by pinning ChromeDriver to a known
compatible version.

[1]: bfd48d156d/.circleci/config.yml (L16)
[2]: bfd48d156d/tools/ngcontainer/Dockerfile (L63)

PR Close #28494
2019-02-01 20:22:04 -05:00
George Kalpakas
194710fc1d ci: fix setting env var with spaces in value (#28494)
PR Close #28494
2019-02-01 20:22:04 -05:00
George Kalpakas
6ae5e2b32a ci(docs-infra): reduce output verbosity to improve log readability (#28494)
PR Close #28494
2019-02-01 20:22:04 -05:00
Keen Yee Liau
d85d396c26 fix(bazel): Bazel builder resolves with require.resolve() (#28478)
This commit fixes a bug in the Bazel builder in which the path to Bazel
executable is constructed using the project path. For non-default
project, the node_modules directory is actually one level above the
project path.

This PR fixes the bug by resolving node_modules with require.resolve().
It requires @bazel/bazel v0.22.1 because previous versions do not have
index.js or main field in package.json and would cause node module
resolution to fail.

This has been tested with both bazel and ibazel.

PR Close #28478
2019-02-01 13:56:54 -05:00
Jeremy Elbourn
1a25144297 perf: pngcrush all pngs (#28479)
This is the result of running
```sh
find ./ -iname "*.png" -exec pngcrush -brute -ow --  {} \;
```

[Summary of size reductions](https://docs.google.com/spreadsheets/d/12Qgx7DfKabWw0PJza6ozC1kCHTofi6wyBLWGtwLW7G4/preview)

Last done in July, 2017 in #18243

PR Close #28479
2019-02-01 13:56:02 -05:00
Keen Yee Liau
449da8c18e fix(bazel): fix integration test for bazel-schematics (#28460)
With the release of @angular/bazel v7.2.3, the npm install step right
after `ng new` installs this version. However there is a bug in the
builder which results in bazel executable not found.

This bug was not discovered before because the dependencies of the
project created by `ng new` are not pinned.

The fix is to pin the version of @angular/bazel to 7.2.2 which relies on
global installation of bazel.

PR Close #28460
2019-01-30 19:05:12 -05:00
Jason Aden
0f37ed1060 release: cut the v7.2.3 release 2019-01-30 11:42:59 -08:00
Jeff Cross
5c85b4f1e9 docs: add Jeff Cross to contributors (#28432)
PR Close #28432
2019-01-29 16:41:32 -08:00
jithil-kore
22bc6ef22a docs: fix typo for Browserslist in build guide (#28328)
PR Close #28328
2019-01-29 16:35:27 -08:00
Matti Järvinen
bf928d1c9e docs: fix typo for Browserslist in file structure guide (#28312)
PR Close #28312
2019-01-29 16:33:19 -08:00
Nazar Nasirzada
d11c2f915b docs: fix typo in lifecycle-hooks.md (#28206)
## PR Checklist
Please check if your PR fulfills the following requirements:
 
* [x]  The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
* [ ]  Tests for the changes have been added (for bug fixes / features)
* [x]  Docs have been added / updated (for bug fixes / features)
 
## PR Type
What kind of change does this PR introduce?

* [ ]  Bugfix
* [ ]  Feature
* [ ]  Code style update (formatting, local variables)
* [ ]  Refactoring (no functional changes, no api changes)
* [ ]  Build related changes
* [ ]  CI related changes
* [x]  Documentation content changes
* [ ]  angular.io application / infrastructure changes
* [ ]  Other... Please describe:

## What is the current behavior?
Issue Number: N/A

## What is the new behavior?
## Does this PR introduce a breaking change?
* [ ]  Yes
* [x]  No

## Other information
PR Close #28206
2019-01-29 16:32:03 -08:00
Janghyun Han
98c99e5073 docs: angular.kr link added (#28113)
PR Close #28113
2019-01-29 16:31:38 -08:00
Erick Xavier
2c63108faa docs(core): add relative path information to component metadata (#27962)
Adds the information that the templateUrl and styleUrls options supports only relative Urls.

Adds more information about relative paths and absolute URLs in project metadata.

PR Close #27962
2019-01-29 16:31:12 -08:00
onlyflix
0ff48a1266 style: change to American English (#27266)
PR Close #27266
2019-01-29 16:30:26 -08:00
Jason Aden
ea2a3f8335 Revert "build: switch example e2e tests to bazel (#28402)" (#28438)
This reverts commit ef78e335604de8352d2fb5bd3a131eca08d3d405.

PR Close #28438
2019-01-29 16:20:27 -08:00
Jason Aden
cbed4851a3 Revert "test: disable failing ivy example e2e tests (#28402)" (#28438)
This reverts commit 351610ca8db31b22c89994de6aa31a015be95082.

PR Close #28438
2019-01-29 16:20:27 -08:00
jithil-kore
7c157780a9 docs: fix Redundant "See also:" link in ContentChild (#28334)
PR Close #28334
2019-01-29 12:03:26 -08:00
jithil-kore
cc1b2a5373 perf: yarn version upgrade (#28360)
PR Close #28360
2019-01-29 11:58:48 -08:00
WilliamKoza
5076185fc8 fix(docs-infra): add hamburger button to CLI COMMANDS section (#28418)
Currently, when we navigate in the `CLI COMMANDS` section, the "hamburger button" isn't present because the class css `folder-cli` is missing.
This PR add this class in order to show this button when we are in this section.

PR Close #28418
2019-01-29 11:48:34 -08:00
Alan Agius
65375f4c21 fix(docs-infra): boolean options default value is incorrect when it's undefined (#27024)
In the CLI when it's undefined it can mean `false`, or sometimes it will be overwritten by a runtime value.

PR Close #27024
2019-01-28 20:43:16 -08:00
Dhananjay Kumar
068a6070dc docs(docs-infra): add ng-India to events list (#28119)
docs: add ng-India to events list
PR Close #28119
2019-01-28 20:18:52 -08:00
Paul Gschwendtner
47e9761a01 build: improve compiler-cli codegen output test (#28191)
* Improves the `compiler-cli/integrationtest` codegen output test slightly by using a more clear test description and by adding an assertion that ensures that decorators are downleveled.

PR Close #28191
2019-01-28 20:07:23 -08:00
Paul Gschwendtner
bef52d20b5 build: fix outdated ngtools compiler-cli test logic (#28191)
* Fixes that the test logic for `ngtools` in the offline compiler test is no longer working due to being unmaintained for a long time
* Makes the path comparison logic platform agnostic, so that the tests can be also executed on Windows

PR Close #28191
2019-01-28 20:07:23 -08:00
Paul Gschwendtner
fe50710021 build: fix outdated i18n compiler-cli test assertions (#28191)
PR Close #28191
2019-01-28 20:07:23 -08:00
Paul Gschwendtner
71b66fb862 build: run offline_compiler_test using bazel (#28191)
PR Close #28191
2019-01-28 20:07:23 -08:00
Keen Yee Liau
8db05b408e test(bazel): Integration test for Sass support (#28297)
Add .sass files to the integration test for bazel-schematics.

Also addressed Alex's comment in
https://github.com/angular/angular/pull/28167/files#r248149866
about the unit tests being too brittle.

PR Close #28297
2019-01-28 20:01:19 -08:00
Paul Gschwendtner
351610ca8d test: disable failing ivy example e2e tests (#28402)
PR Close #28402
2019-01-28 19:21:10 -08:00
Paul Gschwendtner
ef78e33560 build: switch example e2e tests to bazel (#28402)
* No longer builds the example e2e tests using "tsc". The examples are now built with Bazel and can therefore be built with Ivy by using the `--define=compile=aot` switch.
* No longer runs the example e2e tests using the protractor CLI. example e2e tests are executed with the Bazel protractor rule and can therefore run incrementally.

NOTE: Unit tests found within the examples are still running within the legacy jobs.

PR Close #28402
2019-01-28 19:21:10 -08:00
Keen Yee Liau
12b8a6e351 fix(bazel): Builder should invoke local bazel/iblaze (#28303)
Builder for `@angular/bazel` schematics should not expect bazel/ibazel
to be on the PATH. It should instead invoke the local executable
installed by yarn/npm.

PR Close #28303
2019-01-28 12:01:36 -08:00
Keen Yee Liau
260ac20e92 fix(bazel): Bazel-workspace schematics should run in ScopedTree (#28349)
Users should be able to add Bazel workspace to an existing project.
The current approach assumes that the schematics is working on the same
tree as that of ng-new, which includes the top-level directory. Instead,
the schematic should work on the tree rooted at `appRoot` to enable
Bazel files to be added to existing project.

This change uses the newly implemented ScopedTree
a0ac4b0e3d
to achieve this.

NOTE: The version of `@angular-devkit/schematics` that is installed is
used to run the `@angular/bazel` schematic. Even if a different version
is used in the schematic itself, it has no effect.
Therefore, the *latest* Angular CLI should be used to generate the
files. As of this commit, the latest version is @angular/cli@7.3.0-rc.0

PR Close #28349
2019-01-28 12:00:16 -08:00
Paul Gschwendtner
aed48e00d2 build: update sauce connect version (#28378)
PR Close #28378
2019-01-28 11:55:07 -08:00
Keen Yee Liau
a9d46e4952 fix(bazel): ng-new should run yarn install (#28381)
yarn install was disabled in ng-new for Bazel schematics because
Bazel manages its own node_modules dependencies and therefore
there is no need to install dependencies twice.

However, the first yarn install is needed for `ng` commands to work,
most notably `ng build`.

This commit restores the original behavior.

PR Close #28381
2019-01-28 11:54:37 -08:00
WilliamKoza
2f19ad9b46 fix(docs-infra): upgrade codelyzer to 4.5.0 (#28389)
PR Close #28389
2019-01-28 11:51:57 -08:00
Greg Magolan
81678e62db build(bazel): update to bazel 0.22.0 and turn on --incompatible_strict_action_env flag (#28404)
PR Close #28404
2019-01-28 11:48:42 -08:00
Alex Eagle
cf82fbceba build: set a default module_name for ts_library rules (#28051) (#28241)
PR Close #28051

PR Close #28241
2019-01-25 12:52:27 -08:00
George Kalpakas
1d67cb0ce1 test(docs-infra): increase timeout for redirection tests more (#28290)
Occasionally, external URLs take even longer than the previously set 60s
to load, which causes CI flakes.

PR Close #28290
2019-01-25 12:51:38 -08:00
George Kalpakas
318bd83a6e test(docs-infra): unregister the SW after each test (#28290)
This ensures that the SW is cleaned up, even in cases where
synchronization is disabled (and thus the clean-up inside `goTo()`
happens without waiting for Angular).

PR Close #28290
2019-01-25 12:51:38 -08:00
George Kalpakas
f767c22b31 test(docs-infra): unregister the SW after waitForAngular() (#28290)
This increases the chances that the clean-up will take place _after_ the
SW has been registered.

PR Close #28290
2019-01-25 12:51:38 -08:00
George Kalpakas
8346a6dca2 test(docs-infra): properly report errors if page.init() fails/rejects (#28290)
For asynchronous callbacks, this can be done either by calling
`done.fail()` or by returning the promise directly (without requesting a
`done` callback). (Using the latter, because it is shorter.)

PR Close #28290
2019-01-25 12:51:37 -08:00
Keen Yee Liau
6397885e74 test(bazel): Cleanup bazel-schematics integration test (#28351)
PR Close #28351
2019-01-25 12:47:27 -08:00
Greg Magolan
8cee56e8c5 fix(bazel): add @npm//tslib dep to e2e ts_library target in bazel-workspace schematic (#28358)
PR Close #28358
2019-01-25 12:38:35 -08:00
Jason Aden
a1b9995731 refactor(router): initalize browserUrlTree to empty tree (#28376)
The value here is unimportant on initialization since it's not looked at until the second navigation. However, sometimes in testing  the `Location` service is mocked out, or the Router constructor manually called. Assuming `Location` exists in the constructor leads to test failures in `google3` therefore we initialize to a value that will not cause errors.

PR Close #28376
2019-01-25 12:37:57 -08:00
Judy Bogart
35f7ff047a docs: add api doc for ngif (#27376) (#28344)
PR Close #27376

PR Close #28344
2019-01-24 15:45:06 -08:00
Judy Bogart
4ad691a33d docs: add api doc for ngfor (#27377) (#28344)
PR Close #27377

PR Close #28344
2019-01-24 15:45:06 -08:00
Judy Bogart
c5af3f8617 docs: add api doc to template_ref (#28344)
PR Close #28344
2019-01-24 15:45:06 -08:00
WilliamKoza
bc1032866c fix(docs-infra): change the key used to find out the cli section (#28293)
PR Close #28293
2019-01-24 15:41:45 -08:00
Carlos Schneider
63e6d1a896 docs(docs-infra): show top menu at 992px screen width (#26418)
Show top menu at 992px screen width. The JS expression was checking just for screen widths
strictly greater than 992px to show the menu, while the CSS media query was showing the hamburger
icon just for screen widths strictly smaller than 992px, so there was a gap of 1px that the user
could't navigate through the top menu.

closes #24324

PR Close #26418
2019-01-24 10:26:55 -08:00
WilliamKoza
cb9fd9b4d7 feat(docs-infra): saves the scroll position before the change of location (#28037)
Issue #27916, #17308

PR Close #28037
2019-01-24 10:24:43 -08:00
George Kalpakas
d5dca0764c fix(docs-infra): align property names to the top (#28104)
This looks better when the property descriptions span multiple lines;
especially when scrolling to a specific property (e.g.
[AbstractControl#status][1]).

[1]: https://next.angular.io/api/forms/AbstractControl#status

PR Close #28104
2019-01-24 10:24:04 -08:00
George Kalpakas
bcd1a09dec refactor(docs-infra): remove unused CSS style rule (#28104)
The `.properties-table` selector does not match any element and the
styles don't look relevant for the similarly named `.property-table`
class.

PR Close #28104
2019-01-24 10:24:04 -08:00
Dario Braun
898c0134e7 docs: fix typo and add parenthesis to method in HTTP tutorial (#28289)
Merge remote-tracking branch 'origin/TOH' into TOH


PR Close #28289
2019-01-24 10:23:25 -08:00
Felix Lemke
763d2150cc docs(animations): fix group and sequence function usage examples (#28305)
animate functions now contain style functions instead of plain objects
e.g. animate(1s, { background: black }))
to   animate(1s, style({ background: black }))

PR Close #28305
2019-01-24 10:21:35 -08:00
George Kalpakas
beacbfcb8e build(docs-infra): upgrade cli command docs sources to 699743282 (#28329)
Updating [angular#7.2.x](https://github.com/angular/angular/tree/7.2.x) from [cli-builds#7.2.x](https://github.com/angular/cli-builds/tree/7.2.x).
Relevant changes in [commit range](02d2ec250...699743282):

**Modified**
- help/generate.json
- help/new.json

PR Close #28329
2019-01-24 10:18:56 -08:00
William Neely
f72319cf6e docs(router): removed additional to (#25989)
PR Close #25989
2019-01-23 11:00:20 -08:00
Daniel Ruf
5877b3f702 refactor: remove unused parameter in _main method invocation (#28203)
PR Close #28203
2019-01-23 10:58:39 -08:00
Daniel Ruf
cf310ba1fa refactor: fix code style (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
Daniel Ruf
c2d2953ee4 refactor: remove unused parameters (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
Alex Rickabaugh
5c5fe34241 release: cut the v7.2.2 release 2019-01-22 15:27:48 -08:00
Jason Aden
32737a6bf7 fix(router): skipLocationChange with named outlets (#28301)
With #27680, a bug was fixed where multiple redirects using `eager` URL update could cause navigation to fail. However, that fix introduced a problem where with `skipLocationChange` enabled, the URL tree rendered was not properly stored for reference. This specifically caused an issue with named router outlets and subsequent navigations not being recognized.

This PR stores the correct `UrlTree` for reference with later navigations. It fixes the regression introdued with #27680.

Fixes #28200

PR Close #28301
2019-01-22 15:15:34 -08:00
Judy Bogart
7642308c14 docs: correct array to map (#27379)
PR Close #27379
2019-01-22 12:16:46 -08:00
Judy Bogart
f1c08d83b0 docs: add input doc (#27379)
PR Close #27379
2019-01-22 12:16:46 -08:00
Judy Bogart
617412f9c3 docs: add api doc for ng_style directive (#27379)
PR Close #27379
2019-01-22 12:16:46 -08:00
Jason Aden
cf716684a9 build: hide vscode settings e.g. debug launch config (#28299)
PR Close #28299
2019-01-22 11:38:16 -08:00
Luiz Machado
54565ed389 docs: fix crisis-detail milestone files (#27025)
Crisis Detail's template was being added two times and the component's TS none.
PR Close #27025
2019-01-22 11:19:51 -08:00
Alex Eagle
ab08385336 build: create dist/bin symlink with Bazel outputs (#27781)
Note that we had nasty problems in the past when this was enabled, but those have supposedly been fixed.

PR Close #27781
2019-01-22 09:52:46 -08:00
WilliamKoza
eb8ccf65d1 fix(docs-infra): removal of the use of the ChildNode.remove() method that it isn't supported by IE (#28188)
fixes #28177

PR Close #28188
2019-01-22 09:48:20 -08:00
Keen Yee Liau
cb93027f32 build: Fix gulp format for Node >= 10.14 (#28213)
With Node.js v10.14 and greater, running `yarn gulp format` produces
the following error:

```
$ nvm current
v10.15.0
$ yarn gulp format:changed
yarn run v1.12.3
$ /usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/.bin/gulp format:changed
internal/util/inspect.js:31
const types = internalBinding('types');
              ^

ReferenceError: internalBinding is not defined
    at internal/util/inspect.js:31:15
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at require (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:110:12)
    at util.js:25:21
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at require (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:110:12)
    at fs.js:42:21
    at req_ (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:137:5)
    at Object.req [as require] (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/natives/index.js:54:10)
    at Object.<anonymous> (/usr/local/google/home/kyliau/Documents/GitHub/angular/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:99)
```

A search on GitHub reveals this issue is due to natives@1.1.4:
gulpjs/gulp#2246

```
$ yarn why natives
yarn why v1.12.3
[1/4] Why do we have the module "natives"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "natives@1.1.6"
info Reasons this module exists
   - "gulp#vinyl-fs#graceful-fs" depends on it
   - Hoisted from "gulp#vinyl-fs#graceful-fs#natives"
   - Hoisted from "browserstacktunnel-wrapper#unzip#fstream#graceful-fs#natives"
```

The solution is to add a manual resolution for natives@1.1.6

PR Close #28213
2019-01-22 09:45:51 -08:00
Daniel Ruf
607fd8e970 refactor: remove unused case in switch statement (#28253)
PR Close #28253
2019-01-22 09:44:35 -08:00
WilliamKoza
f4ac96d0ff style(docs-infra): Active tslint rule semicolon (#28282)
PR Close #28282
2019-01-22 09:38:45 -08:00
Igor Minar
1c7d156abd ci: add a rebase check to the merge-pr script (#28250)
Adds a check to verify that each PR branch to be merged upstream contains SHAs of commits that significantly changed our CI infrastructure.

This check is used to enforce that we don't merge PRs that have not been rebased recently and could result in merging of non-approved or otherwise bad changes.

PR Close #28250
2019-01-22 09:26:54 -08:00
Alex Eagle
4c00059260 feat(compiler-cli): resolve generated Sass/Less files to .css inputs (#28166)
Users might have run the CSS Preprocessor tool *before* the Angular
compiler. For example, we do it that way under Bazel. This means that
the design-time reference is different from the compile-time one - the
input to the Angular compiler is a plain .css file.

We assume that the preprocessor does a trivial 1:1 mapping using the same
basename with a different extension.

PR Close #28166
2019-01-18 09:49:19 -08:00
Keen Yee Liau
93d78c9c51 build(bazel): Use local rollup & build-optimizer for ng_rollup_bundle (#28215)
The current build workflow depends on cross workspace dependency by
installing angular-cli as a Bazel repository. This is not ideal because
it introduces separate node_module directories other than the one
installed by Angular through the yarn_install rule (ngdeps).

This commit removes angular-cli from the Bazel workspace and installs
rollup and @angular-devkit/build-optimizer locally.

PR Close #28215
2019-01-18 09:07:53 -08:00
George Kalpakas
49bee4c0d8 ci(docs-infra): do not automatically post preview comments on PRs for team (#28211)
Right now, we post such comments whenever a file has been touched that
could potentially have affected the docs. Since the API docs are built
from comments in the source code, almost all non-docs changes are
generating such preview comments, even though most of the time they are
irrelevant to the author and create unnecessary noise on the PR
(especially for actively worked-on PRs).

This commit removes the `team` GitHub team from the list of teams whose
members will automatically get preview comments.
(Adding the `aio: preview` label would still work on any PR.)

Jira: FW-967

PR Close #28211
2019-01-17 14:11:43 -08:00
Kapunahele Wong
d8c75f1bb0 docs: fix comments in services example (#26194)
PR Close #26194
2019-01-16 17:38:24 -08:00
WilliamKoza
6d40ef2d6b fix(docs-infra): improve a11y (#28086)
Issue #27723

PR Close #28086
2019-01-16 17:37:46 -08:00
Keen Yee Liau
4ea6c27dcf build(bazel): Use @angular/cli from root package.json (#28139)
A few integration tests now depend on @angular/cli.

This commit changes the affected tests to use the dependency
on @angular/cli defined at root package.json.

PR Close #28139
2019-01-16 17:37:23 -08:00
Keen Yee Liau
a4d9192fbc feat(bazel): Add support for SASS (#28167)
This commit adds the appropriate rules to the WORKSPACE for a project
that requires SASS support.

PR Close #28167
2019-01-16 17:35:55 -08:00
Keen Yee Liau
7b772e93a3 fix(bazel): Fix integration test after v8 bump (#28194)
The integration test for bazel-schematics installs Angular in
two different locations:

1. Bazel workspace
2. package.json -> fetched from npm

Pull request #28142 changes the test to always install (1) from
source. This breaks when there's a major version bump since the
versions locally and the version in package.json no longer match.

This change updates package.json to fetch @angular/* packages
locally as well.

PR Close #28194
2019-01-16 16:50:52 -08:00
Andrew Kushnir
05168395b0 release: cut the v7.2.1 release 2019-01-16 13:23:06 -08:00
Alan
03293c4fec fix(ivy): normalize summary and factory shim files paths (#28173)
At the moment, paths stored in `maps` are not normalized and in Windows is causing files not to be found when enabling factory shimming.

For example, the map contents will be
```
Map {
  'C:\\git\\cli-repos\\ng-factory-shims\\index.ngfactory.ts' => 'C:\\git\\cli-repos\\ng-factory-shims\\index.ts' }
```

However, ts compiler normalized the paths and is causing;
```
error TS6053: File 'C:/git/cli-repos/ng-factory-shims/index.ngfactory.ts' not found.
error TS6053: File 'C:/git/cli-repos/ng-factory-shims/index.ngsummary.ts' not found.
```

The changes normalized the paths that are stored within the factory and summary maps.

PR Close #28173
2019-01-16 11:56:53 -08:00
George Kalpakas
479019f457 test(upgrade): clean up global state after test (#28181)
In ngUpgradeLite, when a downgraded component
[requests its downgraded module][1], the AngularJS injector is
[temporarily stored][2] with the intention of grabbing it
[once the module has been bootstrapped][3] (which also cleans up the
[temporary injector reference][4]).

In [some tests][5], bootstrapping a component might throw an error,
which causes the test to fail immediatelly and move on to the next
test. In slow browsers (e.g. on CI/Saucelabs), the (successful)
bootstrapping of another downgraded module might not have been
completed in time and thus the temporary injector reference not cleaned
up.

In such a case, if the following test (in our randomized test suite)
happens to rely on the temporary injector reference's being initially
unset (such as [this test][6]), it will fail. This might appear as a
flake on CI, because it depends on a race condition and specific order
of tests, so it usually goes away after a rerun.

This commit fixes it by ensuring the temporary injector reference is
manually cleaned up, when necessary.

Jira issue: FW-939

[1]: f983e99fb2/packages/upgrade/src/common/downgrade_component.ts (L120)
[2]: f983e99fb2/packages/upgrade/src/static/downgrade_module.ts (L165)
[3]: f983e99fb2/packages/upgrade/src/static/downgrade_module.ts (L169)
[4]: f983e99fb2/packages/upgrade/src/static/angular1_providers.ts (L25)
[5]: f983e99fb2/packages/upgrade/test/static/integration/downgrade_module_spec.ts (L1331-L1381)
[6]: f983e99fb2/packages/upgrade/test/static/angular1_providers_spec.ts (L31-L45)

PR Close #28181
2019-01-16 11:56:53 -08:00
Benedikt Meurer
68515818b9 perf(platform-server): use shared DomElementSchemaRegistry instance (#28150) (#28151)
Right now the `ServerRendererFactory2` creates a new instance of the
`DomElementSchemaRegistry` for each and every request, which is quite
costly (for the Tour of Heroes SSR this takes around **30%** of the
overall execution time). Since the schema is never modified, but only
used in a read-only fashion, it should be possible to re-use a single
instance instead.

Naive performance testing with 100 concurrent connections and 1000
requests in total shows an approximate **33%** improvement in Req/Sec
on the Tour of Heroes SSR example.

PR Close #28150

PR Close #28151
2019-01-16 11:56:53 -08:00
Jason Aden
8bc369f828 docs(router): add clarification for Router config (#28159)
PR Close #28159
2019-01-16 11:56:53 -08:00
Judy Bogart
3d1a4d5cc3 docs: add api doc for switch directives (#27378)
PR Close #27378
2019-01-16 11:56:53 -08:00
Ernest Galbrun
5c56b778e0 docs(core): fix typo (#28042)
PR Close #28042
2019-01-16 11:56:53 -08:00
Serginho
585e871c96 fix(service-worker): navigation urls backwards compatibility (#27244)
PR Close #27244
2019-01-16 11:56:53 -08:00
Jason Aden
6ae7aee2c3 fix(router): ensure URL is updated after second redirect with UrlUpdateStrategy="eager" (#27680)
Navigating to a route such as `/users`, you may get redirected to `/login`. Previously, if you go then route to `/users` again the URL will end up showing `/users` after the second redirect. This only happened in `UrlUpdateStrategy="eager"`. This is now fixed so after the second redirect, the URL shows the correct page.

Fixes #27116

PR Close #27680
2019-01-16 11:56:53 -08:00
Keen Yee Liau
701270d039 test(bazel): Use local_repository to load Angular (#28142)
The current integration test for Bazel schematics downloads a
published version of Angular as required by the http_archive
rule in the CLI created WORKSPACE.
However, this makes the test less useful because it does not
actually test any changes to the Angular repo at source.
This PR replaces the http_archive method in the WORSPACE
with local_repository so that any local changes to the Angular
repo are tested accordingly.

With Typescript 3.2, the file e2e/src/app.po.ts generated by CLI
no longer compiles under Bazel due to missing type annotations.
A temporary file is placed in the integration/bazel-schematics
directory while the change is pending in CLI repo.
https://github.com/angular/angular-cli/pull/13406

PR Close #28142
2019-01-16 11:56:53 -08:00
Keen Yee Liau
02a852a34a fix(bazel): Bazel schematics should add router package (#28141)
This commit fixes a bug whereby a Bazel project created by the
schematics would not compiled if project contains routing module.

It is missing a dependency on the router package.

PR Close #28141
2019-01-16 11:56:52 -08:00
赵正阳
531f940212 docs(ivy): remove duplicated words in architecture doc (#27471)
PR Close #27471
2019-01-16 11:56:52 -08:00
krzysztof-grzybek
de80f1b6dd docs: update testing doc example style for HostListener (#26372)
HostListener is preferred over host metadata by official style guide

PR Close #26372
2019-01-16 11:56:52 -08:00
Paul Gschwendtner
ca3965afe0 fix(bazel): incorrectly always uses ngc-wrapped from "npm" workspace (#28137)
* This is a follow-up to cd0451305a which fixes that "ngc-wrapped" from the "npm" workspace is always used if "angular" is fetched as an external dependency.

PR Close #28137
2019-01-16 11:56:52 -08:00
Malgosia
f269e433a7 docs: ng config link fix (#28115)
Fixed 'ng config' link to lead to proper CLI command site
PR Close #28115
2019-01-16 11:56:52 -08:00
WilliamKoza
8750b09fca fix(docs-infra): Add crossed through styling (#28111)
PR Close #28111
2019-01-16 11:56:52 -08:00
WilliamKoza
ea2eef737b fix(docs-infra): change style of deprecated markers (#28111)
PR Close #28111
2019-01-16 11:56:52 -08:00
WilliamKoza
0ceab97a03 fix(docs-infra): render deprecated markers for CLI command options (#28111)
fixes #27563
fixes #27423

PR Close #28111
2019-01-16 11:56:52 -08:00
Paul Gschwendtner
fbbdaaacc0 fix(bazel): replay compilation uses wrong compiler for building esm5 (#28053)
With the update to TypeScript 3.2.x, a big issue seems to have appeared for downstream Bazel users. If the downstream user still uses a lower TypeScript version, normal Bazel targets using the `ng_module` rule are still compiled with the correct/old TypeScript version (assuming they set the `node_modules` attribute properly).

But, if they build the previous Bazel targets by specifying them within a `ng_package` rule, the TypeScript version from the Angular `workspace` is being used for the replayed ESM5 compilation. This is because we resolve the replay compiler to `ngc_wrapped` or `tsc_wrapped` Bazel executables which are defined as part of the `angular` workspace. This means that the compilers are different if the downstream user uses `ngc-wrapped` from the `@npm` repository because the replayed compilation would use the compiler with `@ngdeps//typescript`.

In order to fix this, we should just use the compiler that is defined in the `@angular//BUILD.bazel` file. This target by defaults to the "@npm" workspace which is working for downstream users. This is similar to how it is handled for `tsc-wrapped`. `tsc-wrapped` works as expected for downstream users.

**Note**: This is not the ideal solution because ideally we would
completely respect the `compiler` option from the base `ng_module`, but
this is not possible in a hermetic way, unless we somehow accept the
`compiler` as an attribute that builds all transitive deps. This is
something we should explore in the future. For now, we just fix this in
a reasonable way that is also used for `tsc_wrapped` from the TypeScript
rules.

PR Close #28053
2019-01-16 11:56:52 -08:00
Keen Yee Liau
080de58a88 refactor(bazel): use web_package rule for index.html (#27995)
index.html needs to have the zone.js and the project bundle injected
using script tags. This used to be done explicitly by specifying a
new index.html but with `web_package` rule introduced in rules_nodejs,
it is now possible to perform the injection dynamically.

PR Close #27995
2019-01-16 11:56:52 -08:00
javatutorials2016
5390948360 docs: fix typo in singleton services guide (#27948)
PR Close #27948
2019-01-16 11:56:51 -08:00
Shivam_Vyas
0d860051af docs: change in(what should I import? answer) NgModule FAQs (#27677)
I think only should be after BrowserModule , because we can import more than BrowserModule and I think we need to import other modules to AppModule in most of cases and we should import BrowserModule only in AppModule,so that thing seems okay.

PR Close #27677
2019-01-16 11:56:51 -08:00
Ashinze Ekene
edbba24b60 docs: fix typo in dependency injection guide (#27616)
~~`HeroService` must provided in some parent injector~~
*`HeroService` must be provided in some parent injector*

PR Close #27616
2019-01-16 11:56:51 -08:00
Brad Brandhorst
6ae8d7691d docs: fix typo in docs.md (#27484)
Added a period to the end of the last sentence in the first paragraph
PR Close #27484
2019-01-16 11:56:51 -08:00
kwiateusz
af3cf36ce9 docs: ngComponentOutlet doc updated with new Injector creation (#27291)
PR Close #27291
2019-01-16 11:56:51 -08:00
coultonluke
1be2f11965 docs: updates to minor spelling mistakes in pipes guide (#27208)
PR Close #27208
2019-01-16 11:56:51 -08:00
Brandon Roberts
495ce325b2 docs: add browser polyfills for IE11 with hash-based routing (#27135)
Closes #26511

PR Close #27135
2019-01-16 11:56:51 -08:00
Sasidhar Vanga
92411043d1 docs: fix GitHub pages deployment command (#26896)
closes #26803
PR Close #26896
2019-01-16 11:56:51 -08:00
Steve Dignan
aa3f75b3c9 docs: minor wording change in code example comment (#26835)
PR Close #26835
2019-01-16 11:56:51 -08:00
Courtney Pattison
d64aadf57a docs: fix typo in testing guide (#26828)
PR Close #26828
2019-01-16 11:56:51 -08:00
cyraid
51f7f081a3 docs: update link in universal guide (#26628)
Link to the document "53 percent of mobile site visits" was changed, updated link. Old link led to a page that didn't have the statistics on it.

PR Close #26628
2019-01-16 11:56:50 -08:00
Alan Agius
b9fd62413f docs: fix scripts section and some minor issues in universal documentation (#26444)
PR Close #26444
2019-01-16 11:56:50 -08:00
George Kalpakas
c5664bf245 test(docs-infra): increase timeout for all redirection tests (#28103)
Occasionally, URLs take longer to load, which causes CI flakes.
In #27903, the timeout for external URLs was increased, but internal
URLs turned out to be affected as well.

PR Close #28103
2019-01-16 11:56:50 -08:00
Judy Bogart
c66a076614 docs: add library doc to guides in aio (#27581)
PR Close #27581
2019-01-16 11:56:50 -08:00
Keen Yee Liau
28d34b699d fix(bazel): Add ibazel to deps of Bazel project (#28090)
Incremental rebuilds is a fundamental part of the development
workflow. `@bazel/ibazel` should be added to the dev dependencies
of a Bazel project.

PR Close #28090
2019-01-16 11:56:50 -08:00
Pete Bacon Darwin
47840bee71 docs(forms): fix up @see tags for AbstractContol (#28069)
PR Close #28069
2019-01-16 11:56:50 -08:00
Pete Bacon Darwin
305331f634 build(docs-infra): render @see information in members (#28069)
Previously `@see` tags were only rendered for top level class-like
docs. Now these tags are rendered for methods and properties too.

PR Close #28069
2019-01-16 11:56:50 -08:00
George Kalpakas
5e6c24cb01 build: update version in package.json (#28075)
The version was updated on master (with 0efbb3738), but the commit was
not backported to 7.2.x. As a result, the version on angular.io appears
as `7.2.0-rc.0` (instead of 7.2.0).

PR Close #28075
2019-01-16 11:56:40 -08:00
George Kalpakas
0ec4e1372a docs(service-worker): fix example of manually checking for updates (#28020)
Poll for updates in a way that does not prevent the SW from being
registered. Discussed in https://github.com/angular/angular/pull/27332#pullrequestreview-179504620.

PR Close #28020
2019-01-16 11:55:47 -08:00
George Kalpakas
84c1bad3a1 style(service-worker): fix code formatting in service-worker-getting-started example (#28020)
PR Close #28020
2019-01-16 11:55:47 -08:00
George Kalpakas
1640832f56 docs(service-worker): fix the service-worker-getting-started docs example (#28020)
Changes:
- Change the project type to `service-worker`, so that it gets
  appropriate `package.json` (with `@angular/service-worker` dependency)
  and `angular.json` (with `serviceWorker: true` in production config).
- Move `ngsw-config.json` to the correct directory.
- Specify custom test commands for aio's `yarn example-e2e` to also
  verify that the ServiceWorker bits are set up correctly.

PR Close #28020
2019-01-16 11:55:47 -08:00
George Kalpakas
8ab036262d feat(docs-infra): add support for custom test commands in cli-based docs examples (#28020)
Previously, cli-based docs examples were tested using `yarn e2e ...`. In
some cases, it might make sense to run different or additional checks
for a docs example (when running `yarn example-e2e` in `aio/`).

Currently, the only option is to define a custom project type and
overwrite the `e2e` yarn script in `package.json`. Doing so (in addition
to being cumbersome and verbose) would also end up in the `.zip` archive
that users can download to run the example locally. This would be
confusing, if these custom tests are specific to our CI needs.

This commit adds support for defining a custom list of commands per
example. These commands (if specified) would be run instead of the
default `yarn e2e ...`, when testing the docs examples on CI (via
`yarn example-e2e`).

(This feature will be used to verify that the
`service-worker-getting-started` example is set up correctly in a
subsequent commit, but can be useful in other cases as well.)

PR Close #28020
2019-01-16 11:55:47 -08:00
George Kalpakas
76e8c0ac7b feat(docs-infra): add service-worker project type (#28020)
File overwrites:
- **angular.json**: Add `serviceWorker: true` to production config.
- **package.json**: Add `@angular/service-worker` to dependencies.

This will make any `service-worker` examples work out-of-the-box, when
downloading and running locally from the `.zip` archives.

PR Close #28020
2019-01-16 11:55:47 -08:00
Judy Bogart
0e81e418fb docs: add schematics terms to glossary (#27862)
PR Close #27862
2019-01-16 11:55:47 -08:00
Kapunahele Wong
60255b68c0 docs: re-write interpolation section and add example (#25170)
PR Close #25170
2019-01-16 11:55:47 -08:00
Karanveer Plaha
ae7b3c8d45 docs(router): fixed a typo in CanLoad title text (#27894)
* Interface that a class can implement to be a guard deciding if a children can be loaded.
'...if a children...' changed to '...if children...'
 * Interface that a class can implement to be a guard deciding if children can be loaded.

PR Close #27894
2019-01-16 11:55:47 -08:00
Joseph Harrison-Lim
9556ba7bca docs(router): fix misnamed path (#27879)
This change matches the routes found in the following code example
for auth.guard.ts as well as the login.component.1.ts in the "Add
the LoginComponent" section.

PR Close #27879
2019-01-16 11:55:47 -08:00
Mark Goho
80994b25b9 docs: fix typo (#27865)
PR Close #27865
2019-01-16 11:55:47 -08:00
Johannes Hoppe
2f154b980f docs: fix broken html for deployment.md (#27851)
without the closing quote the text and link are not displayed correctly

PR Close #27851
2019-01-16 11:55:46 -08:00
Teamop
342d352a00 refactor(core): improve type for EventEmitter (#27228)
PR Close #27228
2019-01-16 11:55:46 -08:00
Keen Yee Liau
f240ae5084 build(bazel): Bump @bazel/typescript & @bazel/karma to 0.22.1 (#28031)
PR Close #28031
2019-01-16 11:55:46 -08:00
Suguru Inatomi
e4fc8bad35 fix(bazel): Add /bazel-out to .gitignore (#27874)
PR Close #27874
2019-01-16 11:55:46 -08:00
George Kalpakas
5c680d4aa8 test(upgrade): log more info to help debug CI flakes (#28045)
Related Jira issue: FW-939

PR Close #28045
2019-01-16 11:55:46 -08:00
Paul Gschwendtner
f05c5f82c8 fix(bazel): protractor rule does not run spec files with underscore (#28022)
There are various e2e tests with the `_spec.ts` suffix in the Angular project. Currently the protractor Bazel rule does not pick up these files and just ignores them. Since underscore is commonly used, we should support this.

Needed for the conversion fo the `examples` to Bazel.

PR Close #28022
2019-01-16 11:55:46 -08:00
George Kalpakas
2e0c58ec3e docs: document why not using compare-url orb (#28010)
Discussed in
https://github.com/angular/angular/pull/27775#issuecomment-452565603.

PR Close #28010
2019-01-16 11:55:46 -08:00
Keen Yee Liau
21093b9090 fix(bazel): Add @bazel/bazel to dev deps (#28032)
Project created by @angular/cli depends on Bazel at build time and
we should not assume that Bazel is available globally.
Instead, the project should specify an explicit dev dependency on
`@bazel/bazel`.

PR Close #28032
2019-01-16 11:55:46 -08:00
George Kalpakas
a6153accf0 docs: remove deprecated fromPromise from RxJS guide (#28015)
Follow-up to #27443.

PR Close #28015
2019-01-16 11:55:46 -08:00
Meknassih
dee789c204 docs(core): add missing closing backtick (`) (#27908)
PR Close #27908
2019-01-16 11:55:46 -08:00
Ivan Tham
12dd552fcd docs(forms): remove duplicated link (#27884)
PR Close #27884
2019-01-16 11:55:45 -08:00
Michael De Wree
079bcffe07 docs: fix typo PageNotFoundCompponent (#27799)
closes: #27795

PR Close #27799
2019-01-16 11:55:45 -08:00
Igor Minar
30256e8fe8 ci: add brandonroberts to @angular/docs-infra codeowners (#28023)
Brandon is joining the docs-infra team in addition to the docs team.

PR Close #28023
2019-01-16 11:55:45 -08:00
Keen Yee Liau
8ee69831fc build(bazel): List explicit dependencies in WORKSPACE (#28000)
Instead of relying on implicit dependencies through Angular, the WORKSPACE
of the project should explicitly add rules_nodejs and rules_typescript so
it can better control the versions.

PR Close #28000
2019-01-16 11:55:45 -08:00
Paul Gschwendtner
c3d8e2888d fix(bazel): flat module misses AMD module name on windows (#27839)
* Fixes that the flat module out files do not have a proper AMD module name on Windows. This is currently blocking serving a `ng_module` using the Bazel TypeScript `devserver` on Windows.

PR Close #27839
2019-01-16 11:55:45 -08:00
Paul Gschwendtner
bea677136b build: re-enable disabled e2e tests (#27979)
Re-enables a few e2e tests which have been disabled a long time ago. Since these pass now, we should re-enable them.

PR Close #27979
2019-01-16 11:55:45 -08:00
Paul Gschwendtner
11728bbbd9 build: remove travisci leftovers (#27979)
PR Close #27979
2019-01-16 11:55:45 -08:00
WilliamKoza
1da4b03940 fix(aio): Treating some deprecated (#27981)
PR Close #27981
2019-01-16 11:55:45 -08:00
Dario Braun
54ba0f021f docs(core): fix characters that corrupt link (#27982)
PR Close #27982
2019-01-16 11:55:45 -08:00
George Kalpakas
836a5c72a0 build(docs-infra): remove unnecessary script to workaround cli issue (#28012)
The cli issue has been fixed and we no longer need to work around it.
This is essentially reverting #23470.

PR Close #28012
2019-01-16 11:55:45 -08:00
George Kalpakas
f589933440 test(upgrade): properly clean up after tests to avoid errors in unrelated tests (#28013)
Many `ngUpgrade` tests need to manually [bootstrap modules][1] (instead
of using `TestBed` which automatically cleans up) and thus need to also
manually clean up afterwards (e.g. by calling [destroyPlatform()][2]
after each test).

Failing to destroy the platform is usually not a problem, unless the
next test tries to manually destroy it (as a precaution), as happens
[here][3] (among other places).

More specifically, the problem happens, because (as part of the clean-up
happening on platform destruction) upgraded components will try to
[call a method][4] on `angular.element` after `angular` has been
[set to `undefined`][5] (assuming the last test was using the
[withEachNg1Version()][6] helper).

Because the test order is pseudo-random and thus different on each run,
these errors did not always come up and - when they did- they would go
away after a couple of reruns, making them appear as flakes on CI.

(For reference, the issue was introduced in 43c33d566.)

This commit eliminates the issue by always destroying the platform after
each `ngUpgrade` test.

Jira issue: FW-924

[1]: c3aa24c3f9/packages/upgrade/test/static/test_helpers.ts (L21)
[2]: c3aa24c3f9/packages/upgrade/test/static/integration/upgrade_component_spec.ts (L24)
[3]: c3aa24c3f9/packages/elements/test/create-custom-element_spec.ts (L31)
[4]: c3aa24c3f9/packages/upgrade/src/common/upgrade_helper.ts (L134-L135)
[5]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L115)
[6]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L31)

PR Close #28013
2019-01-16 11:55:45 -08:00
Andrew Crites
ef3ec34aa3 docs: use static zip function as an Observable creator. (#26790)
The existing example makes it seem like zip is a pipeable operator. It can be used this way, but I think that is for backwards compatibility. You can achieve the same functionality by using it as an Observable creator. I think this also makes the example clearer.

PR Close #26790
2019-01-16 11:55:44 -08:00
Kara Erickson
37a6d2d033 Revert "test(ivy): re-enable passing animation tests (#27997)"
This reverts commit 097af5ae2b75b6040d22348d75e2923fa6ada8ec.
It was accidentally merged on both master and patch branches when
it should have only been merged on master.
2019-01-16 11:55:44 -08:00
Zheng Kai
354f3639bb docs: update rxjs example and change fromPromise to from (#27443)
the first example at https://angular.io/guide/rx-library,
https://github.com/ReactiveX/rxjs-tslint/issues/7

PR Close #27443
2019-01-16 11:55:44 -08:00
cexbrayat
c4b06868b1 test: fix outDir in TS 3.2 integration test (#27774)
PR Close #27774
2019-01-16 11:55:44 -08:00
Igor Minar
e3853e842e ci: fix public api rule in codeowners (#27999)
@alxhub spotted that the public api rule in codeowners is being overriden by the Build & CI Owners rule.

swapping the two sections fixes the problem.

PR Close #27999
2019-01-16 11:55:44 -08:00
Kara Erickson
aee5cbd057 test(ivy): re-enable passing animation tests (#27997)
PR Close #27997
2019-01-16 11:55:44 -08:00
Kara Erickson
e9614eff1a ci: update payload size for cli-hello-world (#27994)
PR Close #27994
2019-01-16 11:55:44 -08:00
Kara Erickson
80f9f7e8ef docs: group fixes and features for 7.2.0 in changelog desc (#27974)
PR Close #27974
2019-01-16 11:55:37 -08:00
Alex Eagle
7d2589556f docs: remove Travis status from README (#27973)
we no longer use TravisCI
PR Close #27973
2019-01-16 11:54:04 -08:00
George Kalpakas
468fcab59d ci: compute commit range for rerun workflows (#27775)
On push builds, CircleCI provides `CIRCLE_COMPARE_URL`, which we use to
extract the commit range for a given build. When a workflow is rerun
(e.g. to recover from a flaked job), `CIRCLE_COMPARE_URL` is not
defined, causing some jobs to fail.

This commit fixes it by retrieving the compare URL from the original
workflow. It uses a slow process involving a (potentially large) number
of requests to CircleCI API.
It depends on the (undocumented) fact, that the `workspace_id` is the
same on all rerun workflows and the same as the original `workflow_id`.

PR Close #27775
2019-01-16 11:54:04 -08:00
Igor Minar
f720e972d4 ci: remove required ci status for travis from angular-robot.yaml (#27970)
we missed this one!! oops

the robot should not expect travis status check on PRs any more.

PR Close #27970
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
b51ae7e59a build: increase parallelism for "test_docs_examples" job (#27937)
PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
eedb06936f build: group sharded "test_docs_examples" jobs within circleci (#27937)
* Groups the two sharded `test_docs_examples` job using CircleCI's `parallelism` feature.  This makes the amount of jobs that show up on a PR, more reduced and also reduces code duplication for maintaining the Circle job definition.

PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
ee5a094424 build: bazel integration test using limited resources (#27937)
PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
9773b5a173 build: shard integration tests on circleci (#27937)
PR Close #27937
2019-01-16 11:54:04 -08:00
Igor Minar
eed171839e test: fix integration/platform-server test which had missing @types/node devDep (#27937)
I'm not sure why this problem is visible only now or how this worked before, but the CI
is now failing because @types/node is missing.

I also added the yarn.lock file which was previously omitted. We want the yarn.lock file in so that
our deps don't change over time without us knowing.

PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
1057b52def build: remove "build.sh" script (#27937)
this script is now obsolete and not needed any more. yay!!!

PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
302506e940 build: remove "test.sh" script (#27937)
test.sh is no longer needed... all the tests should now be executed via bazel.

if for whatever reason we need to run the legacy unit test setup, we should should follow the commands that we use to execute those tests in .circle/config.yaml

PR Close #27937
2019-01-16 11:54:04 -08:00
Paul Gschwendtner
cc35feb445 ci: remove travis ci setup (#27937)
we no longer need it... yay!!!

PR Close #27937
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
21b875d4d0 ci: run legacy e2e tests in parallel (#27937)
PR Close #27937
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
dac9c09235 ci: move e2e tests from travis to circleci (#27937)
PR Close #27937
2019-01-16 11:54:03 -08:00
Igor Minar
5cba438eb5 ci: remove build steps that are no longer needed (#27937)
the metadata build seems to be needed only by the offline compiler tests which is currently disabled

PR Close #27937
2019-01-16 11:54:03 -08:00
Igor Minar
2b001cb2b1 ci: move local and saucelabs unit tests to circle (#27937)
Moving the tests over to CircleCI in pretty much "as-is" state just so that we can drop the dependency on Travis.

In the followup changes we plan to migrate these tests to run on sauce under bazel. @gregmagolan is working on that.

I've previously verified that all the tests executed in legacy-unit-tests-local already under bazel.
Therefore the legacy-unit-tests-local job is strictly not necessary any more, but given how flaky legacy-unit-tests-saucelabs is,
it is good to have the -local job just so that we can quickly determine if any failure is a flake or legit issue
(the bazel version of these tests could theoretically run in a slightly different way and fail or not fail in a different way, so having -lcoal job is just an extra safety check).

This change was coauthored with @devversion

PR Close #27937
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
0be8487f09 fix(bazel): protractor utils cannot start server on windows (#27915)
* Currently the protractor utils assume that the specified Bazel server runfile can be resolved by just using the real file system. This is not the case on Windows because the runfiles are not symlinked into the working directory and need to be resolved through the runfile manifest.

PR Close #27915
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
e1e69ca828 test(bazel): re-enable ng_package golden testing on ci (#27829)
* Enables the ng_package golden testing on the CI
* Fixes the ng_package golden testing for Windows

PR Close #27829
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
f376c46d78 test(bazel): fix all ng_package tests not working on windows (#27829)
PR Close #27829
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
fad4145f48 fix(bazel): packager not properly removing amd directives on windows (#27829)
PR Close #27829
2019-01-16 11:54:03 -08:00
Paul Gschwendtner
6b394f62be fix(bazel): ng_package creates invalid typings reexport on windows (#27829)
Currently when building a package on Windows, the typings re-export for secondary entry-points is not valid TypeScript. Similarly the metadata and the "package.json" files use non-posix paths and cause inconsistency within the NPM package.

For example:

_package.json_
```
  "esm5": "./esm5\\core.js",
  "esm2015": "./esm2015\\core.js",
```

_testing.d.t.s_ (of the `core` package)
```
export * from './testing\testing';
```

PR Close #27829
2019-01-16 11:54:03 -08:00
Enmanuel
16aad8b2d8 docs: add Alyle UI to resources (#27954)
PR Close #27954
2019-01-16 11:54:03 -08:00
Igor Minar
25bbcbcbe5 ci: add brandonroberts to @angular/framework-global-approvers-for-docs-only-changes (#27949)
I’ve observed that Brandon reviews many docs-only PRs and then we still need me or Jeniffer to approve them.

In most cases, Brandon is perfectly qualified to approve these, so I’m proposing that Brandon is added to the framework-global-approvers-for-docs-only-changes group.

PR Close #27949
2019-01-16 11:54:02 -08:00
1187 changed files with 164645 additions and 17694 deletions

View File

@ -1,4 +1,6 @@
node_modules
dist
aio/content
aio/node_modules
aio/tools/examples/shared/node_modules
integration/bazel

View File

@ -1,5 +1,3 @@
# Load any settings specific to the current user
try-import .bazelrc.user
################################
# Settings for Angular team members only
################################
@ -22,12 +20,18 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test
# Filesystem interactions #
###############################
# Don't create symlinks like bazel-out in the project.
# These cause VSCode to traverse a massive tree, opening file handles and
# Create symlinks in the project:
# - dist/bin for outputs
# - dist/testlogs, dist/genfiles
# - bazel-out
# NB: bazel-out should be excluded from the editor configuration.
# The checked-in /.vscode/settings.json does this for VSCode.
# Other editors may require manual config to ignore this directory.
# In the past, we say a problem where VSCode traversed a massive tree, opening file handles and
# eventually a surprising failure with auto-discovery of the C++ toolchain in
# MacOS High Sierra.
# See https://github.com/bazelbuild/bazel/issues/4603
build --symlink_prefix=/
build --symlink_prefix=dist/
# Performance: avoid stat'ing input files
build --watchfs
@ -36,6 +40,16 @@ build --watchfs
run --nolegacy_external_runfiles
test --nolegacy_external_runfiles
# Turn on --incompatible_strict_action_env which was on by default
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
# This flag is needed to so that the bazel cache is not invalidated
# when running bazel via `yarn bazel`.
# See https://github.com/angular/angular/issues/27514.
build --incompatible_strict_action_env
run --incompatible_strict_action_env
test --incompatible_strict_action_env
###############################
# Release support #
# Turn on these settings with #
@ -101,3 +115,7 @@ build:remote --remote_instance_name=projects/internal-200822/instances/default_i
# Do not accept remote cache.
# We need to understand the security risks of using prior build artifacts.
build:remote --remote_accept_cached=false
# Load any settings specific to the current user. Needs to be last statement in this
# config, as the user configuration should be able to overwrite flags from this file.
try-import .bazelrc.user

View File

@ -2,6 +2,10 @@
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
# See documentation in /docs/BAZEL.md
# Save downloaded repositories in a location that can be cached by CircleCI. This helps us
# speeding up the analysis time significantly with Bazel managed node dependencies on the CI.
build --repository_cache=/home/circleci/bazel_repository_cache
# Don't be spammy in the logs
# TODO(gmagolan): Hide progress again once build performance improves
# Presently, CircleCI can timeout during bazel test ... with the following

View File

@ -11,16 +11,43 @@
# needed for jobs that run tests without Bazel. Bazel runs tests with browsers that will be
# fetched by the Webtesting rules. Therefore for jobs that run tests with Bazel, we don't need a
# docker image with browsers pre-installed.
# **NOTE**: If you change the version of the docker images, also change the `cache_key` suffix.
# **NOTE 1**: If you change the version of the `*-browsers` docker image, make sure the
# `CI_CHROMEDRIVER_VERSION_ARG` env var (in `.circleci/env.sh`) points to a ChromeDriver
# version that is compatible with the Chrome version in the image.
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
var_1: &default_docker_image circleci/node:10.12
var_2: &browsers_docker_image circleci/node:10.12-browsers
var_3: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-node-10.12
# We don't want to include the current branch name in the cache key because that would prevent
# PRs from being able to restore the cache since the branch names are always different for PRs.
# The cache key should only consist of dynamic values that change whenever something in the
# cache changes. For example:
# 1) yarn lock file changes --> cached "node_modules" are different.
# 2) bazel repository definitions change --> cached bazel repositories are different.
# **NOTE 1 **: If you change the cache key prefix, also sync the restore_cache fallback to match.
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v3-angular-node-10.12-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
# Define common ENV vars
var_4: &define_env_vars
# Initializes the CI environment by setting up common environment variables.
var_4: &init_environment
run:
name: Define environment variables
command: ./.circleci/env.sh
name: Initializing environment (setting up variables, overwriting Yarn)
# Overwrite the yarn installed in the docker container with our own version.
command: |
./.circleci/env.sh
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.13.0/bin/yarn.js)
sudo chmod a+x $ourYarn
sudo ln -fs $ourYarn /usr/local/bin/yarn
echo "Yarn version: $(yarn --version)"
# Add GitHub to known hosts.
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
var_5: &setup_bazel_remote_execution
run:
@ -36,33 +63,94 @@ var_6: &job_defaults
docker:
- image: *default_docker_image
# After checkout, rebase on top of master.
# Similar to travis behavior, but not quite the same.
# See https://discuss.circleci.com/t/1662
# After checkout, rebase on top of target branch.
var_7: &post_checkout
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
run:
name: Rebase PR on target branch
command: >
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
# User is required for rebase.
git config user.name "angular-ci"
git config user.email "angular-ci"
# Rebase PR on top of target branch.
node tools/rebase-pr.js angular/angular ${CIRCLE_PR_NUMBER}
else
echo "This build is not over a PR, nothing to do."
fi
var_8: &yarn_install
run:
name: Running Yarn install
command: yarn install --frozen-lockfile --non-interactive
command: |
# Yarn's requests sometimes take more than 10mins to complete.
# Print something to stdout, to prevent CircleCI from failing due to not output.
while true; do sleep 60; echo "[`date`] Keeping alive..."; done &
KEEP_ALIVE_PID=$!
yarn install --frozen-lockfile --non-interactive
kill $KEEP_ALIVE_PID
var_9: &setup_circleci_bazel_config
run:
name: Setting up CircleCI bazel configuration
command: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
var_10: &restore_cache
restore_cache:
keys:
- *cache_key
# This fallback should be the cache_key without variables.
- v3-angular-node-10.12-
# Branch filter that can be specified for jobs that should only run on publish branches
# (e.g. master or the patch branch)
var_12: &publish_branches_filter
branches:
only:
- master
# e.g. 7.0.x, 7.1.x, etc.
- /\d+\.\d+\.x/
# Workspace initially persisted by the `install` job, and then enhanced by `test_aio` and
# `build-npm-packages`.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_13: &attach_workspace
attach_workspace:
at: ~/
version: 2
jobs:
setup:
<<: *job_defaults
steps:
- checkout
- *post_checkout
# This cache is saved in the build-npm-packages so that Bazel cache is also included.
- *restore_cache
- *init_environment
- *yarn_install
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Make the bazel directories and add a file to them if they don't exist already so that
# persist_to_workspace does not fail.
- run: |
if [ ! -d ~/bazel_repository_cache ]; then
mkdir ~/bazel_repository_cache
touch ~/bazel_repository_cache/MARKER
fi
# Persist any changes at this point to be reused by further jobs.
# **NOTE 1 **: Folders persisted here should be kept in sync with `var_13: &attach_workspace`.
# **NOTE 2 **: To add new content to the workspace, always persist on the same root.
- persist_to_workspace:
root: ~/
paths:
- ./ng
- ./bazel_repository_cache
lint:
<<: *job_defaults
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *yarn_install
- *attach_workspace
- *init_environment
- run: 'yarn bazel:format -mode=check ||
(echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)'
@ -70,19 +158,15 @@ jobs:
- run: 'yarn bazel:lint ||
(echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)'
- run: ./node_modules/.bin/gulp lint
- run: yarn gulp lint
test:
<<: *job_defaults
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
- *setup_circleci_bazel_config
- *yarn_install
# Setup remote execution and run RBE-compatible tests.
- *setup_bazel_remote_execution
@ -91,24 +175,14 @@ jobs:
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- run: yarn bazel test //... --build_tag_filters=-ivy-only,local --test_tag_filters=-ivy-only,local
- save_cache:
key: *cache_key
paths:
- "node_modules"
- "~/bazel_repository_cache"
# Temporary job to test what will happen when we flip the Ivy flag to true
test_ivy_aot:
<<: *job_defaults
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
- *setup_circleci_bazel_config
- *yarn_install
- *setup_bazel_remote_execution
# We need to explicitly specify the --symlink_prefix option because otherwise we would
@ -141,11 +215,8 @@ jobs:
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
# Build aio
- run: yarn --cwd aio build --progress=false
# Lint the code
@ -157,9 +228,9 @@ jobs:
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
- run: yarn --cwd aio payload-size
# Run unit tests
- run: yarn --cwd aio test --watch=false
- run: yarn --cwd aio test --progress=false --watch=false
# Run e2e tests
- run: yarn --cwd aio e2e
- run: yarn --cwd aio e2e --configuration=ci
# Run unit tests for Firebase redirects
- run: yarn --cwd aio redirects-test
@ -169,11 +240,8 @@ jobs:
# Needed because before deploying the deploy-production script runs the PWA score tests.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
# Deploy angular.io to production (if necessary)
- run: setPublicVar CI_STABLE_BRANCH "$(npm info @angular/core dist-tags.latest | sed -r 's/^\s*([0-9]+\.[0-9]+)\.[0-9]+.*$/\1.x/')"
- run: yarn --cwd aio deploy-production
@ -184,33 +252,37 @@ jobs:
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
- *attach_workspace
- *init_environment
# Build aio (with local Angular packages)
- run: yarn --cwd aio build-local --progress=false
# Run PWA-score tests
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
# Run unit tests
- run: yarn --cwd aio test --watch=false
- run: yarn --cwd aio test --progress=false --watch=false
# Run e2e tests
- run: yarn --cwd aio e2e
- run: yarn --cwd aio e2e --configuration=ci
test_aio_local_ivy:
<<: *job_defaults
steps:
- *attach_workspace
- *init_environment
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
# package installer picks up the locally built packages from that location.
# *Note*: We could also adjust the packages installer, but given we won't have
# two different folders of Angular distributions in the future, it's likely not
# worth the efforts to change the AIO packages installer.
- run: mv dist/packages-dist-ivy-aot dist/packages-dist
# Build aio with Ivy (using local Angular packages)
- run: yarn --cwd aio build-with-ivy --progress=false
test_aio_tools:
<<: *job_defaults
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
- *attach_workspace
- *init_environment
# Install
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio extract-cli-command-docs
@ -218,45 +290,48 @@ jobs:
- run: yarn --cwd aio tools-test
- run: ./aio/aio-builds-setup/scripts/test.sh
test_docs_examples_0:
test_docs_examples:
<<: *job_defaults
docker:
# Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image
parallelism: 4
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
# Install root
- *yarn_install
- *attach_workspace
- *init_environment
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Run examples tests
- run: yarn --cwd aio example-e2e --setup --local --shard=0/2
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "3", there will be three parallel CircleCI containers
# with either "0", "1" or "2" as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
test_docs_examples_1:
test_docs_examples_ivy:
<<: *job_defaults
docker:
# Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image
resource_class: xlarge
# We increase the parallelism here to five while the "test_docs_examples" job runs with
# a parallelism of four. This is necessary because this job also need to run NGCC which
# takes up more time and we don't want these jobs to impact the overall CI turnaround.
parallelism: 5
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
# Install root
- *yarn_install
- *attach_workspace
- *init_environment
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Run examples tests
- run: yarn --cwd aio example-e2e --setup --local --shard=1/2
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
# package installer picks up the locally built packages from that location.
# *Note*: We could also adjust the packages installer, but given we won't have
# two different folders of Angular distributions in the future, we should keep
# the packages installer unchanged.
- run: mv dist/packages-dist-ivy-aot dist/packages-dist
# Run examples tests with ivy. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "3", there will be three parallel CircleCI containers
# with either "0", "1" or "2" as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local --ivy --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
aio_preview:
@ -264,12 +339,8 @@ jobs:
environment:
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *yarn_install
- *attach_workspace
- *init_environment
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT
- store_artifacts:
path: *aio_preview_artifact_path
@ -285,45 +356,64 @@ jobs:
# Needed because the test-preview script runs e2e tests and the PWA score test with Chrome.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- run: yarn install --cwd aio --frozen-lockfile --non-interactive
- *attach_workspace
- *init_environment
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run:
name: Wait for preview and run tests
command: node aio/scripts/test-preview.js $CI_PULL_REQUEST $CI_COMMIT $CI_AIO_MIN_PWA_SCORE
# This job exists only for backwards-compatibility with old scripts and tests
# that rely on the pre-Bazel dist/packages-dist layout.
# It duplicates some work with the job above: we build the bazel packages
# twice. Even though we have a remote cache, these jobs will typically run in
# parallel so up-to-date outputs will not be available at the time the build
# The `build-npm-packages` tasks exist for backwards-compatibility with old scripts and
# tests that rely on the pre-Bazel `dist/packages-dist` output structure (build.sh).
# Having multiple jobs that independently build in this manner duplicates some work; we build
# the bazel packages more than once. Even though we have a remote cache, these jobs will
# typically run in parallel so up-to-date outputs will not be available at the time the build
# starts.
# No new jobs should depend on this one.
build-packages-dist:
# Build the view engine npm packages. No new jobs should depend on this.
build-npm-packages:
<<: *job_defaults
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
- *setup_circleci_bazel_config
- *yarn_install
- *setup_bazel_remote_execution
- run: scripts/build-packages-dist.sh
# Save the npm packages from //packages/... for other workflow jobs to read
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
- persist_to_workspace:
root: dist
root: ~/
paths:
- packages-dist
- packages-dist-ivy-aot
- ng/dist/packages-dist
# Save dependencies and bazel repository cache to use on subsequent runs.
- save_cache:
key: *cache_key
paths:
- "node_modules"
- "aio/node_modules"
- "~/bazel_repository_cache"
# Build the ivy npm packages.
build-ivy-npm-packages:
<<: *job_defaults
resource_class: xlarge
steps:
- *attach_workspace
- *init_environment
- *setup_circleci_bazel_config
- *setup_bazel_remote_execution
- run: scripts/build-ivy-npm-packages.sh
# Save the npm packages from //packages/... for other workflow jobs to read
- persist_to_workspace:
root: ~/
paths:
- ng/dist/packages-dist-ivy-aot
# We run the integration tests outside of Bazel for now.
# They are a separate workflow job so that they can be easily re-run.
@ -333,6 +423,7 @@ jobs:
# See comments inside the integration/run_tests.sh script.
integration_test:
<<: *job_defaults
parallelism: 4
docker:
# Needed because the integration tests expect Chrome to be installed (e.g cli-hello-world)
- image: *browsers_docker_image
@ -341,35 +432,31 @@ jobs:
# on a 4G worker so we use a larger machine here too.
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
- run: ./integration/run_tests.sh
- *attach_workspace
- *init_environment
# Runs the integration tests in parallel across multiple CircleCI container instances. The
# amount of container nodes for this job is controlled by the "parallelism" option.
- run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL}
# This job updates the content of repos like github.com/angular/core-builds
# for every green build on angular/angular.
publish_snapshot:
<<: *job_defaults
steps:
- checkout:
<<: *post_checkout
- *define_env_vars
# See below - ideally this job should not trigger for non-upstream builds.
# But since it does, we have to check this condition.
- run:
name: Skip this job for Pull Requests and Fork builds
# Note, `|| true` on the end makes this step always exit 0
command: '[[
"$CI_PULL_REQUEST" != "false"
|| "$CI_REPO_OWNER" != "angular"
|| "$CI_REPO_NAME" != "angular"
]] && circleci step halt || true'
- attach_workspace:
at: dist
# Note: Using `CIRCLE_*` env variables (instead of those defined in `env.sh` so that this
# step can be run before `init_environment`.
command: >
if [[ -n "${CIRCLE_PR_NUMBER}" ]] ||
[[ "$CIRCLE_PROJECT_USERNAME" != "angular" ]] ||
[[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
circleci step halt
fi
- *attach_workspace
- *init_environment
# CircleCI has a config setting to force SSH for all github connections
# This is not compatible with our mechanism of using a Personal Access Token
# Clear the global setting
@ -386,44 +473,101 @@ jobs:
# which does not load the browser through the Bazel webtesting rules.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *attach_workspace
- *init_environment
- run:
name: Run tests against the deployed apps
command: ./aio/scripts/test-production.sh $CI_AIO_MIN_PWA_SCORE
- run:
name: Notify caretaker about failure
command: 'curl --request POST --header "Content-Type: application/json" --data "{\"text\":\":x: \`$CIRCLE_JOB\` job failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}" $CI_SECRET_SLACK_CARETAKER_WEBHOOK_URL'
# `$SLACK_CARETAKER_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
command: 'curl --request POST --header "Content-Type: application/json" --data "{\"text\":\":x: \`$CIRCLE_JOB\` job failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}" $SLACK_CARETAKER_WEBHOOK_URL'
when: on_fail
legacy-unit-tests-saucelabs:
<<: *job_defaults
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
# container for this job. This is necessary because we launch a lot of browsers concurrently
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
resource_class: xlarge
steps:
- *attach_workspace
- *init_environment
- run:
name: Preparing environment for running tests on Saucelabs.
command: |
setPublicVar KARMA_JS_BROWSERS $(node -e 'console.log(require("./browser-providers.conf").sauceAliases.CI_REQUIRED.join(","))')
setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
- run:
name: Starting Saucelabs tunnel
command: ./scripts/saucelabs/start-tunnel.sh
background: true
- run: yarn tsc -p packages
- run: yarn tsc -p modules
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
# too early without Saucelabs not being ready.
- run: ./scripts/saucelabs/wait-for-tunnel.sh
- run: yarn karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
- run: ./scripts/saucelabs/stop-tunnel.sh
legacy-misc-tests:
<<: *job_defaults
steps:
- *attach_workspace
- *init_environment
- run: yarn gulp check-cycle
# TODO: disabled because the Bazel packages-dist does not seem to have map files for
# the ESM5/ES2015 output. See: https://github.com/angular/angular/issues/27966
# - run: yarn gulp source-map-test
workflows:
version: 2
default_workflow:
jobs:
- lint
- test
- test_ivy_aot
- build-packages-dist
- test_aio
- setup
- lint:
requires:
- setup
- test:
requires:
- setup
- test_ivy_aot:
requires:
- setup
- build-npm-packages:
requires:
- setup
- test_aio:
requires:
- setup
- legacy-unit-tests-saucelabs:
requires:
- setup
- deploy_aio:
requires:
- test_aio
- legacy-misc-tests:
requires:
- build-npm-packages
- test_aio_local:
requires:
- build-packages-dist
- build-npm-packages
# - test_aio_local_ivy:
# requires:
# - build-ivy-npm-packages
- test_aio_tools:
requires:
- build-packages-dist
- test_docs_examples_0:
- build-npm-packages
- test_docs_examples:
requires:
- build-packages-dist
- test_docs_examples_1:
requires:
- build-packages-dist
- build-npm-packages
# - test_docs_examples_ivy:
# requires:
# - build-ivy-npm-packages
- aio_preview:
requires:
- setup
# Only run on PR builds. (There can be no previews for non-PR builds.)
filters:
branches:
@ -433,7 +577,7 @@ workflows:
- aio_preview
- integration_test:
requires:
- build-packages-dist
- build-npm-packages
- publish_snapshot:
# Note: no filters on this job because we want it to run for all upstream branches
# We'd really like to filter out pull requests here, but not yet available:
@ -446,19 +590,29 @@ workflows:
- integration_test
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local
- test_docs_examples_0
- test_docs_examples_1
# - test_aio_local_ivy
- test_docs_examples
# - test_docs_examples_ivy
# Get the artifacts to publish from the build-packages-dist job
# since the publishing script expects the legacy outputs layout.
- build-packages-dist
- build-npm-packages
- legacy-unit-tests-saucelabs
- legacy-misc-tests
aio_monitoring:
jobs:
- aio_monitoring
triggers:
- schedule:
# Runs AIO monitoring job at 00:00AM every day.
cron: "0 0 * * *"
filters:
branches:
only:
- master
# TODO:
# - don't build the g3 branch
# - verify that we are bootstrapping with the right yarn version coming from the docker image
# - check local chrome version pulled from docker image
# - remove /tools/ngcontainer

View File

@ -15,7 +15,7 @@
#
# Usage: `setPublicVar <name> <value>`
function setPublicVar() {
setSecretVar $1 $2;
setSecretVar $1 "$2";
echo "$1=$2";
}

View File

@ -1,7 +1,11 @@
#!/usr/bin/env bash
# Variables
readonly projectDir=$(realpath "$(dirname ${BASH_SOURCE[0]})/..")
readonly envHelpersPath="$projectDir/.circleci/env-helpers.inc.sh";
readonly getCommitRangePath="$projectDir/.circleci/get-commit-range.js";
# Load helpers and make them available everywhere (through `$BASH_ENV`).
readonly envHelpersPath="`dirname $0`/env-helpers.inc.sh";
source $envHelpersPath;
echo "source $envHelpersPath;" >> $BASH_ENV;
@ -9,14 +13,22 @@ echo "source $envHelpersPath;" >> $BASH_ENV;
####################################################################################################
# Define PUBLIC environment variables for CircleCI.
####################################################################################################
setPublicVar PROJECT_ROOT "$(pwd)";
# See https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables for more info.
####################################################################################################
setPublicVar PROJECT_ROOT "$projectDir";
setPublicVar CI_AIO_MIN_PWA_SCORE "95";
# This is the branch being built; e.g. `pull/12345` for PR builds.
setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
# ChromeDriver version compatible with the Chrome version included in the docker image used in
# `.circleci/config.yml`. See http://chromedriver.chromium.org/downloads for a list of versions.
# This variable is intended to be passed as an arg to the `webdriver-manager update` command (e.g.
# `"postinstall": "webdriver-manager update $CI_CHROMEDRIVER_VERSION_ARG"`).
setPublicVar CI_CHROMEDRIVER_VERSION_ARG "--versions.chrome 2.45";
setPublicVar CI_COMMIT "$CIRCLE_SHA1";
# `CI_COMMIT_RANGE` will only be available when `CIRCLE_COMPARE_URL` is also available,
# i.e. on push builds (a.k.a. non-PR builds). That is fine, since we only need it in push builds.
setPublicVar CI_COMMIT_RANGE "$(sed -r 's|^.*/([0-9a-f]+\.\.\.[0-9a-f]+)$|\1|i' <<< ${CIRCLE_COMPARE_URL:-})";
# `CI_COMMIT_RANGE` will only be available when `CIRCLE_COMPARE_URL` is also available (or can be
# retrieved via `get-compare-url.js`), i.e. on push builds (a.k.a. non-PR, non-scheduled builds and
# rerun workflows of such builds). That is fine, since we only need it in push builds.
setPublicVar CI_COMMIT_RANGE "`[[ ${CIRCLE_PR_NUMBER:-false} != false ]] && echo "" || node $getCommitRangePath "$CIRCLE_BUILD_NUM" "$CIRCLE_COMPARE_URL"`";
setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}";
setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME";
setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME";
@ -27,8 +39,28 @@ setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME";
####################################################################################################
setSecretVar CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN "$AIO_DEPLOY_TOKEN";
setSecretVar CI_SECRET_PAYLOAD_FIREBASE_TOKEN "$ANGULAR_PAYLOAD_TOKEN";
# Defined in https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
setSecretVar CI_SECRET_SLACK_CARETAKER_WEBHOOK_URL "$SLACK_CARETAKER_WEBHOOK_URL";
####################################################################################################
# Define SauceLabs environment variables for CircleCI.
####################################################################################################
# In order to have a meaningful SauceLabs badge on the repo page,
# the angular2-ci account is used only when pushing commits to master;
# in all other cases, the regular angular-ci account is used.
if [ "${CI_PULL_REQUEST}" = "false" ] && [ "${CI_REPO_OWNER}" = "angular" ] && [ "${CI_BRANCH}" = "master" ]; then
setPublicVar SAUCE_USERNAME "angular2-ci";
setSecretVar SAUCE_ACCESS_KEY "693ebc16208a-0b5b-1614-8d66-a2662f4e";
else
setPublicVar SAUCE_USERNAME "angular-ci";
setSecretVar SAUCE_ACCESS_KEY "9b988f434ff8-fbca-8aa4-4ae3-35442987";
fi
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
setPublicVar SAUCE_TUNNEL_IDENTIFIER "angular-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
# Amount of seconds we wait for sauceconnect to establish a tunnel instance. In order to not
# acquire CircleCI instances for too long if sauceconnect failed, we need a connect timeout.
setPublicVar SAUCE_READY_FILE_TIMEOUT 120
# Source `$BASH_ENV` to make the variables available immediately.

View File

@ -0,0 +1,159 @@
#!/usr/bin/env node
/**
* **Usage:**
* ```
* node get-commit-range <build-number> [<compare-url> [<circle-token>]]
* ```
*
* Returns the value of the `CIRCLE_COMPARE_URL` environment variable (if defined) or, if this is
* not a PR build (i.e. `CIRCLE_PR_NUMBER` is not defined), retrieves the equivalent of
* `CIRCLE_COMPARE_URL` for jobs that are part of a rerun workflow.
*
* **Context:**
* CircleCI sets the `CIRCLE_COMPARE_URL` environment variable (from which we can extract the commit
* range) on push builds (a.k.a. non-PR, non-scheduled builds). Yet, when a workflow is rerun
* (either from the beginning or from failed jobs) - e.g. when a job flakes - CircleCI does not set
* the `CIRCLE_COMPARE_URL`.
*
* **Implementation details:**
* This script relies on the fact that all rerun workflows share the same CircleCI workspace and the
* (undocumented) fact that the workspace ID happens to be the same as the workflow ID that first
* created it.
*
* For example, for a job on push build workflow, the CircleCI API will return data that look like:
* ```js
* {
* compare: 'THE_COMPARE_URL_WE_ARE_LOOKING_FOR',
* //...
* previous: {
* // ...
* build_num: 12345,
* },
* //...
* workflows: {
* //...
* workflow_id: 'SOME_ID_A',
* workspace_id: 'SOME_ID_A', // Same as `workflow_id`.
* }
* }
* ```
*
* If the workflow is rerun, the data for jobs on the new workflow will look like:
* ```js
* {
* compare: null, // ¯\_(ツ)_/¯
* //...
* previous: {
* // ...
* build_num: 23456,
* },
* //...
* workflows: {
* //...
* workflow_id: 'SOME_ID_B',
* workspace_id: 'SOME_ID_A', // Different from current `workflow_id`.
* // Same as original `workflow_id`. \o/
* }
* }
* ```
*
* This script uses the `previous.build_num` (which points to the previous build number on the same
* branch) to traverse the jobs backwards, until it finds a job from the original workflow. Such a
* job (if found) should also contain the compare URL.
*
* **NOTE 1:**
* This is only useful on workflows which are created by rerunning a workflow for which
* `CIRCLE_COMPARE_URL` was defined.
*
* **NOTE 2:**
* The `circleToken` will be used for CircleCI API requests if provided, but it is not needed for
* accessing the read-only endpoints that we need (as long as the current project is FOSS and the
* corresponding setting is turned on in "Advanced Settings" in the project dashboard).
*
* ---
* Inspired by https://circleci.com/orbs/registry/orb/iynere/compare-url
* (source code: https://github.com/iynere/compare-url-orb).
*
* We are not using the `compare-url` orb for the following reasons:
* 1. (By looking at the code) it would only work if the rerun workflow is the latest workflow on
* the branch (which is not guaranteed to be true).
* 2. It is less efficient (e.g. makes unnecessary CircleCI API requests for builds on different
* branches, installs extra dependencies, persists files to the workspace (as a means of passing
* the result to the calling job), etc.).
* 3. It is slightly more complicated to setup and consume than our own script.
* 4. Its implementation is more complicated than needed for our usecase (e.g. handles different git
* providers, handles newly created branches, etc.).
*/
// Imports
const {get: httpsGet} = require('https');
// Constants
const API_URL_BASE = 'https://circleci.com/api/v1.1/project/github/angular/angular';
const COMPARE_URL_RE = /^.*\/([0-9a-f]+\.\.\.[0-9a-f]+)$/i;
// Run
_main(process.argv.slice(2));
// Helpers
async function _main([buildNumber, compareUrl = '', circleToken = '']) {
try {
if (!buildNumber || isNaN(buildNumber)) {
throw new Error(
'Missing or invalid arguments.\n' +
'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)');
}
if (!compareUrl) {
compareUrl = await getCompareUrl(buildNumber, circleToken);
}
const commitRangeMatch = COMPARE_URL_RE.exec(compareUrl)
const commitRange = commitRangeMatch ? commitRangeMatch[1] : '';
console.log(commitRange);
} catch (err) {
console.error(err);
process.exit(1);
}
}
function getBuildInfo(buildNumber, circleToken) {
console.error(`BUILD ${buildNumber}`);
const url = `${API_URL_BASE}/${buildNumber}?circle-token=${circleToken}`;
return getJson(url);
}
async function getCompareUrl(buildNumber, circleToken) {
let info = await getBuildInfo(buildNumber, circleToken);
const targetWorkflowId = info.workflows.workspace_id;
while (info.workflows.workflow_id !== targetWorkflowId) {
info = await getBuildInfo(info.previous.build_num, circleToken);
}
return info.compare || '';
}
function getJson(url) {
return new Promise((resolve, reject) => {
const opts = {headers: {Accept: 'application/json'}};
const onResponse = res => {
const statusCode = res.statusCode || -1;
const isSuccess = (200 <= statusCode) && (statusCode <= 400);
let responseText = '';
res.
on('error', reject).
on('data', d => responseText += d).
on('end', () => isSuccess ?
resolve(JSON.parse(responseText)) :
reject(`Error getting '${url}' (status ${statusCode}):\n${responseText}`));
};
httpsGet(url, opts, onResponse).
on('error', reject).
end();
});
}

131
.github/CODEOWNERS vendored
View File

@ -39,12 +39,14 @@
# (just to make this file easier to understand)
# ================================================
# alan-agius4 - Alan Agius
# alexeagle - Alex Eagle
# alxhub - Alex Rickabaugh
# AndrewKushnir - Andrew Kushnir
# andrewseguin - Andrew Seguin
# benlesh - Ben Lesh
# brandonroberts - Brandon Roberts
# devversion - Paul Gschwendtner
# filipesilva - Filipe Silva
# gkalpak - George Kalpakas
# hansl - Hans Larsen
@ -54,6 +56,7 @@
# kara - Kara Erickson
# kyliau - Keen Yee Liau
# matsko - Matias Niemelä
# mgechev - Minko Gechev
# mhevery - Misko Hevery
# ocombe - Olivier Combe
# petebacondarwin - Pete Bacon Darwin
@ -85,6 +88,7 @@
# - IgorMinar
# - kara
# - mhevery
# - alexeagle
# ===========================================================
@ -93,6 +97,7 @@
# Used for approving minor documentation-only changes that don't require engineering review.
# (secret team to avoid review requests, it also doesn't inherit from @angular/framework because nested teams can't be secret)
#
# - brandonroberts
# - gkalpak
# - jenniferfell
# - petebacondarwin
@ -112,6 +117,7 @@
# - alexeagle
# - kyliau
# - IgorMinar
# - mgechev
# ===========================================================
@ -121,6 +127,7 @@
# - alexeagle
# - filipesilva
# - hansl
# - mgechev
# ===========================================================
@ -258,6 +265,7 @@
# @angular/docs-infra
# ===========================================================
#
# - brandonroberts
# - gkalpak
# - IgorMinar
# - petebacondarwin
@ -288,6 +296,17 @@
# - IgorMinar
# ===========================================================
# @angular/tools-docs-libraries
# ===========================================================
#
# - alan-agius4
# - alexeagle
# - hansl
# - IgorMinar
# - mgechev
# ===========================================================
# @angular/fw-docs-marketing
# ===========================================================
@ -308,6 +327,9 @@
# ===========================================================
#
# - alexeagle
# - devversion
# - filipesilva
# - gkalpak
# - IgorMinar
@ -342,10 +364,19 @@
/packages/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-browser/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/animations.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/complex-animation-sequences.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/reusable-animations.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/route-animations.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/transition-and-triggers.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================
@ -376,12 +407,13 @@
# ================================================
# @angular/compiler-cli/ngtools
# Framework/cli integration
#
# a rule to control API changes between @angular/compiler-cli and @angular/cli
# ================================================
/packages/compiler-cli/src/ngtools/** @angular/tools-cli @angular/framework-global-approvers
/aio/content/guide/ivy.md @angular/tools-cli @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -401,6 +433,14 @@
/packages/platform-webworker/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/packages/platform-webworker-dynamic/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-components.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-modules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-next-steps.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture-services.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/architecture.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/architecture/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/architecture/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/attribute-directives.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/attribute-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/attribute-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -408,6 +448,8 @@
/aio/content/guide/bootstrapping.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/bootstrapping/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/cheatsheet.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/component-interaction.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/component-interaction/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/component-interaction/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -423,7 +465,13 @@
/aio/content/examples/dependency-injection-in-action/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/dependency-injection-in-action/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/dependency-injection-pattern.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/dependency-injection-navtree.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/dependency-injection-providers.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/displaying-data.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/displaying-data/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/displaying-data/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/dynamic-component-loader.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/dynamic-component-loader/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -450,12 +498,9 @@
/aio/content/images/guide/lifecycle-hooks/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/ngcontainer/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/ngcontainer/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/ngmodules.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/ngmodules/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/ngmodule/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/ngmodule/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/ngmodule-api.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -467,6 +512,8 @@
/aio/content/guide/module-types.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/template-syntax.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/event-binding/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/interpolation/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/template-syntax/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/template-syntax/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -489,6 +536,10 @@
/aio/content/examples/structural-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/structural-directives/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/user-input.md @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/user-input/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/user-input/** @angular/fw-core @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================
@ -514,6 +565,7 @@
/aio/content/guide/elements.md @angular/fw-elements @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================
# @angular/forms
# ================================================
@ -644,6 +696,7 @@ testing/** @angular/fw-test
/packages/platform-browser/src/security/** @angular/fw-security
/aio/content/guide/security.md @angular/fw-security @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/security/** @angular/fw-security @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/security/** @angular/fw-security @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -674,6 +727,14 @@ testing/** @angular/fw-test
/aio/tests/** @angular/docs-infra @angular/framework-global-approvers
/aio/tools/** @angular/docs-infra @angular/framework-global-approvers
# Hidden docs
/aio/content/guide/change-log.md @angular/docs-infra @angular/framework-global-approvers
/aio/content/guide/docs-style-guide.md @angular/docs-infra @angular/framework-global-approvers
/aio/content/examples/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
/aio/content/images/guide/docs-style-guide/** @angular/docs-infra @angular/framework-global-approvers
/aio/content/guide/visual-studio-2015.md @angular/docs-infra @angular/framework-global-approvers
/aio/content/examples/visual-studio-2015/** @angular/docs-infra @angular/framework-global-approvers
# ================================================
@ -681,7 +742,17 @@ testing/** @angular/fw-test
# ================================================
/aio/content/guide/quickstart.md @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/cli-quickstart/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/tutorial/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/toh/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt0/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt1/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt2/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt3/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt4/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt5/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/toh-pt6/** @angular/fw-docs-intro @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -689,17 +760,15 @@ testing/** @angular/fw-test
# Docs: observables
# ================================================
/aio/content/examples/observables/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/observables/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/observables.md @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/observables/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/comparing-observables.md @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/observables-in-angular/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/observables-in-angular/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/observables-in-angular.md @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/practical-observable-usage/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/observables-in-angular/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/practical-observable-usage.md @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/rx-library/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/practical-observable-usage/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/rx-library.md @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/rx-library/** @angular/fw-docs-observables @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -710,12 +779,26 @@ testing/** @angular/fw-test
/aio/content/guide/npm-packages.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/browser-support.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/typescript-configuration.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/setup-systemjs-anatomy.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/quickstart/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/setup.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/examples/setup/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/build.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/guide/build/** @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/deployment.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/file-structure.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/releases.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/updating.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/workspace-config.md @angular/fw-docs-packaging @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================
# Docs: libraries
# ================================================
/aio/content/guide/creating-libraries.md @angular/tools-docs-libraries @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/libraries.md @angular/tools-docs-libraries @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/guide/using-libraries.md @angular/tools-docs-libraries @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
@ -724,20 +807,13 @@ testing/** @angular/fw-test
# ================================================
/aio/content/marketing/** @angular/fw-docs-marketing @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/bios/** @angular/fw-docs-marketing @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/images/marketing/** @angular/fw-docs-marketing @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/navigation.json @angular/fw-docs-marketing @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
/aio/content/license.md @angular/fw-docs-marketing @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
# ================================================
# Public API
# ================================================
/tools/public_api_guard/** @angular/fw-public-api
# ================================================
# Build & CI Owners
# ================================================
@ -745,8 +821,11 @@ testing/** @angular/fw-test
/* @angular/fw-dev-infra
/.buildkite/** @angular/fw-dev-infra
/.circleci/** @angular/fw-dev-infra
/.codefresh/** @angular/fw-dev-infra
/.github/** @angular/fw-dev-infra
/.vscode/** @angular/fw-dev-infra
/docs/BAZEL.md @angular/fw-dev-infra
/packages/* @angular/fw-dev-infra
/scripts/** @angular/fw-dev-infra
/third_party/** @angular/fw-dev-infra
/tools/** @angular/fw-dev-infra
@ -754,6 +833,18 @@ testing/** @angular/fw-test
# ================================================
# Public API
# ================================================
/tools/public_api_guard/** @angular/fw-public-api
/aio/content/guide/glossary.md @angular/fw-public-api
/aio/content/guide/styleguide.md @angular/fw-public-api
/aio/content/examples/styleguide/** @angular/fw-public-api
/aio/content/images/guide/styleguide/** @angular/fw-public-api
# ================================================
# CODEOWNERS Owners owners ...
# ================================================

View File

@ -37,7 +37,9 @@ Please create and share minimal reproduction of the issue starting with this tem
<!-- ✍️--> https://stackblitz.com/...
<!--
If StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.
If StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue.
A good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem.
Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.
Issues that don't have enough info and can't be reproduced will be closed.

View File

@ -56,9 +56,9 @@ merge:
- "**/.gitkeep"
- "**/yarn.lock"
- "**/package.json"
- "**/third_party/**"
- "**/tsconfig-build.json"
- "**/tsconfig.json"
- "**/rollup.config.js"
- "**/BUILD.bazel"
- "**/*.md"
- "packages/**/integrationtest/**"
@ -101,9 +101,13 @@ merge:
# list of PR statuses that need to be successful
requiredStatuses:
- "continuous-integration/travis-ci/pr"
- "ci/circleci: build"
- "ci/circleci: lint"
- "ci/circleci: publish_snapshot"
- "ci/angular: size"
- "cla/google"
- "google3"
# the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable
# {{MERGE_LABEL}} will be replaced by the value of the mergeLabel option

4
.gitignore vendored
View File

@ -1,7 +1,7 @@
.DS_STORE
/dist/
/bazel-*
/bazel-out/
/integration/bazel/bazel-*
e2e_test.*
node_modules
@ -13,9 +13,9 @@ pubspec.lock
.c9
.idea/
.settings/
.vscode/launch.json
*.swo
modules/.settings
.vscode
modules/.vscode
# Don't check in secret files

View File

@ -1,66 +0,0 @@
language: node_js
sudo: false
dist: trusty
node_js:
- '10.9.0'
addons:
# firefox: "38.0"
apt:
sources:
# needed to install g++ that is used by npms's native modules
- ubuntu-toolchain-r-test
packages:
# needed to install g++ that is used by npms's native modules
- g++-4.8
branches:
except:
- g3
cache:
yarn: true
directories:
- ./node_modules
- ./.chrome/chromium
- ./aio/node_modules
env:
global:
# GITHUB_TOKEN_ANGULAR=<github token, a personal access token of the angular-builds account, account access in valentine>
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
- secure: "aCdHveZuY8AT4Jr1JoJB4LxZsnGWRe/KseZh1YXYe5UtufFCtTVHvUcLn0j2aLBF0KpdyS+hWf0i4np9jthKu2xPKriefoPgCMpisYeC0MFkwbmv+XlgkUbgkgVZMGiVyX7DCYXVahxIoOUjVMEDCbNiHTIrfEuyq24U3ok2tHc="
matrix:
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
- CI_MODE=e2e
- CI_MODE=js
- CI_MODE=saucelabs_required
# deactivated, see #19768
# - CI_MODE=browserstack_required
# We disable these optional jobs because those acquire tunnel and browser instances which
# could lead to rate limit excess while those are failing most of the time and nobody pays
# attention anyway.
# - CI_MODE=saucelabs_optional
# - CI_MODE=browserstack_optional
matrix:
fast_finish: true
allow_failures:
- env: "CI_MODE=saucelabs_optional"
- env: "CI_MODE=browserstack_optional"
before_install:
# source the env.sh script so that the exported variables are available to other scripts later on
- source ./scripts/ci/env.sh print
install:
- ./scripts/ci/install.sh
script:
- ./scripts/ci/build.sh
- ./scripts/ci/test.sh
- ./scripts/ci/angular.sh
# all the scripts under this line will not quickly abort in case ${TRAVIS_TEST_RESULT} is 1 (job failure)
- ./scripts/ci/cleanup.sh
- ./scripts/ci/print-logs.sh

12
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"devondcarew.bazel-code",
"gkalpak.aio-docs-utils",
"ms-vscode.vscode-typescript-tslint-plugin",
"xaver.clang-format",
],
}

27
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,27 @@
{
"[javascript]": {
"editor.formatOnSave": true,
},
"[typescript]": {
"editor.formatOnSave": true,
},
// Please install https://marketplace.visualstudio.com/items?itemName=xaver.clang-format to take advantage of `clang-format` in VSCode.
// (See https://clang.llvm.org/docs/ClangFormat.html for more info `clang-format`.)
"clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/bazel-out/**": true,
"**/dist/**": true,
"**/aio/src/generated/**": true,
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/bazel-out": true,
"**/dist": true,
"**/aio/src/generated": true,
},
"git.ignoreLimitWarning": true,
}

View File

@ -1,7 +1,5 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_nodejs//:defs.bzl", "node_modules_filegroup")
exports_files([
"tsconfig.json",
"LICENSE",
@ -12,10 +10,10 @@ filegroup(
name = "web_test_bootstrap_scripts",
# do not sort
srcs = [
"@ngdeps//node_modules/reflect-metadata:Reflect.js",
"@ngdeps//node_modules/zone.js:dist/zone.js",
"@ngdeps//node_modules/zone.js:dist/zone-testing.js",
"@ngdeps//node_modules/zone.js:dist/task-tracking.js",
"@npm//node_modules/reflect-metadata:Reflect.js",
"@npm//node_modules/zone.js:dist/zone.js",
"@npm//node_modules/zone.js:dist/zone-testing.js",
"@npm//node_modules/zone.js:dist/task-tracking.js",
"//:test-events.js",
],
)
@ -25,32 +23,14 @@ filegroup(
srcs = [
# We also declare the unminfied AngularJS files since these can be used for
# local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts)
"@ngdeps//node_modules/angular:angular.js",
"@ngdeps//node_modules/angular:angular.min.js",
"@ngdeps//node_modules/angular-1.5:angular.js",
"@ngdeps//node_modules/angular-1.5:angular.min.js",
"@ngdeps//node_modules/angular-1.6:angular.js",
"@ngdeps//node_modules/angular-1.6:angular.min.js",
"@ngdeps//node_modules/angular-mocks:angular-mocks.js",
"@ngdeps//node_modules/angular-mocks-1.5:angular-mocks.js",
"@ngdeps//node_modules/angular-mocks-1.6:angular-mocks.js",
"@npm//node_modules/angular:angular.js",
"@npm//node_modules/angular:angular.min.js",
"@npm//node_modules/angular-1.5:angular.js",
"@npm//node_modules/angular-1.5:angular.min.js",
"@npm//node_modules/angular-1.6:angular.js",
"@npm//node_modules/angular-1.6:angular.min.js",
"@npm//node_modules/angular-mocks:angular-mocks.js",
"@npm//node_modules/angular-mocks-1.5:angular-mocks.js",
"@npm//node_modules/angular-mocks-1.6:angular-mocks.js",
],
)
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
# A nodejs_binary for @angular/bazel/ngc-wrapped to use by default in
# ng_module that depends on @npm//@angular/bazel instead of the
# output of the //packages/bazel/src/ngc-wrapped ts_library rule. This
# default is for downstream users that depend on the @angular/bazel npm
# package. The generated @npm//@angular/bazel/ngc-wrapped target
# does not work because it does not have the node `--expose-gc` flag
# set which is required to support the call to `global.gc()`.
nodejs_binary(
name = "@angular/bazel/ngc-wrapped",
configuration_env_vars = ["compile"],
data = ["@npm//@angular/bazel"],
entry_point = "@angular/bazel/src/ngc-wrapped/index.js",
install_source_map_support = False,
templated_args = ["--node_options=--expose-gc"],
)

View File

@ -1,39 +1,195 @@
<a name="7.2.0"></a>
# [7.2.0](https://github.com/angular/angular/compare/7.2.0-rc.0...7.2.0) (2019-01-07)
<a name="7.2.10"></a>
## [7.2.10](https://github.com/angular/angular/compare/7.2.9...7.2.10) (2019-03-20)
### Bug Fixes
* **bazel:** unable to launch protractor test on windows ([#27850](https://github.com/angular/angular/issues/27850)) ([1e6c9be](https://github.com/angular/angular/commit/1e6c9be))
* **compiler-cli:** incorrect metadata bundle for multiple unnamed re-exports ([#29360](https://github.com/angular/angular/issues/29360)) ([cf8d934](https://github.com/angular/angular/commit/cf8d934)), closes [/github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85](https://github.com//github.com/angular/material2/blob/master/tools/package-tools/build-release.ts/issues/L78-L85)
<a name="7.2.9"></a>
## [7.2.9](https://github.com/angular/angular/compare/7.2.8...7.2.9) (2019-03-12)
This release contains various API docs improvements.
<a name="7.2.8"></a>
## [7.2.8](https://github.com/angular/angular/compare/7.2.7...7.2.8) (2019-03-06)
### Bug Fixes
* **animations:** ensure `position` and `display` styles are handled outside of keyframes/web-animations ([#28911](https://github.com/angular/angular/issues/28911)) ([86981b3](https://github.com/angular/angular/commit/86981b3)), closes [#24923](https://github.com/angular/angular/issues/24923) [#25635](https://github.com/angular/angular/issues/25635)
* **router:** removed obsolete TODO comment ([#29085](https://github.com/angular/angular/issues/29085)) ([2a25ac2](https://github.com/angular/angular/commit/2a25ac2))
* **service-worker:** detect new version even if files are identical to an old one ([#26006](https://github.com/angular/angular/issues/26006)) ([5669333](https://github.com/angular/angular/commit/5669333)), closes [#24338](https://github.com/angular/angular/issues/24338)
* **service-worker:** ignore passive mixed content requests ([#25994](https://github.com/angular/angular/issues/25994)) ([b598e88](https://github.com/angular/angular/commit/b598e88)), closes [/github.com/angular/angular/issues/23012#issuecomment-376430187](https://github.com//github.com/angular/angular/issues/23012/issues/issuecomment-376430187) [#23012](https://github.com/angular/angular/issues/23012)
<a name="7.2.7"></a>
## [7.2.7](https://github.com/angular/angular/compare/7.2.6...7.2.7) (2019-02-27)
### Bug Fixes
* **bazel:** pin browser repositories using [@npm](https://github.com/npm)_bazel_karma//:browser_repositories.bzl in bazel schematics ([#28896](https://github.com/angular/angular/issues/28896)) ([b686449](https://github.com/angular/angular/commit/b686449))
* **core:** traverse and sanitize content of unsafe elements ([#28804](https://github.com/angular/angular/issues/28804)) ([fdcf877](https://github.com/angular/angular/commit/fdcf877)), closes [#25879](https://github.com/angular/angular/issues/25879) [#25879](https://github.com/angular/angular/issues/25879) [#26007](https://github.com/angular/angular/issues/26007) [#28427](https://github.com/angular/angular/issues/28427)
* **language-service:** Fix completions for input/output with alias ([#28904](https://github.com/angular/angular/issues/28904)) ([d0018e6](https://github.com/angular/angular/commit/d0018e6)), closes [#27959](https://github.com/angular/angular/issues/27959)
<a name="7.2.6"></a>
## [7.2.6](https://github.com/angular/angular/compare/7.2.5...7.2.6) (2019-02-20)
### Bug Fixes
* **compiler-cli:** incorrect bundled metadata for static class member call expressions ([#28762](https://github.com/angular/angular/issues/28762)) ([ab69c31](https://github.com/angular/angular/commit/ab69c31)), closes [/github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/keyvalue_differs.ts#L121](https://github.com//github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/keyvalue_differs.ts/issues/L121) [#28741](https://github.com/angular/angular/issues/28741)
<a name="7.2.5"></a>
## [7.2.5](https://github.com/angular/angular/compare/7.2.4...7.2.5) (2019-02-15)
### Bug Fixes
* **compiler-cli:** diagnostics should respect "newLine" compiler option ([#28550](https://github.com/angular/angular/issues/28550)) ([ce750e6](https://github.com/angular/angular/commit/ce750e6))
* **router:** redirect to root url when returned as UrlTree from guard ([#28271](https://github.com/angular/angular/issues/28271)) ([1e58a21](https://github.com/angular/angular/commit/1e58a21)), closes [#27845](https://github.com/angular/angular/issues/27845)
* **router:** set href when routerLink is used on an 'area' element ([#28441](https://github.com/angular/angular/issues/28441)) ([d491a20](https://github.com/angular/angular/commit/d491a20)), closes [#28401](https://github.com/angular/angular/issues/28401)
<a name="7.2.4"></a>
## [7.2.4](https://github.com/angular/angular/compare/7.2.3...7.2.4) (2019-02-06)
### Bug Fixes
* **bazel:** Bazel builder resolves with require.resolve() ([#28478](https://github.com/angular/angular/issues/28478)) ([d85d396](https://github.com/angular/angular/commit/d85d396))
* **bazel:** fix integration test for bazel-schematics ([#28460](https://github.com/angular/angular/issues/28460)) ([449da8c](https://github.com/angular/angular/commit/449da8c))
### Performance Improvements
* pngcrush all pngs ([#28479](https://github.com/angular/angular/issues/28479)) ([1a25144](https://github.com/angular/angular/commit/1a25144)), closes [#18243](https://github.com/angular/angular/issues/18243)
<a name="7.2.3"></a>
## [7.2.3](https://github.com/angular/angular/compare/7.2.2...7.2.3) (2019-01-30)
### Bug Fixes
* **bazel:** add [@npm](https://github.com/npm)//tslib dep to e2e ts_library target in bazel-workspace schematic ([#28358](https://github.com/angular/angular/issues/28358)) ([8cee56e](https://github.com/angular/angular/commit/8cee56e))
* **bazel:** Bazel-workspace schematics should run in ScopedTree ([#28349](https://github.com/angular/angular/issues/28349)) ([260ac20](https://github.com/angular/angular/commit/260ac20))
* **bazel:** Builder should invoke local bazel/iblaze ([#28303](https://github.com/angular/angular/issues/28303)) ([12b8a6e](https://github.com/angular/angular/commit/12b8a6e))
* **bazel:** ng-new should run yarn install ([#28381](https://github.com/angular/angular/issues/28381)) ([a9d46e4](https://github.com/angular/angular/commit/a9d46e4))
### Performance Improvements
* yarn version upgrade ([#28360](https://github.com/angular/angular/issues/28360)) ([cc1b2a5](https://github.com/angular/angular/commit/cc1b2a5))
<a name="7.2.2"></a>
## [7.2.2](https://github.com/angular/angular/compare/7.2.1...7.2.2) (2019-01-22)
### Bug Fixes
* **bazel:** Fix integration test after v8 bump ([#28194](https://github.com/angular/angular/issues/28194)) ([7b772e9](https://github.com/angular/angular/commit/7b772e9)), closes [#28142](https://github.com/angular/angular/issues/28142)
* **router:** `skipLocationChange` with named outlets ([#28301](https://github.com/angular/angular/issues/28301)) ([32737a6](https://github.com/angular/angular/commit/32737a6)), closes [#27680](https://github.com/angular/angular/issues/27680) [#28200](https://github.com/angular/angular/issues/28200)
### Features
* **bazel:** Add support for SASS ([#28167](https://github.com/angular/angular/issues/28167)) ([a4d9192](https://github.com/angular/angular/commit/a4d9192))
* **compiler-cli:** resolve generated Sass/Less files to .css inputs ([#28166](https://github.com/angular/angular/issues/28166)) ([4c00059](https://github.com/angular/angular/commit/4c00059))
<a name="7.2.1"></a>
## [7.2.1](https://github.com/angular/angular/compare/7.2.0...7.2.1) (2019-01-16)
### Bug Fixes
* **bazel:** Add [@bazel](https://github.com/bazel)/bazel to dev deps ([#28032](https://github.com/angular/angular/issues/28032)) ([21093b9](https://github.com/angular/angular/commit/21093b9))
* **bazel:** Add /bazel-out to .gitignore ([#27874](https://github.com/angular/angular/issues/27874)) ([e4fc8ba](https://github.com/angular/angular/commit/e4fc8ba))
* **bazel:** Add ibazel to deps of Bazel project ([#28090](https://github.com/angular/angular/issues/28090)) ([28d34b6](https://github.com/angular/angular/commit/28d34b6))
* **bazel:** Bazel schematics should add router package ([#28141](https://github.com/angular/angular/issues/28141)) ([02a852a](https://github.com/angular/angular/commit/02a852a))
* **bazel:** flat module misses AMD module name on windows ([#27839](https://github.com/angular/angular/issues/27839)) ([c3d8e28](https://github.com/angular/angular/commit/c3d8e28))
* **bazel:** incorrectly always uses ngc-wrapped from "npm" workspace ([#28137](https://github.com/angular/angular/issues/28137)) ([ca3965a](https://github.com/angular/angular/commit/ca3965a))
* **bazel:** ng_package creates invalid typings reexport on windows ([#27829](https://github.com/angular/angular/issues/27829)) ([6b394f6](https://github.com/angular/angular/commit/6b394f6))
* **bazel:** packager not properly removing amd directives on windows ([#27829](https://github.com/angular/angular/issues/27829)) ([fad4145](https://github.com/angular/angular/commit/fad4145))
* **bazel:** protractor rule does not run spec files with underscore ([#28022](https://github.com/angular/angular/issues/28022)) ([f05c5f8](https://github.com/angular/angular/commit/f05c5f8))
* **bazel:** protractor utils cannot start server on windows ([#27915](https://github.com/angular/angular/issues/27915)) ([0be8487](https://github.com/angular/angular/commit/0be8487))
* **bazel:** replay compilation uses wrong compiler for building esm5 ([#28053](https://github.com/angular/angular/issues/28053)) ([fbbdaaa](https://github.com/angular/angular/commit/fbbdaaa))
* **router:** ensure URL is updated after second redirect with UrlUpdateStrategy="eager" ([#27680](https://github.com/angular/angular/issues/27680)) ([6ae7aee](https://github.com/angular/angular/commit/6ae7aee)), closes [#27116](https://github.com/angular/angular/issues/27116)
* **service-worker:** navigation urls backwards compatibility ([#27244](https://github.com/angular/angular/issues/27244)) ([585e871](https://github.com/angular/angular/commit/585e871))
### Performance Improvements
* **platform-server:** use shared `DomElementSchemaRegistry` instance ([#28150](https://github.com/angular/angular/issues/28150)) ([#28151](https://github.com/angular/angular/issues/28151)) ([6851581](https://github.com/angular/angular/commit/6851581))
<a name="7.2.0"></a>
# [7.2.0](https://github.com/angular/angular/compare/7.1.4...7.2.0) (2019-01-07)
7.2.0 release also contains all the fixes released in 7.1.4.
### Features
* add support for typescript 3.2 ([#27536](https://github.com/angular/angular/issues/27536)) ([17e702b](https://github.com/angular/angular/commit/17e702b))
* **bazel:** ng-new schematics with Bazel ([#27277](https://github.com/angular/angular/issues/27277)) ([06d4a0c](https://github.com/angular/angular/commit/06d4a0c))
* **forms:** match getError and hasError to get method signature ([#20211](https://github.com/angular/angular/issues/20211)) ([1b0b36d](https://github.com/angular/angular/commit/1b0b36d))
* **upgrade:** allow nesting components from different downgraded modules ([#27217](https://github.com/angular/angular/issues/27217)) ([bc0ee01](https://github.com/angular/angular/commit/bc0ee01))
* **upgrade:** correctly handle nested downgraded components with `downgradeModule()` ([#27217](https://github.com/angular/angular/issues/27217)) ([326b464](https://github.com/angular/angular/commit/326b464)), closes [#22581](https://github.com/angular/angular/issues/22581) [#22869](https://github.com/angular/angular/issues/22869) [#27083](https://github.com/angular/angular/issues/27083)
<a name="7.2.0-rc.0"></a>
# [7.2.0-rc.0](https://github.com/angular/angular/compare/7.2.0-beta.2...7.2.0-rc.0) (2018-12-18)
* **router:** add predicate function mode for runGuardsAndResolvers ([#27682](https://github.com/angular/angular/issues/27682)) ([12c3176](https://github.com/angular/angular/commit/12c3176)), closes [#26861](https://github.com/angular/angular/issues/26861) [#18253](https://github.com/angular/angular/issues/18253) [#27464](https://github.com/angular/angular/issues/27464)
* **router:** add a Navigation type available during navigation ([#27198](https://github.com/angular/angular/issues/27198)) ([d40af0c](https://github.com/angular/angular/commit/d40af0c))
* **router:** add pathParamsOrQueryParamsChange mode for runGuardsAndResolvers ([#27464](https://github.com/angular/angular/issues/27464)) ([d70a7f3](https://github.com/angular/angular/commit/d70a7f3)), closes [#26861](https://github.com/angular/angular/issues/26861) [#18253](https://github.com/angular/angular/issues/18253)
* **router:** allow passing `state` to routerLink directives ([#27198](https://github.com/angular/angular/issues/27198)) ([73f6ed9](https://github.com/angular/angular/commit/73f6ed9)), closes [#24617](https://github.com/angular/angular/issues/24617)
* **router:** allow passing state to `NavigationExtras` ([#27198](https://github.com/angular/angular/issues/27198)) ([67f4a5d](https://github.com/angular/angular/commit/67f4a5d))
* **router:** restore whole object when navigating back to a page managed by Angular router ([#27198](https://github.com/angular/angular/issues/27198)) ([2684249](https://github.com/angular/angular/commit/2684249))
### Bug Fixes
* **animations:** do not truncate decimals for delay ([#24455](https://github.com/angular/angular/issues/24455)) ([f1c9d6a](https://github.com/angular/angular/commit/f1c9d6a))
* **animations:** mark actual descendant node as disabled ([#26180](https://github.com/angular/angular/issues/26180)) ([df123e0](https://github.com/angular/angular/commit/df123e0))
* **bazel:** unable to launch protractor test on windows ([#27850](https://github.com/angular/angular/issues/27850)) ([1e6c9be](https://github.com/angular/angular/commit/1e6c9be))
* **bazel:** devserver entry_module should have underscore name ([#27719](https://github.com/angular/angular/issues/27719)) ([f57916c](https://github.com/angular/angular/commit/f57916c))
* **bazel:** emit full node stack traces when Angular compilation crashes ([#27678](https://github.com/angular/angular/issues/27678)) ([522919a](https://github.com/angular/angular/commit/522919a))
* **bazel:** fix major/minor semver check between [@angular](https://github.com/angular)/bazel npm packager version and angular bazel repo version ([#27635](https://github.com/angular/angular/issues/27635)) ([1cc08b4](https://github.com/angular/angular/commit/1cc08b4))
* **bazel:** Load http_archive and rules_nodejs dependencies ([#27609](https://github.com/angular/angular/issues/27609)) ([8313ffc](https://github.com/angular/angular/commit/8313ffc))
* **bazel:** ng_package writes unrelevant definitions to bazel out ([#27519](https://github.com/angular/angular/issues/27519)) ([44dfa60](https://github.com/angular/angular/commit/44dfa60)), closes [/github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts#L105-L124](https://github.com//github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts/issues/L105-L124)
* **bazel:** Set module_name and enable ng test ([#27715](https://github.com/angular/angular/issues/27715)) ([85866de](https://github.com/angular/angular/commit/85866de))
* **bazel:** fix TS errors in the `schematics/bazel-workspace` files ([#27600](https://github.com/angular/angular/issues/27600)) ([3290fc3](https://github.com/angular/angular/commit/3290fc3))
* **bazel:** Read latest versions from latest-versions.ts & use semver check ([#27526](https://github.com/angular/angular/issues/27526)) ([30a3b49](https://github.com/angular/angular/commit/30a3b49))
* **bazel:** tsickle dependency not working with typescript 3.1.x ([#27402](https://github.com/angular/angular/issues/27402)) ([f034114](https://github.com/angular/angular/commit/f034114))
* **bazel:** do not throw error when writing tsickle externs ([#27200](https://github.com/angular/angular/issues/27200)) ([20a2bae](https://github.com/angular/angular/commit/20a2bae))
* **bazel:** do not throw if ts compile action does not create esm5 outputs ([#27401](https://github.com/angular/angular/issues/27401)) ([c61a8b7](https://github.com/angular/angular/commit/c61a8b7))
* **bazel:** ng_package cannot be run multiple times without clean ([#27200](https://github.com/angular/angular/issues/27200)) ([4f93749](https://github.com/angular/angular/commit/4f93749))
* **bazel:** ng_package not generating UMD bundles on windows ([#27200](https://github.com/angular/angular/issues/27200)) ([7d59880](https://github.com/angular/angular/commit/7d59880))
* **bazel:** ng_package should correctly map to source maps in secondary entry-points ([#27313](https://github.com/angular/angular/issues/27313)) ([eb17502](https://github.com/angular/angular/commit/eb17502)), closes [#25510](https://github.com/angular/angular/issues/25510)
* **bazel:** Respect existing angular installation ([#27495](https://github.com/angular/angular/issues/27495)) ([4da739a](https://github.com/angular/angular/commit/4da739a))
* **common:** KeyValuePipe should return empty array for empty objects ([#27258](https://github.com/angular/angular/issues/27258)) ([b39efdd](https://github.com/angular/angular/commit/b39efdd))
* **common:** expose request url in network error ([#27143](https://github.com/angular/angular/issues/27143)) ([1db53da](https://github.com/angular/angular/commit/1db53da)), closes [#27029](https://github.com/angular/angular/issues/27029)
* **compiler-cli:** create LiteralLikeNode for String and Number literal ([#27536](https://github.com/angular/angular/issues/27536)) ([2c9b6c0](https://github.com/angular/angular/commit/2c9b6c0))
* **compiler-cli:** flatModuleIndex files not generated on windows with multiple input files ([#27200](https://github.com/angular/angular/issues/27200)) ([d3c08e7](https://github.com/angular/angular/commit/d3c08e7))
* **core:** export a value for InjectFlags ([#27279](https://github.com/angular/angular/issues/27279)) ([23b06af](https://github.com/angular/angular/commit/23b06af)), closes [#27251](https://github.com/angular/angular/issues/27251)
* **core:** More precise return type for `InjectableDecorator` ([#27360](https://github.com/angular/angular/issues/27360)) ([4b9948c](https://github.com/angular/angular/commit/4b9948c)), closes [#26942](https://github.com/angular/angular/issues/26942)
* **forms:** typed argument for FormBuilder group ([#26985](https://github.com/angular/angular/issues/26985)) ([b0c7561](https://github.com/angular/angular/commit/b0c7561))
* **platform-server:** add [@angular](https://github.com/angular)/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([32c5be9](https://github.com/angular/angular/commit/32c5be9)), closes [#26154](https://github.com/angular/angular/issues/26154)
* **router:** ensure URL is updated after second redirect with UrlUpdateStrategy="eager" ([#27523](https://github.com/angular/angular/issues/27523)) ([ad26cd6](https://github.com/angular/angular/commit/ad26cd6)), closes [#27116](https://github.com/angular/angular/issues/27116)
* **router:** update URL after redirects when urlHandlingStrategy='eager' ([#27356](https://github.com/angular/angular/issues/27356)) ([11a8bd8](https://github.com/angular/angular/commit/11a8bd8)), closes [#27076](https://github.com/angular/angular/issues/27076)
* **upgrade:** allow nesting components from different downgraded modules ([#27217](https://github.com/angular/angular/issues/27217)) ([bc0ee01](https://github.com/angular/angular/commit/bc0ee01))
* **upgrade:** correctly handle nested downgraded components with `downgradeModule()` ([#27217](https://github.com/angular/angular/issues/27217)) ([326b464](https://github.com/angular/angular/commit/326b464)), closes [#22581](https://github.com/angular/angular/issues/22581) [#22869](https://github.com/angular/angular/issues/22869) [#27083](https://github.com/angular/angular/issues/27083)
* **upgrade:** upgrade Directive facade should not return different instance from constructor ([#27660](https://github.com/angular/angular/issues/27660)) ([c986d3d](https://github.com/angular/angular/commit/c986d3d))
### Features
* add support for typescript 3.2 ([#27536](https://github.com/angular/angular/issues/27536)) ([17e702b](https://github.com/angular/angular/commit/17e702b))
* **router:** add predicate function mode for runGuardsAndResolvers ([#27682](https://github.com/angular/angular/issues/27682)) ([12c3176](https://github.com/angular/angular/commit/12c3176)), closes [#26861](https://github.com/angular/angular/issues/26861) [#18253](https://github.com/angular/angular/issues/18253) [#27464](https://github.com/angular/angular/issues/27464)
* **upgrade:** don't rely upon the runtime to resolve forward refs ([#27132](https://github.com/angular/angular/issues/27132)) ([a4462c2](https://github.com/angular/angular/commit/a4462c2))
@ -56,19 +212,6 @@
<a name="7.2.0-beta.2"></a>
# [7.2.0-beta.2](https://github.com/angular/angular/compare/7.2.0-beta.1...7.2.0-beta.2) (2018-12-11)
### Bug Fixes
* **bazel:** fix TS errors in the `schematics/bazel-workspace` files ([#27600](https://github.com/angular/angular/issues/27600)) ([3290fc3](https://github.com/angular/angular/commit/3290fc3))
* **bazel:** Read latest versions from latest-versions.ts & use semver check ([#27526](https://github.com/angular/angular/issues/27526)) ([30a3b49](https://github.com/angular/angular/commit/30a3b49))
* **bazel:** tsickle dependency not working with typescript 3.1.x ([#27402](https://github.com/angular/angular/issues/27402)) ([f034114](https://github.com/angular/angular/commit/f034114))
* **forms:** typed argument for FormBuilder group ([#26985](https://github.com/angular/angular/issues/26985)) ([b0c7561](https://github.com/angular/angular/commit/b0c7561))
<a name="7.1.3"></a>
## [7.1.3](https://github.com/angular/angular/compare/7.1.2...7.1.3) (2018-12-11)
@ -95,47 +238,6 @@
* **platform-server:** add [@angular](https://github.com/angular)/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([236ac06](https://github.com/angular/angular/commit/236ac06)), closes [#26154](https://github.com/angular/angular/issues/26154)
<a name="7.2.0-beta.1"></a>
# [7.2.0-beta.1](https://github.com/angular/angular/compare/7.1.0...7.2.0-beta.1) (2018-12-06)
### Bug Fixes
* **bazel:** do not throw error when writing tsickle externs ([#27200](https://github.com/angular/angular/issues/27200)) ([20a2bae](https://github.com/angular/angular/commit/20a2bae))
* **bazel:** do not throw if ts compile action does not create esm5 outputs ([#27401](https://github.com/angular/angular/issues/27401)) ([c61a8b7](https://github.com/angular/angular/commit/c61a8b7))
* **bazel:** ng_package cannot be run multiple times without clean ([#27200](https://github.com/angular/angular/issues/27200)) ([4f93749](https://github.com/angular/angular/commit/4f93749))
* **bazel:** ng_package not generating UMD bundles on windows ([#27200](https://github.com/angular/angular/issues/27200)) ([7d59880](https://github.com/angular/angular/commit/7d59880))
* **bazel:** ng_package should correctly map to source maps in secondary entry-points ([#27313](https://github.com/angular/angular/issues/27313)) ([eb17502](https://github.com/angular/angular/commit/eb17502)), closes [#25510](https://github.com/angular/angular/issues/25510)
* **bazel:** Respect existing angular installation ([#27495](https://github.com/angular/angular/issues/27495)) ([4da739a](https://github.com/angular/angular/commit/4da739a))
* **common:** expose request url in network error ([#27143](https://github.com/angular/angular/issues/27143)) ([1db53da](https://github.com/angular/angular/commit/1db53da)), closes [#27029](https://github.com/angular/angular/issues/27029)
* **compiler-cli:** flatModuleIndex files not generated on windows with multiple input files ([#27200](https://github.com/angular/angular/issues/27200)) ([d3c08e7](https://github.com/angular/angular/commit/d3c08e7))
* **core:** export a value for InjectFlags ([#27279](https://github.com/angular/angular/issues/27279)) ([23b06af](https://github.com/angular/angular/commit/23b06af)), closes [#27251](https://github.com/angular/angular/issues/27251)
* **core:** More precise return type for `InjectableDecorator` ([#27360](https://github.com/angular/angular/issues/27360)) ([4b9948c](https://github.com/angular/angular/commit/4b9948c)), closes [#26942](https://github.com/angular/angular/issues/26942)
* **forms:** apply unicode flag to pattern attribute when supported ([#20819](https://github.com/angular/angular/issues/20819)) ([3c34b8b](https://github.com/angular/angular/commit/3c34b8b))
* **platform-server:** add [@angular](https://github.com/angular)/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([32c5be9](https://github.com/angular/angular/commit/32c5be9)), closes [#26154](https://github.com/angular/angular/issues/26154)
* **router:** update URL after redirects when urlHandlingStrategy='eager' ([#27356](https://github.com/angular/angular/issues/27356)) ([11a8bd8](https://github.com/angular/angular/commit/11a8bd8)), closes [#27076](https://github.com/angular/angular/issues/27076)
* **upgrade:** don't rely upon the runtime to resolve forward refs ([#27132](https://github.com/angular/angular/issues/27132)) ([a4462c2](https://github.com/angular/angular/commit/a4462c2))
### Features
* **bazel:** ng-new schematics with Bazel ([#27277](https://github.com/angular/angular/issues/27277)) ([06d4a0c](https://github.com/angular/angular/commit/06d4a0c))
* **router:** add a Navigation type available during navigation ([#27198](https://github.com/angular/angular/issues/27198)) ([d40af0c](https://github.com/angular/angular/commit/d40af0c))
* **router:** add pathParamsOrQueryParamsChange mode for runGuardsAndResolvers ([#27464](https://github.com/angular/angular/issues/27464)) ([d70a7f3](https://github.com/angular/angular/commit/d70a7f3)), closes [#26861](https://github.com/angular/angular/issues/26861) [#18253](https://github.com/angular/angular/issues/18253)
* **router:** allow passing `state` to routerLink directives ([#27198](https://github.com/angular/angular/issues/27198)) ([73f6ed9](https://github.com/angular/angular/commit/73f6ed9)), closes [#24617](https://github.com/angular/angular/issues/24617)
* **router:** allow passing state to `NavigationExtras` ([#27198](https://github.com/angular/angular/issues/27198)) ([67f4a5d](https://github.com/angular/angular/commit/67f4a5d))
* **router:** restore whole object when navigating back to a page managed by Angular router ([#27198](https://github.com/angular/angular/issues/27198)) ([2684249](https://github.com/angular/angular/commit/2684249))
<a name="7.2.0-beta.0"></a>
# [7.2.0-beta.0](https://github.com/angular/angular/compare/7.1.0...7.2.0-beta.0) (2018-11-28)
### Bug Fixes
* **common:** expose request url in network error ([#27143](https://github.com/angular/angular/issues/27143)) ([1db53da](https://github.com/angular/angular/commit/1db53da)), closes [#27029](https://github.com/angular/angular/issues/27029)
* **upgrade:** don't rely upon the runtime to resolve forward refs ([#27132](https://github.com/angular/angular/issues/27132)) ([a4462c2](https://github.com/angular/angular/commit/a4462c2))
<a name="7.1.1"></a>
## [7.1.1](https://github.com/angular/angular/compare/7.1.0...7.1.1) (2018-11-28)

View File

@ -191,7 +191,7 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
Must be one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix

View File

@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2014-2018 Google, Inc. http://angular.io
Copyright (c) 2010-2019 Google LLC. http://angular.io/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/angular/angular.svg?branch=master)](https://travis-ci.org/angular/angular)
[![CircleCI](https://circleci.com/gh/angular/angular/tree/master.svg?style=shield)](https://circleci.com/gh/angular/angular/tree/master)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)](https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)
[![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

129
WORKSPACE
View File

@ -1,17 +1,6 @@
workspace(name = "angular")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(
"//packages/bazel:package.bzl",
"rules_angular_dependencies",
"rules_angular_dev_dependencies",
)
http_archive(
name = "io_bazel_rules_go",
sha256 = "b7a62250a3a73277ade0ce306d22f122365b513f5402222403e507f2f997d421",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz",
)
# Uncomment for local bazel rules development
#local_repository(
@ -19,59 +8,43 @@ http_archive(
# path = "../rules_nodejs",
#)
#local_repository(
# name = "build_bazel_rules_typescript",
# name = "npm_bazel_typescript",
# path = "../rules_typescript",
#)
# Angular Bazel users will call this function
rules_angular_dependencies()
# Install transitive deps of rules_nodejs
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
rules_nodejs_dependencies()
# These are the dependencies only for us
rules_angular_dev_dependencies()
# Install transitive deps of rules_typescript
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
rules_typescript_dependencies()
#
# Point Bazel to WORKSPACEs that live in subdirectories
#
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "rxjs",
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
strip_prefix = "package/src",
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
name = "build_bazel_rules_nodejs",
sha256 = "5c86b055c57e15bf32d9009a15bcd6d8e190c41b1ff2fb18037b75e0012e4e7c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.26.0/rules_nodejs-0.26.0.tar.gz"],
)
# Point to the integration test workspace just so that Bazel doesn't descend into it
# when expanding the //... pattern
local_repository(
name = "bazel_integration_test",
path = "integration/bazel",
)
#
# Load and install our dependencies downloaded above.
#
# Check the bazel version and download npm dependencies
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version")
# Bazel version must be at least v0.21.0 because:
# - 0.21.0 --experimental_strict_action_env flag turned on by default which fixes cache when
# running `yarn bazel` (see https://github.com/angular/angular/issues/27514#issuecomment-451438271)
check_bazel_version("0.21.0", """
# - 0.21.0 Using --incompatible_strict_action_env flag fixes cache when running `yarn bazel`
# (see https://github.com/angular/angular/issues/27514#issuecomment-451438271)
check_bazel_version(
message = """
You no longer need to install Bazel on your machine.
Angular has a dependency on the @bazel/bazel package which supplies it.
Try running `yarn bazel` instead.
(If you did run that, check that you've got a fresh `yarn install`)
""")
""",
minimum_bazel_version = "0.21.0",
)
# The NodeJS rules version must be at least v0.15.3 because:
# - 0.15.2 Re-introduced the prod_only attribute on yarn_install
# - 0.15.3 Includes a fix for the `jasmine_node_test` rule ignoring target tags
# - 0.16.8 Supports npm installed bazel workspaces
# - 0.26.0 Fix for data files in yarn_install and npm_install
check_rules_nodejs_version("0.26.0")
# Setup the Node.js toolchain
node_repositories(
node_version = "10.9.0",
package_json = ["//:package.json"],
@ -79,41 +52,63 @@ node_repositories(
yarn_version = "1.12.1",
)
local_repository(
yarn_install(
name = "npm",
path = "tools/npm_workspace",
data = [
"//:tools/npm/@angular_bazel/index.js",
"//:tools/npm/@angular_bazel/package.json",
"//:tools/postinstall-patches.js",
"//:tools/yarn/check-yarn.js",
],
package_json = "//:package.json",
# Don't install devDependencies, they are large and not used under Bazel
prod_only = True,
yarn_lock = "//:yarn.lock",
)
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
yarn_install(
name = "ts-api-guardian_deps",
package_json = "@angular//tools/ts-api-guardian:package.json",
yarn_lock = "@angular//tools/ts-api-guardian:yarn.lock",
)
go_rules_dependencies()
# Install all bazel dependencies of the @npm npm packages
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
go_register_toolchains()
install_bazel_dependencies()
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
# Load angular dependencies
load("//packages/bazel:package.bzl", "rules_angular_dev_dependencies")
rules_angular_dev_dependencies()
# Load karma dependencies
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")
rules_karma_dependencies()
# Setup the rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
browser_repositories(
chromium = True,
firefox = True,
)
# Temporary work-around for https://github.com/angular/angular/issues/28681
# TODO(gregmagolan): go back to @io_bazel_rules_webtesting browser_repositories
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
browser_repositories()
# Setup the rules_typescript tooolchain
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")
ts_setup_workspace()
load("@angular//:index.bzl", "ng_setup_workspace")
ng_setup_workspace()
##################################
# Skylark documentation generation
# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
sass_repositories()
# Setup the skydoc toolchain
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
skydoc_repositories()

2
aio/.gitignore vendored
View File

@ -26,11 +26,13 @@
!.vscode/extensions.json
# misc
/.firebase/
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
debug.log
firebase-debug.log
npm-debug.log
testem.log
/typings

View File

@ -26,8 +26,8 @@ ARG AIO_GITHUB_ORGANIZATION=angular
ARG TEST_AIO_GITHUB_ORGANIZATION=test-org
ARG AIO_GITHUB_REPO=angular
ARG TEST_AIO_GITHUB_REPO=test-repo
ARG AIO_GITHUB_TEAM_SLUGS=team,aio-contributors
ARG TEST_AIO_GITHUB_TEAM_SLUGS=team,aio-contributors
ARG AIO_GITHUB_TEAM_SLUGS=aio-auto-previews,aio-contributors
ARG TEST_AIO_GITHUB_TEAM_SLUGS=test-team-1,test-team-2
ARG AIO_NGINX_HOSTNAME=$AIO_DOMAIN_NAME
ARG TEST_AIO_NGINX_HOSTNAME=$TEST_AIO_DOMAIN_NAME
ARG AIO_NGINX_PORT_HTTP=80

View File

@ -104,6 +104,9 @@
},
"archive": {
"browserTarget": "site:build:archive"
},
"ci": {
"progress": false
}
}
},
@ -166,6 +169,11 @@
"options": {
"protractorConfig": "tests/e2e/protractor.conf.js",
"devServerTarget": "site:serve"
},
"configurations": {
"ci": {
"devServerTarget": "site:serve:ci"
}
}
},
"lint": {

View File

@ -57,7 +57,9 @@ dist/
# aot
**/*.ngsummary.json
upgrade-module/tsconfig-aot.json
!rollup-config.js
upgrade-module/rollup-config.js
aot-compiler/**/*.d.ts
aot-compiler/**/*.factory.d.ts
upgrade-phonecat-2-hybrid/aot/**/*
@ -84,5 +86,9 @@ upgrade-phonecat-2-hybrid/aot/**/*
*stackblitz.no-link.html
# ngUpgrade testing
upgrade-phonecat-1-typescript/tsconfig-aot.json
upgrade-phonecat-1-typescript/rollup-config.js
upgrade-phonecat-3-final/tsconfig-aot.json
upgrade-phonecat-3-final/rollup-config.js
!upgrade-phonecat-*/**/karma.conf.js
!upgrade-phonecat-*/**/karma-test-shim.js

View File

@ -20,7 +20,7 @@ export class AppComponent {
movies: IMovie[] = [];
showImage = true;
title = 'AngularJS to Angular Quick Ref Cookbook';
toggleImage(event: UIEvent) {
toggleImage(event?: UIEvent) {
this.showImage = !this.showImage;
this.eventType = (event && event.type) || 'not provided';
}

View File

@ -1,14 +0,0 @@
import { Injectable, Pipe, PipeTransform } from '@angular/core';
import { DatePipe } from '@angular/common';
@Injectable()
// #docregion date-pipe
@Pipe({name: 'date', pure: true})
export class StringSafeDatePipe extends DatePipe implements PipeTransform {
transform(value: any, format: string): string {
value = typeof value === 'string' ?
Date.parse(value) : value;
return super.transform(value, format);
}
}
// #enddocregion date-pipe

View File

@ -19,6 +19,7 @@ import { HeroListAutoCalcPageComponent } from './hero-list-auto-page.component';
import { HeroListAutoComponent } from './hero-list-auto.component';
import { HomeComponent } from './home.component';
import { AboutComponent } from './about.component';
import { InsertRemoveComponent } from './insert-remove.component';
@NgModule({
@ -56,6 +57,7 @@ import { AboutComponent } from './about.component';
HeroListAutoCalcPageComponent,
HeroListAutoComponent,
HomeComponent,
InsertRemoveComponent,
AboutComponent
],
bootstrap: [AppComponent]

View File

@ -2,7 +2,7 @@
<h1>My First Attribute Directive</h1>
<!-- #docregion applied -->
<p appHighlight>Highlight me!</p>
<!-- #enddocregion applied, -->
<!-- #enddocregion applied -->
<!-- #docregion color-1 -->
<p appHighlight highlightColor="yellow">Highlighted in yellow</p>
@ -11,4 +11,4 @@
<!-- #docregion color-2 -->
<p appHighlight [highlightColor]="color">Highlighted with parent component's color</p>
<!-- #enddocregion color-2 -->
<!-- #enddocregion color-2 -->

View File

@ -0,0 +1,3 @@
<!-- #docregion unsupported -->
<p app:Highlight>This is invalid</p>
<!-- #enddocregion unsupported -->

View File

@ -0,0 +1,20 @@
'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
describe('Built Template Functions Example', function () {
beforeAll(function () {
browser.get('');
});
it('should have title Built-in Template Functions', function () {
let title = element.all(by.css('h1')).get(0);
expect(title.getText()).toEqual('Built-in Template Functions');
});
it('should display $any( ) in h2', function () {
let header = element(by.css('h2'));
expect(header.getText()).toContain('$any( )');
});
});

View File

@ -0,0 +1,15 @@
<h1>{{title}}</h1>
<h2><code>$any( )</code> type cast function and an undeclared member</h2>
<p>There is no such member as <code>bestByDate</code> in the following two examples, so nothing renders:</p>
<!-- #docregion any-type-cast-function-1 -->
<p>The item's undeclared best by date is: {{$any(item).bestByDate}}</p>
<!-- #enddocregion any-type-cast-function-1 -->
<h2>using <code>this</code></h2>
<!-- #docregion any-type-cast-function-2 -->
<p>The item's undeclared best by date is: {{$any(this).bestByDate}}</p>
<!-- #enddocregion any-type-cast-function-2 -->

View File

@ -0,0 +1,16 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});

View File

@ -0,0 +1,16 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Built-in Template Functions';
item = {
name : 'Telephone',
origin : 'Sweden',
price: 98
};
}

View File

@ -0,0 +1,18 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Built-in Template Functions Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>

View File

@ -1,5 +1,11 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,10 @@
{
"description": "Built-in Template Functions",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["Built-in Template Functions"]
}

View File

@ -0,0 +1,12 @@
{
"e2e": [
{
"cmd": "yarn",
"args": [
"e2e",
"--no-webdriver-update",
"--port={PORT}"
]
}
]
}

View File

@ -19,20 +19,20 @@ const DifferentParent = Parent;
// #enddocregion provide-the-parent
// The `parentType` defaults to `Parent` when omitting the second parameter.
// #docregion provide-the-parent
const provideParent =
export function provideParent
// #enddocregion provide-parent, provide-the-parent
// #docregion provide-parent
(component: any, parentType?: any) => {
(component: any, parentType?: any) {
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
};
}
// #enddocregion provide-parent
// Simpler syntax version that always provides the component in the name of `Parent`.
const provideTheParent =
export function provideTheParent
// #docregion provide-the-parent
(component: any) => {
(component: any) {
return { provide: Parent, useExisting: forwardRef(() => component) };
};
}
// #enddocregion provide-the-parent

View File

@ -0,0 +1,12 @@
{
"e2e": [
{
"cmd": "yarn",
"args": [
"e2e",
"--no-webdriver-update",
"--port={PORT}"
]
}
]
}

View File

@ -0,0 +1,71 @@
'use strict'; // necessary for es6 output in node
import { browser, element, by, protractor } from 'protractor';
describe('Event binding example', function () {
beforeEach(function () {
browser.get('');
});
let saveButton = element.all(by.css('button')).get(0);
let onSaveButton = element.all(by.css('button')).get(1);
let myClick = element.all(by.css('button')).get(2);
let deleteButton = element.all(by.css('button')).get(3);
let saveNoProp = element.all(by.css('button')).get(4);
let saveProp = element.all(by.css('button')).get(5);
it('should display Event Binding with Angular', function () {
expect(element(by.css('h1')).getText()).toEqual('Event Binding');
});
it('should display 6 buttons', function() {
expect(saveButton.getText()).toBe('Save');
expect(onSaveButton.getText()).toBe('on-click Save');
expect(myClick.getText()).toBe('click with myClick');
expect(deleteButton.getText()).toBe('Delete');
expect(saveNoProp.getText()).toBe('Save, no propagation');
expect(saveProp.getText()).toBe('Save with propagation');
});
it('should support user input', function () {
let input = element(by.css('input'));
let bindingResult = element.all(by.css('h4')).get(1);
expect(bindingResult.getText()).toEqual('Result: teapot');
input.sendKeys('abc');
expect(bindingResult.getText()).toEqual('Result: teapotabc');
});
it('should hide the item img', async () => {
let deleteButton = element.all(by.css('button')).get(3);
await deleteButton.click();
browser.switchTo().alert().accept();
expect(element.all(by.css('img')).get(0).getCssValue('display')).toEqual('none');
});
it('should show two alerts', async () => {
let parentDiv = element.all(by.css('.parent-div'));
let childDiv = element.all(by.css('div > div')).get(1);
await parentDiv.click();
browser.switchTo().alert().accept();
expect(childDiv.getText()).toEqual('Click me too! (child)');
await childDiv.click();
expect(browser.switchTo().alert().getText()).toEqual('Click me. Event target class is child-div');
browser.switchTo().alert().accept();
});
it('should show 1 alert from Save, no prop, button', async () => {
await saveNoProp.click();
expect(browser.switchTo().alert().getText()).toEqual('Saved. Event target is Save, no propagation');
browser.switchTo().alert().accept();
});
it('should show 2 alerts from Save w/prop button', async () => {
await saveProp.click();
expect(browser.switchTo().alert().getText()).toEqual('Saved.');
browser.switchTo().alert().accept();
expect(browser.switchTo().alert().getText()).toEqual('Saved.');
browser.switchTo().alert().accept();
});
});

View File

@ -0,0 +1,25 @@
.group {
background-color: #dae8f9;
padding: 1rem;
margin: 1rem 0;
}
.parent-div {
background-color: #bdd1f7;
border: solid 1px rgb(25, 118, 210);
padding: 1rem;
}
.parent-div:hover {
background-color: #8fb4f9;
}
.child-div {
margin-top: 1rem;
background-color: #fff;
padding: 1rem;
}
.child-div:hover {
background-color: #eee;
}

View File

@ -0,0 +1,53 @@
<h1 id="event-binding">Event Binding</h1>
<div class="group">
<h3>Target event</h3>
<!-- #docregion event-binding-1 -->
<button (click)="onSave($event)">Save</button>
<!-- #enddocregion event-binding-1 -->
<!-- #docregion event-binding-2 -->
<button on-click="onSave($event)">on-click Save</button>
<!-- #enddocregion event-binding-2 -->
<!-- #docregion custom-directive -->
<h4>myClick is an event on the custom ClickDirective:</h4>
<button (myClick)="clickMessage=$event" clickable>click with myClick</button>
{{clickMessage}}
<!-- #enddocregion custom-directive -->
</div>
<div class="group">
<h3>$event and event handling statements</h3>
<h4>Result: {{currentItem.name}}</h4>
<!-- #docregion event-binding-3-->
<input [value]="currentItem.name"
(input)="currentItem.name=$event.target.value" >
without NgModel
<!-- #enddocregion event-binding-3-->
</div>
<div class="group">
<h3>Binding to a nested component</h3>
<h4>Custom events with EventEmitter</h4>
<!-- #docregion event-binding-to-component -->
<app-item-detail (deleteRequest)="deleteItem($event)" [item]="currentItem"></app-item-detail>
<!-- #enddocregion event-binding-to-component -->
<h4>Click to see event target class:</h4>
<div class="parent-div" (click)="onClickMe($event)" clickable>Click me (parent)
<div class="child-div">Click me too! (child) </div>
</div>
<h3>Saves only once:</h3>
<div (click)="onSave()" clickable>
<button (click)="onSave($event)">Save, no propagation</button>
</div>
<h3>Saves twice:</h3>
<div (click)="onSave()" clickable>
<button (click)="onSave()">Save with propagation</button>
</div>

View File

@ -0,0 +1,27 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'Featured product:'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('Featured product:');
}));
it('should render title in a p tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('p').textContent).toContain('Featured product:');
}));
});

View File

@ -0,0 +1,29 @@
import { Component } from '@angular/core';
import { Item } from './item';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
currentItem = { name: 'teapot'} ;
clickMessage = '';
onSave(event?: KeyboardEvent) {
const evtMsg = event ? ' Event target is ' + (<HTMLElement>event.target).textContent : '';
alert('Saved.' + evtMsg);
if (event) { event.stopPropagation(); }
}
deleteItem(item?: Item) {
alert(`Delete the ${item}.`);
}
onClickMe(event?: KeyboardEvent) {
const evtMsg = event ? ' Event target class is ' + (<HTMLElement>event.target).className : '';
alert('Click me.' + evtMsg);
}
}

View File

@ -0,0 +1,22 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { ItemDetailComponent } from './item-detail/item-detail.component';
import { ClickDirective } from './click.directive';
@NgModule({
declarations: [
AppComponent,
ItemDetailComponent,
ClickDirective
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -0,0 +1,18 @@
/* tslint:disable use-output-property-decorator directive-class-suffix */
import { Directive, ElementRef, EventEmitter, Output } from '@angular/core';
@Directive({selector: '[myClick]'})
export class ClickDirective {
@Output('myClick') clicks = new EventEmitter<string>(); // @Output(alias) propertyName = ...
toggle = false;
constructor(el: ElementRef) {
el.nativeElement
.addEventListener('click', (event: Event) => {
this.toggle = !this.toggle;
this.clicks.emit(this.toggle ? 'Click!' : '');
});
}
}

View File

@ -0,0 +1,11 @@
.detail {
border: 1px solid rgb(25, 118, 210);
padding: 1rem;
margin: 1rem 0;
}
img {
max-width: 100px;
display: block;
padding: 1rem 0;
}

View File

@ -0,0 +1,9 @@
<div class="detail">
<p>This is the ItemDetailComponent</p>
<!-- #docregion line-through -->
<img src="{{itemImageUrl}}" [style.display]="displayNone">
<span [style.text-decoration]="lineThrough">{{ item.name }}
</span>
<button (click)="delete()">Delete</button>
<!-- #enddocregion line-through -->
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ItemDetailComponent } from './item-detail.component';
describe('ItemDetailComponent', () => {
let component: ItemDetailComponent;
let fixture: ComponentFixture<ItemDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ItemDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ItemDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,30 @@
/* tslint:disable use-input-property-decorator use-output-property-decorator */
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Item } from '../item';
@Component({
selector: 'app-item-detail',
styleUrls: ['./item-detail.component.css'],
templateUrl: './item-detail.component.html'
})
export class ItemDetailComponent {
@Input() item;
itemImageUrl = 'assets/teapot.svg';
lineThrough = '';
displayNone = '';
@Input() prefix = '';
// #docregion deleteRequest
// This component makes a request but it can't actually delete a hero.
@Output() deleteRequest = new EventEmitter<Item>();
delete() {
this.deleteRequest.emit(this.item.name);
this.displayNone = this.displayNone ? '' : 'none';
this.lineThrough = this.lineThrough ? '' : 'line-through';
}
// #enddocregion deleteRequest
}

View File

@ -0,0 +1,4 @@
export class Item {
name: '';
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo</title>
<title>EventBinding</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));

View File

@ -0,0 +1,10 @@
{
"description": "Event Binding",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["Event Binding"]
}

View File

@ -28,10 +28,7 @@ let checkLogForMessage = (message: string) => {
expect(page.logList.getText()).toContain(message);
};
// TODO(i): temorarily disable these tests because angular-in-memory-web-api is not compatible with rxjs v6 yet
// and we don't have the backwards compatibility package yet.
// Reenable after rxjs v6 compatibility package is out or angular-in-memory-web-api is compatible with rxjs v6
xdescribe('Http Tests', function() {
describe('Http Tests', function() {
beforeEach(() => {
browser.get('');
});

View File

@ -1,3 +1,13 @@
{
"projectType": "i18n"
}
"projectType": "i18n",
"e2e": [
{
"cmd": "yarn",
"args": [
"e2e",
"--no-webdriver-update",
"--port={PORT}"
]
}
]
}

View File

@ -0,0 +1,47 @@
import { browser, element, by } from 'protractor';
describe('Interpolation e2e tests', () => {
beforeEach(function () {
browser.get('');
});
it('should display Interpolation and Template Expressions', function () {
expect(element(by.css('h1')).getText()).toEqual('Interpolation and Template Expressions');
});
it('should display Current customer: Maria', function () {
expect(element.all(by.css('h3')).get(0).getText()).toBe(`Current customer: Maria`);
});
it('should display The sum of 1 + 1 is not 4.', function () {
expect(element.all(by.css('p:last-child')).get(0).getText()).toBe(`The sum of 1 + 1 is not 4.`);
});
it('should display Expression Context', function () {
expect(element.all(by.css('h2')).get(1).getText()).toBe(`Expression Context`);
});
it('should display a list of customers', function () {
expect(element.all(by.css('li')).get(0).getText()).toBe(`Maria`);
});
it('should display two pictures', function() {
let pottedPlant = element.all(by.css('img')).get(0);
let lamp = element.all(by.css('img')).get(1);
expect(pottedPlant.getAttribute('src')).toContain('pottedPlant');
expect(pottedPlant.isDisplayed()).toBe(true);
expect(lamp.getAttribute('src')).toContain('lamp');
expect(lamp.isDisplayed()).toBe(true);
});
it('should support user input', function () {
let input = element(by.css('input'));
let label = element(by.css('label'));
expect(label.getText()).toEqual('Type something:');
input.sendKeys('abc');
expect(label.getText()).toEqual('Type something: abc');
});
});

View File

@ -0,0 +1,60 @@
<div>
<h1>Interpolation and Template Expressions</h1>
<hr />
<div>
<h2>Interpolation</h2>
<!-- #docregion interpolation-example1 -->
<h3>Current customer: {{ currentCustomer }}</h3>
<!-- #enddocregion interpolation-example1 -->
<!-- #docregion component-property -->
<p>{{title}}</p>
<div><img src="{{itemImageUrl}}"></div>
<!-- #enddocregion component-property -->
<h3>Evaluating template expressions </h3>
<h4>Simple evaluation (to a string):</h4>
<!-- #docregion convert-string -->
<!-- "The sum of 1 + 1 is 2" -->
<p>The sum of 1 + 1 is {{1 + 1}}.</p>
<!-- #enddocregion convert-string -->
<h4>Evaluates using a method (also evaluates to a string):</h4>
<!-- #docregion invoke-method -->
<!-- "The sum of 1 + 1 is not 4" -->
<p>The sum of 1 + 1 is not {{1 + 1 + getVal()}}.</p>
<!-- #enddocregion invoke-method -->
</div>
<hr />
<h2>Expression Context</h2>
<div>
<h3>Component context, properties of app.component.ts:</h3>
<!-- #docregion component-context -->
<h4>{{recommended}}</h4>
<img [src]="itemImageUrl2">
<!-- #enddocregion component-context -->
</div>
<div>
<h4>Template context, template input variables (let customer):</h4>
<!-- #docregion template-input-variable -->
<ul>
<li *ngFor="let customer of customers">{{customer.name}}</li>
</ul>
<!-- #enddocregion template-input-variable -->
</div>
<div (keyup)="0">
<h4>Template context: template reference variables (#customerInput):</h4>
<!-- #docregion template-reference-variable -->
<label>Type something:
<input #customerInput>{{customerInput.value}}
</label>
<!-- #enddocregion template-reference-variable -->
</div>
</div>

View File

@ -0,0 +1,16 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});

View File

@ -0,0 +1,25 @@
import { Component } from '@angular/core';
import { CUSTOMERS } from './customers';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
customers = CUSTOMERS;
currentCustomer = 'Maria';
title = 'Featured product:';
itemImageUrl = '../assets/pottedPlant.png';
recommended = 'You might also like:';
itemImageUrl2 = '../assets/lamp.png';
getVal(): number { return 2; }
}

View File

@ -0,0 +1,18 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -0,0 +1,3 @@
export class Customer {
name: string;
}

View File

@ -0,0 +1,9 @@
import { Customer } from './customer';
export const CUSTOMERS: Customer[] = [
{ name: 'Maria' },
{ name: 'Oliver' },
{ name: 'Walter' },
{ name: 'Lakshmi' },
{ name: 'Yasha' }
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= utils.classify(name) %></title>
<title>Interpolation</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -10,7 +10,5 @@
</head>
<body>
<app-root></app-root>
<script src="/zone.min.js"></script>
<script src="/bundle.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));

View File

@ -0,0 +1,10 @@
{
"description": "Interpolation",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["interpolation"]
}

View File

@ -13,8 +13,8 @@ import { AppComponent } from './app.component';
// #enddocregion
*/
// #docregion
import { HighlightDirective } from './highlight.directive';
import { TitleComponent } from './title.component';
import { HighlightDirective } from './highlight.directive.1';
import { TitleComponent } from './title.component.1';
import { UserService } from './user.service';
/* Routing Module */

View File

@ -1,10 +0,0 @@
// #docregion
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'awesome' })
/** Precede the input string with the word "Awesome " */
export class AwesomePipe implements PipeTransform {
transform(phrase: string) {
return phrase ? 'Awesome ' + phrase : '';
}
}

View File

@ -1,20 +0,0 @@
// #docplaster
// Same directive name and selector as
// HighlightDirective in parent AppModule
// It selects for both input boxes and 'highlight' attr
// and it highlights in blue instead of gold
// #docregion
import { Directive, ElementRef } from '@angular/core';
// Highlight the host element or any InputElement in blue
@Directive({ selector: '[highlight], input' })
export class ContactHighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'powderblue';
// #enddocregion
console.log(`* Contact highlight called for ${el.nativeElement.tagName}`);
// #docregion
}
}
// #enddocregion

View File

@ -1,14 +0,0 @@
// #docregion
import { Directive, ElementRef } from '@angular/core';
// Same directive name and selector as
// HighlightDirective in parent AppRootModule
// It selects for both input boxes and 'highlight' attr
// and it highlights in beige instead of yellow
@Directive({ selector: '[highlight]' })
export class HighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'beige';
console.log(`* Hero highlight called for ${el.nativeElement.tagName}`);
}
}

View File

@ -8,7 +8,7 @@ import { UserService } from './user.service';
@Component({
selector: 'app-title',
templateUrl: './title.component.html'
templateUrl: './title.component.1.html'
})
export class TitleComponent {
title = 'Angular Modules';

View File

@ -16,7 +16,7 @@ const ITEMS: Item[] = [
const FETCH_LATENCY = 500;
/** Simulate a data service that retrieves crises from a server */
/** Simulate a data service that retrieves items from a server */
@Injectable()
export class ItemService implements OnDestroy {

View File

@ -61,7 +61,7 @@ export class Routable1Component implements OnInit {
navStart: Observable<NavigationStart>;
constructor(private router: Router) {
// Create a new Observable the publishes only the NavigationStart event
// Create a new Observable that publishes only the NavigationStart event
this.navStart = router.events.pipe(
filter(evt => evt instanceof NavigationStart)
) as Observable<NavigationStart>;

View File

@ -5,10 +5,9 @@ import { retryWhen, map, mergeMap } from 'rxjs/operators';
function backoff(maxTries, ms) {
return pipe(
retryWhen(attempts => range(1, maxTries)
retryWhen(attempts => zip(range(1, maxTries), attempts)
.pipe(
zip(attempts, (i) => i),
map(i => i * i),
map(([i]) => i * i),
mergeMap(i => timer(i * ms))
)
)

View File

@ -1,8 +0,0 @@
{
"server": {
"baseDir": "src",
"routes": {
"/node_modules": "node_modules"
}
}
}

View File

@ -1,8 +0,0 @@
// #docregion
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>`
})
export class AppComponent { name = 'Angular'; }

View File

@ -1,11 +0,0 @@
// #docregion
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Angular Quickstart</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {color:#369;font-family: Arial,Helvetica,sans-serif;}
</style>
<!-- Polyfills -->
<!-- #docregion polyfills -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<!-- #enddocregion polyfills -->
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('main.js').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<!-- #docregion my-app-->
<my-app>Loading AppComponent content here ...</my-app>
<!-- #enddocregion my-app-->
</body>
</html>

View File

@ -1,13 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}

View File

@ -1,11 +0,0 @@
{
"description": "QuickStart",
"files": [
"src/app/app.component.ts",
"src/app/app.module.ts",
"src/main.ts",
"src/index.html"
],
"file": "src/app/app.component.ts",
"tags": ["quickstart"]
}

View File

@ -31,6 +31,7 @@ describe('Router', () => {
heroDetailTitle: heroDetail.element(by.xpath('*[2]')),
adminHref: hrefEles.get(2),
adminPage: element(by.css('app-root > div > app-admin')),
adminPreloadList: element.all(by.css('app-root > div > app-admin > app-admin-dashboard > ul > li')),
loginHref: hrefEles.get(3),
@ -138,6 +139,31 @@ describe('Router', () => {
expect(page.secondaryOutlet.count()).toBe(1, 'secondary outlet');
});
it('should redirect with secondary route', async () => {
const page = getPageStruct();
// go to login page and login
await browser.get('');
await page.loginHref.click();
await page.loginButton.click();
// open secondary outlet
await page.contactHref.click();
// go to login page and logout
await page.loginHref.click();
await page.loginButton.click();
// attempt to go to admin page, redirects to login with secondary outlet open
await page.adminHref.click();
// login, get redirected back to admin with outlet still open
await page.loginButton.click();
expect(await page.adminPage.isDisplayed()).toBeTruthy();
expect(page.secondaryOutlet.count()).toBeTruthy();
});
async function crisisCenterEdit(index: number, save: boolean) {
const page = getPageStruct();
await page.crisisHref.click();

View File

@ -27,10 +27,10 @@ export class LoginComponent {
if (this.authService.isLoggedIn) {
// Get the redirect URL from our auth service
// If no redirect has been set, use the default
let redirect = this.authService.redirectUrl ? this.authService.redirectUrl : '/crisis-center/admin';
let redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/admin';
// Redirect the user
this.router.navigate([redirect]);
this.router.navigateByUrl(redirect);
}
});
}

View File

@ -28,7 +28,7 @@ export class LoginComponent {
if (this.authService.isLoggedIn) {
// Get the redirect URL from our auth service
// If no redirect has been set, use the default
let redirect = this.authService.redirectUrl ? this.authService.redirectUrl : '/admin';
let redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/admin';
// #docregion preserve
// Set our navigation extras object
@ -39,7 +39,7 @@ export class LoginComponent {
};
// Redirect the user
this.router.navigate([redirect], navigationExtras);
this.router.navigateByUrl(redirect, navigationExtras);
// #enddocregion preserve
}
});

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-crisis-list',
templateUrl: './crisis-list.component.html',
styleUrls: ['./crisis-list.component.css']
templateUrl: './crisis-list.component.1.html',
styleUrls: ['./crisis-list.component.1.css']
})
export class CrisisListComponent { }

Some files were not shown because too many files have changed in this diff Show More