4465 Commits

Author SHA1 Message Date
Dylan Hunn 4ad5858eb9 docs: add dylhunn to contributors (#41936)
PR Close #41936
2021-05-04 21:06:31 -07:00
Hugo Mejia eda431410a docs: attributes for 'label' and 'input' elements were mixed up (#41827)
A label should be 'for' an input, and an 'input' should have an 'id'.

PR Close #41827
2021-05-04 08:32:18 -07:00
Talha Azhar 62512d259a docs: fix text jargon from DI notes (#41928)
PR Close #41928
2021-05-04 08:08:48 -07:00
Kapunahele Wong 729d8df920 docs: improve accessibility of form-validation example (#41283)
PR Close #41283
2021-05-03 14:25:12 -07:00
Mikhail ee860366c9 docs(forms): reduce ambiguity in forms data flow wording (#41900)
PR Close #41900
2021-05-03 10:01:15 -07:00
Mathias Schäfer 7e9ef4d257 docs: Update link to Testing Angular online book (#41906)
The book has moved to a its own domain.
PR Close #41906
2021-04-30 14:34:49 -07:00
Igor Minar 6b5f15528c fix(docs-infra): switch over to img[loading=lazy] for front page images (#34900)
This should speed up the perceived loading latency as the image loading won't block rendering.

https://addyosmani.com/blog/lazy-loading/

PR Close #34900
2021-04-30 14:16:24 -07:00
Wojciech Okoński 5bae16da48 docs(docs-infra): fix handling of client-side errors in networking (#36608)
Previously example for handling client-side errors in networking didn't work when there was no Internet connection.
Caught error is ProgressEvent in such case, not ErrorEvent and error.error.message is undefined.

PR Close #36608
2021-04-29 13:51:43 -07:00
George Kalpakas 579c9f66b7 build: update remark packages (#41721) (#41862)
This commit updates the `remark` packages to v12 instead of the latest
(v13), because v13 is a major breaking change that requires more
investigation and work.

More specifically, v13 replaces the internals of `remark` with a new
CommonMark-compliant parser. (See their [release notes][1] for more
info.)

This change causes our old `remark` plugins (in [renderMarkdown.js][2])
to stop working.

[1]: https://github.com/remarkjs/remark/releases/tag/13.0.0
[2]: https://github.com/angular/angular/blob/d42019d4128ca0d9f233a085bfe838f93f8d0412/aio/tools/transforms/remark-package/services/renderMarkdown.js#L17-L24

PR Close #41721

PR Close #41862
2021-04-29 10:06:26 -07:00
Sam Severance 6aa61d540f docs: correct toh router tutorial (#41859)
* `SelectivePreloadingStrategyService` is already provided in the root
   module, so it should not be added to `AppRoutingModule` providers
   array

PR Close #41859
2021-04-29 10:05:31 -07:00
Teri Glover ecf9a12ce4 docs: Edits to remove jargon (#41536)
PR Close #41536
2021-04-28 15:11:33 -07:00
Keen Yee Liau fca8d7ae92 docs: remove tslint, codelyzer & protractor from dev deps (#41826)
TSLint and Codelyzer were deprecated in v11.
Protractor is no longer installed by default in new projects in v12.

PR Close #41826
2021-04-28 14:33:12 -07:00
Kapunahele Wong 3aa6d8fd90 docs: imrpove accessibility of lifecycle hooks example (#41071)
PR Close #41071
2021-04-28 14:26:35 -07:00
George Kalpakas 61ad68a586 fix(docs-infra): do not redirect disambiguated URLs (#41842) (#41854)
In #41788, logic was added to disambiguate case-insensitively equal docs
paths/URLs. This process includes appending a `-\d+` suffix to some
paths/URLs (for example, `/.../inject-1`). Unfortunately, some of the
Firebase redirects configured in `firebase.json` would match these URLs
and redirect them to non-existing paths.
Example failures: [stable][1], [next][2]

NOTE:
This was not picked up in the regular CI tests run for PRs, because the
local devserver and the preview server used to test PRs do not support
Firebase-like redirects.

This commit fixes this by ensuring these disambiguated paths/URLs are
not matched by the redirect rules by checking whether the part of the
suffix after the `-` contains any numeric digits. While this check is
not ideal, it should be good enough for our purpose, since the legacy
URLs that we do want to redirect contain suffixes such as `-class`,
`-function` and thus no numeric digits.

[1]: https://circleci.com/gh/angular/angular/974345
[2]: https://circleci.com/gh/angular/angular/974346

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas 96f5c86fbe build(docs-infra): take disambiguated doc paths into account when generating the sitemap (#41842) (#41854)
In ##41788, the `disambiguateDocsPathsProcessor` was introduced to fix
an issue with case-insensitively equal paths. This processor may alter
the paths of some docs and thus their final URL in the app.

Previously, both the `disambiguateDocPathsProcessor` and the
`createSitemap` processor (which relies on the docs' computed paths to
generate the sitemap file) were configured to run before the
"rendering-docs" phase. However, this resulted in the
`disambiguateDocPathsProcessor`'s running after `createSitemap`, which
meant that the sitemap did not include the updated doc paths.

This commit fixes it by ensuring that the
`disambiguateDocPathsProcessor` is explicitly run before the
`createSitemap` processor, so that the latter will be able to take into
account any changes made by the former.

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas 84e1b10485 test(docs-infra): make it easier to identify the failing URL in testFirebaseRedirection.spec.ts (#41842) (#41854)
This commit includes the URL under test in the test description in
`testFirebaseRedirection.spec.ts` to make it easier to identify the
affected URL when a test fails.

It also avoids unnecessarily creating multiple `FirebaseRedirector`
instances by sharing instances between tests.

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas 2b235b59a0 test(docs-infra): update firebase-test-utils to support regex-based redirects (#41842) (#41854)
This commit updates the utilities in `firebase-test-utils/` to also
support testing Firebase redirects that are configured using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.

[1]: https://firebase.google.com/docs/hosting/full-config#redirects

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas 6f4212f96f refactor(docs-infra): prepare firebase-test-utils for accepting regex-based redirects (#41842) (#41854)
Currently, the utilities for testing Firebase redirects assume that the
redirects are configured using the glob-based `source` property.
However, Firebase also supports configuring redirects using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.

This commit refactors the utilities in `firebase-test-utils/` to make it
easy to add support for such regex-based redirect configurations.

[1]: https://firebase.google.com/docs/hosting/full-config#redirects

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas ccb0ac3a74 test(docs-infra): fix create-example tests on Windows (#41842) (#41854)
Previously, the tests in `create-example.spec.ts` made assertions using
some hard-coded absolute paths (something like `/foo/bar`). This caused
the tests to fail on Windows, where the absolute paths are prefixed with
the drive letter (something like `C:/foo/bar`).

This commit uses `path.resolve()` to ensure paths are converted to the
format used on the current OS.

PR Close #41842

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas a26bbf78bc fix(docs-infra): apply custom autoLinkCode filters to single-word <code> elements (#41709) (#41854)
Previously, the `autoLinkCode` Dgeni post-processor would not apply the
custom filters when matching the whole contents of a `<code>` element.
This meant that custom filters would not be applied to single-word
`<code>` elements.

You can see occurrences of this issue in the following sections of the
"Reactive forms" guide:
- [Creating nested form groups][1]
  (look for `street, city, state, and zip controls`)
- [Using the FormBuilder service to generate controls][2]
  (look for `group method`)

This commit fixes this by also applying the custom filters when
processing the whole contents of a `<code>` element.

This commit also updates the `filterPipes` custom filter to allow
matching a pipe's name in a single-word `<code>` element (where there is
no preceeding `|` character).

[1]: https://v10.angular.io/guide/reactive-forms#creating-nested-form-groups
[2]: https://v10.angular.io/guide/reactive-forms#using-the-formbuilder-service-to-generate-controls

PR Close #41709

PR Close #41854
2021-04-28 09:13:42 -07:00
George Kalpakas 3d1f6938c2 fix(docs-infra): do not process generated nodes for auto-linking (#41709) (#41854)
While generating the docs, when a `<code>` element is inspected for
auto-linking, the `autoLinkCode` Dgeni post-processor will break its
contents up into words and generate text nodes for those words that
should not be auto-linked.

Previously, our text node visitor would visit these generated text nodes
and try to auto-link them too. As a result, it would unnecessarily
process nodes that had already been checked (and could potentially
generate links that would otherwise be ignored).

You can see an occurrence of this issue in the
[Create the product list][1] section of the
"Getting started with Angular" tutorial (look for `<a>`).

This commit fixes this by ensuring the visitor will skip the current
node and any nodes generated by `autoLinkCode`.

[1]: https://v11.angular.io/start#create-the-product-list

PR Close #41709

PR Close #41854
2021-04-28 09:13:42 -07:00
Pete Bacon Darwin eedbb758d2 build(docs-infra): update dgeni-packages to fix version list (#41841)
The current version was not being computed correctly for
next and rc deployments of the angular.io website.

Fixes #41829

PR Close #41841
2021-04-27 12:22:02 -07:00
Amadou Sall c78baccf8d docs: remove the section "Using components vs services from other modules" (#41835)
This section states that "Importing a module with services means that you will have a new instance of that service". This is only true for lazy-loaded `NgModules`. For non-lazy-loaded modules, my understanding is that the providers arrays are flattened into the root injector meaning that importing a module with a service doesn't create a new instance of that service.

PR Close #41835
2021-04-27 10:16:51 -07:00
Kapunahele Wong 7756ead0bf docs: add metadata documentation to httpClient (#41706)
PR Close #41706
2021-04-26 15:17:52 -07:00
Chau Tran 072a0bf30a docs: add chau tran to GDE resources (#41817)
PR Close #41817
2021-04-26 15:16:41 -07:00
Pete Bacon Darwin aa578f56bf docs: fix links to docs with ambiguous paths (#41788)
These docs were linking directly to docs that have ambiguous paths.
These changes ensure that these links are not affected by the
disambiguation processing of those docs.

PR Close #41788
2021-04-26 12:12:01 -07:00
Pete Bacon Darwin 9f958077d2 build(docs-infra): add path disambiguation (#41788)
When two documents have the same `outputPath`, only differing by
letter casing, there can be problems on case-insensitive file-systems:
Only one of each of the docs would end up being written.

Moreover, the Webpack 5 bundler will error if it comes across files
that have this kind of ambiguous paths.

This commit adds a new docType: `disambiguator`, which will display
a list of the docs that match an ambiguous path. Each of the ambiguous
docs is then given a unique path and outputPath to ensure there are no
collisions.

PR Close #41788
2021-04-26 12:12:01 -07:00
Pete Bacon Darwin 09f3531c44 build(docs-infra): no duplicate docTypes in postProcessHtml processor (#41788)
This processor was being initialized with the same docTypes twice.

PR Close #41788
2021-04-26 12:12:01 -07:00
George Kalpakas 21f1466d84 build(docs-infra): fix e2e testing SystemJS-based docs examples (#41796)
This commits makes the SystemJS-based docs examples more self-contained
by ensuring the necessary WebDrivers are fetched before running the e2e
tests.
This is a follow-up to #41689. (See there for more discussion.)

PR Close #41796
2021-04-26 09:25:13 -07:00
George Kalpakas 6fb18b8fd5 fix(docs-infra): fix external link icons positioning (#41794)
While trying to fix the appearance of `<code>` elements inside of
anchors with external URLs in #41694, the positioning of external link
icons was broken for anchors that would span multiple lines (see #41774
for details).

This commit fixes the positioning of external link icons, while still
preserving the correct appearance of `<code>` elements inside anchors
with external URLs.

NOTE:
Different types of links with external URLs can be seen in the following
docs sections:
- http://localhost:4200/docs#assumptions
- http://localhost:4200/guide/http#security-xsrf-protection
- http://localhost:4200/guide/workspace-config#generation-schematics

Fixes #41774

PR Close #41794
2021-04-26 09:24:05 -07:00
Kapunahele Wong 8ea1927910 docs: improve accessibility of architecture example (#41314)
PR Close #41314
2021-04-26 09:13:51 -07:00
Kapunahele Wong 619f774dbd docs: make inputs-outputs example more accessible (#41288)
PR Close #41288
2021-04-26 09:12:19 -07:00
Kapunahele Wong f31277879a docs: improve accessibility of http example (#41057)
PR Close #41057
2021-04-26 09:11:08 -07:00
Sam Severance 163c076f97 docs: Indicate HttpClientModule being imported (#41749)
PR Close #41749
2021-04-23 11:38:35 -07:00
Jessica Janiuk 42c64aa376 Revert "build(docs-infra): fix StackblitzBuilder after jsdom update (#41725)" (#41768)
This reverts commit 2a2c239a0a.

PR Close #41768
2021-04-22 10:14:48 -07:00
Aristeidis Bampakos ad2d239b13 docs: ident the library shematics guide properly (#41755)
PR Close #41755
2021-04-22 08:41:03 -07:00
George Kalpakas 2a2c239a0a build(docs-infra): fix StackblitzBuilder after jsdom update (#41725)
In commit c617f1f768, `jsdom` was updated
from v9 to v16. This includes a breaking change that caused
`StackblitzBuilder` to fail to generate the StackBlitz examples.
However, this failure went unnoticed, because `StackblitzBuilder` still
completed successfully after failing to generate the examples. (This has
been fixed in the previous commit.)

This commit updates `StackblitzBuilder` to use the new `jsdom` API.

PR Close #41725
2021-04-22 08:38:22 -07:00
George Kalpakas 0ae0ac68f3 build(docs-infra): exit with an error code if generating StackBlitz examples fails (#41725)
Previously, failing to generate one or more StackBlitz examples would
log the errors but exit the command successfully. This made it easy to
miss such failures.

This commit fixes this by exiting the process with an error code if
generating one or more StackBlitz examples fails.
(In order to be able to see all potential errors, all examples are
attempted to be generated before exiting the process.)

PR Close #41725
2021-04-22 08:38:21 -07:00
Kapunahele Wong b9818f99ba docs: add instructions for opting into latest Language Service (#41600)
PR Close #41600
2021-04-21 17:29:07 -07:00
Pete Bacon Darwin 8f3e5a5982 build(docs-infra): update docs examples to Angular v11.2.10 (#41689) (#41716)
This commit updates the docs examples to Angular v11.2.10. See the [diff between 11.0.1 and 11.2.10 (FW) and 11.2.9 (CLI)][1].

The changes are fairly trivial including:

- Removal of `emitDecoratorMetadata` from tsconfig.json files, where no JIT compilation is required.
- Setting `enableI18nLegacyMessageIdFormat` to `false` for CLI based applications - the i18n example was already migrated away from legacy message IDs.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.9..11.0.1

PR Close #41689

PR Close #41716
2021-04-20 13:13:09 -07:00
Pete Bacon Darwin 81260c4009 refactor(docs-infra): tidy up systemjs boilerplate for upgrade examples (#41689) (#41716)
The ngUpgrade examples mostly rely upon SystemJS configuration.
This commit tidies up how these examples are built and tested so that
it will be easier to migrate them to work with Angular 11.2.x

PR Close #41689

PR Close #41716
2021-04-20 13:13:09 -07:00
Kapunahele Wong 20e09177b7 docs: add margin to button boilerplate CSS for examples (#41413)
PR Close #41413
2021-04-20 11:37:29 -07:00
Daniel Díaz 7459f6d705 docs: rewrites animation query () method use (#41710)
PR Close #41710
2021-04-20 09:40:30 -07:00
unknown c6dde4cd8c docs: add Material Design for Bootstrap to UI Component resources (#41702)
PR Close #41702
2021-04-20 09:39:16 -07:00
Oluwole Majiyagbe 866b30972b docs: add API CMS capability to Angular App resources (#40924)
PR Close #40924
2021-04-20 09:37:52 -07:00
Bendik Skarpnes 2a136e2eda docs: fix styling issues in example CSS (#41222)
PR Close #41222
2021-04-19 14:15:46 -07:00
Pierre Portejoie 7a153f78aa docs: fix tutorial indicating the app is working when an error is actually displayed (#40732)
PR Close #40732
2021-04-19 14:14:59 -07:00
Amadou Sall 8f6c166aea docs: add missing preposition in the animations guide (#41697)
PR Close #41697
2021-04-19 08:35:12 -07:00
George Kalpakas 0538d5b747 fix(docs-infra): fix code inside anchor elements with external URLs (#41694)
Previously, due to the `inline-flex` display style of anchor elements
with external URLs, `<code>` elements nested inside such anchor elements
would cause extra spacing between lines. An occurrence of this can be
seen in the [Angular workspace configuration][1] guide.

This commit fixes the problem by removing the `inline-flex` display
style (allowing anchor elements to fall back to the default `inline`
style).

For reference, the `inline-flex` style was introduced in commit
7944ee2c30 in order to avoid underlining
link icons. This style seems to no longer be necessary (either it was
never necessary or the underlying browser bug that made it necessary was
fixed).

Before: ![code links before][2]
After: ![code links after][3]

[1]: https://next.angular.io/guide/workspace-config#generation-schematics
[2]: https://user-images.githubusercontent.com/8604205/115149753-34589780-a06e-11eb-8d4e-825b5e94282d.png
[3]: https://user-images.githubusercontent.com/8604205/115149755-3589c480-a06e-11eb-9b15-825d75c74878.png

PR Close #41694
2021-04-19 08:32:10 -07:00
George Kalpakas 8f58a1016f refactor(docs-infra): remove duplicate ol selector (#41694)
This commit removes a duplicate `ol` selector from `typography.scss`.

PR Close #41694
2021-04-19 08:32:10 -07:00