Commit graph

26878 commits

Author SHA1 Message Date
Matthieu Riegler
8683414bc3 build: bump license year (#49984)
Bumping to 2023

Fixes #49983

PR Close #49984
2023-04-25 09:29:16 -07:00
Alan Agius
fed4b9d6e9 docs: add v16 in version compatibility table (#49994)
This commit add version v16 in the version compatibility table.

PR Close #49994
2023-04-25 09:28:44 -07:00
Andrew Scott
02a539cb14 refactor(core): Synchronously emit the current signal value in toObservable (#49894)
As described in
https://github.com/angular/angular/discussions/49681#discussioncomment-5628930,
if an `Observable` created from a signal with `toObservable` is
subscribed to in a template, it will initially have `null` as the value.
Immediately after the template is done executing, effects are flushed
and this results in the `AsyncPipe` getting a new value before the
`checkNoChanges` pass, resulting in `ExpressionChanged` error.

```
template: '{{obs$ | async}}'
...
obs$ = toObservable(signal(0));
```

Instead, this commit updates the `toObservable` to synchronously emit
the initial value to the Observable stream.

Side note here: We don't exactly encourage this pattern. Instead of
using `AsyncPipe`, the template should just read signals.

PR Close #49894
2023-04-25 09:27:38 -07:00
Matthieu Riegler
5607e0f529 fix(core): typing of TestBed Common token. (#49997)
Both `ComponentFixtureAutoDetect`  and `ComponentFixtureNoNgZone` are mistyped. Tokens are only instantiated with booleans.

PR Close #49997
2023-04-25 09:27:08 -07:00
Alan Agius
e40a640dfe test: remove unused size goldens (#49976)
These test has been deleted as such the size check golden here is redundant.
PR Close #49976
2023-04-24 11:56:37 -07:00
Matthieu Riegler
e5801be1b2 refactor(core): call publishSignalConfiguration when bootstraping a standalone component. (#49968)
`publishSignalConfiguration` was not called when bootstraping an app using `boostrapApplication()`

PR Close #49968
2023-04-24 11:54:04 -07:00
Angular Robot
a5428a7fa6 build: update cross-repo angular dependencies (#49964)
See associated pull request for more information.

PR Close #49964
2023-04-24 11:53:26 -07:00
Lars Gyrup Brink Nielsen
5f7d929d9e docs(core): correct description of actively supported versions (#49945)
PR Close #49945
2023-04-24 11:52:17 -07:00
Lars Gyrup Brink Nielsen
59fe20506a docs(core): combine compatibility for minor versions sharing dependencies (#49945)
PR Close #49945
2023-04-24 11:52:17 -07:00
Matthieu Riegler
b9c53658a4 refactor(compiler-cli): remove unecessary type assertion (#49971)
microsoft/TypeScript#43966 was fixed in 4.3.1

PR Close #49971
2023-04-24 11:51:18 -07:00
Qiuran Hu
92897b49b0 docs: fix typo in lazy-loading feature modules doc (#49972)
PR Close #49972
2023-04-24 10:52:43 -07:00
Jessica Janiuk
ec62f426b1 test(core): Add hydration symbols test (#49955)
Add symbols tracking test for hydration.

PR Close #49955
2023-04-24 09:57:52 -07:00
Jessica Janiuk
0b23ad7f56 test(core): add size tracking test for hydration apps (#49955)
This adds test to track size regressions when
hydration is enabled.

PR Close #49955
2023-04-24 09:57:52 -07:00
Alan Agius
f33abc805d ci: do not install Java in the test execturor (#49975)
Java is now only needed for `test_zonejs` as all closure related tests have been removed from the framework.

PR Close #49975
2023-04-24 09:57:23 -07:00
Alan Agius
ce0ce4cde1 docs: remove no longer available tests from readme (#49975)
This commit removes no longer available integration tests from the readme.

PR Close #49975
2023-04-24 09:57:23 -07:00
Alan Agius
b59fe28e29 build: update integration test node_modules (#49975)
This commit updates the tests node_modules to be ignored.

PR Close #49975
2023-04-24 09:57:23 -07:00
Jessica Janiuk
be104ec6ed fix(core): add newline to hydration mismatch error (#49965)
This adds a newline after the hydration mismatch errors to provide more separation and readability.

PR Close #49965
2023-04-24 09:52:45 -07:00
Rushikesh Kavar
1752af1cf5 docs: applicability of NgModule providers (#49966)
saying that providers of this NgModule is available to components,pipes and directive of "this" ngModule is not accurate sentence to describe the fact.
I am referring from: https://angular.io/guide/hierarchical-dependency-injection.
It says that "ModuleInjector is configured by the @NgModule.providers and NgModule.imports property. ModuleInjector is a flattening of all the providers arrays that can be reached by following the NgModule.imports recursively."
So, any component,pipe or directive of other NgModule within same ModuleInjector can use providers of this NgModule.
PR Close #49966
2023-04-24 09:51:56 -07:00
Matthieu Riegler
bb6a3e849e refactor(core): throw an error when APP_INITIALIZER token is not an array. (#49860)
Providing a non-multi token for `APP_INITIALIZER` now throws `INVALID_MULTI_PROVIDER` (NG209)

PR Close #49860
2023-04-23 18:31:24 -07:00
Andrew Kushnir
3bcbfecb78 refactor(platform-browser): log a warning when a custom or a noop ZoneJS is used with hydration (#49944)
Hydration relies on a signal from ZoneJS when it becomes stable inside an application, so that Angular can start serialization process on the server or post-hydration cleanup on the client (to remove DOM nodes that remained unclaimed).

Providing a custom or a "noop" ZoneJS implementation may lead to a different timing of the "stable" event, thus triggering the serialization or the cleanup too early or too late. This is not yet a fully supported configuration.

This commit adds a warning (non-blocking) for those cases.

PR Close #49944
2023-04-23 18:23:28 -07:00
Matthieu Riegler
eb5bc95dbf docs: remove the warning about shadowDom support (#49961)
ShadowDom support is now ubiquitous since 2020 and all evergreen browsers.

PR Close #49961
2023-04-23 18:22:44 -07:00
Matthieu Riegler
2487d41bbf docs: remove mention of the webworker platform issues (#49947)
The Webworker platform was remove in v10, we can remove this part.

Fixes #49934

PR Close #49947
2023-04-23 18:20:58 -07:00
Payam Valadkhan
345dd6d81a refactor(compiler-cli): Add experimental local compilation mode. (#49846)
In this mode the compiler generates code based on each individual source file without using its dependencies. This mode is suitable only for fast edit/refresh during development.

PR Close #49846
2023-04-23 18:19:35 -07:00
Angular Robot
27093a7167 build: update cross-repo angular dependencies (#49956)
See associated pull request for more information.

PR Close #49956
2023-04-21 09:06:25 -07:00
Angular Robot
521e284214 build: update cross-repo angular dependencies to v16.0.0-rc.2 (#49941)
See associated pull request for more information.

PR Close #49941
2023-04-20 14:51:02 -07:00
Andrew Kushnir
bbc2efcda2 refactor(core): hydrate components of the same type used with and without ngSkipHydration (#49943)
This commit updates hydration logic to hanlde a case when the same component is used multiple times in a template and in some of those cases, component is opted-out of hydration, for example:

```
<cmp ngSkipHydration />
<cmp />
```

Previously, the first occurrence of the `<cmp>` would result in storing the `ssrId` on a TView as `null` (since hydration is disabled for the component) and the second component instance reused the `null` as a value, thus also skipping hydration.

With the changes from this commit, the `ssrId` would be set when we come across a hydratable instance. We also make sure that the `ssrId` value never changes after we first set it to a non-`null` value.

PR Close #49943
2023-04-20 14:50:32 -07:00
lonikadze
da1ed98dfd docs: replaces "comp: docs" label to "area: docs" (#49952)
Fixes #49951

PR Close #49952
2023-04-20 14:50:00 -07:00
skrtheboss
c029c678d9 fix(core): ensure takeUntilDestroyed unregisters onDestroy listener on unsubscribe (#49901)
The takeUntilDestroyed must always remove the onDestroy listener,
in the teardown logic.

PR Close #49901
2023-04-19 19:55:09 +00:00
Jessica Janiuk
856a0ecbcd docs: release notes for the v16.0.0-rc.2 release 2023-04-19 12:39:01 -07:00
Jessica Janiuk
4b49bfc4f0 docs: release notes for the v15.2.8 release 2023-04-19 12:15:56 -07:00
lonikadze
a29c51bca4 docs: add information on how to use index option in configuration (#49813)
#49780

PR Close #49813
2023-04-19 18:46:10 +00:00
Pawel Kozlowski
1dc919a3df fix(core): execute query setters in non-reactive context (#49906)
This commit assures that query results setters run when there is no active
reactive consumer set.

PR Close #49906
2023-04-19 18:12:15 +00:00
Pawel Kozlowski
40318021ee fix(core): execute input setters in non-reactive context (#49906)
This change explicitly resets a reactive consumer before setting inputs
on directive instances. This is to assure that any potential input setters
do _not_ run in the reactive context.

PR Close #49906
2023-04-19 18:12:15 +00:00
judytag
726d8a8a71 docs: update-to-version-14 linting fixes (#49839)
PR Close #49839
2023-04-19 18:10:33 +00:00
Kristiyan Kostadinov
9165942629 fix(core): handle invalid classes in class array bindings (#49924)
When binding an array to `class` like `[class]="['foo', 'bar']"`, the runtime treats it the same as a literal binding with all the values being `true`, e.g. `{foo: true, bar: true}`. While object literals can only have string keys, arrays can have any value which can lead to errors if the array contains non-string values.

These changes add some logic to stringify the keys and ignore invalid ones.

Fixes #48473.

PR Close #49924
2023-04-19 16:28:26 +00:00
Matthieu Riegler
661b9549c2 docs: schematics for functional guards & resolvers (#49865)
Adding back the schematics to generate functional guards & resolver that they are supported.

PR Close #49865
2023-04-19 16:22:53 +00:00
Matthieu Riegler
195aaa6b11 refactor(core): Create TestBed injector without a module (#49864)
We can create the injector without relying on th module factory.

PR Close #49864
2023-04-19 15:30:23 +00:00
Alan Agius
38661a6f2b test: update platform-server tests to test both ngmodule and standalone application (#49927)
This commits update the platform-server test structure to add 2 applications in the Angular CLI workspace one based on ngmodules and another standalone. The same E2E suit is ran on both apps.

PR Close #49927
2023-04-19 14:56:29 +00:00
Andrew Kushnir
338c7d9125 test(core): adding extra tests for hydration of view containers located after <ng-content> slots (#49920)
This commit adds extra tests to verify a couple additional use-cases related to view containers located after <ng-content> slots.

PR Close #49920
2023-04-19 14:26:43 +00:00
Andrew Kushnir
81ef9c327d refactor(core): handle empty projection slots within <ng-container> during hydration (#49920)
This commit updates hydration logic to handle cases when there are projection slots present in a template inside of an `<ng-container>` and when there are regular elements follow an <ng-content> slot (see tests for additional information). With this combination, the logic that annotates regular element locations should fallback to calculating a path from a reference node to that node. In case of an <ng-container>, the comment node is located *after* the node that needs an annotation. An existing logic was mistakenly returning an empty path, which was represented as a pointer to teh reference node. This commit fixes that and triggers a fallback to using a component host node as a reference in this case.

Resolves #49918.

PR Close #49920
2023-04-19 14:26:43 +00:00
Alan Agius
efb3c68899 refactor(core): remove redundant hydrationInfo check (#49926)
This check is not needed as it is done in the previous line

PR Close #49926
2023-04-19 14:21:40 +00:00
Alan Agius
4175f6fa09 docs: some changes to the helpful not in preserve-whitespaces (#49928)
This commit updates the note with a recommendation.

PR Close #49928
2023-04-19 14:18:43 +00:00
Alan Agius
de567bb800 docs: fix grammer in preserve whitespaces notes (#49928)
This commit fixes some grammer in preserve whitespaces notes.

PR Close #49928
2023-04-19 14:18:43 +00:00
Lars Gyrup Brink Nielsen
aa960c7db4 docs(core): add version ranges for Angular 14.3 (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
670b809ca7 docs: change section heading (#48753)
Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
bed517d398 docs(core): add version ranges for Angular 15.2 (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
beda7e3c5a docs(core): split versions table into LTS and non-LTS tables (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
c18c3c182b docs(docs-infra): add versions document to code owners (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
d74cc5713d docs(docs-infra): add versions document to the navigation (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00
Lars Gyrup Brink Nielsen
61cfca0d55 docs(core): include introductory text about version compatibility (#48753)
PR Close #48753
2023-04-19 14:07:30 +00:00