Compare commits

...

273 Commits

Author SHA1 Message Date
Andrew Kushnir c25927da25 release: cut the v13.0.2 release (#44199) 2021-11-17 09:35:20 -08:00
fusho-takahashi 158ad09945 docs: Adding type annotation to ngOnInit() to make it consistent with the class structure produced by the CLI (#43579)
PR Close #43579
2021-11-16 14:09:52 -08:00
Armen Vardanyan f218644784 docs: add armen vardanyan to GDE resources (#43919)
PR Close #43919
2021-11-16 14:09:01 -08:00
Joey Perrott 89678d1b18 build: update to latest commit for feature-request github action (#44191)
Updating as this fixes a permissions error.

PR Close #44191
2021-11-16 14:08:24 -08:00
Andrew Kushnir dcf035223f ci: update pullapprove.yml (#44193)
This commit updates the PullApprove config, since Zach is currently focused on improving Components.

PR Close #44193
2021-11-16 14:07:19 -08:00
Paul Gschwendtner 00a16e432a refactor(elements): remove non-existent schematic collection breaking with ng add (#44187)
Removes a non-existent schematic collection wired up for
`@angular/elements` that has been removed
with: https://github.com/angular/angular/commit/619b7cc3857b34598a0036f8ebf9bc2eb27f5507.

Fixes #44160.

PR Close #44187
2021-11-16 12:03:42 -08:00
Dylan Hunn fe4845b055 ci: add dylhunn to review groups for size, piblic api, minimum, and circular (#44190)
This is needed so I can review forms PRs that affect public API.

PR Close #44190
2021-11-16 12:02:15 -08:00
dario-piotrowicz aa98cf17fe docs(animations): improve wording for animation example (#44168)
improve the wording of the text explaining an animation
code snippet as that can be misinterpreted

resolves #43952

PR Close #44168
2021-11-16 09:45:14 -08:00
Ramesh Thiruchelvam 83d22847ee test: type spy objects in test example (#44170)
Example for test doesn't use typing for Jasmine Spy objects. Updated 
them with `SpyObj<T>` typing as in the Angular Documentation.

See https://angular.io/guide/testing-services

PR Close #44170
2021-11-16 09:38:43 -08:00
Martin von Gagern 1d14800ab9 refactor(router): add type annotation for UrlSegment.parameterMap (#44175)
Having the type specified explicitly makes the API reference more readable.
PR Close #44175
2021-11-16 09:36:18 -08:00
Joey Perrott 7115e838fa ci: remove cla: yes from required labels (#44179)
Remove `cla: yes` from the require labels for merging as the CLACheck
tool no longer relies on labels.

Enforcement of the CLA being signed is still enforced by the status check
which is visible both in Github as well as checked by merge tooling.

PR Close #44179
2021-11-15 11:21:56 -08:00
Pete Bacon Darwin 40a2dad031 build: add instructions for getting Angular version for bug report (#44159)
The template asked for the Angular version but did not say how to get it.
Closes #44158

PR Close #44159
2021-11-15 11:21:06 -08:00
Joey Perrott 1f9ec1c14d build: update to yarn v1.22.17 (#44150)
Update to the latest version of yarn, 1.22.17.

PR Close #44150
2021-11-15 11:19:07 -08:00
Andrew Scott 539d720fcd release: cut the v13.0.1 release (#44139) 2021-11-10 15:41:43 -08:00
Joey Perrott ca0873fca9 build: update to latest @angular/dev-infra-private to address issues related to verifying environment (#44138)
Update to the latest package which properly checks if the running version of ng-dev is the version
described in yarn lock.

PR Close #44138
2021-11-10 23:40:09 +00:00
Joey Perrott 1ace7d4f38 refactor: add space to satisfy formatting (#44134)
Add return space to satisfy formatting for the file.

PR Close #44134
2021-11-10 23:33:11 +00:00
Paul Gschwendtner 9c47b77b05 build: sync all lock file and package.json updates from next with patch (#44134)
With the goal of avoiding more conflicts with build changes that should
go into both patch + next in general, this commit brings the lock files
+ `package.json` files from patch branch to the equivalent contents of
the next branch, except for the actual `version` field.

PR Close #44134
2021-11-10 23:33:11 +00:00
dario-piotrowicz e4475e66f9 refactor(core): move outdated comment to view.ts (#44099)
remove the comment suggesting to use a const enum for ViewEncapsulation in
the renderer3/definitions.ts file and add a similar comment in the
view.ts file in which the enum is defined

Note: the new comment does not contain the suggestion of changing `None`
to `0` as it is unclear what benefits that would bring (for more info
see: https://github.com/angular/angular/pull/44099#discussion_r744157686)

PR Close #44099
2021-11-10 20:42:20 +00:00
ileil 5ae679deb8 docs: update review tag to topic (#44008)
PR Close #44008
2021-11-10 19:29:13 +00:00
Pete Bacon Darwin ee2031d9f4 fix(compiler): ensure that partially compiled queries can handle forward references (#44113)
When a partially compiled component or directive is "linked" in JIT mode, the body
of its declaration is evaluated by the JavaScript runtime. If a class is referenced
in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the
file, then the reference must be wrapped in a `forwardRef()` call.

Previously, query predicates were not wrapped correctly in partial declarations
causing the code to crash at runtime. In AOT mode, this code is never evaluated
but instead transformed as part of the build, so this bug did not become apparent
until Angular Material started running JIT mode tests on its distributable output.

This change fixes this problem by noting when queries are wrapped in `forwardRef()`
calls and ensuring that this gets passed through to partial compilation declarations
and then suitably stripped during linking.

See https://github.com/angular/components/pull/23882 and https://github.com/angular/components/issues/23907

PR Close #44113
2021-11-10 18:25:17 +00:00
Pete Bacon Darwin f63771e828 refactor(compiler): rename R3ProviderExpression and associated helpers (#44113)
This interface will be used in other situations so this change renames it to be more general as `MaybeForwardRefExpression`.

PR Close #44113
2021-11-10 18:25:17 +00:00
Pei Wang bfb2882a71 ci: Windows support for tsec_test. (#44130)
Contents of generated tsconfig for tsec_test now depend on whether
Bazel uses symlinked runfiles for nodejs_test. The current
implementation assumes that symlinked runfiles are not available
on Windows.

PR Close #44130
2021-11-10 17:48:48 +00:00
Pete Bacon Darwin 18cc5f5611 test(compiler): remove IE11 match in JIT compiler tests (#44122)
Since we no longer support (nor test on) IE11 we can remove these matches
for `anonymous` functions.

PR Close #44122
2021-11-10 17:37:24 +00:00
Pavan Kumar Jadda 2256734fea docs: updates typescript configuration file links (#44131)
The links for `tsconfig.json` target and module sections no longer valid. This commit updates the document with correct links
PR Close #44131
2021-11-10 17:37:03 +00:00
raman 30a27adf9a fix(platform-browser): use correct parent in animation removeChild callback (#44033)
Animation's `onRemovalComplete` callback is using incorrect `parentNode`.
Should be parentNode provided by `delegate.parentNode(element)` instead of direct `element.parentNode`.
This is not a problem with default renderer but can cause problems with custom renderer if it uses another
logic to add/remove nodes.

Fixes #44023

PR Close #44033
2021-11-10 01:21:56 +00:00
Andrew Scott 0fdecc476d refactor(language-service): Move language service code out of ivy/ folder (#44064)
This commit moves code in the language service package out of the ivy
subfolder. Ivy is the _only_ engine supported in v13+ so there's no need
to have a name for it.

PR Close #44064
2021-11-10 01:20:05 +00:00
Andrew Scott 789c1d43ed refactor(language-service): Remove View Engine code from language service package (#44064)
This commit removes ViewEngine-specific code from the langauge service
package. This code is no longer used since VE is not supported in v13+.

PR Close #44064
2021-11-10 01:20:05 +00:00
Kristiyan Kostadinov 04df3a0b92 fix(compiler-cli): handle pre-release versions when checking version (#44109)
Currently the TS version checking function interprets a version like `1.2.3-rc.5` as `1.2.NaN` which would allow it to bypass the version checking altogether.

These changes add a little bit more logic to ensure that such versions are handled correctly. There's also an error if we don't manage to parse the version string.

Also it seemed like we never actually ran the version check unit tests, because they didn't have a test target.

PR Close #44109
2021-11-09 20:54:45 +00:00
kreuzerk c3d925f400 docs: including additional assets into libraries (#44076)
PR Close #44076
2021-11-09 20:54:22 +00:00
Pete Bacon Darwin 192ee90921 refactor(ngcc): improve logging of progress (#43996)
This commit adds additional information to encourage developers to contact
the author of View Engine libraries and ask them to update to partial Ivy.

Fixes #42308

PR Close #43996
2021-11-09 18:10:19 +00:00
George Kalpakas 47a5136bae build(docs-infra): remove unnecessary work-around for SW config generation (#44114)
Since angular.io is now updated to a version that includes the fix
from #43679, the work-around added in
841c5aebbf can now be removed.

PR Close #44114
2021-11-09 18:08:20 +00:00
Paul Gschwendtner c2f4e9736c ci: instruct renovate to apply patch label to avoid divergence with other version branches (#44065)
Renovate currently always applies the minor label. This often causes
the patch/FF/RC branches to quickly diverge. We should always apply
the patch label with the goal of keeping infra-related changes in sync
as much as possible.. Then it is still possible to selectively apply the
minor/major label if needed (this forces the reviewer to actually think
about where this should go in, if it fails!).

PR Close #44065
2021-11-09 18:08:00 +00:00
dario-piotrowicz c6d023b39f fix(docs-infra): prevent automatic linking of 'number' (#44000)
add 'number' to the ignoreGenericWords set so that it doesn't get
wrongly linked to the decimalPipe during the aio docs generation
as it is a generic typescript term

PR Close #44000
2021-11-09 18:03:39 +00:00
dario-piotrowicz 1434fad0bf refactor(docs-infra): remove eslint directive comments from examples (#43831)
Linting has recently been removed from the examples provided in angular.io
(see PRs #43592 and #43746) such removal effects the downloadable and
stackblitz examples but linting is still generally used in the examples
in the aio project itself (they are being migrated from tslint to eslint in
PR #43218) thus eslint directive comments are still necessary in the code itself.

So the comments need to be present but need not to be exposed to the users
(not in the zips, stackblitzes nor docs themselves), these changes are
removing such comments during the examples' parsing phase (effectively
removing them from all three sources mentioned above).

Original discussion: https://github.com/angular/angular/pull/43218#discussion_r697305494

resolves #43788

PR Close #43831
2021-11-09 18:02:33 +00:00
JoostK 4c700b6244 fix(core): do not use Function constructors in development mode to avoid CSP violations (#43587)
This commit removes the dynamic creation of named arrays for internal
runtime storage arrays as they may cause CSP violations in development
mode,  when an application's CSP configuration does not include
`unsafe-eval`.

Named arrays for view data can still be enabled in development mode
using the `ngDevMode=namedConstructors` query parameter when loading the
application.

The usage of native class syntax for named arrays does not have the
desired effect when the code is downleveled to ES5. Since ES5 targets
are becoming increasingly more rare this is considered less of a problem
than the CSP violation.

Fixes #43494

PR Close #43587
2021-11-09 18:02:13 +00:00
profanis b7d27aaf54 docs(animations): express the seconds in numbers (#40098)
I've noticed that the seconds are expressed both by using numbers and words.
For example, the doc says `0.5 second` and not `half second`.
I believe is more readable to express them by using numbers and is consistent too.

PR Close #40098
2021-11-09 18:01:47 +00:00
JoostK dede29e4f3 fix(compiler-cli): ensure literal types are retained when strictNullInputTypes is disabled (#38305)
Consider the `NgModel` directive which has the `ngModelOptions` input:

```ts
class NgModel {
  @Input() ngModelOptions: { updateOn: 'blur'|'change'|'submit' };
}
```

In a template this may be set using an object literal as follows:

```html
<input ngModel [ngModelOptions]="{updateOn: 'blur'}">
```

This assignment should be accepted, as the object's type aligns with the
`ngModelOptions` input in `NgModel`. However, if the `strictNullInputTypes`
option is disabled this assignment would inadvertently produce an error:

```
Type '{ updateOn: string; }' is not assignable to type '{ updateOn: "blur"|"change"|"submit"; }'.
  Types of property 'updateOn' are incompatible.
    Type 'string' is not assignable to type '"blur"|"change"|"submit"'
```

This is due to the `'blur'` value being inferred to be of type `string`
instead of retaining its literal type. The non-null assertion operator
that is automatically inserted for input binding assignments when
`strictNullInputTypes` is disabled inhibits TypeScript from inferring
the string value as its literal type.

This commit fixes the issue by omitting the insertion of the non-null
operator for object literals and array literals.

PR Close #38305
2021-11-09 18:01:25 +00:00
Joey Perrott b8a7124be6 refactor(compiler-cli): use relative imports within the @angular/compiler-cli package (#44118)
Intrapackage imports should always be done via relative imports rather than using the external
import location.

PR Close #44118
2021-11-08 22:08:27 +00:00
Joey Perrott 5eac4343c1 refactor(compiler): reverse testing of ternary operator to ensure typescript properly narrows types (#44089)
By checking if the providedIn is a function instead of everything but a function, typescript properly
narrows the typings for creating the expressions.

PR Close #44089
2021-11-08 21:30:34 +00:00
Pete Bacon Darwin 644e1e2f8f docs: update getting started tutorial to use StackBlitz web-containers (#44085)
Previous commits changed the docs to use web-container versions for StackBlitz examples.
This commit updates the content of the tutorial to match.

Fixes #44079

PR Close #44085
2021-11-08 18:12:17 +00:00
Pete Bacon Darwin 65fd656444 build(docs-infra): remove link to custom Stackblitz for running tests (#44085)
Previously there was a custom version of the testing app for Stackblitz that would run the tests in the browser.
With the web-container approach, this is no longer necessary since the tests can be run directly from the command line.

Fixes #44047

PR Close #44085
2021-11-08 18:12:17 +00:00
Pete Bacon Darwin 0f64a35ade build(docs-infra): ensure necessary boilerplate files appear in Stackblitz examples (#44085)
The `tsconfig.app.json` and similar were not appearing in the generated Stackblitz examples.

PR Close #44085
2021-11-08 18:12:17 +00:00
Pete Bacon Darwin 091db9c325 build(docs-infra): remove unused code (#44085)
This import was not being used and so it is redundant and can be removed.

PR Close #44085
2021-11-08 18:12:17 +00:00
JoostK e5a960b159 fix(compiler): generate correct code for safe method calls (#44088)
When a safe method call such as `person?.getName()` is used, the
compiler would generate invalid code if the argument list also contained
a safe method call. For example, the following code:

```
person?.getName(config?.get('title').enabled)
```

would generate

```
let tmp;
ctx.person == null ? null : ctx.person.getName((tmp = tmp) == null ?
null : tmp.enabled)
```

Notice how the call to `config.get('title')` has completely disappeared,
with `(tmp = tmp)` having taken its place.

The issue occurred due to how the argument list would be converted
from expression AST to output AST twice. First, the outer safe method
call would first convert its arguments list. This resulted in a
temporary being allocated for `config.get('title')`, which was stored in
the internal `_resultMap`. Only after the argument list has been
converted would the outer safe method call realize that it should be
guarded by a safe access of `person`, entering the `convertSafeAccess`
procedure to convert itself. This would convert the argument list once
again, but this time the `_resultMap` would already contain the
temporary `tmp` for `config?.get('title')`. Consequently, the safe
method in the argument list would be emitted as `tmp`.

This commit fixes the issue by ensuring that nodes are only converted
once.

Closes #44069

PR Close #44088
2021-11-08 17:31:37 +00:00
Pete Bacon Darwin 0c6c4d815e docs: add Angular 13 support information (#44098)
Closes #44097

PR Close #44098
2021-11-08 17:03:59 +00:00
Michael Urban db37f029b7 docs(animations): update developers on state of package (#44014)
Notify developers that @angular/animations package has been "significantly de-prioritized"

`animateChild` documentation now references #30477

References #30477# Please enter the commit message for your changes. Lines starting

PR Close #44014
2021-11-08 17:03:29 +00:00
George Kalpakas 7e0c7cefe5 build(docs-infra): fix SystemJS-based docs examples (#43868)
Previously, the SystemJS-based docs examples (typically `ngUpgrade`
examples) were not compatible with Angular v13 (due to the removal of
UMD bundles from the published packages).

This commit makes the examples compatible with Angular v13 and
re-enables the tests for all SystemJS-based examples on CI.

PR Close #43868
2021-11-08 17:01:16 +00:00
George Kalpakas 23d56d7469 build(docs-infra): include systemjs as a dependency to SystemJS-based docs examples (#43868)
Due to an oversight, the `systemjs` package was previously not included
as a dependency in the boilerplate `package.json` file for
SystemJS-based docs examples, despite it being required by the app.

PR Close #43868
2021-11-08 17:01:16 +00:00
George Kalpakas f367efb14d docs(upgrade): minor fixes to the upgrade guide (#43868)
Includes the following fixes:
- Remove unused `format` attribute from `<code-example>` elements
- Explicitly mention that the starting point for the "Phonecat Upgrade
  Tutorial" is the 1.5.x version of the original Phonecat tutorial
  (since the original tutorial has since been updated to use AngularJS
  v1.8.x and use npm instead of bower).

PR Close #43868
2021-11-08 17:01:16 +00:00
Renovate Bot 3c0daa94ba build: update dependency vlq to v2 (#43901)
PR Close #43901
2021-11-08 17:00:56 +00:00
Joe Martin (Crowdstaffing) 8566b78191 docs: update link (#44017)
Update link to match heading.

PR Close #44017
2021-11-08 17:00:18 +00:00
George Kalpakas f3d9e117d2 build(docs-infra): update Angular CLI/framework/Material to final v13 RCs in docs examples (#44030)
This commit updates the docs examples to the latest prerelease versions
of Angular CLI, framework and CDK/Material.

It also updates the apps to more closely align with new apps CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.0 CLI app and a
v13.0.0-rc.2 one.

[1]: cexbrayat/angular-cli-diff@13.0.0-rc.0...13.0.0-rc.2

PR Close #44030
2021-11-08 16:59:47 +00:00
Paul Gschwendtner 06b2023e13 test: update size goldens for AIO after updating to final v13 RCs (#44030)
Updates the size goldens for AIO to reflect the new measurements
after the v13 update to the latest release-candidates. i.e.

* rc.3 of Angular framework
* rc.2 of Angular CDK/Material
* rc.3 of Angular CLI.

Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>

PR Close #44030
2021-11-08 16:59:47 +00:00
Paul Gschwendtner f477d0cc55 build(docs-infra): update AIO to angular framework/components/cli final RCs (#44030)
Updates AIO to the latest v13 release-candidate version of all
Angular-owned packages, such as Angular CDK and Angular Material.

Applies changes needed for the v13 CLI as performed by the CLI
through `ng update`:

https://github.com/angular/angular-cli/tree/7ff8c5350ea2e49574dd659adae02215957d2685/packages/schematics/angular/migrations/update-13.

Additionally, the web components polyfill has been removed as all browsers
supported by Angular seem to support custom elements v1 natively, according to:

* https://caniuse.com/custom-elementsv1
* https://www.webcomponents.org/ (scroll down to browser support)

Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>

PR Close #44030
2021-11-08 16:59:47 +00:00
Renovate Bot 12769e3583 build: update angular (#44030)
Update all `@angular/*` and `@schematics/*` root dependencies to latest
versions.

PR Close #44030
2021-11-08 16:59:47 +00:00
Roman Frołow 6a36483858 docs(forms): fix typo in toInteger() function (#44075)
PR Close #44075
2021-11-08 16:59:08 +00:00
Joey Perrott 5b1938c50f refactor(core): correct typing when getting the Nearest LContainer (#44087)
Updating the casted typings of `getNearestLContainer` to ensure that typescript properly
returns the LContainer | null type.

PR Close #44087
2021-11-05 21:31:50 +00:00
Joey Perrott bc6f0a0611 refactor(core): correct typing checks when registering destroy hooks (#44087)
Making the typing filtering more explicit allows typescript to properly recognize the presence of the
`prototype` property on the provider within the `registerDestroyHooksIfSupported` method.

PR Close #44087
2021-11-05 21:31:50 +00:00
Joey Perrott c96ba23dc5 refactor(core): remove truthy check for classes getter (#44087)
Remove the truthy check for the classes getter as both paths from the check assume className was not
undefined.  This allows for typescript to properly determine the type of `className` in the falsy path
from the truthy check.

PR Close #44087
2021-11-05 21:31:50 +00:00
iRealNirmal 210f7e5d2c refactor(forms): update minlength/maxlength to inherit abstractValidator (#43998)
Modified minlength and maxlength validator to inherit abstractValidator

For every validator type different PR will be raised as discussed in #42378.

Closes #42267

PR Close #43998
2021-11-05 20:09:53 +00:00
Joey Perrott 8f840c357c ci: update mobile browsers tested via browser stack to correctly test supported browsers (#44083)
Update to running tests against latest ios and android emulators.

PR Close #44083
2021-11-05 19:55:42 +00:00
Joey Perrott e0420d382a docs: remove reference of testing against BrowserStack (#44083)
Remove BrowserStack from statement about CI tests using the service as Angular now only uses Saucelabs for
our platform specific browser testing.

PR Close #44083
2021-11-05 19:55:42 +00:00
Joey Perrott 4562a03f6c docs: update listed supported browsers to accurately reflect support browsers (#44083)
Update documentation to note 2 most recent major versions of Android browser support
rather than explictly listing browsers.

PR Close #44083
2021-11-05 19:55:42 +00:00
A. Singh 58f453da15 docs: improve documentation (#44031)
PR Close #44031
2021-11-05 16:23:50 +00:00
Paul Gschwendtner e0c25f836b build: add angular v12 packages to renovate ignore list (#44054)
The Angular v12 alias packages should not be accidentally updated to
v13 by Renovate. These packages are still used by tests for e.g. Ngcc
and should continue to provide the APF v12 View Engine output.

PR Close #44054
2021-11-05 16:22:54 +00:00
Paul Gschwendtner 4ccb768fc7 ci: do not capture nested bazel integration test workspace within Bazel (#44061)
The `integration/bazel` folder cannot be excluded within the
`.bazelignore` file. This is necessary so that the integration test
rule can glob for all files within the integration test.

The downside is that the `integration/bazel/<..>` folder is being
discovered by the `//...` target query, causing Starlark files to
be interpreted/validated. e.g.

https://app.circleci.com/pipelines/github/angular/angular/39255/workflows/c6c448ed-9a44-49b3-a0c2-2c7328ce2855/jobs/1079169

Previously such errors did not appear because no Starlark `.bzl` files
within the test imported other files using the `//` absolute resolution.

Explicitly excluding the nested packages using the `--deleted_packages`
option is the most idiomatic way of achieving this currently (similarly
done by `rules_nodejs`). More information on why this is so verbose
currently:

https://github.com/bazelbuild/bazel/issues/12034

PR Close #44061
2021-11-05 16:22:18 +00:00
Paul Gschwendtner fba7bc0243 refactor(bazel): fix typo in packager action file comments (#44061)
Fixes two typoes in the packager logic.

PR Close #44061
2021-11-05 16:22:18 +00:00
Paul Gschwendtner bfc8bdb9c8 test: re-enable bazel integration test with APF v13 (#44061)
Re-enables the Bazel integration test that we have disabled
as part of the APF v13 changes. Since there are no UMD files
anymore, the Karma tests no longer worked. Similarly, the Angular
linker had to run for building the production bundle.

PR Close #44061
2021-11-05 16:22:18 +00:00
Aristeidis Bampakos 33e51716dc docs: update install guide for angular elements (#44077)
Co-Authored-By: George Kalpakas <kalpakas.g@gmail.com>

PR Close #44077
2021-11-05 16:21:58 +00:00
Alan Agius 68cc2e240b docs: update Definition of Terms in APF guide (#44060)
Several improvements to the Definition of Terms of terms section in the APF guide.

PR Close #44060
2021-11-04 18:59:14 +00:00
Alan Agius 86980aaaac docs: unlink async keyword in APF guide (#44060)
Currently, `async` keywords in the APF guide incorrectly links to https://angular.io/api/common/AsyncPipe

PR Close #44060
2021-11-04 18:59:14 +00:00
Alan Agius 980b173e35 docs: update apf guide files layouts table (#44060)
With this change we improve the file layout structure table and align it with other similar tables example: https://angular.io/guide/file-structure

PR Close #44060
2021-11-04 18:59:14 +00:00
Paul Gschwendtner 00420fa295 test: re-enable platform-server integration test (#44055)
Re-enables the platform-server integration test that we had
to disable when we landed the APF v13 changes.

We can re-enable it by setting up the `fullySpecified` option
similar to how the CLI does it.

PR Close #44055
2021-11-04 18:57:22 +00:00
mgechev 5377cad88e docs: update roadmap update date (#44036)
PR Close #44036
2021-11-04 18:56:14 +00:00
Alan Agius cbe3086e5c build(docs-infra): configure region parser to allow .mjs (#44027)
This commit updates the necessary config settings to allow `.mjs` files to be able to be parsed by the region parser. We configure the parser to use `inline-c-only` so that comments are generated in like the below

```
// #docregion
```

rather than

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

PR Close #44027
2021-11-04 18:55:52 +00:00
Alan Agius 007a616a9e docs: improve consuming partial-Ivy code outside the Angular CLI (#44027)
With this change we add an example of how to consume the linker plugin and also clean up the parts of this section.

Closes #44026

PR Close #44027
2021-11-04 18:55:52 +00:00
mgechev 42034bc95f docs: update the survey expiry date (#44021)
PR Close #44021
2021-11-04 18:55:24 +00:00
Paul Gschwendtner 739cb1dd60 test: update ng-update integration test to test v13 migrations (#44016)
Updates the `ng-update` migration integration test to run against
v13 migrations. We have removed all older migrations so this integration
test needs to be updated.

PR Close #44016
2021-11-04 18:54:55 +00:00
Paul Gschwendtner dfa92f3ab6 test: re-enable ng-update migration integration test (#44016)
Re-enables the ng-update migration integration test as all the ESM/CJS
interop changes have landed in the `@angular/core` schematics folder.

PR Close #44016
2021-11-04 18:54:55 +00:00
Paul Gschwendtner 7d12e7b537 test: wire up ng-add-localize CLI project as integration test to run within Bazel (#44016)
Wires up the `ng-add-localize` minimal CLI project to run as integration
test within Bazel.

PR Close #44016
2021-11-04 18:54:55 +00:00
Paul Gschwendtner 6797431680 refactor(localize): ensure schematic code runs as commonjs (#44016)
The schematic code in `@angular/localize` is currently still emitted
as CommonJS, while the rest of `@angular/localize` is strict ESM (which
is also denoted through `type: module` in the package.json file).

The schematic code is currently imported as CJS from the CLI so it
is not a problem right now. Still, it is safer to ensure the code
for schematics is properly picked up as CJS through a local
`package.json` file resetting `type: module` to `type: commonjs`.

PR Close #44016
2021-11-04 18:54:55 +00:00
Paul Gschwendtner 2c777b9bef test: setup minimal CLI project for ng-add localize integration test (#44016)
Sets up a minimal CLI project for testing that `ng add @angular/localize`
works as expected. Schematic sub-packages are prone to CJS/ESM issues
due the overall framework packages being denoted as strict ESM.

This may not be an issue in the concrete scenario of `@angular/localize`
right now, but it is still good to have an integration test similar to
the tests we have for `@angular/core` schematics.

PR Close #44016
2021-11-04 18:54:55 +00:00
Renovate Bot c809e4b763 build: update dependency tsec to v0.1.10 (#43899) (#44010)
Updates the tsec dependency to v0.1.10 so that the Tsec
Windows support PR can land.

PR Close #43899

PR Close #44010
2021-11-04 18:54:21 +00:00
Joel Lefkowitz 5be8bd40b5 docs: amend inaccurate immutability definition (#43951) (#43951)
PR Close #43951

PR Close #43951
2021-11-04 18:53:18 +00:00
Joey Perrott 80310b012a refactor(core): set up structure for google3 usage of migration schematics (#43980)
Set up exporting the migration rules from the google3 directly from the internal
@angular/migrations package.  This package is an internal only package to be
exposed for loading TSLint rules.

PR Close #43980
2021-11-04 11:23:12 -07:00
Joey Perrott ef15db0e80 docs: add blog post link to CHANGELOG (#44050)
PR Close #44050
2021-11-03 17:26:22 -07:00
Andrew Kushnir 07440752b3 docs: update CHANGELOG with deprecations (#44035)
This commit adds deprecation messages from the commits in the `.next` and `.rc` releases.

PR Close #44035
2021-11-03 17:03:34 -07:00
Joey Perrott 9741473f04 ci: update aio payloads size (#44046)
Update the payloads size for aio tracking.

PR Close #44046
2021-11-03 16:37:11 -07:00
Joey Perrott ea77439d25 fix(docs-infra): remove tilda from scss imports in aio (#44046)
Remove tilda usages.

PR Close #44046
2021-11-03 16:37:11 -07:00
Alex Rickabaugh 35e3809d09 build(docs-infra): update to 13.0.0 (#44046)
This commit updates AIO to use the published 13.0.0 packages, as the final
step after the release.

PR Close #44046
2021-11-03 16:37:10 -07:00
Joey Perrott 1e11648102 build: update lock files (#44046)
Update the lock files and add --frozen-lockfile flag to the aio presetup command.

PR Close #44046
2021-11-03 16:37:10 -07:00
Pete Bacon Darwin b361242a13 build(docs-infra): target webcontainers for stackblitz "live-example" links (#44041)
This commit changes the Stackblitz live examples to create "webcontainer" projects on Stackblitz.
This approach supports the new Angular v13 packaging formats but webcontainers are not supported on some browers. So this is a temporary solution.

PR Close #44041
2021-11-03 16:19:56 -07:00
Alex Rickabaugh 167e2a8bb8 release: cut the v13.0.0 release (#44032)
PR Close #44032
2021-11-03 10:51:28 -07:00
Paul Gschwendtner b6f2a55147 fix(migrations): prevent migrations from updating external templates multiple times (#44013)
The `NgComponentTemplateVisitor` helper was always referring back to the original source file on disk
rather than the virtual file in the migration. This meant that some template migrations could attempt
to modify the template multiple times resulting in invalid output.

As an example the `migration-v13-router-link-empty-expression` migrates the following template:

```
<div [routerLink]></div>
```

to

```
<div [routerLink]="[]"></div>
```

But if the template was referenced multiple times in the program, such as when the component was
referenced in the source and test entry-points, the migration would result in things like:

```
<div [routerLink]="[]"="[]"></div>
```

Fixes #44005.

PR Close #44013
2021-11-03 09:38:44 -07:00
Pete Bacon Darwin 95a68c5dc3 fix(migrations): account for CRLF characters in template migrations (#44013)
Previously, when parsing code for templates to migrate, CRLF characters were converted to just LF.
This meant that the source-spans being used to overwrite the template strings in the original source code were out of sync with the positions identified in the parsed templates.

This commit fixes this by parsing the raw text of the template taken from the source code instead of processed string contents.

Fixes #44005

PR Close #44013
2021-11-03 09:38:44 -07:00
Pete Bacon Darwin 59f12c30cc ci: re-enable the schematics tests (#44013)
These tests had been disabled when we initially disabled ViewEngine.
The tests appear to run fine despite this, so we can re-enable them.

PR Close #44013
2021-11-03 09:38:44 -07:00
Alex Rickabaugh d24cbcea70 release: cut the v13.0.0-rc.3 release (#44011)
PR Close #44011
2021-11-01 18:50:22 -07:00
Alex Rickabaugh 4fd388b084 docs: initial commit of Angular Package Format documentation (#43987)
This commit adds the Angular Package Format to AIO. Previously this document
was updated and versioned in Google Docs.

The document is also updated for the Angular Package Format version 13.

PR Close #43987
2021-11-01 18:24:21 -07:00
Joe Martin (Crowdstaffing) 74c497289f docs: update per feedback (#44009)
Update content per feedback from previous PR.

PR Close #44009
2021-11-01 17:38:54 -07:00
mgechev 892ded5865 docs: update the roadmap in alignment with v13 progress (#43986)
PR Close #43986
2021-11-01 14:02:14 -07:00
Andrew Scott 87bcb3f183 Revert "refactor(router): restore history in a consistent way on canceled navigations (#43651)" (#44006)
This reverts commit a268c4471f.

Causes failures in internal team's code. The failures likely relate to
attempting to manually update private Router state tracking properties,
which this change would have affected.

PR Close #44006
2021-11-01 09:25:36 -07:00
Joe Martin (Crowdstaffing) 0382f863db docs: update left-nav (#43964)
Update left-nav toc.

PR Close #43964
2021-10-29 16:51:34 -07:00
Joe Martin (Crowdstaffing) 0a51212d0e docs: add link (#43964)
Add link for RFC. Clean up markdown formatting.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) dd79d317a4 docs: update per tech review (#43964)
Update content per feedback in tech review.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) c9718897a6 docs: update release notes (#43964)
Update release note for version 13.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) 618a9c76f7 docs: add redirect test (#43964)
Add redirect test for new latest version topic.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) 4e57cab6d4 docs: add links (#43964)
docs: add links to additional information.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) a23942ef53 docs: remove previous latest verison (#43964)
Remove content for previous latest version.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) b671a37ba8 docs: update migration content (#43964)
Update content for AngularJS to Angular migration.  Add note to manually create UMD bundles.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) a4dc5da4ee docs: update library use content (#43964)
Update content for library use.

PR Close #43964
2021-10-29 16:51:33 -07:00
Joe Martin (Crowdstaffing) 97eed3e83c docs: add latest version content (#43964)
Add the update to latest version content for version 13.  Add redirect for latest version content.  Update toc for later version content.

PR Close #43964
2021-10-29 16:51:33 -07:00
Alan Agius 9c99afdc7c fix(docs-infra): search box input line-height (#43983)
This fixes an issue on Safari which caused the text to be pushed down when blurring out of the search input field. The root cause of the problem appears to be that previously the computed line height was that of 32px, which caused a shift in content.

Closes #43935

PR Close #43983
2021-10-29 15:47:09 -07:00
Joe Martin (Crowdstaffing) 6b248556e8 docs: update note (#43979)
Update the note for hierarchy of locale identifiers.

PR Close #43979
2021-10-29 15:46:37 -07:00
Joe Martin (Crowdstaffing) aea63fcc17 docs: remove link (#43979)
Remove redundant link.

PR Close #43979
2021-10-29 15:46:37 -07:00
Andrew Kushnir f4ea80a3c1 refactor(core): add ViewRef to private exports (#43978)
This commit adds `ViewRef` to private exports, so it can be reused in internal packages.

The `ViewRef` symbol remains *private* and should not be referenced directly.

PR Close #43978
2021-10-29 15:45:50 -07:00
George Kalpakas 494d056c48 refactor(docs-infra): remove obsolete way of disabling DocViewer animations (#43977)
Previously, there were two ways to disable view transition animations in
`DocViewerComponent`: Using a `.no-animations` CSS class on the
`<aio-doc-viewer>` element and setting the static
`DocViewerComponent.animationsEnabled` property to `false`. The latter
was only used to disable animations for testing purposes.

With the recent introduction of `AppComponent.reducedMotion`, there is
now an easy way to disable animations in tests using the
`.no-animations` class (which is applied by `AppComponent` based on the
value of `AppComponent.reducedMotion`). Therefore, it is no longer
necessary to have `DocViewerComponent.animationEnabled`.

This commit removes the now obsolete `animationsEnalbed` property.

PR Close #43977
2021-10-29 15:45:02 -07:00
George Kalpakas 22c5f35a8c fix(docs-infra): improve accessibility by respecting prefers-reduced-motion (#43977)
Make the app easier to use for people with motion sensitivities by
disabling several animations (esp. ones involving moving things around)
when the user prefers reduced motion. The user's preference is detected
using the [prefers-reduced-motion][1] CSS media feature.

Disabled animations include:
- View fade in/out transitions.
- Sidenav open/close animations.
- Top-menu color and size changes.
- Contributor cards flip animations.

For more details on using `prefers-reduced-motion` and disabling
Angular animations see:
- [Designing with reduced motion for motion sensitivities][2]
- [Disabling Angular animations at runtime][3]

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
[2]: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
[3]: https://dev.to/this-is-angular/disabling-angular-animations-at-runtime-9a6

PR Close #43977
2021-10-29 15:45:02 -07:00
Alan Agius 7307ea33bd test: remove ng_elements_schematics integration test (#43975)
This test has been removed as since the elements schematic has been removed in a previous commit.

PR Close #43975
2021-10-29 15:43:56 -07:00
Alan Agius f544a53f5f fix(elements): remove incorrect @angular/platform-browser peer dependency (#43975)
The elements package doesn't use `@angular/platform-browser` therefore this is not needed.

PR Close #43975
2021-10-29 15:43:56 -07:00
Alan Agius a468213f34 fix(elements): remove ng-add schematic (#43975)
This schematic is no longer needed since all the [browsers](https://angular.io/guide/browser-support) that Angular supports `CustomElementRegistry` APIs.

Side note: `document-register-element` has been deprecated in favor of `@ungap/custom-element`

PR Close #43975
2021-10-29 15:43:56 -07:00
Alan Agius 8f7ceae5df docs: update elements page (#43975)
This section was outdated since now all CLI projects are es2015+ and don't require the polyfill since legacy browsers are no longer supported.

PR Close #43975
2021-10-29 15:43:56 -07:00
Alan Agius fce7bb8daf test: remove document-register-element from elements tests (#43975)
All the [browsers](https://angular.io/guide/browser-support) that Angular supports `CustomElementRegistry` APIs

PR Close #43975
2021-10-29 15:43:56 -07:00
Andrew Kushnir c50abe57c8 docs: update dynamic component guide to use factory-less ViewContainerRef.createComponent (#43895)
PR Close #43895
2021-10-29 15:39:04 -07:00
George Kalpakas 3084df8b64 ci: improve angular.io deployment process for the master branch (#43963)
Previously, the master branch was only deployed to the
`next-angular-io-site` Firebase site, which is connected to the
`next.angular.io` domain. However, if the master major version was
higher than the stable major version (or the RC major version in case
there was an active RC), we also had to manually configure (via the
Firebase console and/or DNS records) the `v<X>.angular.io` domain to
redirect to `next.angular.io`. Then, once `<X>` became the new stable or
RC version, we had to manually remove the redirect (to let
`v<X>.angular.io` be redirected to `angular.io` or `rc.angular.io`).

This commit is part of a new process that reduces the manual steps as
follows (the steps below only apply when the master major version is
higher than the current stable and RC (if applicable)):
- A `v<X>-angular-io-site` Firebase site will be created as soon as the
  version in the `master` branch's `package.json` is updated to a new
  major.
- The `v<X>.angular.io` domain will be connected to that new Firebase
  site.
- When deploying from the master branch, we will deploy to both
  `next-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `next.angular.io`.
- When the master version becomes the new stable/RC, we will start
  deploying to `v<X>-angular-io-site` from the stable/RC branch, which
  will update the Firebase config to stop redirecting to
  `next.angular.io` and redirect to `(rc.)angular.io` instead (without
  requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas 6662fcfa12 ci: improve angular.io deployment process for the RC branch (#43963)
Previously, (when there was an active RC) the RC branch was only
deployed to the `rc-angular-io-site` Firebase site, which is connected
to the `rc.angular.io` domain. However, if the RC major version was
higher than the stable major version, we also had to manually configure
(via the Firebase console and/or DNS records) the `v<X>.angular.io`
domain to redirect to `rc.angular.io`. Then, once `<X>` became the new
stable version, we had to manually remove the redirect (to let
`v<X>.angular.io` be redirected to `angular.io`).

This commit is part of a new process that reduces the manual steps as
follows (the steps below only apply to RC versions that have a higher
major version than the current stable):
- A `v<X>-angular-io-site` Firebase site will be created for the new RC
  version.
- The `v<X>.angular.io` domain will be connected to that new Firebase
  site.
- When deploying from the RC branch, we will deploy to both
  `rc-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `rc.angular.io`.
- When the RC version becomes the new stable, we will start deploying to
  `v<X>-angular-io-site` from the stable branch, which will update the
  Firebase config to stop redirecting to `rc.angular.io` and redirect to
  `angular.io` instead (without requiring changes in the Firebase
  console or DNS).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas 40abf0307d ci: improve angular.io deployment process for the stable branch (#43963)
Previously, the stable branch was always deployed to the
`v<X>-angular-io-site` Firebase site, which was connected to the
`angular.io` domain. Whenever a new major version was released (and
became the new stable version), the `angular.io` domain had to be
disconnected from the previous Firebase site and be connected to the new
`v<Y>-angular-io-site` Firebase site. This was a manual process that
involved making changes in the Firebase console and the DNS records.

This commit is part of a new process that reduces the manual steps as
follows:
- A new `stable-angular-io-site` Firebase site is created.
- The `angular.io` domain will be connected to that new Firebase site.
- When deploying from the stable branch, we will deploy to both
  `stable-angular-io-site` and `v<X>-angular-io-site`. In addition, the
  deployment to `v<X>-angular-io-site` will update the Firebase config
  file to redirect to `angular.io`.
- When a new major version is released, we will start deploying from the
  new stable branch to `stable-angular-io-site`, but there will be no
  need to connect/disconnect the `angular.io` domain. Also,
  `v<X>.angular.io` will stop redirecting to `angular.io` by means of
  updating the Firebase config file (without requiring changes in the
  Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas d1321a1fe7 feat(docs-infra): add post-deploy actions for testing more redirect configs (#43963)
Add `deploy-to-firebase` post-deploy actions to allow testing various
redirect configs.
In a future commit, this will allow testing redirects for the `stable`,
`rc` and `next` deployments via the Firebase config file (without
requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas f5d236b248 refactor(docs-infra): make it easier to configure Firebase redirects at deployment (#43963)
Refactor the `deploy-to-firebase` post-deploy actions by extracting
logic to separate helper functions. This makes it easier to create more
functions for testing various redirect configs (in a future commit).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas 78d0bda39e feat(docs-infra): add more granular support for configuring Firebase redirects at deployment (#43963)
Previously, there was a `deploy-to-firebase` pre-deploy action for
configuring Firebase to redirect non-file requests to `angular.io`. This
is used for ensuring that `rc.angular.io` is correctly redirected to
`angular.io`, even when people have previously visited (and have a
ServiceWorker activated on) `rc.angular.io`.

This commit adds pre-deploy actions for configuring Firebase to redirect
a deployment to any of `angular.io`, `rc.angular.io` or
`next.angular.io` and also configure whether all requests or only
non-file requests will be redirected.
In a future commit, this will allow managing redirects for the `stable`,
`rc` and `next` deployments via the Firebase config file (without
requiring changes in the Firebase console or DNS).

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas 609579c8f2 feat(docs-infra): create undo functions for all pre-deploy actions (#43963)
Create functions to undo the changes made by any pre-deploy action.
In a future commit, this will allow deploying a build to multiple
projects/sites with different small tweaks for each.

PR Close #43963
2021-10-29 15:05:11 -07:00
George Kalpakas 57e6339cd1 test(docs-infra): avoid running expensive operations when focusing/skipping tests (#43963)
Previously, the pre-computation of branch version info for the
`deploy-to-firebase` tests would always take place even when the tests
that used that info were skipped. This pre-computation involves network
access and may add a noticeable delay.

This commit refactors the tests to not do the pre-computation if the
corresponding tests are skipped. This allows for a faster iteration
when focusing on a different set of tests.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 4c22339bcb refactor(docs-infra): move deploy-to-firebase post-deploy actions to a separate file (#43963)
Move some functions that are used as post-deploy actions from
`deploy-to-firebase/index.mjs` to a separate file
(`deploy-to-firebase/post-deploy-actions.mjs`) to keep `index.mjs` small
and easier to maintain.

NOTE:
While not strictly necessary atm, `post-deploy-actions.mjs` uses the
same default export pattern for consistency with `utils.mjs`.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 5049124b25 refactor(docs-infra): move deploy-to-firebase pre-deploy actions to a separate file (#43963)
Move some functions that are used as pre-deploy actions from
`deploy-to-firebase/index.mjs` to a separate file
(`deploy-to-firebase/pre-deploy-actions.mjs`) to keep `index.mjs` small
and easier to maintain.

Also, rename the `removeServiceWorker()` function to
`disableServiceWorker()`, which is a little more accurate.

NOTE:
While not strictly necessary atm, `pre-deploy-actions.mjs` uses the same
default export pattern for consistency with `utils.mjs`.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 6d7c2e0e71 refactor(docs-infra): move deploy-to-firebase util functions to a separate file (#43963)
Move some util functions from `deploy-to-firebase/index.mjs` to a
separate file (`deploy-to-firebase/utils.mjs`) to keep `index.mjs` small
and easier to maintain.

NOTE:
To make it easier to mock functions in tests, `utils.mjs` uses a default
export (instead of multiple named exports) and references local
functions through the default exported object.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 7120a008c8 refactor(docs-infra): create logSectionHeader() helper in deploy-to-firebase script (#43963)
Create a `logSectionHeader()` helper function to avoid duplicating code.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 50b2d273b8 refactor(docs-infra): convert deploy-to-firebase script to ESM (#43963)
Convert the `deploy-to-firebase` script (and corresponding tests) from
CommonJS format to ESM.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas c359da412b build(docs-infra): validate computed deployments in deploy-to-firebase script (#43963)
The `deploy-to-firebase` script might have to deploy a single AIO build
to multiple projects/sites (potentially with small tweaks between each).

This commit adds a step to validate the computed deployments to ensure
they are compatible with each other (for example, that there is exactly
one primary deployment that builds the app and sets the theme/mode and
that all secondary deployments are compatible with the primary one).

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 3f480a1836 refactor(docs-infra): add name and type to deployment info (#43963)
This commit adds two new properties, `name` and `type`, to deployment
info data. This will make it easier to differentiate between deployment
targets (e.g. primary vs secondary) and will provide more informative
log messages.

In a subsequent commit, this new data can be used to validate the
computed deployments list.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 8292c6636b fix(docs-infra): improve an error message in deploy-to-firebase script (#43963)
This commit fixes a typo in an error message thrown in the
`deploy-to-firebase` script (`but it was but it was` --> `but it was`).

It also makes the error clearer when the request was not redirected.

Old error:
> Expected '<original-url>' to be redirected to '<expected-url>', but it
> was but it was redirected to 'undefined'.

New error:
> Expected '<original-url>' to be redirected to '<expected-url>', but it
> was not redirected.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 6ee479d8eb build(docs-infra): enable linting for deploy-to-firebase scripts (#43963)
This commit enables linting for the scripts in
`aio/scripts/deploy-to-firebase/`. It also makes the necessary changes
to the files to make linting pass.

PR Close #43963
2021-10-29 15:05:10 -07:00
George Kalpakas 2fa48e5f88 refactor(docs-infra): move deploy-to-firebase.js into a dedicated directory (#43963)
This commit moves the `aio/scripts/deploy-to-firebase.js` script into a
new directory, `aio/scripts/deploy-to-firebase/`. This will make it
easier to break it up into multiple smaller files to better organize the
code (without polluting the `aio/scripts/` directory).

PR Close #43963
2021-10-29 15:05:10 -07:00
Alan Agius 96b99c443b docs: update creating libraries guide (#43982)
We update the `creating libraries` guide to remove View Engine references. This is because in version 13 users are no longer able to build libraries using View Engine.

In addition to the above, we also remove references to `npm link`. As this is actually not a recommended workflow, and was mostly needed in older versions of the CLI prior to version 6, were multi-projects workspaces were introduced.

Closes #43949

PR Close #43982
2021-10-29 14:23:04 -07:00
George Kalpakas 3faef7180d refactor(docs-infra): align docs examples with default CLI TS config (#43880)
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.

PR Close #43880
2021-10-29 13:10:26 -07:00
George Kalpakas 12b7f4490f build(docs-infra): update docs examples to Angular v13.0.0-rc.0 (#43880)
This commit updates the docs examples to Angular v13.0.0-rc.0. In
addition to updating the dependency versions, it also updates the
projects' structure and configs to more closely match what a new v13 CLI
app would look like. See, also, the [diff][1] between a basic v12.1.3
CLI app and a v13.0.0-rc.0 one.
(NOTE: v12.1.3 was the last version for which we aligned the projects
with how a new CLI app would look like.)

Additionlly:
- Since we now use RxJS v7 in docs examples, this commit removes the
  extra CI steps to explicitly test the docs examples against RxJS v7.
- Since Angular v13 no longer supports IE, this commit removes an
  IE-specific section from `upgrade-setup.md`.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/12.1.3..13.0.0-rc.0

PR Close #43880
2021-10-29 13:10:26 -07:00
George Kalpakas 620a705065 test(docs-infra): fix practical-observable-usage docs example tests with RxJS v7 (#43880)
Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.

PR Close #43880
2021-10-29 13:10:26 -07:00
George Kalpakas 6ff9798268 build: use the latest version of Chrome (v93) in non-bazel tests (#43880)
This commit updates the version of Chrome used in non-bazel tests (via
Puppeteer) to the latest (v93).

PR Close #43880
2021-10-29 13:10:26 -07:00
Jochen Kraushaar f225bfde80 docs(common): describe behavior when reference changes (#42863)
PR Close #42863
2021-10-28 11:34:26 -07:00
vthinkxie 8ae99821d6 fix(core): support InjectFlags argument in NodeInjector.get() (#41592)
The `InjectFlags` argument was defined for both `getOrCreateInjectable()` and `Injector`, but was ignored in `NodeInjector`.
This PR adds support for getting parent token via `NodeInjector.get()`.

close #31776

PR Close #41592
2021-10-28 11:20:01 -07:00
Pete Bacon Darwin 59ca52fd4f refactor: simplify the LOCALE_ID provider (#43913)
Other parts of the intialization process are responsible for passing the locale id to ivy, so it does not need to happen in the provider factory. E.g. `PlatformRef.bootstrapModule()` and `R3TestBedCompiler.finalize()`.

PR Close #43913
2021-10-28 11:19:13 -07:00
Pete Bacon Darwin 4ba1a249ad refactor: remove ɵloc and related code (#43913)
This code is not used in ivy - and probably was not being used
in View Engine either.

PR Close #43913
2021-10-28 11:19:13 -07:00
Jessica Janiuk 8d89b2853c Revert "refactor(forms): update minlength/maxlength to inherit abstractValidator" (#43971)
This reverts commit 7b31b887f9.

PR Close #43971
2021-10-27 21:42:26 +00:00
Jessica Janiuk a2ce1da85b release: cut the v13.0.0-rc.2 release (#43968) 2021-10-27 11:29:30 -07:00
Mladen Jakovljević 7de7dc89bf fix(docs-infra): fix heritage links (#43956)
Fix incorrect escape of special characters when rendering member heritage docs. Example: DefaultIterableDiffer docs incorrectly renders what this class implements - it does not fully display generic types of implemented interfaces.

PR Close #43956
2021-10-27 16:13:36 +00:00
Virginia Dooley b7be4cfc02 docs: review tag added (#43465)
PR Close #43465
2021-10-27 16:13:02 +00:00
Alan Agius cfc509c48a refactor(migrations): remove no longer accessible migrations (#43947)
With this change we remove no longer needed migrations. These migrations are no longer accessible following a change angular/angular-cli#21986 in the Angular CLI.  The CLI now shows an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.

Example to update from version 11 to version 13 the recommand approach is to run the following commands

```
ng update @angular/core@12
ng update @angular/core@13 (which is the same as ng update @angular/core)
```

NB: It is recommand that when update from one major to another, users verify that their applications is working as expected.

PR Close #43947
2021-10-26 23:59:42 +00:00
Virginia Dooley ec23ae99d5 docs: reviewed tag added (#43487)
PR Close #43487
2021-10-26 23:57:45 +00:00
Virginia Dooley 0dbe1c695a docs: reviewed tag added (#43488)
PR Close #43488
2021-10-26 22:57:21 +00:00
Renovate Bot 081a4c2722 build: update all non-major dependencies (#43917)
PR Close #43917
2021-10-26 21:16:07 +00:00
iRealNirmal c44d1cbd58 refactor(forms): update minlength/maxlength to inherit abstractValidator (#43835)
Modified minlength and maxlength validator to inherit abstractValidator

For every validator type different PR will be raised as discussed in #42378.

Closes #42267

PR Close #43835
2021-10-26 20:24:40 +00:00
Joey Perrott 97b6f6843f ci: update commit-message-based-labels job to be called labels (#43944)
Using the job name labels results in a more readable and better looking Github status.

PR Close #43944
2021-10-26 20:20:05 +00:00
Joey Perrott 1571c2b58f build: create issue selector configuration (#43923)
Create a configuration file to set up the new issue selector page.

PR Close #43923
2021-10-26 20:19:07 +00:00
Renovate Bot 269feceb67 build: lock file maintenance (#43937)
PR Close #43937
2021-10-26 20:12:01 +00:00
JoostK fa7693f784 refactor(compiler-cli): extract error documentation base url into separate file (#43527)
Prior refactorings caused unexpected g3 sync issues due to a patch that
changes the error documentation URL. This commit moves the base url into
a separate file to make this more apparent.

PR Close #43527
2021-10-26 18:22:34 +00:00
JoostK 8e13c351ac fix(compiler-cli): avoid broken references in .d.ts files due to @internal markers (#43527)
The `ErrorCode` enum in the `error_code.ts` file is governed by public
api guards but the other top-level exports from that file are exempt
from public api documentation and are therefore marked as `@internal`.
However, TypeScript is configured with the `stripInternal` compiler
option such that declarations with `@internal` markers are not emitted
into the `.d.ts` files, but this means that the reexports in the barrel
file end up referring to missing declarations.

The `stripInternal` option is considered internal and its documentation
states to use at your own risk (as per https://github.com/microsoft/TypeScript/issues/45307).
Having the option enabled is desirable for us as it works well for
hiding class fields that are marked `@internal`, which is an effective
way to hide members from the .d.ts file. As a workaround for the issue
with top-level symbols, the declarations with `@internal` markers are
moved to dedicated files for which no public api guard is setup,
therefore allowing their `@internal` markers to be dropped.

Fixes #43097

PR Close #43527
2021-10-26 18:22:33 +00:00
dirk diebel 59e56e79d0 docs(docs-infra): change deprecated keyboardEvent.keyCode example to use keyboardEvent.code (#43934)
PR Close #43934
2021-10-26 00:05:23 +00:00
amayer42 940eafa351 docs(localize): fix spelling of documentation link (#43941)
Fixes the spelling of 'i18n' in a documentation link.
PR Close #43941
2021-10-25 22:05:18 +00:00
Jessica Janiuk 15bdd0d48f Revert "refactor(migrations): remove no longer accessible migrations" (#43943)
This reverts commit f21ad8780b.

PR Close #43943
2021-10-25 22:02:32 +00:00
Alan Agius 087fae5ea9 refactor(migrations): remove no longer accessible migrations (#43942)
With this change we remove no longer needed migrations. These migrations are no longer accessible following a change https://github.com/angular/angular-cli/pull/21986 in the Angular CLI.  The CLI now shows an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.

Example to update from version 11 to version 13 the recommand approach is to run the following commands

```
ng update @angular/core@12
ng update @angular/core@13 (which is the same as ng update @angular/core)
```

NB: It is recommand that when update from one major to another, users verify that their applications is working as expected.

PR Close #43942
2021-10-25 19:32:27 +00:00
Andrew Kushnir 8277c38bd8 test(platform-browser): complete component bootstrap before switching to the next test (#43933)
The bootstrap tests that reused the same component (the `HelloRootCmp` one) were randomly failing due to the incomplete cleanup between tests. This commit ensures that the component bootstrap is fully cimpleted and there are no pending async actions before going to the next test.

PR Close #43933
2021-10-25 17:58:27 +00:00
George Kalpakas 7c5d642106 fix(ngcc): support alternate UMD layout when adding new imports (#43931)
In #43879, `UmdReflectionHost` was updated to deal with the new UMD
format used by Rollup, where the parenthesis is around the wrapper
function and not the wrapper function call.
For reference, this caused failures in the `ngcc-validation` repo
([example 1][1], [example 2][2]).

This commit updates `UmdRenderingFormatter` to also handle both UMD
formats. In order to validate the change, this commit also updates the
`UmdRenderingFormatter` tests to run against both UMD formats.

[1]: https://circleci.com/gh/angular/ngcc-validation/65916
[2]: https://circleci.com/gh/angular/ngcc-validation/65758

PR Close #43931
2021-10-25 17:56:27 +00:00
Doug Parker 8178a3028b docs: deprecate @angular-devkit/build-optimizer (#43915)
The entire package is deprecated in v13. Deprecation message is mostly copied from the package's [README](https://github.com/angular/angular-cli/blob/13.0.0-next.9/packages/angular_devkit/build_optimizer/README.md), with just some minor edits.

(cherry picked from commit d81744e600)

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius 9968a8ad82 docs: remove fesm5 and esm5 deprecation notice. (#43915)
This has been removed in version 11 and should no longer be listed.

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius e569a9c1fe docs: update CLI deprecation guide to reflect new deprecations (#43915)
With this change we update the CLI deprecations sections as per version 13.

PR Close #43915
2021-10-25 17:54:52 +00:00
Alan Agius 096ebb2830 docs: format tables in deprecations page (#43915)
Currently, the table are unformatted which makes it extremely hard to read when viewing the markdown file directly.

PR Close #43915
2021-10-25 17:54:52 +00:00
ericcheng2005 97fc9de2c4 refactor(core): made comment structure consistent in index.ts (#43684)
changed second big block of comments to use multi-line comment structure instead of multiple single-line comments

PR Close #43684
2021-10-21 18:40:00 +00:00
ericcheng2005 6dc4d83f37 docs: added commas to sentences in .vscode/README.md (#43684)
PR Close #43684
2021-10-21 18:40:00 +00:00
ericcheng2005 23928a02d3 docs: fixed minor grammar mistakes in CONTRIBUTING (#43684)
PR Close #43684
2021-10-21 18:39:59 +00:00
Doug Parker 72f6877cb0 docs: remove Ivy-specific guides (#43860)
Ivy is the only supported rendering engine in v13, so there is no need to document the concept. Everything in Angular is Ivy. This starts the removal process by deleting Ivy-specific guides and references to them. It also updates the glossary to be more clear that Ivy is the current rendering engine while View Engine is simply a historical note.

This does not attempt to fully remove all references to "Ivy" or "View Engine", that will likely be a more involved clean up process.

PR Close #43860
2021-10-21 18:14:34 +00:00
krzysztof-grzybek adc68b100b fix(router): reuse route strategy fix (#43791)
Currently, it's impossible to cache (detach/attach) parent route without caching child routes.
This produces a bug, when navigating from a/b to c, then to a/d, where a route is cached.
On the last navigation, we incorrectly restore a/b route instead of a/d.
This change introduces new behavior: if the route should be detached/attached,
we do so, but we check also child routes recursively.

Fixes #17333

PR Close #43791
2021-10-21 16:28:03 +00:00
Alan Agius 5d031848d3 ci: update angular/dev-infra/github-actions sha (#43904)
Consume latest version of `angular/dev-infra/github-actions`.

PR Close #43904
2021-10-21 16:26:36 +00:00
Alan Agius bbbf678bed ci: replace breaking-changes-label with commit-message-based-labels (#43904)
See: https://github.com/angular/dev-infra/pull/269 for more context

PR Close #43904
2021-10-21 16:26:35 +00:00
Tomasz Domański 22009f62df docs: fix typos in the workspace config guide (#43918)
PR Close #43918
2021-10-21 14:42:46 +00:00
George Kalpakas 0039b712c0 refactor(service-worker): avoid unnecessary writes to cache when version fails (#43680)
When an app version is detected as broken, the SW calls the
`Driver#versionFailed()` method. Previously, this method would in turn
call the `Driver#sync()` method, which writes some metadata about the
SW's state to the `ngsw:/:db:contol` cache. More specifically,
`Driver#sync()` persists info about all known app versions, which one is
the latest and also what version each client is assigned to.

However, no relevant info is changed inside `Driver#versionFailed()`, so
the call to `Driver#sync()` is redundant (since there are no changes
that need to be synced with the cache). This is a left-over from
before #43518, when `Driver#versionFailed()` used to update version
assignments and thus did require synchronization with the cache.

This commit removes the redundant `Driver#sync()` call to avoid an
unnecessary write to the cache.

PR Close #43680
2021-10-21 14:20:51 +00:00
iRealNirmal 665466def3 docs: move deprecations example snippets to external file (#43700)
Moving angular depreciation examples to external project

closes #43337

PR Close #43700
2021-10-20 20:24:55 +00:00
Willy Schott ae52bf1df3 docs: clarify meaning of ellipsis in bazel command (#43890)
PR Close #43890
2021-10-20 20:14:49 +00:00
Andrew Kushnir b31a9a75ad release: cut the v13.0.0-rc.1 release (#43911) 2021-10-20 09:57:26 -07:00
JoostK 7d33af0400 test(compiler-cli): run i18n extraction tests using Ivy compiler (#43893)
This commit re-enables the `extract_i18n` test target and updates the
test to run with the Ivy compiler.

PR Close #43893
2021-10-19 16:26:22 -07:00
JoostK aef01389e1 test(compiler-cli): run watch mode tests using Ivy compiler (#43893)
This commit re-enables the `perform_watch` test target and updates the
test to run with the Ivy compiler.

Additionally, this target was switched over to use Angular v12 packages
as input to the test, to allow the ViewEngine tests to continue working
with v13 packages which are Ivy-only. This commit reverts those changes
now that View Engine tests are disabled, as it's desirable to test
against local artifacts that are build within the monorepo instead of
depending on NPM packages.

PR Close #43893
2021-10-19 16:26:22 -07:00
Alan Agius 9d9346c57a docs: add docs about build cache (#43843)
With this change we add docs about persistant disk cache with was enabled by default in the CLI via https://github.com/angular/angular-cli/pull/21827

PR Close #43843
2021-10-19 10:45:30 -07:00
Joey Perrott 812a33df8c ci: mark core/schematics/test:test and compiler-cli/test:perform_watch test as view engine only (#43862)
Both test targets fail because, at test time, they use the view engine compiler, even when bazel sets the
configuration to use ivy.

PR Close #43862
2021-10-19 10:06:57 -07:00
Doug Parker aafde79a71 refactor(compiler-cli): throw an error when compiling with View Engine. (#43862)
The View Engine compiler now throws when constructed and will be removed shortly. Direct users should switch to `NgtscProgram` to build with [Ivy](https://angular.io/guide/ivy). The View Engine compiler is being removed, so this makes it throw an error to ensure no one accidentally depends on code being removed.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott 57bf6b7cbd ci: correct comment related to building view engine npm packages (#43862)
Removing the comment related about building the npm packages using view engine as it was actually done via
ivy, now that ivy is used for all builds there is no need for expressing the aspect of the build.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott 5e562b66d4 ci: remove view engine test job (#43862)
Remove the view engine test job as view engine is no longer being tested on CI.  Additionally, update size
tracking to rely on test job instead of test_ivy_aot.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott 04b4209d71 ci: remove windows view engine test job (#43862)
Remove the windows view engine test job as view engine is no longer being tested on CI.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott f1e18493ca ci: remove saucelabs view engine tests (#43862)
Remove the view engine specific saucelabs test job and associated tags/tooling as view engine is no longer being tested
on CI.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott 442f520e48 build: remove ivy-aot bazel tag (#43862)
Remove the ivy-aot bazel tag from usage as it served a duplicate purpose as ivy-only which is now removed as both are
unneeded with Ivy as the default compiler used.

PR Close #43862
2021-10-19 10:06:57 -07:00
Joey Perrott 90ac77051d build: remove fixme-ivy-aot tag filter (#43862)
Remove the fixme-ivy-aot tag filter from usage as no targets are tagged with fixme-ivy-aot as ivy is now the
compiler used by default.

PR Close #43862
2021-10-19 10:06:56 -07:00
Joey Perrott 959f563fc9 build: remove "ivy-only" bazel tag (#43862)
Because all actions are assumed to be running on Ivy, things which only work on Ivy should not be marked as
Ivy only.

PR Close #43862
2021-10-19 10:06:56 -07:00
Joey Perrott 730511b948 build: rename "no-ivy-aot" tag to "view-engine-only" (#43862)
Using the tag "view-engine-only" better describes the expected usage of bazel targets with the test. They can
only be run with view engine.

PR Close #43862
2021-10-19 10:06:56 -07:00
Joey Perrott c3f677dbe6 build: remove test-ivy-aot yarn script (#43862)
Since building with ViewEngine is not longer desired on CI, removing the ivy vs non-ivy testing yarn scripts
is done, informing developers to instead use `yarn test` as all tests should be run using the Ivy complier.

PR Close #43862
2021-10-19 10:06:56 -07:00
Joey Perrott b75ee8d810 build: Use Ivy compiler for bazel builds by default (#43862)
Setting the angular_ivy_enabled environment variable to True will default Bazel builds to use the Ivy
compiler rather than defaulting to ViewEngine.

PR Close #43862
2021-10-19 10:06:56 -07:00
Joey Perrott b489ae5ecd ci: remove browserstack configuration (#43881)
Remove browserstack configuration from the repo as it is not used for our CI.

PR Close #43881
2021-10-18 15:00:23 -07:00
Pete Bacon Darwin c882b9fa8b fix(ngcc): support alternate wrapper function layout for UMD (#43879)
Recently rollup, used by ng-packagr, changed the position of parentheses
around its generated UMD wrapper functions.

This commit ensures that ngcc can handle both.

Fixes #43870

PR Close #43879
2021-10-18 14:57:03 -07:00
Andrew Kushnir fc6519c25a Revert "fix(compiler): support i18n interpolated only attribute bindings (#43815)" (#43882)
This reverts commit bba0a87055.

The reason for rollback: this change is breaking some targets in Google's codebase when there is no attribute value is displayed (attr.aria-label) when translated.

PR Close #43882
2021-10-18 13:16:01 -07:00
Kristiyan Kostadinov 14b492df26 fix(compiler): do not error if $any is used inside a listener (#43866)
Fixes that `$any` casts weren't being converted to statements inside listeners which resulted in a compiler error.

Fixes #43841.

PR Close #43866
2021-10-18 10:43:03 -07:00
George Kalpakas cbde9edace docs: fix a couple of random typos (#43878)
PR Close #43878
2021-10-18 10:41:34 -07:00
Andrew Scott dc6909ad3e fix(router): Do not clear currentNavigation if already set to next one (#43852)
Experimentation with the Router URL management exposed a situation where
the `currentNavigation` was being cleared in the `finalize` after the
`currentNavigation` was already set to the next one.

This change ensures that the `currentNavigation` is only cleared if the
id of the finalized transition matches the one on the
`currentNavigation` object.

PR Close #43852
2021-10-18 10:30:54 -07:00
Andrew Scott dbcc4bebee refactor(router): Remove use of browserUrlTree in scheduleNavigation (#43632)
There are no added tests here because the change is generally equivalent
to what was there before. The goal of that piece of code is to prevent
duplicate navigations due to the location synchronization code between
AngularJS and Angular. That is, the Angular router listens to the
`popstate` event and triggers navigations, but so does the AngularJS
router and triggers navigations through `router.navigateByUrl`. The
`setTimeout` in the Angular Router's `setUpLocationChangeListener` is
there to make this bit of code work: the 'popstate'/'hashchange'
navigation will necessarily come after the imperative nav triggered by
AngularJS's location sync.

Anyhow, in the long run, I would like to get rid of this bit of code
altogether. We should not have special handling for these cases. The
AngularJS/Angular location sync should either:

1. Not trigger a duplicate navigation in the first place
or
2. Be tolerant to processing the duplicate navigation.

In the short term, this change benefits the router while we investigate
removing this logic completely because now browserUrlTree has a single
responsiblity: to support `onSameUrlNavigation==='reload'`. This means
that we can work towards removing the `browserUrlTree` tracking from the
Router code at some point as well and have the `onSameUrlNavigation`
logic be part of a pre-navigation hook that can be handled outside the
`Router`. This may or may not be possible, but the change here opens up
that change for investigation.

PR Close #43632
2021-10-18 10:29:23 -07:00
David Shevitz db57e391cc docs: update getting started links to provide a more consistent user experience (#43872)
PR Close #43872
2021-10-18 09:25:36 -07:00
Pete Bacon Darwin 8c91e33d5d fix(compiler): support i18n interpolated only attribute bindings (#43815)
While fully dynamic bound properties (and attributes) cannot be marked for localization, properties that only contain interpolation can.

This commit ensure that attribute bindings that only contain interpolation can also be marked for localization.

Closes #43260

PR Close #43815
2021-10-18 09:24:42 -07:00
dario-piotrowicz ebc9b55dcf fix(docs-infra): add paddings to docs-card titles (#43859)
improve the aio docs-card title by adding some padding
so that it doesn't get too close to the card's edges

PR Close #43859
2021-10-18 09:23:19 -07:00
dario-piotrowicz 017748c477 fix(docs-infra): move security anchors outside callout elements (#43865)
two callout elements in the security guide have anchors
as their first child element instead of the callout's header
causing ugly/unwanted spacing, move the anchors above the
callout elements to fix such issue

PR Close #43865
2021-10-18 09:22:39 -07:00
Paul Gschwendtner ee2678ca42 build: update bazel integration test to rules_nodejs v4.4.1 (#43853)
Updates the Bazel integration test to `rules_nodejs` v4.4.1. Renovate
could not complete this update automatically because it is unable
to update the `package.json` and `lock` file due to there being
relative `file:` references.

PR Close #43853
2021-10-15 13:55:53 -07:00
Renovate Bot 0983eec7ab build: update all non-major dependencies (#43853)
Updates all non-major dependencies to their latest available
versions.

PR Close #43853
2021-10-15 13:55:53 -07:00
Pete Bacon Darwin 70c14ed66d build(docs-infra): add a box around CLI command line reference syntax (#43850)
This commit helps to make the section that describes an overview of the syntax of a CLI command stand out from the surrounding text.

Closes #26574

PR Close #43850
2021-10-15 11:35:47 -07:00
Andrew Scott 772e08d14e fix(router): fix Router's public API for canceledNavigationResolution (#43842)
The commit which made the `canceledNavigationResolution` property on the `Router`
public did not add the corresponding configuration in the `ExtraOptions`.
https://github.com/angular/angular/commit/3c6b653089837459809a370ebcaf8911c3bab9ed
This was a mistake and is being corrected in this commit. We should not
encourage changing the properties post-setup (i.e.
`inject(Router).canceledNavigationResolution = 'computed'`). This manner
of configuration makes the options non-tree shakeable because we have to
keep both implementations in case the value changes at runtime.

PR Close #43842
2021-10-15 11:35:02 -07:00
Younes Jaaidi 12dfc0e991 docs: add younes jaaidi to GDE resources (#43721)
PR Close #43721
2021-10-15 10:49:26 -07:00
Doug Parker 426a3ecae7 fix(compiler-cli): updates ngc to pass the build when only warnings are emitted (#43673)
Refs #42966.

Previously, a build when emitted one warning and no errors would fail with a non-zero exit code. This is not what users would expect, but had not been an issue before since the compiler did not actually emit any warnings. With upcoming extended template diagnostics and other warnings, this is now a case that needs to be supported. Warnings are printed to `stderr` as before, but `ngc` now exits with code `0` and the build is considered successful.

Implemented this by adding a new `expectedExitCode` parameter to `driveDiagnostics()` which asserts against the real exit code. Most importantly, it does not **require** the the build to pass since any exit code can be given, so it is up to the test to assert this as well as many messages printed to make sure they are acceptable. This is useful for testing warnings and ensuring the build still passes.

PR Close #43673
2021-10-15 10:17:39 -07:00
JoostK e3b4abe3db docs: include WrappedValue as removed API on deprecation page (#43685)
A rebase of #43507 seems to have inadvertently dropped the note about
the removed `WrappedValue` API from the deprecations page, so this
commit reintroduces the text.

PR Close #43685
2021-10-15 10:16:03 -07:00
dario-piotrowicz 7e5268174b fix(docs-infra): apply minor style fixes to aio contributor cards (#43844)
improve the aio contributors card by aligning centrally the
contributor's name and adding some padding so that it doesn't
get too close to the card's edges

Note: the name's aligning was already present by wrongly removed in
PR #43355

PR Close #43844
2021-10-15 10:12:59 -07:00
Joe Martin (Crowdstaffing) 91e73c4505 docs: internationalization topics (#43819)
Update links and code-examples.  Remove redundant comments.

PR Close #43819
2021-10-14 15:53:27 -07:00
Andrew Scott 68cdcd3259 Revert "refactor(router): clean up internal hooks (#43804)" (#43845)
This reverts commit 5cc51880db.

PR Close #43845
2021-10-14 14:43:41 -07:00
Renovate Bot de5a63ba40 build: update dependency @typescript-eslint/parser to v5 (#43807)
PR Close #43807
2021-10-14 10:14:49 -07:00
Andrew Scott 5f6e568dd6 refactor(router): clean up internal hooks (#43804)
* beforePreactivation hook is unused
* The only place that uses afterPreactivation does not use the arguments

Not to say we won't want to provide hooks similar to this in the future,
but the current state is over-engineered for what it's being used for.

PR Close #43804
2021-10-14 10:04:01 -07:00
Alan Agius 39cb30e2f2 docs: add missing value types to optimization configuration (#43839)
It appears that when the tables were changed from HTML to markdown some value types were lost. With this change we add the missing types and remove the commented out HTML content.

PR Close #43839
2021-10-14 10:01:57 -07:00
Alan Agius 342d642301 docs: remove no longer relevant sections in build page (#43837)
`Backward compatibility with Lighthouse` and `Backward compatibility with CSS grid` sections are no longer relevant since Internet Explorer is no longer supported.

PR Close #43837
2021-10-14 10:01:20 -07:00
Natalia Venditto 1c3afc9658 docs: add natalia venditto to GDE resources (#43825)
PR Close #43825
2021-10-14 10:00:02 -07:00
Joey Perrott 6113813300 docs: add missing split marker (#43830)
Due to an outdated version of ng-dev running during release the changelog generated did not include a split marker,
it should be added to avoid issues in the future.

PR Close #43830
2021-10-13 18:48:00 +00:00
Andrew Scott b5eccde447 release: cut the v13.0.0-rc.0 release (#43828) 2021-10-13 11:24:59 -07:00
Alan Agius 7ba9591a1d ci: remove rollup from renovate ignoreDeps (#43737)
We can now update to the latest rollup version.

PR Close #43737
2021-10-13 16:56:42 +00:00
Alan Agius 80449f4570 build: update rollup dependencies (#43737)
With this change we update `rollup` and remove the usage of no longer maintained `rollup-plugin-commonjs` and `rollup-plugin-node-resolve` plugins.

PR Close #43737
2021-10-13 16:56:42 +00:00
dario-piotrowicz b155bf71d0 refactor(docs-infra): remove unnecessary tsconfig.json file (#43818)
the tsconfig.json file in aio/content/examples does not seem necessary
anymore as it was only used for tslinting and tslint has been removed
from the examples in PR #43592 and PR #43746

PR Close #43818
2021-10-13 16:51:11 +00:00
Renovate Bot 567c8fad42 build: update dependency @typescript-eslint/eslint-plugin to v5 (#43806)
PR Close #43806
2021-10-13 16:49:50 +00:00
Joey Perrott 780082c025 build: update to cldr@39 (#43820)
Update repository to use cldr version 39 as it is the latest available.

PR Close #43820
2021-10-13 16:49:24 +00:00
Renovate Bot c6496350a9 build: update dependency @rollup/plugin-commonjs to v21 (#43675)
PR Close #43675
2021-10-13 16:48:46 +00:00
dario-piotrowicz 098d7ade70 docs(core): apply minor improvements to the InjectionToken's api docs (#43693)
PR Close #43693
2021-10-13 16:46:28 +00:00
Joe Martin (Crowdstaffing) ad832900b7 docs: update internationalization topics (#43722)
Add new $localize and Ivy content.  Clean up navigation.

PR Close #43722
2021-10-12 21:38:38 +00:00
Andrew Scott db01894791 docs: remove mention of router API that 'may be deprecated' (#43765)
The `params` and `queryParams` properties are listed in the deprecations as
properties that "may be deprecated in the future". We should not
document "maybe" deprecations. They are either deprecated or they are
not deprecated. For this case, there is no value in the deprecation
without a plan for how we will remove them. Once that is in place, we
can truly deprecate them.

PR Close #43765
2021-10-12 17:56:06 +00:00
dario-piotrowicz 663690fc86 fix(docs-infra): improve cancel icon in top-menu search (#43600)
webkit browsers show a cancel X icon in the input search on focus/hover
which allows to clear the content of the input, such icon has small
glitches/imperfections so use a mat-icon instead

(this also adds such icon to non-webkit browsers)

PR Close #43600
2021-10-12 17:50:30 +00:00
Joey Perrott 42f93418b6 docs: update CHANGELOG.md readme to include entry separators (#43799)
Add `<!-- CHANGELOG SPLIT MARKER -->` between changelog entries to match the expected
format of the CHANGELOG.md file for the repository tooling.

PR Close #43799
2021-10-12 17:49:20 +00:00
Renovate Bot af31781e10 build: lock file maintenance (#43793)
PR Close #43793
2021-10-12 17:48:28 +00:00
dario-piotrowicz 39f625a4e9 docs(animations): fix wrong code links present in the animations guide (#43787)
fix the links present in the animations guide under td elements written as
`<code>[text](link)()</code>` which are not rendered properly

Note:
  - the bug was introduced in PR #42885
  - the bug is only present for code blocks inside html block elements,
    the aforementioned format can be used in the inline html elements without issues

PR Close #43787
2021-10-12 17:48:00 +00:00
mgechev 154dda2eed docs: update ngUpgrade support message (#43704)
PR Close #43704
2021-10-12 17:46:15 +00:00
Alan Agius 27ba8033dc docs: update how to remove a configuration item (#43795)
To remove a configuration item, `undefined` needs to be used as value.
PR Close #43795
2021-10-12 17:44:56 +00:00
Alan Agius 8e9e27a1df docs: update config path in per user tracking section (#43795)
`cli.analyticsSharing.user` is not a valid config path. `cli.analyticsSharing.uuid` is the correct one.

Partially addresses https://github.com/angular/angular-cli/issues/21916

PR Close #43795
2021-10-12 17:44:56 +00:00
Alan Agius 05c03117bc ci: use Node.js browsers image (#43810)
Spinning up a Node.js browsers image has little to no overhead when the image is not cached on the host. `install_chrome_libs` however takes takes ~13s everytime.

PR Close #43810
2021-10-12 17:43:15 +00:00
Alan Agius 73c1570237 build(docs-infra): update min range of node versions (#43810)
Eslint 8 which is used in AIO requires Node.js `14.17.x` or later.

PR Close #43810
2021-10-12 17:43:15 +00:00
Alan Agius 791b6f47e4 ci: update default circle ci image to cimg/node:14.17.6 (#43810)
With this change we update Node.js version to 14.17 which is needed because of Eslint 8. Also, we replace the legacy images `circleci/node` with the new images `cimg/node`.

See: https://circleci.com/developer/images/image/cimg/node

PR Close #43810
2021-10-12 17:43:15 +00:00
Paul Gschwendtner a589aff3e4 ci: re-enable dev-app building in components-repo-unit-tests job (#43798)
Re-enables the building of the `src/dev-app` package in the components
repo when the components-repo-unit-test job runs. We previously disabled
the dev-app because it was not compatible with template typechecking of
ngtsc. This should be fixed now and can re-enable it.

This could be valuable for having some actual real test scenarios of
type checking.

PR Close #43798
2021-10-12 17:42:46 +00:00
Paul Gschwendtner 562137e16b ci: re-enable components-repo-unit-tests job after APF v13 adjustments (#43798)
The APF v13 changes have landed in the `angular/components` repository
so that the CI check can be re-enabled.

PR Close #43798
2021-10-12 17:42:46 +00:00
David Shevitz 44f3eeb32d docs: add redirect from angular.io/guide to angular.io/docs (#43341)
PR Close #43341
2021-10-12 17:41:49 +00:00
Daniel Díaz 631769ca85 docs: fix typo in hierarchical injectors file (#43652)
PR Close #43652
2021-10-12 17:41:25 +00:00
Kristiyan Kostadinov 7396021e4b fix(core): avoid duplicating comments in TestBed teardown migration (#43776)
Currently the TestBed teardown migration is set up in a similar way to all other migrations where we take a `CallExpression`, add a parameter to it, print it, and replace the existing call. The problem is that doing so while preserving the `expression` of the original `CallExpression` can cause comments to be duplicated. This can happen quite frequently, because by default the CLI generates comments before `initTestModule` calls.

To work around it, these changes make the migration more precise by inserting a new parameter or replacing and existing one using string manipulation.

This requires a bit more code, but it's more reliable than the following alternatives:
1. Using `getFullStart` and `getFullWidth` to replace the node. This would work with our current setup, but the problem is that `getFullStart` also includes whitespace and newlines before the leading comment. This can cause us to mess up the user's formatting and figuring out which whitespace to keep and which one to remove is tricky.
2. Recreating the `CallExpression.expression` when constructing the new node. This would also work since it'll drop any existing comments, but the problem is that `CallExpression.expression` can be a wide variety of nodes which we would have to account for. We can't use `getMutableClone`, because it preserves the comments.

Fixes #43739.

PR Close #43776
2021-10-11 17:18:55 +00:00
dario-piotrowicz 6b9045213d refactor(docs-infra): remove tslint from cli systemjs examples (#43746)
remove the deprecated tslint from the examples of type systemjs

note: eslint hasn't be applied and linting has been removed entirely
to follow angular's unopinionated view on linting

PR Close #43746
2021-10-11 17:14:30 +00:00
Renovate Bot 2a67227ab3 build: update dependency jsdom to v18 (#43786)
PR Close #43786
2021-10-11 16:44:47 +00:00
Thomas Turrell-Croft ef1a70fc53 docs: Formalize language describing HttpClient (#43778)
PR Close #43778
2021-10-11 16:43:16 +00:00
Tanguy Nodet bfb2b81556 docs: add missing declaration of CartComponent in tutorial (#43774)
PR Close #43774
2021-10-11 16:42:36 +00:00
Paul Gschwendtner bc36814f0d build: update karma-sauce-launcher to latest version with heartbeat to prevent idle timeout (#43659)
Updates the `karma-sauce-launcher` to the latest version that comes with
the heartbeat implemented. Whenever we create an instance of a browser
in Saucelabs, we need to send a Selenium command every X seconds as otherwise
Saucelabs will terminate the session due to it thinking the session is already
unused. This is especially a problem for Karma unit tests as there is no
selenium command at all, except for the initial one loading the Karma site.

The latest version of the launcher has implemented an interval that
dispatches a noop selenium command every X seconds to notify Saucelabs
that the instance is still active.

The current version of the launcher does not do that. This is likely
the source of some disconnects because after 10-13min, the SL browser
is terminated but Karma still waits some minute after realizing the
browser is actually disconnected.

We (the Angular team), contributed to that version in the past since
the heartbeat was very flaky.. and we removed it. With the new version
a lot has changed, the underlying Selenium client has changed so it's
worth trying again with the heartbeat re-implemented; it worked pretty
well so far in the COMP repo).

PR Close #43659
2021-10-11 16:41:28 +00:00
dario-piotrowicz 1869474386 refactor(docs-infra): remove linting from i18n example angular.json (#43747)
remove linting from the i18n angular.json example as that is no longer
present in the boilerplace angular.json (and the two should be kept in
sync)

note: the linting was removed from the boilerplate angular.json file in PR #43592

PR Close #43747
2021-10-08 20:42:01 +00:00
Doug Parker 978ac81af5 docs: update CSP section to mention Angular's minimum requirements (#43553)
Closes angular/angular-cli#21711.
Refs #6361, #37631.

PR Close #43553
2021-10-08 20:40:54 +00:00
George Kalpakas 7778cb3680 fix(docs-infra): ensure SwUpdatesService is instantiated (#43766)
In 305d05545a, we accidentally stopped
instantiating the `SwUpdatesService` service, which meant that we were
no longer subscribing to ServiceWorker update events and proactively
checking for updates. We would still gets updates, because the
ServiceWorker automatically checks on each navigation request and when a
new ServiceWorker instance is created, but we would not proactively
fetch updates and also miss `unrecoverable` errors.

This commit fixes this by exposing an `enable()` method from
`SwUpdatesService`, which has to be explicitly called for the service to
be enabled, and ensures that the method is called when `AppComponent` is
initialized.
The commit also gets rid of the `SwUpdatesModule` (whose only purpose
was to provide `SwUpdatesService`) in favor of using `providedIn`.

Fixes #43695

PR Close #43766
2021-10-08 20:39:46 +00:00
markostanimirovic af11d3b721 docs: fix forms in template examples (#43772)
PR Close #43772
2021-10-08 20:39:13 +00:00
George Kalpakas a64adabf65 fix(docs-infra): avoid prepending version info to error messages twice (#43767)
Previously, we used to prepend version info to error messages by
updating their `message` property and their `stack` property. However,
due to the fact that on some browsers `error.stack` is lazily computed
based on `error.message` the first time the `stack` property is
accessed, this resulted in prepending the version info twice.

This commit ensures that the version info is only prepended to
`error.stack` once to avoid unnecessary repetition in error messages.

PR Close #43767
2021-10-08 20:17:59 +00:00
George Kalpakas e2bf4e442a ci: avoid testing angular.io against RxJS v7 twice (#43767)
Previously, we used to run the angular.io unit tests against both RxJS
v6 (which was the version specified in `package.json`) and RxJS v7 on
CI, as a way to guard against future regressions with RxJS v7.

Now that `package.json` has been updated to RxJS v7, there is no reason
to explicitly re-run the unit test against RxJS v7 on CI, so this commit
removes the corresponding steps.

PR Close #43767
2021-10-08 20:17:59 +00:00
George Kalpakas 6194696340 fix(docs-infra): fix Sass rule resulting in invalid CSS (#43767)
The way the Sass rule was defined previously resulted in invalid CSS of
the form:
```css
table > thead > { ... }
```

This, in turn, resulted in a build-time warning:
```
Warning:  > styles.9a5a35b070498c08.css:3079:14: warning: Unexpected "{"
    3079 │ table thead > {
         ╵               ^
```

This commit fixes the affected rule (mostly to avoid the warning,
because this change doesn't seem to have any visual difference). It also
fixes other rules that were currently not affected (because they only
had nested rules and no direct styles), but were susceptible to being
affected in the future.

PR Close #43767
2021-10-08 20:17:59 +00:00
George Kalpakas d049a61f2a docs: use correct service name when creating error handler in http example (#43767)
PR Close #43767
2021-10-08 20:17:59 +00:00
Joey Perrott 7e858f362c build: update to latest @angular/dev-infra-private (#43785)
Update to the latest version of the dev infra packages to allow for merging deprecations during the feature
freeze period.

PR Close #43785
2021-10-08 20:15:36 +00:00
Alan Agius 747553dd68 docs: deprecate ViewEngine-based renderModuleFactory (#43757)
DEPRECATED:

The `renderModuleFactory` symbol in `@angular/platform-server` is no longer necessary as of Angular v13.

The `renderModuleFactory` calls can be replaced with `renderModule`.

PR Close #43757
2021-10-07 16:47:54 -07:00
Renovate Bot 06a87c4a65 build: update all non-major dependencies (#43760)
PR Close #43760
2021-10-07 20:56:11 +00:00
hchiam f8ae6ff08e docs(docs-infra): fix a11y of external links (#43725)
prevent screen readers from falsely announcing "open_in_new" since they may not actually open new tabs/windows but simply send the current page to a domain outside angular.io

Fixes #43512

PR Close #43725
2021-10-07 20:55:24 +00:00
Andrew Scott aef18bcbd6 release: cut the v13.0.0-next.15 release (#43769) 2021-10-07 12:08:50 -07:00
Dylan Hunn 325fafad70 release: cut the v13.0.0-next.14 release (#43751) (#43768)
PR Close #43751

PR Close #43768
2021-10-07 19:03:42 +00:00
Paul Gschwendtner d977701a43 feat(bazel): allow for custom conditions to be set in ng_package targets (#43764)
The APF v13 `ng_package` rule will generate the `exports` field if not
set. Currently it allows for additional subpath entries to be configured
manually. The packager does not allow for custom conditions in subpath
exports which are auto-generated.

This is sometimes useful and necessary though. e.g. in Angular Material,
we also need to expose the index Sass file through a `sass` conditional
that the Webpack Sass loader will pick up. For this, the packager needs
to support manual additional conditions (as long as they do not
conflict).

PR Close #43764
2021-10-07 16:50:50 +00:00
819 changed files with 32689 additions and 58998 deletions
+12 -3
View File
@@ -84,9 +84,8 @@ query --deleted_packages=integration/bazel,integration/bazel/src,integration/baz
################################
# Temporary Settings for Ivy #
################################
# To determine if the compiler used should be Ivy instead of ViewEngine, one can use `--config=ivy`
# on any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
build --define=angular_ivy_enabled=False
# Set the default compiler used for bazel builds to be Ivy.
build --define=angular_ivy_enabled=True
build:view-engine --define=angular_ivy_enabled=False
build:ivy --define=angular_ivy_enabled=True
@@ -143,6 +142,16 @@ test:saucelabs --flaky_test_attempts=1
# --ng_perf will ask the Ivy compiler to produce performance results for each build.
build --flag_alias=ng_perf=//packages/compiler-cli:ng_perf
#####################################################################
# Folders to ignore for integration tests (nested Bazel workspaces) #
#####################################################################
# The nested Bazel integration test workspace should not be analysed as part of
# Skyframe, but should also not be ignored in order to be able to glob for its files.
# TODO: Simplify this once https://github.com/bazelbuild/bazel/issues/12034 is fixed
build --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e,integration/bazel/tools,integration/bazel/tools/angular
query --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e,integration/bazel/tools,integration/bazel/tools/angular
####################################################
# User bazel configuration
# NOTE: This needs to be the *last* entry in the config.
+37 -154
View File
@@ -24,19 +24,19 @@ version: 2.1
# **NOTE 2 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
# **NOTE 3 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v5-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_3: &cache_key v6-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
# folder will contain all previously used versions and ultimately cause the cache restoring to
# be slower due to its growing size.
var_4: &cache_key_fallback v5-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
var_4: &cache_key_fallback v6-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
# Windows needs its own cache key because binaries in node_modules are different.
var_3_win: &cache_key_win v5-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v5-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
var_3_win: &cache_key_win v6-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v6-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
var_5: &components_repo_unit_tests_cache_key v1-angular-components-{{ checksum "month.txt" }}-db18b4093f23ae5c0ef76f6a9699c670ee5d55f7
var_5: &components_repo_unit_tests_cache_key v1-angular-components-{{ checksum "month.txt" }}-83da73fb621720fbe801d3a503d50fd82b3da0c8
var_6: &components_repo_unit_tests_cache_key_fallback v1-angular-components-{{ checksum "month.txt" }}
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages`.
@@ -86,7 +86,17 @@ executors:
type: string
default: medium
docker:
- image: circleci/node:14.16.1@sha256:951e12268fe692615bfd155c327bd910e10c99db98404badd03879f984c32b31
- image: cimg/node:14.17.6@sha256:589b5e494173bfb48923fa8d29b010b4d17079ac98d08de95dd4a78e57f5aa0b
resource_class: << parameters.resource_class >>
working_directory: ~/ng
test-browser-executor:
parameters:
resource_class:
type: string
default: medium
docker:
- image: cimg/node:14.17.6-browsers@sha256:aa6d08a04d13dd8aa18ae94be70a703c14dde0e99ea572e885e548f47f95eaa9
resource_class: << parameters.resource_class >>
working_directory: ~/ng
@@ -118,22 +128,6 @@ commands:
- attach_workspace:
at: *workspace_location
# Install shared libs used by Chrome that is either provisioned by
# rules_webtesting or by puppeteer.
install_chrome_libs:
description: Install shared Chrome libs
steps:
- run:
name: Install shared Chrome libs
command: |
sudo apt-get update
# Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2)
# and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1)
# which are dependencies of chrome & needed for karma & protractor headless chrome tests.
# This is a very small install which takes around 7s in comparing to using the full
# circleci/node:x.x.x-browsers image.
sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1
# Install java runtime which is required by some integration tests such as
# //integration:hello_world__closure_test, //integration:i18n_test and
# //integration:ng_elements_test to run the closure compiler
@@ -298,7 +292,7 @@ jobs:
test:
executor:
name: default-executor
name: test-browser-executor
# Now that large integration tests are running locally in parallel (they can't run on RBE yet
# as they require network access for yarn install), this test is running out of memory
# consistently with the xlarge machine.
@@ -307,28 +301,13 @@ jobs:
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- install_java
- run:
command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
# We need to explicitly specify the --symlink_prefix option because otherwise we would
# not be able to easily find the output bin directory when uploading artifacts for size
# measurements.
command: yarn test --symlink_prefix=dist/ -- //...
no_output_timeout: 20m
# Temporary job to test what will happen when we flip the Ivy flag to true
test_ivy_aot:
executor:
name: default-executor
resource_class: xlarge
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
# We need to explicitly specify the --symlink_prefix option because otherwise we would
# not be able to easily find the output bin directory when uploading artifacts for size
# measurements.
- run:
command: yarn test-ivy-aot //... --symlink_prefix=dist/
no_output_timeout: 20m
# Publish bundle artifacts which will be used to calculate the size change. **Note**: Make
# sure that the size plugin from the Angular robot fetches the artifacts from this CircleCI
# job (see .github/angular-robot.yml). Additionally any artifacts need to be stored with the
@@ -349,7 +328,7 @@ jobs:
destination: core/todo/bundle.br
# NOTE: This is currently limited to master builds only. See the `monitoring` configuration.
saucelabs_view_engine:
saucelabs:
executor:
name: default-executor
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
@@ -361,47 +340,22 @@ jobs:
- init_environment
- init_saucelabs_environment
- run:
name: Run Bazel tests on Saucelabs with ViewEngine
name: Run Bazel tests on Saucelabs
# See /tools/saucelabs/README.md for more info
command: |
yarn bazel run //tools/saucelabs:sauce_service_setup
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "view-engine-only", ...) except attr("tags", "fixme-saucelabs", ...)')
yarn bazel test --config=saucelabs ${TESTS}
yarn bazel run //tools/saucelabs:sauce_service_stop
no_output_timeout: 40m
- notify_webhook_on_fail:
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
# NOTE: This is currently limited to master builds only. See the `monitoring` configuration.
saucelabs_ivy:
executor:
name: default-executor
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
# container for this job. This is necessary because we launch a lot of browsers concurrently
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
resource_class: xlarge
steps:
- custom_attach_workspace
- init_environment
- init_saucelabs_environment
- run:
name: Run Bazel tests on Saucelabs with Ivy
# See /tools/saucelabs/README.md for more info
command: |
yarn bazel run //tools/saucelabs:sauce_service_setup
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
yarn bazel run //tools/saucelabs:sauce_service_stop
no_output_timeout: 40m
- notify_webhook_on_fail:
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
test_aio:
executor: default-executor
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
# Build aio
- run: yarn --cwd aio build --progress=false
# Lint the code
@@ -420,23 +374,19 @@ jobs:
- run: yarn --cwd aio redirects-test
deploy_aio:
executor: default-executor
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
# Deploy angular.io to production (if necessary)
- run: setPublicVar_CI_STABLE_BRANCH
- run: yarn --cwd aio deploy-production
test_aio_local:
executor: default-executor
environment:
RXJS_VERSION_7: '7.4.0'
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
# Build aio (with local Angular packages)
- run: yarn --cwd aio build-local-ci
# Run unit tests
@@ -447,17 +397,6 @@ jobs:
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
# Check the bundle sizes.
- run: yarn --cwd aio payload-size aio-local
# Run tests with RxJS v7.
- run: yarn --cwd aio add rxjs@$RXJS_VERSION_7 && yarn --cwd aio aio-use-local
- run:
name: Ensure we use RxJS v7
command: >-
node --eval "
const expected = process.env.RXJS_VERSION_7;
const actual = require('./aio/node_modules/rxjs/package.json').version;
assert(actual === expected, 'Expected RxJS v' + expected + ', but found v' + actual + '.');
"
- run: yarn --cwd aio test --progress=false --watch=false
test_aio_tools:
executor: default-executor
@@ -473,33 +412,18 @@ jobs:
test_docs_examples:
executor:
name: default-executor
name: test-browser-executor
resource_class: xlarge
parallelism: 5
environment:
RXJS_VERSION_7: '7.4.0'
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
- run: yarn --cwd aio example-e2e --setup --local --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
# Run tests with RxJS v7.
- run: yarn --cwd aio/tools/examples/shared add rxjs@$RXJS_VERSION_7 && yarn --cwd aio example-use-local && yarn --cwd aio boilerplate:add
- run:
name: Ensure we use RxJS v7
command: >-
node --eval "
const expected = process.env.RXJS_VERSION_7;
const actual = require('./aio/tools/examples/shared/node_modules/rxjs/package.json').version;
assert(actual === expected, 'Expected RxJS v' + expected + ', but found v' + actual + '.');
"
# Exclude some examples that are not yet compatible with v7.
- run: yarn --cwd aio example-e2e --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} --exclude=practical-observable-usage --exclude=upgrade-module --exclude=upgrade-phonecat
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
aio_preview:
@@ -519,11 +443,10 @@ jobs:
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
test_aio_preview:
executor: default-executor
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- run:
name: Wait for preview and run tests
@@ -535,8 +458,6 @@ jobs:
# 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.
# Build the view engine npm packages. No new jobs should depend on this.
build-npm-packages:
executor:
name: default-executor
@@ -631,11 +552,10 @@ jobs:
command: yarn node aio/scripts/test-external-urls.js
aio_monitoring_stable:
executor: default-executor
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- run: setPublicVar_CI_STABLE_BRANCH
- run:
name: Check out `aio/` and yarn from the stable branch
@@ -654,11 +574,10 @@ jobs:
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
aio_monitoring_next:
executor: default-executor
executor: test-browser-executor
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- run:
name: Run tests against https://next.angular.io/
command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE
@@ -804,31 +723,13 @@ jobs:
- setup_win
- run:
name: Build all windows CI targets
command: bazel build --build_tag_filters=-ivy-only //packages/compiler-cli/...
command: bazel build --build_tag_filters=-view-engine-only //packages/compiler-cli/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: bazel test --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/...
command: bazel test --test_tag_filters="-view-engine-only,-browser:chromium-local" //packages/compiler-cli/...
no_output_timeout: 15m
test_ivy_aot_win:
executor: windows-executor
steps:
- setup_win
- run:
name: Build all windows CI targets
command: bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: bazel test --config=ivy --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //packages/localize/...
no_output_timeout: 15m
# Save dependencies to use on subsequent runs.
- save_cache:
key: *cache_key_win
paths:
- ~/.cache/yarn
workflows:
version: 2
default_workflow:
@@ -843,9 +744,6 @@ workflows:
- test:
requires:
- setup
- test_ivy_aot:
requires:
- setup
- build-npm-packages:
requires:
- setup
@@ -883,7 +781,6 @@ workflows:
requires:
# Only publish if tests and integration tests pass
- test
- test_ivy_aot
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local
- test_docs_examples
@@ -891,20 +788,15 @@ workflows:
# since the publishing script expects the legacy outputs layout.
- build-npm-packages
- legacy-unit-tests-saucelabs
# TODO(devversion): re-enable once the Angular components repo has been updated to deal
# with partial compilation APF v13 package output (i.e. with the linker processing).
#- components-repo-unit-tests:
# requires:
# - build-npm-packages
- components-repo-unit-tests:
requires:
- build-npm-packages
- test_zonejs:
requires:
- setup
- test_win:
requires:
- setup
- test_ivy_aot_win:
requires:
- setup
monitoring:
jobs:
@@ -918,16 +810,7 @@ workflows:
- aio_monitoring_next:
requires:
- setup
- saucelabs_ivy:
# Testing saucelabs via Bazel currently taking longer than the legacy saucelabs job as it
# each karma_web_test target is provisioning and tearing down browsers which is adding
# a lot of overhead. Running once daily on master only to avoid wasting resources and
# slowing down CI for PRs.
# TODO: Run this job on all branches (including PRs) once karma_web_test targets can
# share provisioned browsers and we can remove the legacy saucelabs job.
requires:
- setup
- saucelabs_view_engine:
- saucelabs:
# Testing saucelabs via Bazel currently taking longer than the legacy saucelabs job as it
# each karma_web_test target is provisioning and tearing down browsers which is adding
# a lot of overhead. Running once daily on master only to avoid wasting resources and
+1 -1
View File
@@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
setPublicVar COMPONENTS_REPO_BRANCH "master"
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
setPublicVar COMPONENTS_REPO_COMMIT "db18b4093f23ae5c0ef76f6a9699c670ee5d55f7"
setPublicVar COMPONENTS_REPO_COMMIT "83da73fb621720fbe801d3a503d50fd82b3da0c8"
####################################################################################################
+2 -2
View File
@@ -41,8 +41,8 @@ copy .circleci\bazel.windows.rc ${Env:USERPROFILE}\.bazelrc
####################################################################################################
# Install specific version of node.
####################################################################################################
nvm install 14.16.1
nvm use 14.16.1
nvm install 14.17.6
nvm use 14.17.6
# These Bazel prereqs aren't needed because the CircleCI image already includes them.
# choco install yarn --version 1.16.0 --no-progress
+1 -1
View File
@@ -1,7 +1,7 @@
# Image metadata and config.
# Ideally, the Node.js version should match what we use on CI.
# See `executors > default-executor` in `.circleci/config.yml`.
FROM circleci/node:14-browsers
FROM cimg/node:14-browsers
LABEL name="Angular dev environment" \
+1 -1
View File
@@ -59,7 +59,7 @@ body:
- type: textarea
id: environment
attributes:
label: Please provide the environment you discovered this bug in
label: Please provide the environment you discovered this bug in (run `ng version`)
render: true
placeholder: |
Angular CLI: 12.0.5
@@ -1,6 +0,0 @@
---
name: Security Issue Disclosure
about: Report a security issue in Angular Framework, Material, or CLI
---
Please read https://angular.io/guide/security#report-issues on how to disclose security related issues.
@@ -1,11 +0,0 @@
---
name: "Support Request"
about: Questions and requests for support
---
Please do not file questions or support requests on the GitHub issues tracker.
You can get your questions answered using other communication channels. Please see:
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Thank you!
-8
View File
@@ -1,8 +0,0 @@
---
name: "Angular CLI"
about: Issues and feature requests for Angular CLI
---
Please file any Angular CLI issues at: https://github.com/angular/angular-cli/issues/new
For the time being, we keep Angular CLI issues in a separate repository.
@@ -1,8 +0,0 @@
---
name: "Angular Components"
about: Issues and feature requests for Angular Components
---
Please file any Angular Components issues at: https://github.com/angular/components/issues/new
For the time being, we keep Angular Components issues in a separate repository.
+14
View File
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Security issue disclosure
url: https://angular.io/guide/security#report-issues
about: Report a security issue in Angular Framework, CDK, Material, or CLI
- name: Angular CLI
url: https://github.com/angular/angular/issues/new/choose
about: Issues and feature requests for Angular CLI
- name: Angular Material and Components Development Kit (CDK)
url: https://github.com/angular/components/issues/new/choose
about: Issues and feature requests for Angular Material
- name: Support Request
url: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
about: Questions and requests for support
+1 -3
View File
@@ -4,7 +4,7 @@
size:
disabled: false
maxSizeIncrease: 2000
circleCiStatusName: 'ci/circleci: test_ivy_aot'
circleCiStatusName: 'ci/circleci: test'
# options for the merge plugin
merge:
@@ -100,7 +100,6 @@ merge:
# list of labels that a PR needs to have, checked with a regexp (e.g. "target:" will work for the label "target: master")
requiredLabels:
- 'target: *'
- 'cla: yes'
# list of labels that a PR shouldn't have, checked after the required labels with a regexp
forbiddenLabels:
@@ -108,7 +107,6 @@ merge:
- 'action: cleanup'
- 'action: review'
- 'state: blocked'
- 'cla: no'
# list of PR statuses that need to be successful
requiredStatuses:
+2 -2
View File
@@ -5,10 +5,10 @@ on:
types: [opened, synchronize, reopened]
jobs:
breaking-changes-label:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: angular/dev-infra/github-actions/breaking-changes-label@861dc90572784e714aeaa9dfb20ceebeb57cdb07
- uses: angular/dev-infra/github-actions/commit-message-based-labels@88d1b37354dad996d399f8ca0ace6cd1ba7e3307
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/feature-request@f83903fe1ac848407ef81465f66588e5accb6537
- uses: angular/dev-infra/github-actions/feature-request@9f4129ec12a88d58239eed4757c42acf30a73544
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@7679cff885633cd33bf5ac7922a5304e8971a5a6
- uses: angular/dev-infra/github-actions/lock-closed@88d1b37354dad996d399f8ca0ace6cd1ba7e3307
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
+1 -1
View File
@@ -1 +1 @@
14.16.1
14.17.6
+13 -8
View File
@@ -180,6 +180,7 @@ groups:
- crisbeto # Kristiyan Kostadinov
- devversion # Paul Gschwendtner
- dgp1130 # Doug Parker
- dylhunn # Dylan Hunn
- filipesilva # Filipe Silva
- gkalpak # Georgios Kalpakas
- gregmagolan # Greg Magolan
@@ -544,7 +545,7 @@ groups:
'packages/compiler-cli/src/extract_i18n.ts',
'packages/localize/**',
'aio/content/guide/i18n-overview.md',
'aio/content/guide/i18n-common.md',
'aio/content/guide/i18n-common-overview.md',
'aio/content/guide/i18n-common-add-package.md',
'aio/content/guide/i18n-common-locale-id.md',
'aio/content/guide/i18n-common-format-data-locale.md',
@@ -553,8 +554,8 @@ groups:
'aio/content/guide/i18n-common-merge.md',
'aio/content/guide/i18n-common-deploy.md',
'aio/content/guide/i18n-example.md',
'aio/content/guide/i18n-optional.md',
'aio/content/guide/i18n-optional-manual-source-locale.md',
'aio/content/guide/i18n-optional-overview.md',
'aio/content/guide/i18n-optional-manual-runtime-locale.md',
'aio/content/guide/i18n-optional-import-global-variants.md',
'aio/content/guide/i18n-optional-manage-marked-text.md',
'aio/content/examples/i18n/**'
@@ -983,6 +984,7 @@ groups:
'aio/content/guide/updating.md',
'aio/content/guide/deprecations.md',
'aio/content/guide/migration-legacy-message-id.md',
'aio/content/examples/deprecation-guide/**',
'aio/content/guide/migration-renderer.md',
'aio/content/guide/migration-undecorated-classes.md',
'aio/content/guide/migration-dynamic-flag.md',
@@ -990,7 +992,7 @@ groups:
'aio/content/guide/migration-localize.md',
'aio/content/guide/migration-module-with-providers.md',
'aio/content/guide/static-query-migration.md',
'aio/content/guide/updating-to-version-12.md',
'aio/content/guide/update-to-latest-version.md',
'aio/content/guide/ivy-compatibility.md',
'aio/content/guide/ivy-compatibility-examples.md'
])
@@ -1088,9 +1090,11 @@ groups:
- *can-be-global-docs-approved
- >
contains_any_globs(files, [
'aio/content/examples/angular-linker-plugin/webpack.config.mjs',
'aio/content/guide/creating-libraries.md',
'aio/content/guide/libraries.md',
'aio/content/guide/using-libraries.md'
'aio/content/guide/using-libraries.md',
'aio/content/guide/angular-package-format.md'
])
reviewers:
users:
@@ -1222,6 +1226,7 @@ groups:
contains_any_globs(files.exclude("goldens/public-api/manage.js"), [
'goldens/public-api/**',
'docs/NAMING.md',
'aio/content/guide/angular-package-format.md',
'aio/content/errors/*.md',
'aio/content/guide/glossary.md',
'aio/content/guide/styleguide.md',
@@ -1235,10 +1240,10 @@ groups:
- IgorMinar
- alxhub
- atscott
- dylhunn
- jelbourn
- petebacondarwin
- jessicajaniuk
- zarend
# OOO as of 2020-09-28 - pkozlowski-opensource
reviews:
request: 4 # Request reviews from four people
@@ -1264,10 +1269,10 @@ groups:
- IgorMinar
- alxhub
- atscott
- dylhunn
- jelbourn
- petebacondarwin
- jessicajaniuk
- zarend
# OOO as of 2020-09-28 - pkozlowski-opensource
reviews:
request: 4 # Request reviews from four people
@@ -1293,10 +1298,10 @@ groups:
- IgorMinar
- alxhub
- atscott
- dylhunn
- jelbourn
- petebacondarwin
- jessicajaniuk
- zarend
# OOO as of 2020-09-28 - pkozlowski-opensource
####################################################################################
+2 -2
View File
@@ -12,9 +12,9 @@ To use the recommended configurations follow the steps below:
- copy (or link) `.vscode/recommended-tasks.json` to `.vscode/tasks.json`
- restart the editor
If you already have your custom workspace settings you should instead manually merge the file contents.
If you already have your custom workspace settings, you should instead manually merge the file contents.
This isn't an automatic process so you will need to repeat it when settings are updated.
This isn't an automatic process, so you will need to repeat it when settings are updated.
To see the recommended extensions select "Extensions: Show Recommended Extensions" in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
-3
View File
@@ -39,7 +39,6 @@
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test/acceptance",
"--config=debug"
],
@@ -57,7 +56,6 @@
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test/render3",
"--config=debug"
],
@@ -75,7 +73,6 @@
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test",
"--config=debug"
],
-4
View File
@@ -9,7 +9,6 @@
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test",
"packages/core/test/acceptance",
"packages/core/test/render3",
@@ -42,7 +41,6 @@
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test/acceptance",
],
"group": "test",
@@ -71,7 +69,6 @@
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test",
],
"group": "test",
@@ -100,7 +97,6 @@
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"--config=ivy",
"packages/core/test/render3",
],
"group": "test",
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,4 +2,4 @@
# yarn lockfile v1
yarn-path ".yarn/releases/yarn-1.22.10.cjs"
yarn-path ".yarn/releases/yarn-1.22.17.cjs"
+585 -605
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -58,9 +58,9 @@ If you would like to *implement* a new feature, please consider the size of the
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
Before you submit an issue, please search the issue tracker. An issue for your problem might already exist and the discussion might inform you of workarounds readily available.
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
We want to fix all the issues as soon as possible, but before fixing a bug, we need to reproduce and confirm it.
In order to reproduce bugs, we require that you provide a minimal reproduction.
Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions.
@@ -259,7 +259,7 @@ The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is opti
Must be one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
* **ci**: Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
+1 -1
View File
@@ -112,7 +112,7 @@ Read through our [contributing guidelines][contributing] to learn about our subm
### Want to Help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing][contributing] and then check out one of our issues labeled as <kbd>[help wanted](https://github.com/angular/angular/labels/help%20wanted)</kbd> or <kbd>[good first issue](https://github.com/angular/angular/labels/good%20first%20issue)</kbd>.
Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing][contributing] and then check out one of our issues labeled as <kbd>[help wanted](https://github.com/angular/angular/labels/help%20wanted)</kbd> or <kbd>[good first issue](https://github.com/angular/angular/labels/good%20first%20issue)</kbd>.
### Code of Conduct
+4 -10
View File
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "3635797a96c7bfcd0d265dacd722a07335e64d6ded9834af8d3f1b7ba5a25bba",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.3.0/rules_nodejs-4.3.0.tar.gz"],
sha256 = "4913ea835810c195df24d3a929315c29a64566cc48e409d8b0f35008b4e02e59",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.4/rules_nodejs-4.4.4.tar.gz"],
)
# The PKG rules are needed to build tar packages for integration tests. The builtin
@@ -32,7 +32,7 @@ check_rules_nodejs_version(minimum_version_string = "2.2.0")
# Setup the Node.js toolchain
node_repositories(
node_version = "14.16.1",
node_version = "14.17.6",
package_json = ["//:package.json"],
)
@@ -71,13 +71,7 @@ load("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_data
cldr_data_repository(
name = "cldr_data",
# Since we use the Github archives for CLDR 37, we need to specify a path
# to the available locales. This wouldn't be needed with CLDR 39 as that
# comes with an official JSON archive not containing a version suffix.
available_locales_path = "cldr-core-37.0.0/availableLocales.json",
urls = {
"https://github.com/unicode-cldr/cldr-core/archive/37.0.0.zip": "32b5c49c3874aa342b90412c207b42e7aefb2435295891fb714c34ce58b3c706",
"https://github.com/unicode-cldr/cldr-dates-full/archive/37.0.0.zip": "e1c410dd8ad7d75df4a5393efaf5d28f0d56c0fa126c5d66e171a3f21a988a1e",
"https://github.com/unicode-cldr/cldr-numbers-full/archive/37.0.0.zip": "a921b90cf7f436e63fbdd55880f96e39a203acd9e174b0ceafa20a02c242a12e",
"https://github.com/unicode-org/cldr-json/releases/download/39.0.0/cldr-39.0.0-json-full.zip": "a631764b6bb7967fab8cc351aff3ffa3f430a23646899976dd9d65801446def6",
},
)
+3
View File
@@ -6,6 +6,9 @@
/src/generated
/tmp
# Cache folder for the Angular CLI.
.angular/cache
# dependencies
/node_modules
@@ -6,4 +6,4 @@ TODO (gkalpak): Add docs. Mention:
Relevant files: `aio/aio-builds-setup/scripts/test.sh`
- Deploying from CI.
Relevant files: `.circleci/config.yml`, `scripts/ci/deploy.sh`, `aio/scripts/build-artifacts.sh`,
`aio/scripts/deploy-to-firebase.js`
`aio/scripts/deploy-to-firebase/index.mjs`
+75
View File
@@ -0,0 +1,75 @@
# Persistent disk cache
Angular CLI saves a number of cachable operations on disk by default.
When you re-run the same build, the build system restores the state of the previous build and re-uses previously performed operations, which decreases the time taken to build and test your applications and libraries.
To amend the default cache settings, add the `cli.cache` object to your [Workspace Configuration](guide/workspace-config).
The object goes under `cli.cache` at the top level of the file, outside the `projects` sections.
```json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"cache": {
...
}
},
"projects": {}
}
```
For more information, see [cache options](guide/workspace-config#cache-options).
### Enabling and disabling the cache
Caching is enabled by default. To disable caching run the following command:
```bash
ng config cli.cache.enabled false
```
To re-enable caching, set `cli.cache.enabled` to `true`.
### Cache environments
By default, disk cache is only enabled for local environments.
To enable caching for all environments, run the following command:
```bash
ng config cli.cache.environment all
```
For more information, see `environment` in [cache options](guide/workspace-config#cache-options).
<div class="alert is-helpful">
The Angular CLI checks for the presence and value of the `CI` environment variable to determine in which environment it is running.
</div>
### Cache path
By default, `.angular/cache` is used as a base directory to store cache results. To change this path, run the following command:
```bash
ng config cli.cache.path ".cache/ng"
```
### Clearing the cache
To clear the cache, run one of the following commands.
To clear the cache on Unix-based operating systems:
```bash
rm -rf .angular/cache
```
To clear the cache on Windows:
```bash
rmdir /s /q .angular/cache
```
For more information, see [rm command](https://man7.org/linux/man-pages/man1/rm.1.html) and [rmdir command](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rmdir).
+3 -3
View File
@@ -27,7 +27,7 @@ ng config --global cli.analyticsSharing.tracking UA-123456-12
To turn off this feature, run the following command:
<code-example language="sh">
ng config --global --remove cli.analyticsSharing
ng config --global cli.analyticsSharing undefined
</code-example>
## Per user tracking
@@ -36,11 +36,11 @@ You can add a custom user ID to the global configuration, in order to identify u
If that user enables CLI analytics for their own project, your analytics display tracks and labels their individual usage.
<code-example language="sh">
ng config --global cli.analyticsSharing.user SOME_USER_NAME
ng config --global cli.analyticsSharing.uuid SOME_USER_NAME
</code-example>
To generate a new random user ID, run the following command:
<code-example language="sh">
ng config --global cli.analyticsSharing.user ""
ng config --global cli.analyticsSharing.uuid ""
</code-example>
+3 -2
View File
@@ -28,8 +28,6 @@
**/tsconfig.json
**/tsconfig.app.json
**/tsconfig.spec.json
# TODO: remove tslint.json after linting has been removed from systemjs examples
**/tslint.json
**/karma-test-shim.js
**/browser-test-shim.js
**/node_modules
@@ -104,3 +102,6 @@ upgrade-phonecat-3-final/rollup-config.js
#angular-compiler-options
!angular-compiler-options/tsconfig.json
!angular-compiler-options/tsconfig.app.json
# deprecated-example
!deprecation-guide/angular.package.json
@@ -9,6 +9,8 @@
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
@@ -20,7 +22,7 @@
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"es2020",
"dom"
]
// #docregion angular-compiler-options
@@ -0,0 +1,26 @@
// #docplaster ...
// #docregion webpack-config
import linkerPlugin from '@angular/compiler-cli/linker/babel';
export default {
// #enddocregion webpack-config
// #docregion webpack-config
module: {
rules: [
{
test: /\.m?js$/,
use: {
loader: 'babel-loader',
options: {
plugins: [linkerPlugin],
compact: false,
cacheDirectory: true,
}
}
}
]
}
// #enddocregion webpack-config
// #docregion webpack-config
}
// #enddocregion webpack-config
@@ -36,7 +36,7 @@ export class AppComponent {
// #docregion prepare-router-outlet
prepareRoute(outlet: RouterOutlet) {
return outlet?.activatedRouteData?.animation;
return outlet?.activatedRouteData?.['animation'];
}
// #enddocregion prepare-router-outlet
@@ -10,9 +10,9 @@ import { LoggerService } from './logger.service';
})
export class DateLoggerService extends LoggerService
{
logInfo(msg: any) { super.logInfo(stamp(msg)); }
logDebug(msg: any) { super.logInfo(stamp(msg)); }
logError(msg: any) { super.logError(stamp(msg)); }
override logInfo(msg: any) { super.logInfo(stamp(msg)); }
override logDebug(msg: any) { super.logInfo(stamp(msg)); }
override logError(msg: any) { super.logError(stamp(msg)); }
}
function stamp(msg: any) { return msg + ' at ' + new Date(); }
@@ -153,7 +153,7 @@ export class BethComponent implements Parent {
export class AlexComponent extends Base
// #enddocregion alex-class-signature
{
name = 'Alex';
override name = 'Alex';
}
// #enddocregion alex-1
@@ -40,7 +40,7 @@ export class SortedHeroesComponent extends HeroesBaseComponent {
super(heroService);
}
protected afterGetHeroes() {
protected override afterGetHeroes() {
this.heroes = this.heroes.sort((h1, h2) => {
return h1.name < h2.name ? -1 :
(h1.name > h2.name ? 1 : 0);
@@ -25,8 +25,8 @@ export function superCar() {
}
/////////// example 3 //////////
class MockEngine extends Engine { cylinders = 8; }
class MockTires extends Tires { make = 'YokoGoodStone'; }
class MockEngine extends Engine { override cylinders = 8; }
class MockTires extends Tires { override make = 'YokoGoodStone'; }
export function testCar() {
// Test car with 8 cylinders and YokoGoodStone tires.
@@ -75,7 +75,7 @@ export class Provider4Component {
export class EvenBetterLogger extends Logger {
constructor(private userService: UserService) { super(); }
log(message: string) {
override log(message: string) {
const name = this.userService.user.name;
super.log(`Message to ${name}: ${message}`);
}
@@ -0,0 +1,20 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
// Add your e2e tests here
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
@@ -0,0 +1,6 @@
<select>
<!--#docregion two-way-template-deprecated-->
<option *ngFor="let optionName of options" [(value)]="optionName"></option>
<!--#enddocregion two-way-template-deprecated-->
</select>
@@ -0,0 +1,25 @@
<h1>Deprecation</h1>
<!--#docregion deprecated-example-->
<input [formControl]="control" [(ngModel)]="value">
<!--#enddocregion deprecated-example-->
<!--#docregion reactive-form-example-->
<input [formControl]="control">
<!--#enddocregion reactive-form-example-->
<!--#docregion template-driven-form-example-->
<input [(ngModel)]="value">
<!--#enddocregion template-driven-form-example-->
<select>
<!--#docregion valid-template-bind-->
<option *ngFor="let optionName of options" [value]="optionName"></option>
<!--#enddocregion valid-template-bind-->
</select>
@@ -0,0 +1,20 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
// Add your unit tests here
});
@@ -0,0 +1,60 @@
// #docplaster
import { Component, ContentChild, Injector, Input, OnInit, StaticProvider, TemplateRef } from '@angular/core';
import { ReflectiveInjector } from '@angular/core';
import {
FormControl,
} from '@angular/forms';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'example';
value = 'initial value';
control: FormControl = new FormControl('');
options = [
'repeat-value'
];
/*
// #docregion template-with-input-deprecated
@Input() @ContentChild(TemplateRef) tpldeprecated !: TemplateRef<any>;
// #enddocregion template-with-input-deprecated
*/
// #docregion template-with-input
@Input() tpl !: TemplateRef<any>;
@ContentChild(TemplateRef) inlineTemplate !: TemplateRef<any>;
// #enddocregion template-with-input
ngOnInit() {
// #docregion deprecated-example, template-driven-form-example
this.value = 'some value';
// #enddocregion deprecated-example, template-driven-form-example
this.setValue();
}
setValue(): void {
// #docregion reactive-form-example
this.control.setValue('some value');
// #enddocregion reactive-form-example
}
}
class InjectorExample {}
const Provider = [InjectorExample];
const providers: StaticProvider[] = [Provider];
// #docregion reflective-injector-deprecated-example
ReflectiveInjector.resolveAndCreate(providers);
// #enddocregion reflective-injector-deprecated-example
// #docregion static-injector-example
Injector.create({providers});
// #enddocregion static-injector-example
@@ -0,0 +1,75 @@
// #docplaster
import { BrowserModule } from '@angular/platform-browser';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { SubmitButtonComponent } from './submit-button/submit-button.component';
// #docregion lazyload-syntax, lazyload-deprecated-syntax
const routes: Routes = [{
path: 'lazy',
// #enddocregion lazyload-deprecated-syntax
// The new import() syntax
loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)
// #enddocregion lazyload-syntax
/*
// #docregion lazyload-deprecated-syntax
// The following string syntax for loadChildren is deprecated
loadChildren: './lazy/lazy.module#LazyModule',
// #enddocregion lazyload-deprecated-syntax
*/
// #docregion lazyload-syntax, lazyload-deprecated-syntax
}];
// #enddocregion lazyload-syntax, lazyload-deprecated-syntax
@NgModule({
declarations: [
AppComponent,
SubmitButtonComponent
],
// #docregion reactive-form-no-warning
imports: [
// #enddocregion reactive-form-no-warning
RouterModule.forChild(routes),
FormsModule,
BrowserModule,
// #docregion reactive-form-no-warning
ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'})
],
// #enddocregion reactive-form-no-warning
providers: [],
bootstrap: [AppComponent],
exports: [RouterModule]
})
export class AppModule { }
class SomeModule { }
class SomeConfig { }
// #docplaster ...
// #docregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
@NgModule({
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
// #docregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
})
// #docplaster
export class MyModule {
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
/*
// #docregion ModuleWithProvidersNonGeneric
static forRoot(config: SomeConfig): ModuleWithProviders {
// #enddocregion ModuleWithProvidersNonGeneric
*/
// #docregion ModuleWithProvidersGeneric
static forRoot(config: SomeConfig): ModuleWithProviders<SomeModule> {
// #docregion ModuleWithProvidersNonGeneric
return {
ngModule: SomeModule,
providers: [
{provide: SomeConfig, useValue: config}
]
};
}
}
// #enddocregion ModuleWithProvidersGeneric, ModuleWithProvidersNonGeneric
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LazyRoutingModule { }
@@ -0,0 +1 @@
<p>lazy works!</p>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LazyComponent } from './lazy.component';
describe('LazyComponent', () => {
let component: LazyComponent;
let fixture: ComponentFixture<LazyComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LazyComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LazyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-lazy',
templateUrl: './lazy.component.html',
styleUrls: ['./lazy.component.css']
})
export class LazyComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LazyRoutingModule } from './lazy-routing.module';
import { LazyComponent } from './lazy.component';
@NgModule({
declarations: [
LazyComponent
],
imports: [
CommonModule,
LazyRoutingModule
]
})
export class LazyModule { }
@@ -0,0 +1 @@
<p>submit-button works!</p>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SubmitButtonComponent } from './submit-button.component';
describe('SubmitButtonComponent', () => {
let component: SubmitButtonComponent;
let fixture: ComponentFixture<SubmitButtonComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SubmitButtonComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(SubmitButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,53 @@
// #docplaster ...
import { Component, Input } from '@angular/core';
// #docregion submitButton, submitButtonNarrow
@Component({
// #enddocregion submitButton, submitButtonNarrow
// #docplaster
selector: 'app-submit-button',
templateUrl: './submit-button.component.html',
styleUrls: ['./submit-button.component.css']
// #docregion submitButton, submitButtonNarrow
})
export class SubmitButtonComponent {
// #enddocregion submitButtonNarrow
private disabledValue = false;
@Input()
get disabled(): boolean {
return this.disabledValue;
}
set disabled(value: boolean|'') {
this.disabledValue = (value === '') || value;
}
}
// #enddocregion submitButton
@Component({
selector: 'app-submit-button-valid',
templateUrl: './submit-button.component.html',
styleUrls: ['./submit-button.component.css']
})
export class SubmitButtonValidComponent {
// tslint:disable: variable-name
// #docregion submitButtonNarrow
static ngAcceptInputType_disabled: boolean|'';
private disabledValue = false;
@Input()
get disabled(): boolean {
return this.disabledValue;
}
// #enddocregion submitButtonNarrow
/*
// #docregion submitButtonNarrow
set disabled(value: boolean) {
this.disabledValue = (value === '') || value;
}
// #enddocregion submitButtonNarrow
*/
// #docregion submitButtonNarrow
}
// #enddocregion submitButtonNarrow
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ponyracer</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
@@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -0,0 +1,14 @@
{
"description": "Deprecation Guide",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"tags": [
[
"deprecation",
"guide"
]
]
}
@@ -1,5 +1,5 @@
// #docregion
import { Component, Input, OnInit, ViewChild, ComponentFactoryResolver, OnDestroy } from '@angular/core';
import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { AdDirective } from './ad.directive';
import { AdItem } from './ad-item';
@@ -18,15 +18,12 @@ import { AdComponent } from './ad.component';
})
// #docregion class
export class AdBannerComponent implements OnInit, OnDestroy {
@Input() ads: AdItem[] = [];
currentAdIndex = -1;
@ViewChild(AdDirective, {static: true}) adHost!: AdDirective;
interval: number | undefined;
constructor(private componentFactoryResolver: ComponentFactoryResolver) { }
interval: number|undefined;
ngOnInit() {
this.loadComponent();
@@ -41,12 +38,10 @@ export class AdBannerComponent implements OnInit, OnDestroy {
this.currentAdIndex = (this.currentAdIndex + 1) % this.ads.length;
const adItem = this.ads[this.currentAdIndex];
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(adItem.component);
const viewContainerRef = this.adHost.viewContainerRef;
viewContainerRef.clear();
const componentRef = viewContainerRef.createComponent<AdComponent>(componentFactory);
const componentRef = viewContainerRef.createComponent<AdComponent>(adItem.component);
componentRef.instance.data = adItem.data;
}
@@ -2,5 +2,5 @@
import { QuestionBase } from './question-base';
export class DropdownQuestion extends QuestionBase<string> {
controlType = 'dropdown';
override controlType = 'dropdown';
}
@@ -2,5 +2,5 @@
import { QuestionBase } from './question-base';
export class TextboxQuestion extends QuestionBase<string> {
controlType = 'textbox';
override controlType = 'textbox';
}
@@ -7,7 +7,7 @@
<div [hidden]="formDir.submitted">
<div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.identityRevealed && (heroForm.touched || heroForm.dirty)">
<div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)">
<div class="form-group">
<label for="name">Name</label>
@@ -18,13 +18,13 @@
<div *ngIf="name.invalid && (name.dirty || name.touched)"
class="alert alert-danger">
<div *ngIf="name.errors?.required">
<div *ngIf="name.errors?.['required']">
Name is required.
</div>
<div *ngIf="name.errors?.minlength">
<div *ngIf="name.errors?.['minlength']">
Name must be at least 4 characters long.
</div>
<div *ngIf="name.errors?.forbiddenName">
<div *ngIf="name.errors?.['forbiddenName']">
Name cannot be Bob.
</div>
</div>
@@ -38,14 +38,14 @@
<div *ngIf="alterEgo.pending">Validating...</div>
<div *ngIf="alterEgo.invalid" class="alert alert-danger alter-ego-errors">
<div *ngIf="alterEgo.errors?.uniqueAlterEgo">
<div *ngIf="alterEgo.errors?.['uniqueAlterEgo']">
Alter ego is already taken.
</div>
</div>
</div>
<!-- #docregion cross-validation-error-message -->
<div *ngIf="heroForm.errors?.identityRevealed && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert alert-danger">
<div *ngIf="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert alert-danger">
Name cannot match alter ego.
</div>
<!-- #enddocregion cross-validation-error-message -->
@@ -59,7 +59,7 @@
</select>
<div *ngIf="power.invalid && power.touched" class="alert alert-danger">
<div *ngIf="power.errors?.required">Power is required.</div>
<div *ngIf="power.errors?.['required']">Power is required.</div>
</div>
</div>
@@ -6,7 +6,7 @@
<form #heroForm="ngForm" appIdentityRevealed>
<!-- #enddocregion cross-validation-register-validator -->
<div [hidden]="heroForm.submitted">
<div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.identityRevealed && (heroForm.touched || heroForm.dirty)">
<div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)">
<div class="form-group">
<label for="name">Name</label>
<!-- #docregion name-with-error-msg -->
@@ -19,13 +19,13 @@
<div *ngIf="name.invalid && (name.dirty || name.touched)"
class="alert">
<div *ngIf="name.errors?.required">
<div *ngIf="name.errors?.['required']">
Name is required.
</div>
<div *ngIf="name.errors?.minlength">
<div *ngIf="name.errors?.['minlength']">
Name must be at least 4 characters long.
</div>
<div *ngIf="name.errors?.forbiddenName">
<div *ngIf="name.errors?.['forbiddenName']">
Name cannot be Bob.
</div>
@@ -45,14 +45,14 @@
<div *ngIf="alterEgo.pending">Validating...</div>
<div *ngIf="alterEgo.invalid" class="alert alter-ego-errors">
<div *ngIf="alterEgo.errors?.uniqueAlterEgo">
<div *ngIf="alterEgo.errors?.['uniqueAlterEgo']">
Alter ego is already taken.
</div>
</div>
</div>
<!-- #docregion cross-validation-error-message -->
<div *ngIf="heroForm.errors?.identityRevealed && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert">
<div *ngIf="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert">
Name cannot match alter ego.
</div>
<!-- #enddocregion cross-validation-error-message -->
@@ -68,7 +68,7 @@
</select>
<div *ngIf="power.errors && power.touched" class="alert">
<div *ngIf="power.errors.required">Power is required.</div>
<div *ngIf="power.errors['required']">Power is required.</div>
</div>
</div>
@@ -14,13 +14,15 @@ import { ProductListComponent } from './product-list/product-list.component';
import { ProductAlertsComponent } from './product-alerts/product-alerts.component';
// #enddocregion declare-product-alerts
import { ProductDetailsComponent } from './product-details/product-details.component';
// #docregion declare-cart
import { CartComponent } from './cart/cart.component';
// #enddocregion declare-cart
import { ShippingComponent } from './shipping/shipping.component';
// #docregion product-details-route, http-client-module, shipping-route, cart-route, declare-product-alerts
// #docregion product-details-route, http-client-module, shipping-route, cart-route, declare-product-alerts, declare-cart
@NgModule({
// #enddocregion declare-product-alerts
// #enddocregion declare-product-alerts, declare-cart
imports: [
BrowserModule,
// #enddocregion product-details-route, cart-route
@@ -39,7 +41,7 @@ import { ShippingComponent } from './shipping/shipping.component';
])
],
// #enddocregion cart-route
// #docregion declare-product-alerts
// #docregion declare-product-alerts, declare-cart
declarations: [
AppComponent,
TopBarComponent,
@@ -49,11 +51,12 @@ import { ShippingComponent } from './shipping/shipping.component';
ProductDetailsComponent,
// #enddocregion product-details-route
CartComponent,
// #enddocregion declare-cart
// #enddocregion http-client-module
ShippingComponent
// #docregion declare-product-alerts, http-client-module, product-details-route
// #docregion declare-product-alerts, http-client-module, product-details-route, declare-cart
],
// #enddocregion declare-product-alerts, product-details-route
// #enddocregion declare-product-alerts, product-details-route, declare-cart
bootstrap: [
AppComponent
]
@@ -56,6 +56,7 @@ export class TiresService {
})
export class CarService {
id = 'C1';
constructor(
protected engineService: EngineService,
protected tiresService: TiresService) { }
@@ -75,13 +76,15 @@ export class CarService {
providedIn: 'root'
})
export class CarService2 extends CarService {
id = 'C2';
override id = 'C2';
constructor(
protected engineService: EngineService,
protected tiresService: TiresService) {
protected override engineService: EngineService,
protected override tiresService: TiresService) {
super(engineService, tiresService);
}
getCar() {
override getCar() {
const car = super.getCar();
car.name = 'BamBam Motors, BroVan 2000';
return car;
@@ -92,13 +95,15 @@ export class CarService2 extends CarService {
providedIn: 'root'
})
export class CarService3 extends CarService2 {
id = 'C3';
override id = 'C3';
constructor(
protected engineService: EngineService,
protected tiresService: TiresService) {
protected override engineService: EngineService,
protected override tiresService: TiresService) {
super(engineService, tiresService);
}
getCar() {
override getCar() {
const car = super.getCar();
car.name = 'Chizzamm Motors, Calico UltraMax Supreme';
return car;
@@ -30,7 +30,7 @@ export class PackageSearchService {
constructor(
private http: HttpClient,
httpErrorHandler: HttpErrorHandler) {
this.handleError = httpErrorHandler.createHandleError('HeroesService');
this.handleError = httpErrorHandler.createHandleError('PackageSearchService');
}
search(packageName: string, refresh = false): Observable<NpmPackageInfo[]> {
-13
View File
@@ -142,19 +142,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
@@ -28,7 +28,7 @@ export class MyCounterComponent implements OnChanges {
}
// A change to `counter` is the only change we care about
const chng = changes.counter;
const chng = changes['counter'];
const cur = chng.currentValue;
const prev = JSON.stringify(chng.previousValue); // first time is {}; after is integer
this.changeLog.push(`counter: currentValue = ${cur}, previousValue = ${prev}`);
@@ -44,7 +44,7 @@ export class PeekABooComponent extends PeekABooDirective implements
const changesMsgs: string[] = [];
for (const propName in changes) {
if (propName === 'name') {
const name = changes.name.currentValue;
const name = changes['name'].currentValue;
changesMsgs.push(`name ${this.verb} to "${name}"`);
} else {
changesMsgs.push(propName + ' ' + this.verb);
@@ -14,12 +14,12 @@ describe('observables', () => {
});
it('should listen to input changes', () => {
let triggerInputChange!: (e: {keyCode: number}) => void;
let triggerInputChange!: (e: {code: string}) => void;
const input = {
value: 'Test',
addEventListener: jasmine
.createSpy('addEvent')
.and.callFake((eventName: string, cb: (e: {keyCode: number}) => void) => {
.and.callFake((eventName: string, cb: (e: {code: string}) => void) => {
if (eventName === 'keydown') {
triggerInputChange = cb;
}
@@ -29,10 +29,10 @@ describe('observables', () => {
const document = { getElementById: () => input } as unknown as Document;
docRegionFromEvent(document);
triggerInputChange({keyCode: 65});
triggerInputChange({code: 'A'});
expect(input.value).toBe('Test');
triggerInputChange({keyCode: 27});
triggerInputChange({code: 'Escape'});
expect(input.value).toBe('');
});
@@ -55,11 +55,11 @@ function fromEvent<T extends keyof HTMLElementEventMap>(target: HTMLElement, eve
export function docRegionFromEvent(document: Document) {
// #docregion fromevent_use
const ESC_KEY = 27;
const ESC_CODE = 'Escape';
const nameInput = document.getElementById('name') as HTMLInputElement;
const subscription = fromEvent(nameInput, 'keydown').subscribe((e: KeyboardEvent) => {
if (e.keyCode === ESC_KEY) {
if (e.code === ESC_CODE) {
nameInput.value = '';
}
});
@@ -51,5 +51,5 @@ export class FlyingHeroesComponent {
styles: ['#flyers, #all {font-style: italic}', 'button {display: block}', 'input {margin: .25rem .25rem .5rem 0;}'],
})
export class FlyingHeroesImpureComponent extends FlyingHeroesComponent {
title = 'Flying Heroes (impure pipe)';
override title = 'Flying Heroes (impure pipe)';
}
@@ -1,13 +1,15 @@
import { Observable, of } from 'rxjs';
/// <reference types="node" />
import { of } from 'rxjs';
import { docRegionTypeahead } from './typeahead';
describe('typeahead', () => {
let document: Document;
let ajax: jasmine.Spy;
let tick: MockClock['tick'];
let triggertInputChange: (e: { target: { value: string } }) => void;
beforeEach(() => {
jasmine.clock().install();
const input = {
addEventListener: jasmine
.createSpy('addEvent')
@@ -21,40 +23,37 @@ describe('typeahead', () => {
document = { getElementById: (id: string) => input } as unknown as Document;
ajax = jasmine.createSpy('ajax').and.callFake((url: string) => of('foo bar'));
});
afterEach(() => {
jasmine.clock().uninstall();
tick = MockClock.install();
});
it('should make an ajax call to the corrent endpoint', () => {
docRegionTypeahead(document, ajax);
triggertInputChange({ target: { value: 'foo' } });
jasmine.clock().tick(11);
tick(11);
expect(ajax).toHaveBeenCalledWith('/api/endpoint?search=foo');
});
it('should not make an ajax call, when the input length < 3', () => {
docRegionTypeahead(document, ajax);
triggertInputChange({ target: { value: '' } });
jasmine.clock().tick(11);
tick(11);
expect(ajax).not.toHaveBeenCalled();
triggertInputChange({ target: { value: 'fo' } });
jasmine.clock().tick(11);
tick(11);
expect(ajax).not.toHaveBeenCalled();
});
it('should not make an ajax call for intermediate values when debouncing', () => {
docRegionTypeahead(document, ajax);
triggertInputChange({ target: { value: 'foo' } });
jasmine.clock().tick(9);
tick(9);
triggertInputChange({ target: { value: 'bar' } });
jasmine.clock().tick(9);
tick(9);
triggertInputChange({ target: { value: 'baz' } });
jasmine.clock().tick(9);
tick(9);
triggertInputChange({ target: { value: 'qux' } });
expect(ajax).not.toHaveBeenCalled();
jasmine.clock().tick(10);
tick(10);
expect(ajax).toHaveBeenCalledTimes(1);
expect(ajax).toHaveBeenCalledWith('/api/endpoint?search=qux');
});
@@ -62,11 +61,94 @@ describe('typeahead', () => {
it('should not make an ajax call, when the input value has not changed', () => {
docRegionTypeahead(document, ajax);
triggertInputChange({ target: { value: 'foo' } });
jasmine.clock().tick(11);
tick(11);
expect(ajax).toHaveBeenCalled();
ajax.calls.reset();
triggertInputChange({ target: { value: 'foo' } });
jasmine.clock().tick(11);
tick(11);
expect(ajax).not.toHaveBeenCalled();
});
// Helpers
interface MockTask {
id: NodeJS.Timeout;
fn: () => unknown;
delay: number;
recurring: boolean;
nextTriggerTime: number;
}
class MockClock {
private tasks: MockTask[] = [];
private constructor(private now: number) {}
static install(mockTime = 0): MockClock['tick'] {
const mocked = new this(mockTime);
spyOn(global, 'clearInterval').and.callFake(id => mocked.clearTask(id));
spyOn(global, 'clearTimeout').and.callFake(id => mocked.clearTask(id));
spyOn(global, 'setInterval').and.callFake(
(fn, delay, ...args) => mocked.createTask(fn, delay, true, ...args));
spyOn(global, 'setTimeout').and.callFake(
(fn, delay, ...args) => mocked.createTask(fn, delay, false, ...args));
spyOn(Date, 'now').and.callFake(() => mocked.now);
return mocked.tick.bind(mocked);
}
private clearTask(id: MockTask['id']): void {
this.tasks = this.tasks.filter(task => task.id !== id);
}
private createTask(
fn: MockTask['fn'], delay: MockTask['delay'], recurring: MockTask['recurring'],
...args: any[]): MockTask['id'] {
// Avoid infinite loops.
if (recurring && (delay <= 0)) {
delay = 1;
}
const task: MockTask = {
id: {} as MockTask['id'],
fn: fn.bind<null, unknown, unknown>(null, ...args),
delay,
recurring,
nextTriggerTime: this.now + delay,
};
this.queueTask(task);
return task.id;
}
private queueTask(task: MockTask): void {
const firstLaterTaskIdx = this.tasks.findIndex(
otherTask => otherTask.nextTriggerTime > task.nextTriggerTime);
const newTaskIdx = (firstLaterTaskIdx === -1) ? this.tasks.length : firstLaterTaskIdx;
this.tasks.splice(newTaskIdx, 0, task);
}
private tick(millis: number): void {
const finalNow = this.now + millis;
while (this.tasks[0]?.nextTriggerTime <= finalNow) {
const task = this.tasks.shift()!;
this.now = task.nextTriggerTime;
if (task.recurring) {
this.queueTask({...task, nextTriggerTime: this.now + task.delay});
}
try {
task.fn();
} catch (err) {
console.error(err);
}
}
this.now = finalNow;
}
}
});
@@ -127,8 +127,8 @@ describe('Reactive forms', () => {
const formValue = await formValueElement.getText();
const formJson = JSON.parse(formValue.toString().replace('Form Value:', ''));
expect(profile.firstName).toBe(formJson.firstName);
expect(profile.lastName).toBe(formJson.lastName);
expect(profile['firstName']).toBe(formJson.firstName);
expect(profile['lastName']).toBe(formJson.lastName);
expect(formJson.aliases[0]).toBe(aliasText);
});
});
@@ -15,7 +15,7 @@ import { slideInAnimation } from './animations';
// #docregion function-binding
export class AppComponent {
getAnimationData(outlet: RouterOutlet) {
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
return outlet?.activatedRouteData?.['animation'];
}
}
// #enddocregion function-binding
@@ -12,6 +12,6 @@ import { slideInAnimation } from './animations';
})
export class AppComponent {
getAnimationData(outlet: RouterOutlet) {
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
return outlet?.activatedRouteData?.['animation'];
}
}
@@ -26,7 +26,7 @@ export class CrisisDetailComponent implements OnInit {
ngOnInit() {
this.route.data
.subscribe(data => {
const crisis: Crisis = data.crisis;
const crisis: Crisis = data['crisis'];
this.editName = crisis.name;
this.crisis = crisis;
});
@@ -10,7 +10,7 @@ export class SelectivePreloadingStrategyService implements PreloadingStrategy {
preloadedModules: string[] = [];
preload(route: Route, load: () => Observable<any>): Observable<any> {
if (route.data && route.data.preload && route.path != null) {
if (route.data?.['preload'] && route.path != null) {
// add the route path to the preloaded module array
this.preloadedModules.push(route.path);
@@ -32,8 +32,8 @@
<h2>Reference variables, forms, and NgForm</h2>
<!-- #docregion ngForm -->
<form #itemForm="ngForm" (ngSubmit)="onSubmit(itemForm)">
<label for="name">Name <input class="form-control" name="name" ngModel required />
</label>
<label for="name">Name</label>
<input type="text" id="name" class="form-control" name="name" ngModel required />
<button type="submit">Submit</button>
</form>
@@ -58,10 +58,10 @@ export class HeroDetailComponent {
})
export class BigHeroDetailComponent extends HeroDetailComponent {
@Input() hero!: Hero;
@Output() deleteRequest = new EventEmitter<Hero>();
@Input() override hero!: Hero;
@Output() override deleteRequest = new EventEmitter<Hero>();
delete() {
override delete() {
this.deleteRequest.emit(this.hero);
}
}
@@ -2,9 +2,15 @@
<!-- #docregion -->
<form (ngSubmit)="onSubmit(heroForm)" #heroForm="ngForm">
<div class="form-group">
<label for="name">Name
<input class="form-control" name="name" required [(ngModel)]="hero.name">
</label>
<label for="name">Name</label>
<input
type="text"
id="name"
class="form-control"
name="name"
required
[(ngModel)]="hero.name"
/>
</div>
<button type="submit" [disabled]="!heroForm.form.valid">Submit</button>
</form>
@@ -1,24 +0,0 @@
{
"description": "Testing - specs",
"files":[
"src/expected.ts",
"src/index-specs.html",
"src/main-specs.ts",
"src/styles.css",
"src/test.css",
"src/tests.sb.ts",
"e2e/src/**/*.ts",
"src/app/**/*.css",
"src/app/**/*.html",
"src/app/**/*.ts",
"src/testing/**/*",
"src/**/*.spec.ts"
],
"main": "src/index-specs.html",
"tags": ["testing"],
"devDependencies": ["jasmine-core", "jasmine-marbles"]
}
@@ -8,7 +8,7 @@ import {
///////// Fakes /////////
export class FakeValueService extends ValueService {
value = 'faked service value';
override value = 'faked service value';
}
////////////////////////
describe('demo (no TestBed):', () => {
@@ -372,14 +372,14 @@ describe('demo (with TestBed):', () => {
expect(el.context).toBe(childComp, 'context is the child component');
expect(el.attributes.account).toBe(childComp.id, 'account attribute');
expect(el.attributes.bank).toBe(childComp.bank, 'bank attribute');
expect(el.attributes['account']).toBe(childComp.id, 'account attribute');
expect(el.attributes['bank']).toBe(childComp.bank, 'bank attribute');
expect(el.classes.closed).toBe(true, 'closed class');
expect(el.classes.open).toBeFalsy('open class');
expect(el.classes['closed']).toBe(true, 'closed class');
expect(el.classes['open']).toBeFalsy('open class');
expect(el.styles.color).toBe(comp.color, 'color style');
expect(el.styles.width).toBe(comp.width + 'px', 'width style');
expect(el.styles['color']).toBe(comp.color, 'color style');
expect(el.styles['width']).toBe(comp.width + 'px', 'width style');
// Removed on 12/02/2016 when ceased public discussion of the `Renderer`. Revive in future?
// expect(el.properties['customProperty']).toBe(true, 'customProperty');
@@ -510,11 +510,11 @@ describe('demo (with TestBed):', () => {
expect(comp.children.toArray().length).toBe(4,
'three different child components and an ElementRef with #content');
expect(el.references.nc).toBe(comp, '#nc reference to component');
expect(el.references['nc']).toBe(comp, '#nc reference to component');
// #docregion custom-predicate
// Filter for DebugElements with a #content reference
const contentRefs = el.queryAll( de => de.references.content);
const contentRefs = el.queryAll( de => de.references['content']);
// #enddocregion custom-predicate
expect(contentRefs.length).toBe(4, 'elements w/ a #content reference');
});
@@ -698,5 +698,5 @@ class FakeGrandchildComponent { }
@Injectable()
class FakeValueService extends ValueService {
value = 'faked value';
override value = 'faked value';
}
@@ -1,6 +1,9 @@
import { Router } from '@angular/router';
import { asyncData, ActivatedRouteStub } from '../../testing';
import { HeroDetailComponent } from './hero-detail.component';
import { HeroDetailService } from './hero-detail.service';
import { Hero } from '../model/hero';
////////// Tests ////////////////////
@@ -8,13 +11,13 @@ import { Hero } from '../model/hero';
describe('HeroDetailComponent - no TestBed', () => {
let comp: HeroDetailComponent;
let expectedHero: Hero;
let hds: any;
let router: any;
let hds: jasmine.SpyObj<HeroDetailService>;
let router: jasmine.SpyObj<Router>;
beforeEach((done: DoneFn) => {
expectedHero = {id: 42, name: 'Bubba' };
const activatedRoute = new ActivatedRouteStub({ id: expectedHero.id });
router = jasmine.createSpyObj('router', ['navigate']);
router = jasmine.createSpyObj('Router', ['navigate']);
hds = jasmine.createSpyObj('HeroDetailService', ['getHero', 'saveHero']);
hds.getHero.and.returnValue(asyncData(expectedHero));
@@ -11,13 +11,13 @@ import { HeroService } from './hero.service';
describe ('HeroesService (with spies)', () => {
// #docregion test-with-spies
let httpClientSpy: { get: jasmine.Spy };
let httpClientSpy: jasmine.SpyObj<HttpClient>;
let heroService: HeroService;
beforeEach(() => {
// TODO: spy on other methods too
httpClientSpy = jasmine.createSpyObj('HttpClient', ['get']);
heroService = new HeroService(httpClientSpy as any);
heroService = new HeroService(httpClientSpy);
});
it('should return expected heroes (HttpClient called once)', (done: DoneFn) => {
@@ -30,19 +30,19 @@ export class TestHeroService extends HeroService {
heroes = getTestHeroes();
lastResult!: Observable<any>; // result from last method call
addHero(hero: Hero): Observable<Hero> {
override addHero(hero: Hero): Observable<Hero> {
throw new Error('Method not implemented.');
}
deleteHero(hero: number | Hero): Observable<Hero> {
override deleteHero(hero: number | Hero): Observable<Hero> {
throw new Error('Method not implemented.');
}
getHeroes(): Observable<Hero[]> {
override getHeroes(): Observable<Hero[]> {
return this.lastResult = asyncData(this.heroes);
}
getHero(id: number | string): Observable<Hero> {
override getHero(id: number | string): Observable<Hero> {
if (typeof id === 'string') {
id = parseInt(id, 10);
}
@@ -51,7 +51,7 @@ export class TestHeroService extends HeroService {
return this.lastResult;
}
updateHero(hero: Hero): Observable<Hero> {
override updateHero(hero: Hero): Observable<Hero> {
return this.lastResult = this.getHero(hero.id).pipe(
map(h => {
if (h) {
@@ -71,7 +71,7 @@ describe('HighlightDirective', () => {
it('bare <h2> should not have a customProperty', () => {
expect(bareH2.properties.customProperty).toBeUndefined();
expect(bareH2.properties['customProperty']).toBeUndefined();
});
// #enddocregion selected-tests
@@ -1,39 +0,0 @@
import 'jasmine-core/lib/jasmine-core/jasmine-html.js';
import 'jasmine-core/lib/jasmine-core/boot.js';
declare var jasmine: any;
import './polyfills';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
// Spec files to include in the Stackblitz tests
import './tests.sb.ts';
//
bootstrap();
//
function bootstrap() {
if ((window as any).jasmineRef) {
location.reload();
return;
} else {
window.onload?.({} as Event);
(window as any).jasmineRef = jasmine.getEnv();
}
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
}
@@ -1,26 +0,0 @@
// Import spec files individually for Stackblitz
import './app/about/about.component.spec.ts';
import './app/app-initial.component.spec.ts';
import './app/app.component.router.spec.ts';
import './app/app.component.spec.ts';
import './app/banner/banner-initial.component.spec.ts';
import './app/banner/banner.component.spec.ts';
import './app/banner/banner.component.detect-changes.spec.ts';
import './app/banner/banner-external.component.spec.ts';
import './app/dashboard/dashboard-hero.component.spec.ts';
import './app/dashboard/dashboard.component.no-testbed.spec.ts';
import './app/dashboard/dashboard.component.spec.ts';
import './app/demo/async-helper.spec.ts';
import './app/demo/demo.spec.ts';
import './app/demo/demo.testbed.spec.ts';
import './app/hero/hero-detail.component.no-testbed.spec.ts';
import './app/hero/hero-detail.component.spec.ts';
import './app/hero/hero-list.component.spec.ts';
import './app/model/hero.service.spec.ts';
import './app/model/testing/http-client.spec.ts';
import './app/shared/canvas.component.spec.ts';
import './app/shared/highlight.directive.spec.ts';
import './app/shared/title-case.pipe.spec.ts';
import './app/twain/twain.component.spec.ts';
import './app/twain/twain.component.marbles.spec.ts';
import './app/welcome/welcome.component.spec.ts';
+14 -6
View File
@@ -1,17 +1,25 @@
{
"description": "Heroes Test App",
"files":[
"files": [
"src/index.html",
"src/main.ts",
"src/test.ts",
"src/styles.css",
"src/test.css",
"e2e/src/**/*.ts",
"src/app/**/*.css",
"src/app/**/*.html",
"src/app/**/*.ts"
"src/app/**/*.ts",
"src/app/**/*.spec.ts",
"src/testing/**/*.ts",
"src/expected.ts",
"karma.conf.js"
],
"tags": ["testing"],
"devDependencies": ["jasmine-core", "jasmine-marbles"]
"tags": [
"testing"
],
"devDependencies": [
"jasmine-core",
"jasmine-marbles"
]
}
@@ -26,7 +26,7 @@ export class HeroesComponent implements OnInit {
constructor() { }
ngOnInit() {
ngOnInit(): void {
}
}
@@ -24,7 +24,7 @@ export class HeroesComponent implements OnInit {
constructor() { }
ngOnInit() {
ngOnInit(): void {
}
// #docregion on-select
@@ -18,7 +18,7 @@ export class HeroDetailComponent implements OnInit {
constructor() { }
ngOnInit() {
ngOnInit(): void {
}
}
@@ -15,7 +15,7 @@ export class HeroesComponent implements OnInit {
constructor() { }
ngOnInit() {
ngOnInit(): void {
}
onSelect(hero: Hero): void {
@@ -12,7 +12,7 @@ export class HeroDetailComponent implements OnInit {
constructor() { }
ngOnInit() {
ngOnInit(): void {
}
}
@@ -24,7 +24,7 @@ export class HeroesComponent implements OnInit {
constructor(private heroService: HeroService, private messageService: MessageService) { }
// #docregion ng-on-init
ngOnInit() {
ngOnInit(): void {
this.getHeroes();
}
// #enddocregion ng-on-init
@@ -13,7 +13,7 @@ export class DashboardComponent implements OnInit {
constructor(private heroService: HeroService) { }
ngOnInit() {
ngOnInit(): void {
this.getHeroes();
}

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