Compare commits

..

78 Commits
7.2.2 ... 7.2.4

Author SHA1 Message Date
74c202a5cd release: cut the v7.2.4 release 2019-02-05 19:39:39 -08:00
483e8d28ec revert: build: switch to typescript's es2015 typings (#28134)
This reverts commit a6fd118f79.
2019-02-05 18:08:39 -05:00
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
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
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 c8b70ae8e4.

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
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
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
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
dad1bc7ca3 build: bump year (#28220)
PR Close #28220
2019-02-04 16:41:00 -05:00
2109c30afe docs: fix shadow variable in tutorial example (#28499)
PR Close #28499
2019-02-04 14:54:53 -05:00
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
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
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
60c5ebd46a ci(docs-infra): compile with Ivy (#28421)
Jira: FW-552

PR Close #28421
2019-02-04 11:02:40 -05:00
b71d1987cd build(docs-infra): upgrade @angular/cli to 7.2.1 (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
e6325eb9ef refactor(docs-infra): get rid of on component input (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
114519ab6a fix(ivy): add missing private render3 exports (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
a9a095d44a refactor(core): remove duplicate check in defaultStyleSanitizer (#28421)
PR Close #28421
2019-02-04 11:02:40 -05:00
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
baeb446392 ci: add mgechev to tools & tools-bazel codeowners (#28384)
PR Close #28384
2019-02-04 03:31:29 -08:00
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
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
194710fc1d ci: fix setting env var with spaces in value (#28494)
PR Close #28494
2019-02-01 20:22:04 -05:00
6ae5e2b32a ci(docs-infra): reduce output verbosity to improve log readability (#28494)
PR Close #28494
2019-02-01 20:22:04 -05:00
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
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
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
0f37ed1060 release: cut the v7.2.3 release 2019-01-30 11:42:59 -08:00
5c85b4f1e9 docs: add Jeff Cross to contributors (#28432)
PR Close #28432
2019-01-29 16:41:32 -08:00
22bc6ef22a docs: fix typo for Browserslist in build guide (#28328)
PR Close #28328
2019-01-29 16:35:27 -08:00
bf928d1c9e docs: fix typo for Browserslist in file structure guide (#28312)
PR Close #28312
2019-01-29 16:33:19 -08:00
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
98c99e5073 docs: angular.kr link added (#28113)
PR Close #28113
2019-01-29 16:31:38 -08:00
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
0ff48a1266 style: change to American English (#27266)
PR Close #27266
2019-01-29 16:30:26 -08:00
ea2a3f8335 Revert "build: switch example e2e tests to bazel (#28402)" (#28438)
This reverts commit ef78e33560.

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

PR Close #28438
2019-01-29 16:20:27 -08:00
7c157780a9 docs: fix Redundant "See also:" link in ContentChild (#28334)
PR Close #28334
2019-01-29 12:03:26 -08:00
cc1b2a5373 perf: yarn version upgrade (#28360)
PR Close #28360
2019-01-29 11:58:48 -08:00
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
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
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
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
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
fe50710021 build: fix outdated i18n compiler-cli test assertions (#28191)
PR Close #28191
2019-01-28 20:07:23 -08:00
71b66fb862 build: run offline_compiler_test using bazel (#28191)
PR Close #28191
2019-01-28 20:07:23 -08:00
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
351610ca8d test: disable failing ivy example e2e tests (#28402)
PR Close #28402
2019-01-28 19:21:10 -08:00
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
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
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
aed48e00d2 build: update sauce connect version (#28378)
PR Close #28378
2019-01-28 11:55:07 -08:00
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
2f19ad9b46 fix(docs-infra): upgrade codelyzer to 4.5.0 (#28389)
PR Close #28389
2019-01-28 11:51:57 -08:00
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
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
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
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
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
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
6397885e74 test(bazel): Cleanup bazel-schematics integration test (#28351)
PR Close #28351
2019-01-25 12:47:27 -08:00
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
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
35f7ff047a docs: add api doc for ngif (#27376) (#28344)
PR Close #27376

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

PR Close #28344
2019-01-24 15:45:06 -08:00
c5af3f8617 docs: add api doc to template_ref (#28344)
PR Close #28344
2019-01-24 15:45:06 -08:00
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
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
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
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
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
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
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
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
f72319cf6e docs(router): removed additional to (#25989)
PR Close #25989
2019-01-23 11:00:20 -08:00
5877b3f702 refactor: remove unused parameter in _main method invocation (#28203)
PR Close #28203
2019-01-23 10:58:39 -08:00
cf310ba1fa refactor: fix code style (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
c2d2953ee4 refactor: remove unused parameters (#28203)
PR Close #28203
2019-01-23 10:58:38 -08:00
232 changed files with 2234 additions and 1594 deletions

View File

@ -42,6 +42,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 #

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,10 +11,19 @@
# 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.
var_3: &cache_key v2-angular-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-node-10.12
# Define common ENV vars
var_4: &define_env_vars
@ -45,7 +54,13 @@ var_7: &post_checkout
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:
@ -157,9 +172,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
@ -197,9 +212,22 @@ jobs:
# (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:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
# Build aio with Ivy (using local Angular packages)
- run: yarn --cwd aio build-with-ivy --progress=false
test_aio_tools:
<<: *job_defaults
@ -278,14 +306,16 @@ jobs:
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:
@ -306,6 +336,29 @@ jobs:
root: dist
paths:
- packages-dist
# Build the ivy npm packages.
build-ivy-npm-packages:
<<: *job_defaults
resource_class: xlarge
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- *define_env_vars
- *setup_circleci_bazel_config
- *yarn_install
- *setup_bazel_remote_execution
- run: scripts/build-ivy-npm-packages.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
paths:
- packages-dist-ivy-aot
# We run the integration tests outside of Bazel for now.
@ -481,7 +534,7 @@ workflows:
- lint
- test
- test_ivy_aot
- build-packages-dist
- build-npm-packages
- test_aio
- legacy-unit-tests-local
- legacy-unit-tests-saucelabs
@ -490,19 +543,19 @@ workflows:
- test_aio
- legacy-e2e-tests:
requires:
- build-packages-dist
- build-npm-packages
- legacy-misc-tests:
requires:
- build-packages-dist
- build-npm-packages
- test_aio_local:
requires:
- build-packages-dist
- build-npm-packages
- test_aio_tools:
requires:
- build-packages-dist
- build-npm-packages
- test_docs_examples:
requires:
- build-packages-dist
- build-npm-packages
- aio_preview:
# Only run on PR builds. (There can be no previews for non-PR builds.)
filters:
@ -513,7 +566,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:
@ -526,10 +579,11 @@ workflows:
- integration_test
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local
# - test_aio_local_ivy
- test_docs_examples
# Get the artifacts to publish from the build-packages-dist job
# Get the artifacts to publish from the build-npm-packages job
# since the publishing script expects the legacy outputs layout.
- build-packages-dist
- build-npm-packages
- legacy-e2e-tests
- legacy-misc-tests
- legacy-unit-tests-local

View File

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

View File

@ -18,6 +18,11 @@ setPublicVar PROJECT_ROOT "$(pwd)";
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 (or can be
# retrieved via `get-compare-url.js`), i.e. on push builds (a.k.a. non-PR, non-scheduled builds and

3
.github/CODEOWNERS vendored
View File

@ -54,6 +54,7 @@
# kara - Kara Erickson
# kyliau - Keen Yee Liau
# matsko - Matias Niemelä
# mgechev - Minko Gechev
# mhevery - Misko Hevery
# ocombe - Olivier Combe
# petebacondarwin - Pete Bacon Darwin
@ -113,6 +114,7 @@
# - alexeagle
# - kyliau
# - IgorMinar
# - mgechev
# ===========================================================
@ -122,6 +124,7 @@
# - alexeagle
# - filipesilva
# - hansl
# - mgechev
# ===========================================================

View File

@ -1,3 +1,37 @@
<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)

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

@ -62,8 +62,8 @@ local_repository(
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
# 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)
# - 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("0.21.0", """
You no longer need to install Bazel on your machine.
Angular has a dependency on the @bazel/bazel package which supplies it.

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": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -97,7 +97,7 @@ export class HeroService {
/** POST: add a new hero to the server */
addHero (hero: Hero): Observable<Hero> {
return this.http.post<Hero>(this.heroesUrl, hero, httpOptions).pipe(
tap((hero: Hero) => this.log(`added hero w/ id=${hero.id}`)),
tap((newHero: Hero) => this.log(`added hero w/ id=${newHero.id}`)),
catchError(this.handleError<Hero>('addHero'))
);
}

View File

@ -1508,7 +1508,7 @@ done manually.
When `true`, this option tells the compiler not to check the TypeScript version.
The compiler will skip checking and will not error out when an unsupported version of TypeScript is used.
Setting this option to `true` is not recommended because unsupported versions of TypeScript might have undefined behaviour.
Setting this option to `true` is not recommended because unsupported versions of TypeScript might have undefined behavior.
This option is `false` by default.

View File

@ -273,8 +273,8 @@ The CLI uses [Autoprefixer](https://github.com/postcss/autoprefixer) to ensure c
You may find it necessary to target specific browsers or exclude certain browser versions from your build.
Internally, Autoprefixer relies on a library called [Browserslist](https://github.com/browserslist/browserslist) to figure out which browsers to support with prefixing.
Browserlist looks for configuration options in a `browserlist` property of the package configuration file, or in a configuration file named `.browserslistrc`.
Autoprefixer looks for the Browserlist configuration when it prefixes your CSS.
Browserlist looks for configuration options in a `browserslist` property of the package configuration file, or in a configuration file named `.browserslistrc`.
Autoprefixer looks for the `browserslist` configuration when it prefixes your CSS.
* You can tell Autoprefixer what browsers to target by adding a browserslist property to the package configuration file, `package.json`:
```

View File

@ -53,7 +53,7 @@ Workspace-wide `node_modules` dependencies are visible to this project.
| `app/` | Contains the component files in which your app logic and data are defined. See details in [App source folder](#app-src) below. |
| `assets/` | Contains image files and other asset files to be copied as-is when you build your application. |
| `environments/` | Contains build configuration options for particular target environments. By default there is an unnamed standard development environment and a production ("prod") environment. You can define additional target environment configurations. |
| `browserlist` | Configures sharing of target browsers and Node.js versions among various front-end tools. See [Browserlist on GitHub](https://github.com/browserslist/browserslist) for more information. |
| `browserslist` | Configures sharing of target browsers and Node.js versions among various front-end tools. See [Browserslist on GitHub](https://github.com/browserslist/browserslist) for more information. |
| `favicon.ico` | An icon to use for this app in the bookmark bar. |
| `index.html` | The main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any `<script>` or` <link>` tags here manually. |
| `main.ts` | The main entry point for your app. Compiles the application with the [JIT compiler](https://angular.io/guide/glossary#jit) and bootstraps the application's root module (AppModule) to run in the browser. You can also use the [AOT compiler](https://angular.io/guide/aot-compiler) without changing any code by appending the `--aot` flag to the CLI `build` and `serve` commands. |

View File

@ -124,7 +124,7 @@ calls the lifecycle hook methods in the following sequence at specific moments:
Respond after Angular checks the component's views and child views / the view that a directive is in.
Called after the `ngAfterViewInit` and every subsequent `ngAfterContentChecked()`.
Called after the `ngAfterViewInit()` and every subsequent `ngAfterContentChecked()`.
</td>
</tr>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -2,7 +2,7 @@
@description
The MIT License
Copyright (c) 2014-2018 Google, Inc.
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

@ -698,5 +698,13 @@
"website": "https://brianflove.com",
"bio": "Brian is a software engineer and GDE in Angular with a passion for learning, writing, speaking, teaching and mentoring. Brian has been building web applications for over 20 years and has long been a fanboy of JavaScript. When not in front of his Macbook Pro Brian is in the Rocky Mountains skiing or hiking.",
"group": "GDE"
},
"jeffbcross": {
"name": "Jeff Cross",
"picture": "jeff-cross.jpg",
"twitter": "jeffbcross",
"website": "https://nrwl.io/",
"bio": "Jeff is an Angular Consultant at nrwl.io where he helps enterprise teams succeed with Angular. Prior to founding Nrwl, Jeff was one of the earliest members of the Angular Core Team at Google, and contributed to many of the early state management and performance efforts of AngularJS and Angular.",
"group": "GDE"
}
}

View File

@ -19,6 +19,12 @@
<td>Atlanta, Georgia</td>
<td>January 9 - 12, 2019</td>
</tr>
<!-- ng-India 2019-->
<tr>
<th><a href="https://www.ng-ind.com/" title="ng-India">ng-India</a></th>
<td>Gurgaon, India</td>
<td>February 23, 2019</td>
</tr>
</tbody>
</table>

View File

@ -753,6 +753,10 @@
{
"title": "日本語版",
"url": "https://angular.jp/"
},
{
"title": "한국어",
"url": "https://angular.kr/"
}
]
}

View File

@ -112,7 +112,7 @@ Inject `HttpClient` into the constructor in a private property called `http`.
</code-example>
Keep injecting the `MessageService`. You'll call it so frequently that
you'll wrap it in private `log` method.
you'll wrap it in a private `log()` method.
<code-example
path="toh-pt6/src/app/hero.service.ts"

View File

@ -17,7 +17,9 @@
"build": "yarn ~~build",
"prebuild-local": "yarn setup-local",
"build-local": "yarn ~~build",
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js 02d2ec250",
"prebuild-with-ivy": "yarn setup-local && yarn ivy-ngcc",
"build-with-ivy": "node scripts/build-with-ivy",
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js b5e796a03",
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
"test": "yarn check-env && ng test",
"pree2e": "yarn check-env && yarn update-webdriver",
@ -60,7 +62,7 @@
"generate-stackblitz": "node ./tools/stackblitz-builder/generateStackblitz",
"generate-zips": "node ./tools/example-zipper/generateZips",
"build-404-page": "node scripts/build-404-page",
"update-webdriver": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG",
"update-webdriver": "webdriver-manager update --standalone false --gecko false $CI_CHROMEDRIVER_VERSION_ARG",
"~~check-env": "node scripts/check-environment",
"~~clean-generated": "node --eval \"require('shelljs').rm('-rf', 'src/generated')\"",
"~~build": "ng build --configuration=stable",
@ -71,7 +73,7 @@
},
"engines": {
"node": ">=10.9.0 <11.0.0",
"yarn": ">=1.10.1 <1.13.0"
"yarn": ">=1.10.1 <1.14.0"
},
"private": true,
"dependencies": {
@ -91,12 +93,11 @@
"core-js": "^2.4.1",
"rxjs": "^6.3.0",
"tslib": "^1.9.0",
"web-animations-js": "^2.2.5",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "7.2.0-beta.2",
"@angular-devkit/build-angular": "^0.12.1",
"@angular/cli": "7.2.1",
"@angular/compiler": "^7.0.0",
"@angular/compiler-cli": "^7.0.0",
"@angular/language-service": "^7.0.0",
@ -107,7 +108,7 @@
"canonical-path": "1.0.0",
"chalk": "^2.1.0",
"cjson": "^0.5.0",
"codelyzer": "~4.2.1",
"codelyzer": "~4.5.0",
"cross-spawn": "^5.1.0",
"css-selector-parser": "^1.3.0",
"dgeni": "^0.4.11",

View File

@ -9,7 +9,7 @@ const SRC_DIR = resolve(__dirname, '../src');
const DIST_DIR = resolve(__dirname, '../dist');
// Run
_main(process.argv.slice(2));
_main();
// Functions - Definitions
function _main() {

View File

@ -0,0 +1,46 @@
#!/usr/bin/env node
// Imports
const {extend, parse} = require('cjson');
const {readFileSync, writeFileSync} = require('fs');
const {join, resolve} = require('path');
const {exec, set} = require('shelljs');
set('-e');
// Constants
const ROOT_DIR = resolve(__dirname, '..');
const TS_CONFIG_PATH = join(ROOT_DIR, 'tsconfig.json');
const NG_COMPILER_OPTS = {
angularCompilerOptions: {
// Related Jira issue: FW-737
allowEmptyCodegenFiles: true,
enableIvy: 'ngtsc',
},
};
// Run
_main(process.argv.slice(2));
// Functions - Definitions
function _main(buildArgs) {
console.log('\nModifying `tsconfig.json`...');
const oldTsConfigStr = readFileSync(TS_CONFIG_PATH, 'utf8');
const oldTsConfigObj = parse(oldTsConfigStr);
const newTsConfigObj = extend(true, oldTsConfigObj, NG_COMPILER_OPTS);
const newTsConfigStr = JSON.stringify(newTsConfigObj, null, 2);
writeFileSync(TS_CONFIG_PATH, newTsConfigStr);
console.log(newTsConfigStr);
try {
const buildArgsStr = buildArgs.join(' ');
console.log(`\nBuilding${buildArgsStr && ` with args \`${buildArgsStr}\``}...`);
exec(`yarn ~~build ${buildArgsStr}`, {cwd: ROOT_DIR});
} finally {
console.log('\nRestoring `tsconfig.json`...');
writeFileSync(TS_CONFIG_PATH, oldTsConfigStr);
}
console.log('\nDone!');
}

View File

@ -61,7 +61,7 @@
(docInserted)="onDocInserted()"
(docRendered)="onDocRendered()">
</aio-doc-viewer>
<aio-dt [on]="dtOn" [(doc)]="currentDocument"></aio-dt>
<aio-dt *ngIf="dtOn" [(doc)]="currentDocument"></aio-dt>
</main>
</mat-sidenav-container>

View File

@ -169,6 +169,13 @@ describe('AppComponent', () => {
expect(component.tocMaxHeight).toMatch(/^\d+\.\d{2}$/);
});
it('should update `scrollService.updateScrollPositonInHistory()`', () => {
const scrollService = fixture.debugElement.injector.get<ScrollService>(ScrollService);
spyOn(scrollService, 'updateScrollPositionInHistory');
component.onScroll();
expect(scrollService.updateScrollPositionInHistory).toHaveBeenCalled();
});
});
describe('SideNav', () => {
@ -461,11 +468,15 @@ describe('AppComponent', () => {
let scrollService: ScrollService;
let scrollSpy: jasmine.Spy;
let scrollToTopSpy: jasmine.Spy;
let scrollAfterRenderSpy: jasmine.Spy;
let removeStoredScrollPositionSpy: jasmine.Spy;
beforeEach(() => {
scrollService = fixture.debugElement.injector.get<ScrollService>(ScrollService);
scrollSpy = spyOn(scrollService, 'scroll');
scrollToTopSpy = spyOn(scrollService, 'scrollToTop');
scrollAfterRenderSpy = spyOn(scrollService, 'scrollAfterRender');
removeStoredScrollPositionSpy = spyOn(scrollService, 'removeStoredScrollPosition');
});
it('should not scroll immediately when the docId (path) changes', () => {
@ -510,33 +521,24 @@ describe('AppComponent', () => {
expect(scrollSpy).toHaveBeenCalledTimes(1);
});
it('should scroll to top when call `onDocRemoved` directly', () => {
scrollToTopSpy.calls.reset();
it('should call `removeStoredScrollPosition` when call `onDocRemoved` directly', () => {
component.onDocRemoved();
expect(scrollToTopSpy).toHaveBeenCalled();
expect(removeStoredScrollPositionSpy).toHaveBeenCalled();
});
it('should scroll after a delay when call `onDocInserted` directly', fakeAsync(() => {
it('should call `scrollAfterRender` when call `onDocInserted` directly', (() => {
component.onDocInserted();
expect(scrollSpy).not.toHaveBeenCalled();
tick(scrollDelay);
expect(scrollSpy).toHaveBeenCalled();
expect(scrollAfterRenderSpy).toHaveBeenCalledWith(scrollDelay);
}));
it('should scroll (via `onDocInserted`) when finish navigating to a new doc', fakeAsync(() => {
expect(scrollToTopSpy).not.toHaveBeenCalled();
it('should call `scrollAfterRender` (via `onDocInserted`) when navigate to a new Doc', fakeAsync(() => {
locationService.go('guide/pipes');
tick(1); // triggers the HTTP response for the document
tick(1); // triggers the HTTP response for the document
fixture.detectChanges(); // triggers the event that calls `onDocInserted`
expect(scrollToTopSpy).toHaveBeenCalled();
expect(scrollSpy).not.toHaveBeenCalled();
expect(scrollAfterRenderSpy).toHaveBeenCalledWith(scrollDelay);
tick(scrollDelay);
expect(scrollSpy).toHaveBeenCalled();
tick(500); // there are other outstanding timers in the AppComponent that are not relevant
}));
});

View File

@ -127,7 +127,7 @@ export class AppComponent implements OnInit {
}
if (path === this.currentPath) {
// scroll only if on same page (most likely a change to the hash)
this.autoScroll();
this.scrollService.scroll();
} else {
// don't scroll; leave that to `onDocRendered`
this.currentPath = path;
@ -187,11 +187,6 @@ export class AppComponent implements OnInit {
.subscribe(() => this.updateShell());
}
// Scroll to the anchor in the hash fragment or top of doc.
autoScroll() {
this.scrollService.scroll();
}
onDocReady() {
// About to transition to new view.
this.isTransitioning = true;
@ -204,9 +199,7 @@ export class AppComponent implements OnInit {
}
onDocRemoved() {
// The previous document has been removed.
// Scroll to top to restore a clean visual state for the new document.
this.scrollService.scrollToTop();
this.scrollService.removeStoredScrollPosition();
}
onDocInserted() {
@ -216,9 +209,8 @@ export class AppComponent implements OnInit {
// (e.g. sidenav, host classes) needs to happen asynchronously.
setTimeout(() => this.updateShell());
// Scroll 500ms after the new document has been inserted into the doc-viewer.
// The delay is to allow time for async layout to complete.
setTimeout(() => this.autoScroll(), 500);
// Scroll the good position depending on the context
this.scrollService.scrollAfterRender(500);
}
onDocRendered() {
@ -242,7 +234,7 @@ export class AppComponent implements OnInit {
@HostListener('window:resize', ['$event.target.innerWidth'])
onResize(width: number) {
this.isSideBySide = width > this.sideBySideWidth;
this.isSideBySide = width >= this.sideBySideWidth;
this.showFloatingToc.next(width > this.showFloatingTocWidth);
if (this.isSideBySide && !this.isSideNavDoc) {
@ -256,7 +248,6 @@ export class AppComponent implements OnInit {
@HostListener('click', ['$event.target', '$event.button', '$event.ctrlKey', '$event.metaKey', '$event.altKey'])
onClick(eventTarget: HTMLElement, button: number, ctrlKey: boolean, metaKey: boolean, altKey: boolean): boolean {
// Hide the search results if we clicked outside both the "search box" and the "search results"
if (!this.searchElements.some(element => element.nativeElement.contains(eventTarget))) {
this.hideSearchResults();
@ -348,6 +339,9 @@ export class AppComponent implements OnInit {
// Dynamically change height of table of contents container
@HostListener('window:scroll')
onScroll() {
this.scrollService.updateScrollPositionInHistory();
if (!this.tocMaxHeightOffset) {
// Must wait until `mat-toolbar` is measurable.
const el = this.hostElement.nativeElement as Element;

View File

@ -46,7 +46,7 @@ export interface TabInfo {
export class CodeTabsComponent implements OnInit, AfterViewInit {
tabs: TabInfo[];
@Input('linenums') linenums: string;
@Input() linenums: string;
@ViewChild('content') content;

View File

@ -4,18 +4,17 @@ import { DocumentContents } from 'app/documents/document.service';
@Component({
selector: 'aio-dt',
template: `
<div *ngIf="on">
<hr>
<textarea #dt [value]="text" rows="10" cols="80"></textarea>
<br/>
<button (click)="dtextSet()">Show change</button>
</div>
<div>
<hr>
<textarea #dt [value]="text" rows="10" cols="80"></textarea>
<br/>
<button (click)="dtextSet()">Show change</button>
</div>
`
})
export class DtComponent {
@Input() on = false;
@Input('doc') doc: DocumentContents;
@Input() doc: DocumentContents;
@Output() docChange = new EventEmitter<DocumentContents>();
@ViewChild('dt', { read: ElementRef })

View File

@ -1,23 +1,20 @@
<div class="grid-fluid">
<div class="footer-block" *ngFor="let node of nodes">
<h3>{{node.title}}</h3>
<ul>
<li *ngFor="let item of node.children">
<a class="link" [href]="item.url"
[title]="item.tooltip || item.title">{{ item.title }}</a>
</li>
</ul>
</div>
<div class="grid-fluid">
<div class="footer-block" *ngFor="let node of nodes">
<h3>{{node.title}}</h3>
<ul>
<li *ngFor="let item of node.children">
<a class="link" [href]="item.url" [title]="item.tooltip || item.title">{{ item.title }}</a>
</li>
</ul>
</div>
</div>
<p>
Powered by Google ©2010-2018.
Code licensed under an <a href="license" title="License text" >MIT-style License</a>.
Documentation licensed under
<a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
</p>
<p>
Version {{versionInfo?.full}}.
</p>
<!-- TODO: twitter widget (but only on pages that use twitter) -->
<p>
Super-powered by Google ©2010-2019.
Code licensed under an <a href="license" title="License text">MIT-style License</a>.
Documentation licensed under
<a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
</p>
<p>
Version {{versionInfo?.full}}.
</p>

View File

@ -1,9 +1,3 @@
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
import { NgZone, Injectable } from '@angular/core';
import { ConnectableObservable, Observable, race, ReplaySubject, timer } from 'rxjs';
import { concatMap, first, publishReplay } from 'rxjs/operators';

View File

@ -1,6 +1,8 @@
import { ReflectiveInjector } from '@angular/core';
import { PlatformLocation } from '@angular/common';
import { Location, LocationStrategy, PlatformLocation, ViewportScroller } from '@angular/common';
import { DOCUMENT } from '@angular/common';
import { MockLocationStrategy, SpyLocation } from '@angular/common/testing';
import { fakeAsync, tick } from '@angular/core/testing';
import { ScrollService, topMargin } from './scroll.service';
@ -8,8 +10,9 @@ describe('ScrollService', () => {
const topOfPageElem = {} as Element;
let injector: ReflectiveInjector;
let document: MockDocument;
let location: MockPlatformLocation;
let platformLocation: MockPlatformLocation;
let scrollService: ScrollService;
let location: SpyLocation;
class MockPlatformLocation {
hash: string;
@ -27,6 +30,11 @@ describe('ScrollService', () => {
scrollIntoView = jasmine.createSpy('Element scrollIntoView');
}
const viewportScrollerStub = jasmine.createSpyObj(
'viewportScroller',
['getScrollPosition', 'scrollToPosition']);
beforeEach(() => {
spyOn(window, 'scrollBy');
});
@ -34,12 +42,24 @@ describe('ScrollService', () => {
beforeEach(() => {
injector = ReflectiveInjector.resolveAndCreate([
ScrollService,
{ provide: Location, useClass: SpyLocation },
{ provide: DOCUMENT, useClass: MockDocument },
{ provide: PlatformLocation, useClass: MockPlatformLocation }
{ provide: PlatformLocation, useClass: MockPlatformLocation },
{ provide: ViewportScroller, useValue: viewportScrollerStub },
{ provide: LocationStrategy, useClass: MockLocationStrategy }
]);
location = injector.get(PlatformLocation);
platformLocation = injector.get(PlatformLocation);
document = injector.get(DOCUMENT);
scrollService = injector.get(ScrollService);
location = injector.get(Location);
});
it('should set `scrollRestoration` to `manual` if supported', () => {
if (scrollService.supportManualScrollRestoration) {
expect(window.history.scrollRestoration).toBe('manual');
} else {
expect(window.history.scrollRestoration).toBeUndefined();
}
});
describe('#topOffset', () => {
@ -107,7 +127,7 @@ describe('ScrollService', () => {
describe('#scroll', () => {
it('should scroll to the top if there is no hash', () => {
location.hash = '';
platformLocation.hash = '';
const topOfPage = new MockElement();
document.getElementById.and
@ -118,7 +138,7 @@ describe('ScrollService', () => {
});
it('should not scroll if the hash does not match an element id', () => {
location.hash = 'not-found';
platformLocation.hash = 'not-found';
document.getElementById.and.returnValue(null);
scrollService.scroll();
@ -128,7 +148,7 @@ describe('ScrollService', () => {
it('should scroll to the element whose id matches the hash', () => {
const element = new MockElement();
location.hash = 'some-id';
platformLocation.hash = 'some-id';
document.getElementById.and.returnValue(element);
scrollService.scroll();
@ -139,7 +159,7 @@ describe('ScrollService', () => {
it('should scroll to the element whose id matches the hash with encoded characters', () => {
const element = new MockElement();
location.hash = '%F0%9F%91%8D'; // 👍
platformLocation.hash = '%F0%9F%91%8D'; // 👍
document.getElementById.and.returnValue(element);
scrollService.scroll();
@ -210,4 +230,136 @@ describe('ScrollService', () => {
});
});
describe('#isLocationWithHash', () => {
it('should return true when the location has a hash', () => {
platformLocation.hash = 'anchor';
expect(scrollService.isLocationWithHash()).toBe(true);
});
it('should return false when the location has no hash', () => {
platformLocation.hash = '';
expect(scrollService.isLocationWithHash()).toBe(false);
});
});
describe('#needToFixScrollPosition', async() => {
it('should return true when popState event was fired after a back navigation if the browser supports ' +
'scrollRestoration`. Otherwise, needToFixScrollPosition() returns false', () => {
if (scrollService.supportManualScrollRestoration) {
location.go('/initial-url1');
// We simulate a scroll down
location.replaceState('/initial-url1', 'hack', {scrollPosition: [2000, 0]});
location.go('/initial-url2');
location.back();
expect(scrollService.popStateFired).toBe(true);
expect(scrollService.scrollPosition).toEqual([2000, 0]);
expect(scrollService.needToFixScrollPosition()).toBe(true);
} else {
location.go('/initial-url1');
location.go('/initial-url2');
location.back();
expect(scrollService.popStateFired).toBe(false); // popStateFired is always false
expect(scrollService.scrollPosition).toEqual([0, 0]); // scrollPosition always equals [0, 0]
expect(scrollService.needToFixScrollPosition()).toBe(false);
}
});
it('should return true when popState event was fired after a forward navigation if the browser supports ' +
'scrollRestoration`. Otherwise, needToFixScrollPosition() returns false', () => {
if (scrollService.supportManualScrollRestoration) {
location.go('/initial-url1');
location.go('/initial-url2');
// We simulate a scroll down
location.replaceState('/initial-url1', 'hack', {scrollPosition: [2000, 0]});
location.back();
scrollService.popStateFired = false;
scrollService.scrollPosition = [0, 0];
location.forward();
expect(scrollService.popStateFired).toBe(true);
expect(scrollService.scrollPosition).toEqual([2000, 0]);
expect(scrollService.needToFixScrollPosition()).toBe(true);
} else {
location.go('/initial-url1');
location.go('/initial-url2');
location.back();
location.forward();
expect(scrollService.popStateFired).toBe(false); // popStateFired is always false
expect(scrollService.scrollPosition).toEqual([0, 0]); // scrollPosition always equals [0, 0]
expect(scrollService.needToFixScrollPosition()).toBe(false);
}
});
});
describe('#scrollAfterRender', async() => {
let scrollSpy: jasmine.Spy;
let scrollToTopSpy: jasmine.Spy;
let needToFixScrollPositionSpy: jasmine.Spy;
let scrollToPosition: jasmine.Spy;
let isLocationWithHashSpy: jasmine.Spy;
let getStoredScrollPositionSpy: jasmine.Spy;
const scrollDelay = 500;
beforeEach(() => {
scrollSpy = spyOn(scrollService, 'scroll');
scrollToTopSpy = spyOn(scrollService, 'scrollToTop');
scrollToPosition = spyOn(scrollService, 'scrollToPosition');
needToFixScrollPositionSpy = spyOn(scrollService, 'needToFixScrollPosition');
getStoredScrollPositionSpy = spyOn(scrollService, 'getStoredScrollPosition');
isLocationWithHashSpy = spyOn(scrollService, 'isLocationWithHash');
});
it('should call `scroll` when we navigate to a location with anchor', fakeAsync(() => {
needToFixScrollPositionSpy.and.returnValue(false);
getStoredScrollPositionSpy.and.returnValue(null);
isLocationWithHashSpy.and.returnValue(true);
scrollService.scrollAfterRender(scrollDelay);
expect(scrollSpy).not.toHaveBeenCalled();
tick(scrollDelay);
expect(scrollSpy).toHaveBeenCalled();
}));
it('should call `scrollToTop` when we navigate to a location without anchor', fakeAsync(() => {
needToFixScrollPositionSpy.and.returnValue(false);
getStoredScrollPositionSpy.and.returnValue(null);
isLocationWithHashSpy.and.returnValue(false);
scrollService.scrollAfterRender(scrollDelay);
expect(scrollToTopSpy).toHaveBeenCalled();
tick(scrollDelay);
expect(scrollSpy).not.toHaveBeenCalled();
}));
it('should call `viewportScroller.scrollToPosition` when we reload a page', fakeAsync(() => {
getStoredScrollPositionSpy.and.returnValue([0, 1000]);
scrollService.scrollAfterRender(scrollDelay);
expect(viewportScrollerStub.scrollToPosition).toHaveBeenCalled();
expect(getStoredScrollPositionSpy).toHaveBeenCalled();
}));
it('should call `scrollToPosition` after a popState', fakeAsync(() => {
needToFixScrollPositionSpy.and.returnValue(true);
getStoredScrollPositionSpy.and.returnValue(null);
scrollService.scrollAfterRender(scrollDelay);
expect(scrollToPosition).toHaveBeenCalled();
tick(scrollDelay);
expect(scrollSpy).not.toHaveBeenCalled();
expect(scrollToTopSpy).not.toHaveBeenCalled();
}));
});
});

View File

@ -1,5 +1,5 @@
import { Injectable, Inject } from '@angular/core';
import { PlatformLocation } from '@angular/common';
import { Location, PlatformLocation, ViewportScroller } from '@angular/common';
import { DOCUMENT } from '@angular/common';
import { fromEvent } from 'rxjs';
@ -13,6 +13,13 @@ export class ScrollService {
private _topOffset: number | null;
private _topOfPageElement: Element;
// true when popState event has been fired.
popStateFired = false;
// scroll position which has to be restored after the popState event
scrollPosition: [number, number] = [0, 0];
// true when the browser supports `scrollTo`, `scrollX`, `scrollY` and `scrollRestoration`
supportManualScrollRestoration: boolean;
// Offset from the top of the document to bottom of any static elements
// at the top (e.g. toolbar) + some margin
get topOffset() {
@ -32,9 +39,37 @@ export class ScrollService {
constructor(
@Inject(DOCUMENT) private document: any,
private location: PlatformLocation) {
private platformLocation: PlatformLocation,
private viewportScroller: ViewportScroller,
private location: Location) {
// On resize, the toolbar might change height, so "invalidate" the top offset.
fromEvent(window, 'resize').subscribe(() => this._topOffset = null);
try {
this.supportManualScrollRestoration = !!window && !!window.scrollTo && 'scrollX' in window
&& 'scrollY' in window && !!history && !!history.scrollRestoration;
} catch {
this.supportManualScrollRestoration = false;
}
// Change scroll restoration strategy to `manual` if it's supported
if (this.supportManualScrollRestoration) {
history.scrollRestoration = 'manual';
// we have to detect forward and back navigation thanks to popState event
this.location.subscribe(event => {
// the type is `hashchange` when the fragment identifier of the URL has changed. It allows us to go to position
// just before a click on an anchor
if (event.type === 'hashchange') {
this.scrollToPosition();
} else {
// The popstate event is always triggered by doing a browser action such as a click on the back or forward button.
// It can be follow by a event of type `hashchange`.
this.popStateFired = true;
// we always should have a scrollPosition in our state history
this.scrollPosition = event.state ? event.state['scrollPosition'] : null;
}
});
}
}
/**
@ -50,6 +85,44 @@ export class ScrollService {
this.scrollToElement(element);
}
/**
* test if the current location has a hash
*/
isLocationWithHash(): boolean {
return !!this.getCurrentHash();
}
/**
* When we load a document, we have to scroll to the correct position depending on whether this is a new location,
* a back/forward in the history, or a refresh
* @param delay before we scroll to the good position
*/
scrollAfterRender(delay: number) {
// If we do rendering following a refresh, we use the scroll position from the storage.
const storedScrollPosition = this.getStoredScrollPosition();
if (storedScrollPosition) {
this.viewportScroller.scrollToPosition(storedScrollPosition);
} else {
if (this.needToFixScrollPosition()) {
// The document was reloaded following a popState `event` (called by the forward/back button), so we manage
// the scroll position
this.scrollToPosition();
} else {
// The document was loaded either of the following cases: a direct navigation via typing the URL in the
// address bar or a click on a link. If the location contains a hash, we have to wait for async
// layout.
if (this.isLocationWithHash()) {
// Scroll 500ms after the new document has been inserted into the doc-viewer.
// The delay is to allow time for async layout to complete.
setTimeout(() => this.scroll(), delay);
} else {
// If the location doesn't contain a hash, we scroll to the top of the page.
this.scrollToTop();
}
}
}
}
/**
* Scroll to the element.
* Don't scroll if no element.
@ -79,10 +152,42 @@ export class ScrollService {
this.scrollToElement(this.topOfPageElement);
}
scrollToPosition() {
this.viewportScroller.scrollToPosition(this.scrollPosition);
this.popStateFired = false;
}
/**
* Update the state with scroll position into history.
*/
updateScrollPositionInHistory() {
if (this.supportManualScrollRestoration) {
const currentScrollPosition = this.viewportScroller.getScrollPosition();
this.location.replaceState(this.location.path(true), undefined, {scrollPosition: currentScrollPosition});
window.sessionStorage.setItem('scrollPosition', currentScrollPosition.toString());
}
}
getStoredScrollPosition(): [number, number] | null {
const position = window.sessionStorage.getItem('scrollPosition');
return position ? JSON.parse('[' + position + ']') : null;
}
removeStoredScrollPosition() {
window.sessionStorage.removeItem('scrollPosition');
}
/**
* Check if the scroll position need to be manually fixed after popState event
*/
needToFixScrollPosition(): boolean {
return this.popStateFired && this.scrollPosition && this.supportManualScrollRestoration;
}
/**
* Return the hash fragment from the `PlatformLocation`, minus the leading `#`.
*/
private getCurrentHash() {
return decodeURIComponent(this.location.hash.replace(/^#/, ''));
return decodeURIComponent(this.platformLocation.hash.replace(/^#/, ''));
}
}

View File

@ -1,9 +1,3 @@
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
import {NgZone} from '@angular/core';
import {Observable} from 'rxjs';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -17,5 +17,5 @@ import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js';
/** IE10 and IE11 requires the following to support `@angular/animation`. */
import 'web-animations-js';
/** Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. */
// import 'web-animations-js';

View File

@ -47,6 +47,7 @@ aio-shell.page-resources mat-toolbar.mat-toolbar {
// DOCS PAGES OVERRIDE: HAMBURGER
aio-shell.folder-api mat-toolbar.mat-toolbar,
aio-shell.folder-cli mat-toolbar.mat-toolbar,
aio-shell.folder-docs mat-toolbar.mat-toolbar,
aio-shell.folder-guide mat-toolbar.mat-toolbar,
aio-shell.folder-tutorial mat-toolbar.mat-toolbar {

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