Commit graph

25025 commits

Author SHA1 Message Date
Ilia Mirkin
e2ab99b95e fix(common): allow null/undefined to be passed to ngClass input (#39280) (#46906)
With strict template type checking, a null/undefined value will raise an
error. However the implementation is completely fine with it, and it
would be pointless to "fix" it at the callsite and convert to e.g. an
empty string. Allow all of the "supported types" to be passed in
directly to ngClass.

Fixes #39280

PR Close #46906
2022-08-01 12:55:13 -07:00
Andrew Scott
f364378e4d fix(router): Use correct return type for provideRoutes function (#46941)
The provideRoutes function of the Router returns a Provider array and should not be typed as 'any'

PR Close #46941
2022-08-01 11:20:49 -07:00
Andrew Scott
8600732b09 feat(router): Expose the default matcher for Routes used by the Router (#46913)
This commit adds the `defaultUrlMatcher` from the Router to the public
API. `UrlMatcher` and `UrlMatchResult` are already in the public api so
the signature of the function as well as the return value are already
exposed. Any change to those or the implementation of `defaultUrlMatcher`
would already be breaking so there's no additional risk in exposing the
default matcher.

This function can be useful for developers who want to create a custom
matcher which builds on the default matcher of the Router. Currently,
the only way to do this would be to copy-paste the implementation.

fixes #35928

PR Close #46913
2022-08-01 11:19:33 -07:00
Andrew Scott
55febc1691 refactor(router): Remove unused ANALYZE_FOR_ENTRY_COMPONENTS (#46942)
`entryComponents` is a feature that is not used or necessary in Angular
anymore.

PR Close #46942
2022-08-01 11:18:09 -07:00
Roman Matusevich
6fc52c5cba docs: fix selector in Component Interaction guide (#46995)
The selector for the `CountdownTimerComponent` is `app-countdown-timer`
not `countdown-timer`.

PR Close #46995
2022-08-01 11:16:30 -07:00
Asaf M
4ac2196695 docs: fixed typos (#47008)
Used my script: https://github.com/Uziel302/websites-spell-checker/blob/master/mdnversion

PR Close #47008
2022-08-01 11:15:54 -07:00
J Rob Gant
af4f5df150 refactor(zone.js): remove leftover debugging code using Error.stack (#46989)
Pull request #46672 added some debugging code to trace down the
root cause of its bug, but parts of the debugging code has never
been cleaned up and ended up landing as part of the PR.

This commit removes the code as it might cause unexpected issues.
Likely when e.g. `Error` is patched and would perform XHRs in testing,
unveiling e.g. CORS issues. See #46989.

PR Close #46989
2022-08-01 09:52:29 -07:00
George Kalpakas
99e5fa157d test(service-worker): remove redundant ternary operator from MockRequest initialization (#46912)
Since the `init` parameter has a default value of `{}`, it can never be
`!== undefined`. Thus, it is not necessary to account for that case.

PR Close #46912
2022-08-01 09:51:56 -07:00
George Kalpakas
3b34254932 docs(service-worker): remove duplication when describing notificationclick operations (#46912)
PR Close #46912
2022-08-01 09:51:56 -07:00
Tristan Sprößer
383090858c feat(service-worker): support sendRequest as a notificationclick action (#46912)
Implement a new `notificationclick` action, `sendRequest`, which sends a
GET request to the specified URL, without opening a new window. This can
be useful for hitting an API endpoint.

PR Close #46912
2022-08-01 09:51:55 -07:00
Cédric Exbrayat
49e1912e1d refactor(compiler-cli): remove unused error codes (#46847)
A few codes were unused, or no longer used.

PR Close #46847
2022-08-01 09:50:12 -07:00
Kristiyan Kostadinov
ac6e7fa97e fix(bazel): allow extendedDiagnostics option to be passed in through tsconfig (#46953)
Adds the `extendedDiagnostics` field to the list of allowed options so that it is picked up from the user's tsconfig.

PR Close #46953
2022-08-01 09:49:14 -07:00
George Kalpakas
f386cdb499 refactor(docs-infra): remove code that prints debug info (#46987)
In #41106, code was added in angular.io to print info that would help us
investigate and debug a ServiceWorker issue (#28114). Since the fix for
the issue was deployed on October 6th, 2021, the related error rate has
dropped dramatically:

![ChunkLoadError rate](https://user-images.githubusercontent.com/8604205/181502119-64ffb5de-f38e-4414-abcd-0fada29fd6d5.png)

Additionally, there have been no known occurrences or reports of the
issue in the last several months.

The remaining occurrences could be attributed to older versions still
being around on people's devices (due to the ServiceWorker caching) and
other circumstances not related to the ServiceWorker, for which there is
not much we can do. For example, a user could keep a tab open with an
older version of the app, which requests hashed files that no longer
exist on the server. If the ServiceWorker is not activated on such a tab
(either because the browser does not support it or because the user has
disabled it, for example), then it is expected that these requests would
fail.

This commit removes the code that prints ServiceWorker-related debug
info to reduce the payload size of the app.

Fixes #41117

PR Close #46987
2022-08-01 09:48:14 -07:00
Angular Robot
996071035b build: update eslint dependencies to v5.31.0 (#46968)
See associated pull request for more information.

PR Close #46968
2022-08-01 09:46:41 -07:00
Angular Robot
d6899d516d build: update io_bazel_rules_sass digest to 030f696 (#46947)
See associated pull request for more information.

PR Close #46947
2022-08-01 09:40:03 -07:00
Angular Robot
bba2e252cd build: update dependency google-closure-compiler to v20220719 (#46926)
See associated pull request for more information.

PR Close #46926
2022-08-01 09:39:25 -07:00
Angular Robot
1a0850ce4d build: update cross-repo angular dependencies to 6d9c069 (#46905)
See associated pull request for more information.

PR Close #46905
2022-08-01 09:38:34 -07:00
Aristeidis Bampakos
0a5abf3093 docs: modify callout in TOH part 2 (#46964)
PR Close #46964
2022-08-01 09:30:04 -07:00
Andrew Quinn
aadcc13106 docs: fix typo in guide/structural-directives page (#46961)
Fix typo [missing plural marker "element_s_"] on https://angular.io/guide/structural-directives.

Original:
>Structural directives are directives which change the DOM layout by adding and removing DOM element.

Fix:
>Structural directives are directives which change the DOM layout by adding and removing DOM element**s**.
PR Close #46961
2022-08-01 09:29:40 -07:00
Bob Watson
bfddfe5622 docs: initial upload of styles used by doc linter (#46897)
Add the configuration and style files to support documentation linting. The `README.md` file includes instructions for installation and use of the lint tool.

PR Close #46897
2022-08-01 09:29:06 -07:00
angular-robot[bot]
3ca985269d
build: update SECURITY.md to match the content of angular/.github 2022-07-22 18:34:00 +00:00
angular-robot[bot]
d651e733bd
build: update CODE_OF_CONDUCT.md to match the content of angular/.github 2022-07-22 18:29:44 +00:00
Bob Watson
52bbf7fd60 build: update doc approvers (#46939)
Remove: TMDavis, who is no longer at Google
Add: bob-watson who is now on the team

PR Close #46939
2022-07-22 15:39:34 +00:00
Ivaylo Kirov
d4c9523e36 docs: add missing period to the Security guide (#46900)
PR Close #46900
2022-07-22 15:37:30 +00:00
Andrew Kushnir
07606e3181 feat(platform-browser): add isEmpty method to the TransferState class (#46915)
This commit adds the `isEmpty` method to the `TransferState` class to make it possible to check whether the state is empty or not. This is helpful in situations when the `TransferState` should be serialized and the content is transferred to the client (if the state is empty - certain operations can be omitted).

PR Close #46915
2022-07-22 09:17:47 +00:00
Simona Cotin
afa6050a11 docs: add simona cotin to contributors (#46922)
PR Close #46922
2022-07-22 08:27:08 +00:00
Alan Agius
f4348360a6 docs(router): remove incorrect deprecation text in InitialNavigation (#46916)
Remove left over deprecation note.

PR Close #46916
2022-07-22 08:26:25 +00:00
Andrew Scott
8ac45a6264 refactor(router): Update internal INITIAL_NAVIGATION token to use an enum (#46925)
This updates the internal use of INITIAL_NAVIGATION to do two things:

1. Explicitly provide `Enabled` as the default for the token factory
2. Use an enum instead of a string to reduce bundle size

PR Close #46925
2022-07-22 08:25:37 +00:00
Andrew Kushnir
46c44de0cc refactor(platform-server): include TransferState providers into ServerModule (#46899)
This commit updates the code to include the TransferState providers (used for serialization) into the `ServerModule` instead of having the need to import the `ServerTransferStateModule` separately.

The list of providers in the `ServerTransferStateModule` is now empty and importing it is a noop. This is not a breaking change, since the `ServerModule` must be included anyways to make server rendering work correctly.

PR Close #46899
2022-07-21 12:17:43 +00:00
Paul Gschwendtner
24f63fa4e3 build: cut zone.js v0.11.7 (#46911)
Bumps the version for the upcoming `0.11.7` zone.js version,
including the changelog.

PR Close #46911
2022-07-21 10:25:37 +00:00
Emmanuel Roux
10289f1f6e feat(router): expose resolved route title (#46826)
Expose resolved route title from ActivatedRoute and ActivatedRouteSnapshot

PR Close #46826
2022-07-21 09:24:56 +00:00
Cédric Exbrayat
76790a63de fix(core): improve the missing control flow directive message (#46903)
Similarly to what has been done in #46846 for the extended diagnostics about missing control flow directive that was only mentioning that the `CommonModule` should be imported, this commit improves the validation done by the JiT compiler.
Now that the control flow directives are available as standalone, the message mentions that directive itself can be imported.

The message now also mentions which import should be used for the directive (as it can be tricky to figure out that `NgForOf` is the directive corresponding to `*ngFor`).

PR Close #46903
2022-07-21 08:27:31 +00:00
Andrew Scott
d583f85701 refactor(router): Update Router to be providedIn: 'root' (#46824)
This commit updates the Router itself to be `providedIn: 'root'` with a
factory function rather than provided in the `RouterModule`.

PR Close #46824
2022-07-20 11:36:04 -07:00
Andrew Kushnir
a0b2d36415 refactor(platform-server): make TransferState standalone-friendly (#46879)
This commit updates the `TransferState` to make it `providedIn: 'root'`. This makes the entire `BrowserTransferStateModule` module unnecessary, so it got deprecated as well.

The `ServerTransferStateModule` is still retained, but the `renderApplication` function now also includes the necessary tokens to serialize the `TransferState` automatically, so when using the `renderApplication` function, there is no need to include `ServerTransferStateModule` as well.

This change is a part of the ongoing efforts to update the shape of the FW APIs to make them standalone-friendly (so there is no need to import any NgModules).

PR Close #46879
2022-07-20 11:05:08 -07:00
Andrew Kushnir
473f65fe1f docs: release notes for the v14.1.0 release 2022-07-20 10:47:42 -07:00
Andrew Kushnir
6cd5b759aa docs: release notes for the v14.0.7 release 2022-07-20 10:39:34 -07:00
Doug Parker
4e328c47be refactor(bazel): remove experimental_extended_template_diagnostics flag (#46898)
Extended diagnostics are enabled by default now and this flag doesn't do anything anymore but I missed it in a previous cleanup.

PR Close #46898
2022-07-20 08:50:43 -07:00
dario-piotrowicz
3562eb107d refactor(compiler-cli): improve error for non-exported non-standalone (#46114)
improve the error message for non-standalone components which are not
exported from their module, and that are also imported directly as if
they were standalone

this change simply adds the suggestion to the developer to import the
ngModule instead

resolves #46004

PR Close #46114
2022-07-20 08:50:00 -07:00
Andrew Kushnir
7a6509bdc1 refactor(core): NgModuleRef should not implement EnvironmentInjector interface (#46896)
This commit refactors the `NgModuleRef` implementation to drop functions required by the `EnvironmentInjector` interface. Previously the idea was that the `NgModuleRef` can act as an Injector to facilitate easier transition to standalone. However, from the mental model perspective, the `NgModuleRef` has the `injector` field, which is the correct injector reference and can be used is needed as an `EnvironmentInjector`.

PR Close #46896
2022-07-20 08:49:15 -07:00
Andrew Scott
422f06d1cd Revert "fix(core): Fix runInContext for NgModuleRef injector (#46877)" (#46896)
This reverts commit 14081dc48d.

PR Close #46896
2022-07-20 08:49:15 -07:00
Angular Robot
f55224a1f9 build: update cross-repo angular dependencies to cdaaa15 (#46853)
See associated pull request for more information.

PR Close #46853
2022-07-20 08:48:43 -07:00
Bob Watson
0d192e8d0b docs: add info about request timeouts (#46882)
* Adds a short note about how service workers report request timeouts
* Updated heading levels to present a clearer hierarchy and cleaner local TOC
* Removed documentation lint errors
* Moves the service worker service timeout paragraph to a more logical topic in service-worker-devops
* Removes line error from the more logical topic.
* address feedback from PR review comments

fixes #46445

PR Close #46882
2022-07-20 08:47:59 -07:00
Paul Gschwendtner
0dc754a726 test: convert source-map core tests to use async/await instead of fakeAsync (#46888)
The source map tests rely on asynchronous logic from the `source-map`
package. The tests itself are written using `fakeAsync` but this
unnecessarily complicates the interaction with the asynchronous
source-map helpers/package.

To fix this, we just make the tests use async/await as we don't intend
to test fakeAsync in this `describe` block..

PR Close #46888
2022-07-19 09:40:54 -07:00
Paul Gschwendtner
4b1204cca7 build: disable jasminewd2 types for sourcemap playground test (#46888)
The sourcemap test in the e2e playground is now using async/await code.
This results in errors now with the Bazel TS compilation because it
detects that `expect` is returning a promise and should be awaited.

This happens due to the jasminewd2 types. We should just use the actual
jasmine types and not rely on the deprecated selenium control flow,
using explicit async/await in the whole test. This also solves the issue
with the source-map types being async/await now.

PR Close #46888
2022-07-19 09:40:54 -07:00
Paul Gschwendtner
d42ed733d8 test: update source-map tests to account for source-map breaking change (#46888)
The source-map package now requires the
`SourceMapConsumer`/`SourceMapGenerator` classes to be instantiated
asynchronously. This commit updates our tests to account for that.

PR Close #46888
2022-07-19 09:40:54 -07:00
Paul Gschwendtner
f080ae5e51 build: remove source-map package from compiler-cli bundling external list (#46888)
The source-map package is no longer explicitly used in the
`compiler-cli` package and therefore can be removed from the ESBuild
bundling, denoting it as external. This should be a noop.

PR Close #46888
2022-07-19 09:40:54 -07:00
Paul Gschwendtner
c643ec4129 build: update source-map package to latest version (#46888)
The source-map package is updated as part #46707, but the minor
version bump introduced breaking changes. This commit extracts the
update so that we can handle it separately accounting for the breaking
changes. Also removing the caret since this package apparently makes
breaking changes in minor segment bumps.

PR Close #46888
2022-07-19 09:40:54 -07:00
Andrew Scott
14081dc48d fix(core): Fix runInContext for NgModuleRef injector (#46877)
The `runInContext` for `NgModuleRef` was previously an infinite loop.

PR Close #46877
2022-07-19 09:37:32 -07:00
Angular Robot
0e3a2759b0 build: update github/codeql-action action to v2.1.16 (#46885)
See associated pull request for more information.

PR Close #46885
2022-07-19 16:05:05 +00:00
Angular Robot
e736f95884 build: update eslint dependencies to v5.30.7 (#46884)
See associated pull request for more information.

PR Close #46884
2022-07-19 16:04:37 +00:00