Commit graph

29561 commits

Author SHA1 Message Date
Alex Rickabaugh
cc0f38130b docs: release notes for the v14.0.0-rc.2 release (#46144)
PR Close #46144
2022-05-25 14:37:39 -07:00
Alex Rickabaugh
155c289797 docs: release notes for the v13.3.10 release (#46142)
PR Close #46142
2022-05-25 13:43:01 -07:00
dario-piotrowicz
a1e5aad5dc fix(core): improve TestBed declarations standalone error message (#45999)
improve the error message developers get when adding a standalone
component in the TestBed.configureTestingModule's declarations array,
by making more clear the fact that this error originated from the
TestBed call

resolves #45923

PR Close #45999
2022-05-25 12:20:52 -07:00
Renovate Bot
d2ea1ba876 build: update angular (#46120)
PR Close #46120
2022-05-25 12:18:05 -07:00
Kristiyan Kostadinov
1cc158375b build: update to TypeScript 4.7 final (#46132)
Bumps up the repo to the final version of TypeScript 4.7. Also updates AIO to 4.7.

PR Close #46132
2022-05-25 11:37:12 -07:00
dario-piotrowicz
7c6b740b97 docs: fix … presented in aio code docs (#46123)
the symbol `…` displays correctly in code-example blocks and in
plain html text, it does however not work correctly for code espressed
using backticks, fix such occurrences by replacing `…` with `...`

PR Close #46123
2022-05-25 11:30:30 -07:00
mgechev
8db9930aa0 docs: update the Angular roadmap as of May 2022 (#46117)
* Update project completion status
* Update project description based on state
* Add new projects to the future section

PR Close #46117
2022-05-25 11:23:53 -07:00
dario-piotrowicz
8629f2d0af refactor(compiler-cli): fix "for to" typo in code comment (#46113)
fix the typo/extra for in a code comment saying
"this is used for to determine" so that it only says
"this is used to determine"

PR Close #46113
2022-05-24 10:52:17 -07:00
dario-piotrowicz
9ed50ad36f docs: replace wrong hyphen with # in aio cheatsheet (#46125)
replace the hyphen symbol wrongly used in the aio cheatsheet
doc to create a template variable with the proper # symbol

PR Close #46125
2022-05-24 10:49:52 -07:00
Roopesh Chinnakampalli
983aa233cf docs: corrected the misspelled word (#46126)
innovation -> invocation
PR Close #46126
2022-05-24 10:47:46 -07:00
David Schmidt
bd94c076c7 docs: fix FormRecord example (#46124)
PR Close #46124
2022-05-24 10:47:07 -07:00
Aristeidis Bampakos
0b6ca5b807 docs: align lightbox elements together (#46107)
Align lightbox `div` elements so that the image appears inside the lightbox correctly.

PR Close #46107
2022-05-24 10:45:52 -07:00
Andrew Scott
53ca936366 feat(router): Add ability to create UrlTree from any ActivatedRouteSnapshot (#45877)
This exposes a new function from the router public API that allows
developers to create a `UrlTree` from _any_ `ActivatedRouteSnapshot`.
The current Router APIs only support creating a `UrlTree` from an
`ActivatedRoute` which is both active _and_ materially appears in the
`UrlTree` (it cannot be an empty path named outlet). This is because the
implementation of the current way of creating a `UrlTree` attempts to
look up the `UrlSegment` of the `ActivatedRoute` in the currently active
`UrlTree` of the router. When this doesn't work, the `UrlTree` creation
fails.

Note that this API does not replace the current one. That would actually be a
breaking change but should be done at some point in the future (v15). That is,
`router.navigate` should call this new function. At that point, we can
remove `_lastPathIndex`, `_urlSegment`, and `_correctedPathIndex` from
the `ActivatedRoute`, along with all of the logic associated with
determining what those should be. In addition, this would unblock a fix
for #26081 because the `applyRedirects` and `recognize` operations
could be combined into one.  Overall, this would simplify logic in the router
and reduce code size. It also exposes core routing capabilities as a helper function
which were previously private API, which is a necessary step towards #42953.

As a stress test for this new function, it _was_ swapped in as the
default for `UrlTree` creation in #45859 and tested internally. The
results indicate that this function behaves correctly.

resolves #42191 (Tested directly)
resolves #38276 (The test with a guard covers this case)
resolves #22763 (Tested directly)

PR Close #45877
2022-05-24 10:40:24 -07:00
Jan Kuehle
7efa09b401 perf(bazel): use allowedInputs to avoid fs.stat (#46069)
Call tsc_wrapped's fileExists function instead of TypeScript's.

tsc_wrapped (used internally by ngc-wrapped) has an optimization under
bazel to avoid file system calls where possible. It takes advantage
bazelOpts.allowedInputs, which contains a list of all files available
for compilation.

File system calls can be quite slow depending on the file system. In
google3 I saw a 38 seconds compilation, which spent 6 seconds just doing
fs.stat calls during module resolution. Those fs.stat calls are entirely
gone after with this change.

PR Close #46069
2022-05-24 10:39:17 -07:00
mariu
c3205d0962 feat(devtools): Create browser specific styles for chrome and firefox (#46037)
Create browser specific styles for chrome and firefox

PR Close #46037
2022-05-23 14:00:10 -07:00
dario-piotrowicz
f04a8ead18 docs: move all bazel testing info to a single location (#46084)
instead of presenting the same (or similar information) in both the
DEVELOPER.md and the BAZEL.md files, more all the information in the
BAZEL file and refer to that section in the DEVELOPER file

PR Close #46084
2022-05-23 13:59:05 -07:00
dario-piotrowicz
390e9896d3 docs: update directives info to include standalone (#46078)
update the directives api doc to inform developers that
directives can also be declared as standalone

PR Close #46078
2022-05-23 13:54:11 -07:00
A. J. Javier
281d4b7ace docs: fix angularfire2 hyperlink (#46046)
PR Close #46046
2022-05-23 13:52:11 -07:00
JoostK
e592cc7c1c refactor(compiler-cli): report better error when a ModuleWithProviders call occurs within Component.imports (#46009)
This commit improves the reported error when importing e.g. `RouterModule.forRoot()`
from within `Component.imports`. Such import is not supported, as standalone components
can only refer to other standalone entities or NgModules in their `imports` array;
`ModuleWithProviders` are not supported as `Component.imports` is meant to be used
for the compilation scope of the component, _not_ for configuring DI.

Closes #46003

PR Close #46009
2022-05-23 13:50:05 -07:00
JoostK
3d19f32942 refactor(compiler-cli): extract ModuleWithProviders analysis out of NgModule handler (#46009)
This commit moves the foreign function resolver logic for detecting a
`ModuleWithProviders` in a return type position of a function call, as the logic can
then be reused for standalone components in a subsequent commit.

PR Close #46009
2022-05-23 13:50:05 -07:00
dario-piotrowicz
a99f2eb38d feat(docs-infra): add group role and label for aio-notification (#45770)
add a role and an aria-label to the aio-notification component so that
it can be handled better by assistive technologies

resolves #44345

PR Close #45770
2022-05-23 13:48:28 -07:00
dario-piotrowicz
c8086b7e86 docs: make structural directives guide generic (#44895)
tweak the current structural directives guide (currently mainly targeted
at the creation of custom structural directives) so that is more generic
and a point of reference for structural directives in general

this also includes the re-addition of the one-per-element section
removed in PR #40015

resolves #44786

PR Close #44895
2022-05-23 13:44:41 -07:00
Aristeidis Bampakos
30427135ce docs: remove broken code from TOH tutorial (#46105)
At the end of Part 2 of the Tour or Heroes tutorial, there is a code sample that is broken. It looks like it was added by mistake because it is not related to the summary.
PR Close #46105
2022-05-23 13:31:23 -07:00
Paul Gschwendtner
91070d9512 ci: fix formatting for babel_ast_host.ts file after recent changes (#46082)
The formatting of the `babel_ast_host.ts` file is invalid due to a
recently-merged PR. The PR had a passing `lint` state but this seemed
to just appear like this because the Git comparison range on upstream
branches can become invalid (due to a known bug in CircleCI -- reported)

PR Close #46082
2022-05-23 13:30:38 -07:00
dario-piotrowicz
a43385cca4 docs: add standalone details to NG8001 (#46079)
improve the degubbing section of the NG8001 error by including details
about standalone components

PR Close #46079
2022-05-23 13:28:48 -07:00
Tom Raithel
551671fd51 docs: fix division by zero in progress events example (#46077)
If the `event.total` is undefined, this line would have generated a `NaN` due to division by zero. I suppose, that a `0` would be more suitable for this case.

PR Close #46077
2022-05-23 13:27:45 -07:00
Paul Gschwendtner
0bb8c48ae7 build: fix unbound variable error in build artifact script (#46076)
We recently had a couple of issues with the shallowing of snapshot
git repositories. In an attempt to fix this, parts of the publish
script of the COMP repo have been used, but variables have not been
updated properly.

This commit fixes an unbound variable, avoiding errors when snapshots
are published for a new branch (e.g. when we branch-off).

PR Close #46076
2022-05-23 13:26:32 -07:00
Nathan Nontell
8461259334 docs(docs-infra): update createComponent description to fix incorrect method name and invalid use of html escaping (#46074)
PR Close #46074
2022-05-23 13:21:45 -07:00
George Kalpakas
f83ee69e17 build(docs-infra): update Angular Material to v14.0.0-rc.0 in AIO (#45997)
Update angular.io to the latest prerelease version of Angular Material
(v14.0.0-rc.0).

PR Close #45997
2022-05-23 13:20:10 -07:00
George Kalpakas
c9e5b5b5c0 build(docs-infra): update Angular CLI/framework to v14.0.0-rc.0 in AIO (#45997)
Update angular.io to the latest prerelease versions of Angular CLI and
framework (v14.0.0-rc.0).

Also update angular.io to more closely align with new CLI apps. See also
the [diff][1] between a basic v13.0.0-next.9 CLI app and a v14.0.0-rc.0
one.

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

PR Close #45997
2022-05-23 13:20:10 -07:00
George Kalpakas
8d4dcbcccc build(docs-infra): update AIO payload sizes (#45997)
Update the AIO payload sizes to better see the impact in size of changes
in subsequent commits.

PR Close #45997
2022-05-23 13:20:10 -07:00
George Kalpakas
67ec9eec64 build(docs-infra): update Angular CLI/framework to v14.0.0-rc.0 in docs examples (#45997)
Update the docs examples to the latest prerelease versions of Angular
CLI and framework (v14.0.0-rc.0).

Also update the example apps to more closely align with new CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.3 CLI app and a
v14.0.0-rc.0 one.

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

PR Close #45997
2022-05-23 13:20:10 -07:00
dario-piotrowicz
18b0ee073f fix(compiler-cli): update unknown tag error for aot standalone components (#45919)
update the error message presented during aot compilation when an unrecognized
tag/element is found in a standalone component so that it does not mention
the ngModule anymore

Note: the jit variant is present in PR #45920

resolves #45818

PR Close #45919
2022-05-23 13:18:49 -07:00
Jerome Kruse
e235c70d7d docs: update service-worker-config to more clearly describe behavior (#45909)
Fixes #45280

PR Close #45909
2022-05-23 13:17:51 -07:00
Andrew Kushnir
985f8d721e fix(core): produce proper error message for unknown props on <ng-template>s (#46068)
Currently for cases when an unknown structural directive is applied to `<ng-template>`s, an error message thrown by the framework doesn't contain a tag name, for example:

```
NG0303: Can't bind to 'unknownDir' since it isn't a known property of 'null'.
```

The underlying reason is that the tag name for the `<ng-template>` is not produced (`null` is useed as a value) by the compiler in case of inline templates and runtime logic relies on this effect.

This commit handles this situation when an error message is thrown, as the fastest way to improve the error message. More refactoring would be needed to avoid relying on the mentioned effect at runtime.

PR Close #46068
2022-05-23 10:03:23 -07:00
Thomas Mair
863c32e8c9 fix(docs-infra): add member name to search index without ignore list (#46060)
Previously classs, interface and enum members where filtered with the default word ignore list. This lead to  poor search results if a search for a member on the ignore list was performed.

PR Close #46060
2022-05-23 09:56:08 -07:00
J Rob Gant
1bd0532e87 docs: Remove outdated note (#46022)
Component.styles can now use SCSS or LESS preprocessors.

PR Close #46022
2022-05-23 09:53:40 -07:00
Doug Parker
23a9990935 docs: add demo video for Angular CLI autocompletion doc (#45995)
The CLI autocompletion doc added in https://github.com/angular/angular-cli/pull/23146 includes a demo GIF, but AIO currently has no infrastructure to pull assets like images from the CLI repository, so this demo needs to be stored directly in AIO on this repository.

PR Close #45995
2022-05-23 09:30:44 -07:00
dario-piotrowicz
b1a4b305db fix(core): update unknown tag error for jit standalone components (#45920)
update the error message presented during jit compilation when an unrecognized
tag/element is found in a standalone component so that it does not mention
the ngModule anymore

Note: the aot variant is present in PR #45919

resolves #45818

PR Close #45920
2022-05-23 09:27:08 -07:00
Andrew Kushnir
dfba192706 fix(core): handle AOT-compiled standalone components in TestBed correctly (#46052)
Previously, the code in TestBed didn't take into account the fact that the `cmp.dependencies` array after the AOT compilation might contain regular (NgModule-based) Components/Directive/Pipes. As a result, some NgModule-specific code paths were invoked for non-NgModule types, thus leading to errors.

This commit updates the code to handle AOT-compiled structure of standalone components correctly.

PR Close #46052
2022-05-23 09:25:08 -07:00
Andrew Kushnir
8704574f7e fix(core): restore NgModule state correctly after TestBed overrides (#46049)
This commit updates the NgModule logic to account for a case when a type has more than one generated def. This is a common situation for NgModules which have at least two: ɵmod and ɵinj. Previously, the second def was not stored before applying overrides, thus leaving it modified after the test, leaking the state as a result. This fix ensures that we store all defs before applying any overrides.

PR Close #46049
2022-05-23 09:23:11 -07:00
Pawel Kozlowski
ae18f00023 docs: add guide to standalone components preview (#46058)
Add a new page in developers guide section with the general
overview of the standalone components, directives and pipes
Additional APIs (bootstrapApplication, router, DI) as also
covered.

PR Close #46058
2022-05-23 09:15:06 -07:00
Joey Perrott
76f5a559e8 build: update saucelabs key (#46089)
Update the saucelabs key for the newly generated key

PR Close #46089
2022-05-21 20:21:41 +00:00
Joey Perrott
f017029cea build: update saucelabs key (#46088)
Update the saucelabs key for the newly generated key

PR Close #46088
2022-05-21 20:11:03 +00:00
Paul Gschwendtner
a0be043f81 reactor(compiler-cli): account for babel types change (#45967)
This commit accounts for the Babel types changes. Some properties
can now also be `undefined` so existing checks/assertions had to
be adjusted to also capture `undefined` (along with `null`).

Additionally, in preparation for a new ECMA proposal, Babel types
seem to have been updated to include private names in object property
keys. This is not necessarily the case for object expressions, but
could be for object patterns (in the future -- when implemented).

More details: https://github.com/babel/babel/pull/14304 and
https://github.com/tc39/proposal-destructuring-private.

PR Close #45967
2022-05-20 14:18:10 -07:00
Paul Gschwendtner
71e4bf5256 build: update api-extractor to avoid crash for properties without explicit type (#45967)
API extractor crashes got fixed with
https://github.com/microsoft/rushstack/pull/3424.

PR Close #45967
2022-05-20 14:18:09 -07:00
Paul Gschwendtner
bd91572986 build: lock file maintenance to avoid node module differences for babel types (#45967)
We recently updated Babel and the Bazel types but this actually
resulted in duplicates, causing differences between what people
seen in their IDE vs. what Bazel builds.

This commit removes the lock file and generates it fully fresh,
deduping dependencies and also fixing the differences between
local IDE and Bazel.

As part of this we also need to update/fixup one assertion on the
Babel node path types, because the node start/end can now also
be `undefined`.

PR Close #45967
2022-05-20 14:18:09 -07:00
Renovate Bot
d869ede818 build: update all non-major dependencies (#45967)
PR Close #45967
2022-05-20 14:18:09 -07:00
Dylan Hunn
0e14df697a fix(forms): Warn on FormControls that are constructed with both options and asyncValidators.
DEPRECATED:

It is now deprecated to provide *both* `AbstractControlOption`s and an async validators argument to a FormControl. Previously, the async validators would just be silently dropped, resulting in a probably buggy forms. Now, the constructor call is deprecated, and Angular will print a warning in devmode.
2022-05-19 15:49:02 -07:00
Dylan Hunn
37bf6932e9 fix(forms): Add a nonNullable option to FormControl for consistency.
DEPRECATED:

The `initialValueIsDefault` option has been deprecated and replaced with the otherwise-identical `nonNullable` option, for the sake of naming consistency.
2022-05-19 15:49:02 -07:00