Commit graph

21825 commits

Author SHA1 Message Date
Virginia Dooley
e5d08c1902 docs: update reviewed tag (#43452)
PR Close #43452
2021-09-15 10:49:05 -07:00
dario-piotrowicz
66c6dbdc79 refactor(docs-infra): introduce max-len 120 eslint rule (#43439)
add the max-len rule to the aio eslintrc and fix what code
breaks such rule

PR Close #43439
2021-09-15 10:47:35 -07:00
dario-piotrowicz
4ef9d247b6 refactor(docs-infra): fix typos in app component (and its tests) (#43439)
fix some minor typos found in the app.component.ts and
app.component.spec.ts files

PR Close #43439
2021-09-15 10:47:35 -07:00
Pete Bacon Darwin
1986407ab5 docs: move i18n angular.json snippets to external file (#43216)
Note that because `angular.json` is a "boilerplate" file we cannot
just add comments to the one that is actually used in the application.

Instead this commit makes a copy, which is annotated with docregions.
To ensure that this file is not ignored by the example-collector, we had to
update the `.gitignore` to not ignore this file. (This also allows the file to be
easily stored tracked in git).

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
79aa784168 build(docs-infra): support overriding boilerplate files in examples (#43216)
It is now possible to specify file paths in the `"boilerplate-override"`
property of `example-config.json` files to tell the example boilerplate
system to use the file in the example directory rather than overwriting the
example file with that from the boilerplate directory.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
758ba0f0f9 build(docs-infra): indent docplaster markers to the level of the docregion (#43216)
This change makes docplaster markers fit better with the surrounding code
that is being rendered.  Instead of:

```
{
  "a": 100,
// ...
  "b": 200,
// ...
}
```

you can now get

```
{
  "a": 100,
  // ...
  "b": 200,
  // ...
}
```

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
a73aaa9396 build(docs-infra): switch JSON examples to use inline docregion comments (#43216)
Now JSON files should be commented using

```
// #docregion
```

rather than

```
/* #docregion */
```

There are currently no JSON files with either kind of comments so this change
has no impact yet.

But when we add some examples with such comments, they will also benefit
from `// ... ` style docplasters to join docregion fragments.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c464bb4555 docs: move duplicate custom id snippets to external examples (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
04e41b8c35 docs: move nginx and apache config blocks to external files (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
ad04c1bc62 build(docs-infra): support docregions in .conf files (#43216)
This commit tells the docregion parser how to process files that end in `.conf`.

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c0988d6f52 docs: move plural function example to external file (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
602a127d08 docs: move global locale import to external example file (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
eb0c1475ab docs: move shell snippets to external example files (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c77c8b7913 build(docs-infra): support docregions in .sh example files (#43216)
This commit tells the docregion parser how to process `.sh` files.

PR Close #43216
2021-09-15 10:46:45 -07:00
Andrew Kushnir
5e9eb7abbd
release: cut the v13.0.0-next.6 release (#43464) 2021-09-15 10:37:18 -07:00
Andrew Kushnir
bab963fd7f
docs: release notes for the v12.2.6 release (#43463) 2021-09-15 10:34:03 -07:00
Joe Martin (Crowdstaffing)
02ccceb17e docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
85617ee67c docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
61e9bb5715 docs: update link (#43451)
Update link per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
76683a4e2a docs: update punctuation (#43451)
Update punctuation per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
6fe6ca8812 docs: update grammar (#43451)
Update grammar per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
43704138ca docs: update spelling (#43451)
Update spelling per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Joe Martin (Crowdstaffing)
c136a050c9 docs: update capitalization (#43451)
Update capitalization per review.

PR Close #43451
2021-09-14 15:51:30 -07:00
Andrew Scott
3ec9ee65b9 refactor(router): Remove TODO and slightly adjust eager browserUrlTree update (#43426)
No test was added for this case because I can't think of a test case to
write that would work.

This change updates the code for a consistent mental model of setting
the `browserUrlTree`. It's only meant to track the `UrlTree` that the
`UrlHandlingStrategy` is set to extract, not the full `rawUrl`. Notice
that everywhere else, the `browserUrlTree` is set to
`urlAfterRedirects`, which is computed based on the extracted URL, _not_
the `rawUrl`.

PR Close #43426
2021-09-14 11:11:43 -07:00
Andrew Scott
5163999fb9 test(router): Add tests to document expected behavior (#43449)
PR #43102 broke some use-cases. These tests document expected behavior
and would have prevented #43446 and #43447. Recent changes have already
addressed these issues, but it would still be a good idea to cover these
use-cases in tests as well.

PR Close #43449
2021-09-14 11:11:08 -07:00
Renovate Bot
71e432305b build: lock file maintenance (#43285)
PR Close #43285
2021-09-14 11:08:59 -07:00
Andrew Scott
796da641f0 fix(router): Do not modify parts of URL excluded from with 'eager' updates (#43421)
The previous code would set the browser URL to be only the part that's
extracted by the `UrlHandlingStrategy`. However, there may be parts of
the URL which are _should not_ be handled by the Angular Router. This
change updates the code to set the browser URL in the same way that's
done with `'deferred'`: Merging the extracted URL after redirects with
the whole raw URL of the navigation, which includes parts not handled by
the `UrlHandlingStrategy`.

PR Close #43421
2021-09-14 08:35:15 -07:00
David Shevitz
e8e41efcea docs: add guidelines for localizing angular documentation (#43314)
PR Close #43314
2021-09-14 08:32:51 -07:00
George Kalpakas
bdefeb1f11 perf(docs-infra): reduce unnecessary whitespace in API docs (#43435)
The HTML for the docs pages is generated by Dgeni based on some
[Nunjucks][1] templates.

Previously, these templates were set up in a way that introduced a lot
excess whitespace in the generated HTML, unnecessarily bloating the
corresponding JSON files that need to be downloaded in order to view a
certain docs page. This has been discussed in #28105 and was again
observed while investigating #43285.

This commit refactors some of the templates related to API docs (which
seem to be the most affected ones) to drastically reduce the amount of
excess whitespace. More specifically, the total size of all files in
`generated/docs/api/` was reduced from ~13MB to ~7MB.

Besides the reduced payload size for each API page, this change will
also reduce the amount of memory needed by the ServiceWorker to cache
the API pages that have been visited by a user.

NOTE:
The affected files are not eagerly downloaded when navigating to
angular.io. Instead, each file is downloaded individually, as soon as a
user visits the corresponding API docs page. Therefore, the impact of
this change will be relatively small for most users.

[1]: https://mozilla.github.io/nunjucks/

PR Close #43435
2021-09-14 08:29:50 -07:00
George Kalpakas
39800c1768 build(docs-infra): update remark-html to 13.0.2 (#43435)
NOTE:
This [version][1] includes a breaking fix ([commit b0b1ba5c5][2]), which
turns sanitization on by default. Since, we don't need sanitization (the
HTML is authored by docs authors and tooling and should be safe), this
commit restores the old behavior by setting the [sanitize][3] option to
`false`.

[1]: https://github.com/remarkjs/remark-html/releases/tag/13.0.2
[2]: b0b1ba5c55
[3]: https://github.com/remarkjs/remark-html#optionssanitize

PR Close #43435
2021-09-14 08:29:50 -07:00
George Kalpakas
549b372458 build(docs-infra): update github-slugger to 1.4.0 (#43435)
NOTE:
This [version][1] includes a breaking fix ([commit af59f343d][2]). More
specifically `github-slugger` will no longer trim the text of a heading
before generating an ID and (with whitespace converted to `-`) this
results in different heading IDs:
**Before:** `<h3>  foo bar  </h3>` --> `<h3 id="foo-bar">...`
**After:** `<h3>  foo bar  </h3>` --> `<h3 id="--foo-bar--">...`

The different IDs now break some of our anchor-links, becuase
`github-slugger` is used by [rehype-slug][3], which is in turn used by
our [autolinkHeadings][4] dgeni post-processor.

To avoid the issue with broken anchor links, we update the
`renderMethodDetail()` nunjucks macro to omit excess whitespace in
headings.

[1]: https://github.com/Flet/github-slugger/releases/tag/v1.4.0
[2]: af59f343dc
[3]: https://github.com/rehypejs/rehype-slug
[4]: 75a3c778b1/aio/tools/transforms/angular-base-package/post-processors/autolink-headings.js (L3)

PR Close #43435
2021-09-14 08:29:49 -07:00
Andrew Scott
0e8548f667 fix(router): Allow renavigating to failed URLs (#43424)
There are situations where the Router does not currently clean up failed navigations
correctly. While this is problematic on its own, we can mitigate some of
the damage by processing any URL when we get a navigation request when
the internal router state is out of sync.

Each of the added tests would fail without this change.

fixes #34795

PR Close #43424
2021-09-13 14:48:00 -07:00
Pei Wang
5ccc9e8a1d build: Exclude tsconfig-tsec.json files from sync with g3 (#43108)
Those files are for tsec_test only and therefore irrelevant to google3.

PR Close #43108
2021-09-13 14:45:57 -07:00
Pei Wang
006bf654b9 build: Upgrade tsec to 0.1.9 (#43108)
Upgrade tsec version form 0.1.8 to 0.1.9. The new version has a minor
bug fix.

PR Close #43108
2021-09-13 14:45:57 -07:00
Pei Wang
188a46971f build: Use aspects to gather srcs and deps for tsec_test. (#43108)
This is to replace the implicitly created ts_library_forwared rules and
keep changes related to tsec/bazel integration solely in tools/tsec.bzl.

PR Close #43108
2021-09-13 14:45:57 -07:00
Pei Wang
d12d068c37 build: Turn tsec checks into bazel tests. (#43108)
Introduce two new bazel rules: tsec_test and tsec_config, for
describing the tsec checks and the tsconfig file needed for such
checks, respectively. Currently, tsec_test only checks the srcs
of a ts_library or ng_module. It does not check direct or transitive
dependencies. Also, tsconfig files need to be manually maintained
to make sure tsec can read all necessary input (including global
symbols).

PR Close #43108
2021-09-13 14:45:57 -07:00
Pei Wang
509031c734 build: Enable tsec checks for critical packages. (#43108)
tsec is a static analyzer that discovers Trusted Types violations.
Deploy tsec to make sure there will be no TT regression in several
critical packages, including core, platform-browser, platform-server
and their dependencies. Existing violations have been reviewed and
exempted in packages/tsec-exemption.json. Future changes to the
exemption list requires security review.

PR Close #43108
2021-09-13 14:45:57 -07:00
Andrew Scott
79eee5509f docs(router): Add documentation for the router reset rawUrlTree (#43420)
Add documentation to the router and an additional test based on more
complete understanding of how things work.

PR Close #43420
2021-09-13 14:41:23 -07:00
Naveed Ahmed
59353c6305 fix(service-worker): clear service worker cache in safety worker (#43324)
clear angular service worker cache in safety worker to ensure stale
or broken contents are not served in future requests

Fixes #43163

PR Close #43324
2021-09-13 14:34:32 -07:00
mezhik91
de682ebb1f docs: add Dmytro Mezhenskyi to GDE resources (#43282)
PR Close #43282
2021-09-13 12:57:00 -07:00
dario-piotrowicz
6d8a711f5c docs: remove unnecessary "https://angular.io/" from aio links (#43425)
PR Close #43425
2021-09-13 09:24:07 -07:00
Renovate Bot
75a3c778b1 build: update dependency karma to v6 (#43413)
PR Close #43413
2021-09-10 10:56:47 -07:00
mgechev
578aba1939 docs: add ngUpgrade maintenance timeline (#43379)
Add details about the maintenance timeline for ngUpgrade, reflecting
the deprecation of AngularJS.

PR Close #43379
2021-09-10 09:23:11 -07:00
dario-piotrowicz
df177d9176 docs: amend code related to string-expressions for property binding (#43366)
resolves #43287

PR Close #43366
2021-09-10 09:22:14 -07:00
Aristeidis Bampakos
7c2434da7f docs: add Architect Training to resources (#43327)
PR Close #43327
2021-09-09 14:53:59 -07:00
Andrew Scott
cbac0c3514 docs: Add documentation and TODOs for cleanup (#43391)
* Document `currentUrlTree`, `browserUrlTree`, and `rawUrlTree`
* Add a couple `TODO` comments to investigate changes based on understanding

PR Close #43391
2021-09-09 14:53:27 -07:00
Andrew Kushnir
012209f55f Revert "refactor(router): clean up unnecessary flag in restoreHistory function" (#43409)
This reverts commit 061a456e39.

PR Close #43409
2021-09-09 14:23:30 -07:00
Aristeidis Bampakos
b31adaf6cc docs: add Angular Projects book in resources (#43130)
PR Close #43130
2021-09-09 11:33:37 -07:00
David Shevitz
a0fe89919f docs: update the reviewed tag for what-is-angular topic (#43213)
PR Close #43213
2021-09-09 11:30:31 -07:00
Amadou Sall
4761842440 docs: remove extraneous word in the Dependency injection in action guide (#43255)
PR Close #43255
2021-09-09 11:27:30 -07:00