Commit Graph

21152 Commits

Author SHA1 Message Date
Paul Gschwendtner 57865b352a ci: do not update shared dev-infra package in components-repo-unit-tests job (#42268)
The shared dev-infra package from `HEAD` should not be installed
when running the `components-repo-unit-tests` job. This is done
because otherwise changes to the dev-infra package can result in
build setup issues for the CI job (while the goal of the CI job
is to test the framework)

PR Close #42268
2021-06-03 10:37:41 -07:00
Paul Gschwendtner a16f82b851 refactor(dev-infra): move shared browser bazel setup into dedicated bazel folder (#42268)
This change moves the `dev-infra/browsers` folder into `dev-infra/bazel`.
The browser folder is providing custom configuration for Bazel, so it
should live within the `bazel` folder for a more well-structured
`dev-infra` folder.

PR Close #42268
2021-06-03 10:37:41 -07:00
Paul Gschwendtner 49c3ce58bf refactor(dev-infra): remove duplicate method that checks for uncommitted changes (#42409)
Removes the duplicate `hasLocalChanges` method from the Git client. We
already have `hasUncommittedChanges`. Also removes a TODO for adding
`assertNoLocalChanges` as it seems more flexible to manually check
(i.e. better messaging with context on the current tool; e.g. "cannot
perform rebase")

PR Close #42409
2021-06-03 10:36:40 -07:00
David Shevitz 71fa896a91 docs: update link to jasmine documentation about spies (#42463)
PR Close #42463
2021-06-03 10:34:23 -07:00
Kristiyan Kostadinov 3d1c905c91 refactor(docs-infra): clean up AIO Sass files (#42442)
Cleans up AIO's Sass files by:
* Switching them all over to the `@use`-based API from Angular Material.
* Removing the import of the Material theming API in a bunch of places that weren't using it.
* Migrating the new usages of Sass utility functions to the new syntax (e.g. `map.get` vs `map-get`).
* Fixing a few files that were using 4 spaces for indentation instead of 2.

PR Close #42442
2021-06-02 13:25:42 -07:00
Alex 0ac193c86c docs: fix typo in the Router guide (#42455)
PR Close #42455
2021-06-02 13:24:30 -07:00
Paul Gschwendtner 97c5a3ae6f feat(dev-infra): prevent deprecations from being merged into patch branch (#42454)
As per SemVer, deprecations should only be released if the
minor version is incremented. This means that we should error
if commits w/ deprecations target an upcoming patch, LTS release.

Additionally, we also error if deprecations are made as part of
an upcoming release-candidate.

PR Close #42454
2021-06-02 13:23:54 -07:00
Paul Gschwendtner 107f15df03 refactor(dev-infra): add JSDoc throws description to assertion functions (#42454)
Adds the JSDoc `@throws` annotation to functions that would throw
within in the ng-dev tool. We want to add `@throws` so clearly
communicate if the invocation of a function results in errors or not.

This helps if IDEs show the `@throws` annotation on invocation, or
if TS ever lands a feature like Java `throws`, with more fine-grained
and typed error handling.

PR Close #42454
2021-06-02 13:23:54 -07:00
Paul Gschwendtner d3531a7d41 fix(dev-infra): breaking change and deprecation notes incorrectly picked up (#42436)
If a commit message currently mentions the breaking change or
deprecation note keywords, the commit message parse logic
accidentally picks up the note. This could then accidentally
prevent the commit from being merged (e.g. if the commit targets
the patch branch but mentioned the `BREAKING CHANGE: ` marker).

This commit switches the commit message notes pattern to only
capture notes at the beginning of a line (also allowing accidental
whitespace). This matches with the format we describe in our
contribution guide, as well as with our commit message validation
logic that also assumes notes at the beginning of a line.

PR Close #42436
2021-06-02 13:22:55 -07:00
Paul Gschwendtner bc5a8f4d37 feat(dev-infra): validate deprecation notes in commit messages (#42436)
Currently the commit message validation tool from `ng-dev` validates
the `BREAKING CHANGE:` commit message notes. This commit adds a similar
check for `DEPRECATED:` commit message notes.

Additionally, the check for breaking changes is reworked slightly to
be more tolerant (i.e. if there is only a single line break after the
summary; this is acceptable as per the parser and commonly done in the
COMP repo). The checks have been updated to capture wrong keywords that
are commonly used instead of the correct one. e.g. if a commit message
uses `DEPRECATIONS:` instead of `DEPRECATED:`, the validation will fail.

This prevents changelog generation issues where breaking change notes,
or deprecations are missing. This happened in the COMP repo where
the `DEPRECATED:` keyword was used incorrectly. See:

99391e7939

PR Close #42436
2021-06-02 13:22:55 -07:00
Sam Severance c0b2eeb54c docs: remove unused imports from unit tests (#42441)
PR Close #42441
2021-06-02 13:22:09 -07:00
Sam Severance c1a9f07ea1 docs: refactor `WelcomeComponent` unit test (#42441)
PR Close #42441
2021-06-02 13:22:08 -07:00
Igor Minar 1fe1dd1f19 docs: clarify the wording around live examples for all testing guides (#42406)
We should primarily point readers to the stackblitz that contains the spec files and runs them.

The application stackblitz is secondary (and doesn't actually contain the spec files, which is confusing).

Fixes #38535

PR Close #42406
2021-06-02 13:20:13 -07:00
Igor Minar 4c39869566 docs: add a note about javascript mime-types to the deployment guide (#42339)
Some servers don't serve the .js files with the correnct headers. This change documents the requirement.

Fixes #30835

PR Close #42339
2021-06-02 13:17:36 -07:00
Renovate Bot f3f10140b5 build: lock file maintenance (#42264)
PR Close #42264
2021-06-02 13:16:58 -07:00
Andrew Scott fe22c2b0b6 fix(language-service): Correct rename info for pipe name expressions (#41974)
Prior to this PR, attempting to get rename info for pipe name expressions would defer to the
typescript language service, which would return no rename info. This was not caught because
the test was written incorrectly.

This PR corrects the test behavior and adjusts the logic in getting rename info to account
for indirect renames (like pipe names).

PR Close #41974
2021-06-02 13:15:48 -07:00
Paul Gschwendtner f8814d3558
fix(dev-infra): update outdated build-worker.js file (#42458)
Updates the outdated build-worker.js file. This file has
been accidentally not updated when we fixed the Octokit
authentication to unblock the caretaker.
2021-06-02 13:13:26 -07:00
Paul Gschwendtner 3b434ed94d
fix(dev-infra): github oauth token not picked up by Octokit (#42456)
We recently updated `@octokit/rest` to a more recent version. For this
the Github client had to be refactored to account for new types of
Octokit. With the refactorings the authentication of the Github
client broke as we used an incorrect option for setting the OAuth
token. The TS transpilation did not fail because the Octokit types
support arbitrary options in the constructor. This is not solvable
on our side, so we cannot prevent similar issues in the future
unfortunately. Adding tests for authentication is not a reasonable
option either.
2021-06-02 12:48:51 -07:00
Andrew Kushnir 7bd5ea4a7e release: cut the v12.1.0-next.4 release 2021-06-02 18:02:43 +00:00
Andrew Kushnir 678b264d0d docs: release notes for the v12.0.3 release 2021-06-02 17:55:27 +00:00
David Pfeiffer 574f64041e docs: specify correct interceptor class type (#42437)
In the "Interceptor order" section of the HTTP guide there is a typo which incorrectly lists the same service twice when referring to two different services. The order that these services are listed is important, and this commit fixes the typo by listing the services in the correct order.
PR Close #42437
2021-06-01 16:36:58 -07:00
Andrew Scott 6a2e3e2b2c docs: change Navigation from type to interface (#42281)
Navigation type should be interface so it can be documented on aio site.

fixes #37384

PR Close #42281
2021-06-01 14:13:20 -07:00
Renovate Bot 2b7dc15655 build: update dependency ts-node to v10 (#42257)
PR Close #42257
2021-06-01 14:12:37 -07:00
Renovate Bot 5babdb2284 build: update angular (#42379)
PR Close #42379
2021-06-01 12:51:54 -07:00
Alex Rickabaugh e039075a28 fix(compiler-cli): better detect classes that are indirectly exported (#42207)
The compiler flag `compileNonExportedClasses` allows the Angular compiler to
process classes which are not exported at the top level of a source file.
This is often used to allow for AOT compilation of test classes inside
`it()` test blocks, for example.

Previously, the compiler would identify exported classes by looking for an
`export` modifier on the class declaration itself. This works for the
trivial case, but fails for indirectly exported classes:

```typescript
// Component is declared unexported.
@Component({...})
class FooCmp {...}

// Indirect export of FooCmp
export {FooCmp};
```

This is not an immediate problem for most application builds, since the
default value for `compileNonExportedClasses` is `true` and therefore such
classes get compiled regardless.

However, in the Angular Language Service now, `compileNonExportedClasses` is
forcibly overridden to `false`. That's because the tsconfig used by the IDE
and Language Service is often far broader than the application build's
configuration, and pulls in test files that can contain unexported classes
not designed with AOT compilation in mind.

Therefore, the Language Service has trouble working with such structures.

In this commit, the `ReflectionHost` gains a new API for detecting whether a
class is exported. The implementation of this method now not only considers
the `export` modifier, but also scans the `ts.SourceFile` for indirect
exports like the example above. This ensures the above case will be
processed directly in the Language Service.

This new operation is cached using an expando symbol on the `ts.SourceFile`,
ensuring good performance even when scanning large source files with lots of
exports (e.g. a FESM file under `ngcc`).

Fixes #42184.

PR Close #42207
2021-06-01 12:16:46 -07:00
JoostK 44b737ecb4 docs: clarify how declaration files can be installed (#42417)
The documentation suggested that `@types/*` scoped packages would
automatically be recognized, however the CLI configures a project such
that the package has to be explicitly added to the TypeScript
configuration files.

Closes #37572

PR Close #42417
2021-06-01 10:17:32 -07:00
Kristiyan Kostadinov 3e192bfa4d build: fix linting against jasmine focus functions (#42415)
We were linting against usages of `fdescribe` and `fit` by referencing the `no-jasmine-focus` rule which isn't installed, causing tslint to log the following:

```
Could not find implementations for the following rules specified in the configuration:
    no-jasmine-focus
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned
```

These changes switch to using the built-in `ban` rule.

PR Close #42415
2021-06-01 10:16:55 -07:00
George Kalpakas 1d9c6bb31d docs(docs-infra): document the implementation of styles (incl. theming) in angular.io (#42396)
PR Close #42396
2021-06-01 10:16:21 -07:00
George Kalpakas 4a5af60dc5 fix(docs-infra): improve homepage layout in print mode (#42396)
In #41129, the `.hero-logo` image was changed from an `<img>` element to
a `<div>` with an image background. As a result, in print mode (where
browsers often omit backgrounds to save ink) the logo was not present.

This commit fixes this by ensuring the word `Angular` is displayed as a
title instead of the logo in print mode. It also hides the `Get started`
button in print mode, since it doesn't add any value.

Before: ![homepage-print before][1]
After: ![homepage-print after][2]

[1]: https://user-images.githubusercontent.com/8604205/120068867-889e6080-c08b-11eb-9bd5-233d8592f7ec.png
[2]: https://user-images.githubusercontent.com/8604205/120068869-89cf8d80-c08b-11eb-8740-a68a5ef68c34.png

PR Close #42396
2021-06-01 10:16:20 -07:00
George Kalpakas 58160742b1 refactor(docs-infra): remove unused `_typography-theme.scss` file (#42396)
This commit removes the `_typography-theme.scss` file that is currently
not used. The file contains a single Sass mixin
(`docs-site-typography-theme()`), which is never called.

PR Close #42396
2021-06-01 10:16:20 -07:00
George Kalpakas 3b97287758 refactor(docs-infra): minor refactorings/style changes (#42396)
This commit includes some minor refactorings and style changes as a
follow-up to PR #41129. (The changes were minor enough that didn't
warrant blocking the PR.)

PR Close #42396
2021-06-01 10:16:20 -07:00
Joey Perrott aeb407296b refactor(dev-infra): update to later version of @octokit/rest and remove class extenstion of Octokit (#42395)
Update @octokit/rest and remove the usage of a class extension of Octokit as the
class does not have a class define constructor.

PR Close #42395
2021-06-01 10:14:48 -07:00
George Kalpakas af762fa917 build: allow Node.js v15 and above for local development (#42387)
This commit changes the `engines` rules in the root `package.json` as
well as the `package.json` used when working on docs example to also
accept Node.js versions greater than v14. This aligns them with
`aio/package.json` and allows using Node.js v15 and v16 (current) for
local development in the `angular/angular` repo.

Related to #42367.

PR Close #42387
2021-06-01 10:14:08 -07:00
Dylan Hunn c54643f00e docs(forms): make the forms validation guide specify more clearly what happens when mixing HTML5 native validators with Angular forms. (#42377)
Previously, the docs didn't say anything about the fact that the `novalidate` attribute is added to the enclosing form, or how to override that behavior. I have added a couple lines in the appropriate spot clarifying this issue.

PR Close #42377
2021-06-01 10:13:36 -07:00
Doug Parker e0381a87c9 docs: update CLI builder to be platform agnostic (#42371)
Fixes #35373.

This changes the example from "run an arbitrary process" to "copy a file". This should make it a bit easier to follow, require less background knowledge to understand, and not use any platform-specific commands that won't work for Windows users.

The most glaring issue with this change is that this doc does not explictly specify how to build and run a builder. I've updated some of the files to hint at this a bit more (such as the `"implementation": "./dist/my-builder.js"`), but another pass is required to figure out the best way to compile a builder and how we want to structure this example to best communicate that.

PR Close #42371
2021-06-01 10:13:02 -07:00
Doug Parker 2a311c51e6 docs: minor cleanup (#42371)
Mainly just fixing some spacing and adding `.prototype` for non-static properties.

PR Close #42371
2021-06-01 10:13:02 -07:00
Andrew Scott 1b8bbddff5 docs: list supported values for `read` in decorator metadata (#42370)
fixes #20927

PR Close #42370
2021-06-01 10:12:23 -07:00
George Kalpakas e798bfabb0 build(docs-infra): fix linting warnings (#42359)
This commit fixes some linting warning that were printed when running
`ng lint`. The warnings can be seen in the `lint` step of
[this CI job][1].

Most of the warnings were related to the deprecation of passing context
to Jasmine matchers in favor of using the [withContext()][2] matcher
(introduced in Jasmine v3.3.0).

[1]: https://circleci.com/gh/angular/angular/995543
[2]: https://jasmine.github.io/api/3.3/matchers.html#withContext

PR Close #42359
2021-06-01 10:11:47 -07:00
Andrew Scott 62b5a6cb07 docs: add docs for DebugElement (#42352)
fixes #36048

PR Close #42352
2021-05-27 17:02:24 -07:00
Igor Minar 184de5048a docs: expand documentation for ROUTES (#42398)
Previously the docs were very minimalistic. The most important thing missing from the docs
was that people should primarily use higher level APIs instead of using ROUTES directly.

It would be nice to holistically overhaul more of the router API docs, but that's out of
scope of this change.

Fixes #39350

PR Close #42398
2021-05-27 16:47:39 -07:00
Teri Glover 4cd2cc439d docs: Edits to remove jargon in Reference section (#42033)
PR Close #42033
2021-05-27 16:47:05 -07:00
Teri Glover ee0e3fbf89 docs: edits to remove jargon (#42025)
PR Close #42025
2021-05-27 16:46:11 -07:00
Teri Glover 3a959152f9 docs: Edited to remove jargon, fixed issue (#42026)
PR Close #42026
2021-05-27 15:37:14 -07:00
Teri Glover 1710fa861c docs: Edits to remove jargon (#42026)
PR Close #42026
2021-05-27 15:37:13 -07:00
Teri Glover 635aaaa27d docs: Edited to remove jargon. (#41978)
PR Close #41978
2021-05-27 15:36:38 -07:00
Andrew Scott d33fdea1e3 docs: clarify behavior of strict templates flags (#42392)
fixes #39355

PR Close #42392
2021-05-27 14:08:50 -07:00
Andrew Scott 8572fef491 docs: change markdown table to HTML table in template typecheck doc (#42392)
PR Close #42392
2021-05-27 14:08:49 -07:00
Joey Perrott fa0144fde6 docs: clarify the shortcomings of local variable technique for parent-child component interactions (#42331)
Closes #38302

PR Close #42331
2021-05-27 14:04:43 -07:00
AleksanderBodurri cdb8f556fb feat(docs-infra): implement dark mode (#41129)
defines styles for a first iteration of an aio darkmode

PR Close #41129
2021-05-27 11:24:53 -07:00
AleksanderBodurri 8d9d1c293d feat(docs-infra): create module theme files (#41129)
creates theming files for the module styles in aio; done as part of the effor to make aio themeable

PR Close #41129
2021-05-27 11:24:53 -07:00