Commit graph

29561 commits

Author SHA1 Message Date
Matthieu Riegler
8c0285b4af docs: remove outdated/unsupported webworker doc (#49856)
The webworker platform has been removed in v11 by #38846

PR Close #49856
2023-04-17 14:01:41 +00:00
Matthieu Riegler
f9886e1e28 refactor(docs-infra): remove dart support & mentions (#49857)
There is no need to keep the support for Dart here.

PR Close #49857
2023-04-17 14:00:49 +00:00
Qiuran Hu
ea4d9e8ef8 docs: fix typo in Hierarchical injectors doc (#49824)
PR Close #49824
2023-04-17 13:59:09 +00:00
ChrTall
fd0c26e430 docs: Fixed Typo (#49753)
Fixed Typo
PR Close #49753
2023-04-17 13:58:15 +00:00
Matthieu Riegler
bf2e11c035 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-17 13:37:09 +00:00
Andrew Kushnir
d994f8520c fix(core): include inner ViewContainerRef anchor nodes into ViewRef.rootNodes output (#49867)
Currently, the `ViewRef.rootNodes` output is missing anchor (comment) nodes for inner `ViewContainerRef`s,
when an achor node was created for that instance of a `ViewContainerRef` (which happens in all cases except
when an <ng-container> was used as a host for a view container).

This issue affects hydration logic, which relies on the number of root nodes within a view to properly determine
segments in DOM that belong to a particular view.

Resolves #49849.

PR Close #49867
2023-04-17 13:35:58 +00:00
Andrew Kushnir
f37cb477a8 refactor(core): log hydration setup warning in dev mode only (#49876)
This commit updates the code to log hydration setup warning in dev mode only. Previously, the warning was retained in the code even after optimization, thus making it into production bundles. The warning is meant to let developers know that hydration was enabled, but wasn't activated, so it's safe to tree-shake it away from production bundles.

PR Close #49876
2023-04-17 13:34:53 +00:00
Andrew Kushnir
96a4e74069 refactor(platform-server): refactor internal _render function (#49851)
The change in 8c3b92cfb3 inspired a followup refactor where the `_render` method can just accept a PlatformRef and an ApplicationRef instances directly.

PR Close #49851
2023-04-17 13:34:00 +00:00
Angular Robot
3fcf8bd667 build: update actions/checkout digest to 8e5e7e5 (#49815)
See associated pull request for more information.

PR Close #49815
2023-04-17 13:31:19 +00:00
Alan Agius
8c3b92cfb3 refactor(platform-server): simplify _render method (#49840)
This commits simplifies the `_render` method by using async/await.

PR Close #49840
2023-04-14 15:28:41 -04:00
Alan Agius
9e9b424332 test(router): enable a subset of bootstrapping test to ran on node (#49843)
Some of these test can run on Node.js

PR Close #49843
2023-04-14 14:14:55 -04:00
Andrew Scott
cbca5817d8 fix(router): canceledNavigationResolution: 'computed' with redirects to the current URL (#49793)
The `canceledNavigationResolution: 'computed'` option does not correctly
assign page IDs or restore them when redirects result in navigating to
the current URL. This change ensures that the page IDs are still
incremented and restored correctly in this scenario.

PR Close #49793
2023-04-14 14:55:06 +00:00
Matthieu Riegler
aebf1158f6 ci: Remove environment files and EnableProdMode on integration tests (#49746)
Since v15, prod mode is handled by the CLI with the `optimization` flag. We can remove the environement files and `enableProdMode` when the tests use the CLI.

PR Close #49746
2023-04-14 14:13:33 +00:00
Matthieu Riegler
5715154461 refactor(core): Remove NG_DEV_MODE const (#49838)
Follow up to #49530, removing the last remaining `NG_DEV_MODE`

PR Close #49838
2023-04-14 14:12:53 +00:00
Andrew Scott
b4e83caba9 refactor(core): Do not need to set lView slots to null in createLView (#49836)
The slots are initialized to null in the tView blueprint

PR Close #49836
2023-04-14 14:12:23 +00:00
Andrew Scott
a26e6f6fa8 test(core): re-add tests for signals in OnPush components (#49836)
These tests were accidentally deleted during a rebase.

PR Close #49836
2023-04-14 14:12:23 +00:00
Jessica Janiuk
09f9670f72 docs: release notes for the v16.0.0-rc.1 release 2023-04-14 07:10:36 -07:00
Pawel Kozlowski
2c22e6fb5f fix(core): onDestroy should be registered only on valid DestroyRef (#49804)
It might happen that the lifecycle scope represented by DestroyRef becomes
invalid before an onDestroy hook is registered (ex. injector or component
instance got destroyed). In such cases registration of the onDestroy hooks
should no longer be possible.

Fixes #49658

PR Close #49804
2023-04-13 21:14:44 +00:00
Pawel Kozlowski
2d0fcd611b refactor(core): add asReadonly helper to writable signals (#49802)
The new asReadonly method on the WritableSignal interface makes
it possible to create readonly instance of a writable signal.

Readonly signals can be accessed to read their value,
but can't be changed using set, update or mutate methods.

PR Close #49802
2023-04-13 20:48:12 +00:00
Andrew Scott
90166bed25 fix(core): Fix capitalization of toObservableOptions (#49832)
The capitalization of the interface should be pascal case.

PR Close #49832
2023-04-13 19:12:54 +00:00
Payam Valadkhan
294fae02eb refactor(core): fix privately imported symbol from signals package (#49812)
The signals package is a separate target, and imports from it should go through its index.ts entrypoint.

PR Close #49812
2023-04-13 14:04:57 +00:00
Alan Agius
ddf0d4eabe fix(http): HTTP cache was being disabled prematurely (#49826)
This commit fixes an issue were on the server the HTTP cache was being disabled prematurely which caused HTTP calls performed in `ngOnInit` life cycle hooks not to be cached.

PR Close #49826
2023-04-13 14:04:00 +00:00
Andrew Kushnir
7fd0b678f3 refactor(core): avoid deep links into @angular/core (#49823)
This commit updates the code to avoid deep links into the `@angular/core`, which triggers a build issue in apps when a code is referenced.

PR Close #49823
2023-04-13 14:03:27 +00:00
Andrew Kushnir
54f18c832d refactor(core): rename internal DI token that indicates whether hydration is enabled (#49800)
This commit renames an internal token to better align it with the naming of the function (to highlight the fact that it's responsible for DOM part of the hydration).

PR Close #49800
2023-04-13 14:02:33 +00:00
Matthieu Riegler
38fe1b91fc refactor(core): drop IE workarounds (#49763)
Angular doesn't support IE anymore. We can remove the workarounds related to IE.

Some workarounds are keep because of the support of domino but the comments related to IE are removed.

PR Close #49763
2023-04-13 14:01:45 +00:00
Danilo Bassi
ab5e2d9387 fix(http): prevent headers from throwing an error when initializing numerical values (#49379)
Some libraries could use numbers in headers. this fix prevents Angular from
throwing an error by casting those numerical values into strings.

Fixes #49353

PR Close #49379
2023-04-13 14:00:16 +00:00
Kristiyan Kostadinov
5ac8ca4f55 fix(core): error if document body is null (#49818)
Fixes an error that came up internally which was being thrown, because in some cases the `document.body` might be null.

PR Close #49818
2023-04-12 12:51:53 -07:00
Andrew Kushnir
577374f05e docs: release notes for the v16.0.0-rc.0 release 2023-04-12 12:18:12 -07:00
Andrew Kushnir
a900a0d94a docs: release notes for the v15.2.7 release 2023-04-12 12:08:24 -07:00
Alan Agius
71e9532d5d test: improve testing of HTTP and transfer state cache (#49810)
This commit improves the HTTP transfer state integration test by using `provideClientHydration` method and validates that no HTTP calls are performed during the client bootstrapping.

PR Close #49810
2023-04-12 09:45:34 -07:00
Andrew Scott
1dddb78786 fix(core): toObservable should allow writes to signals in the effect (#49769)
`toObservable` creates an `effect` that watches for updates to the
source signal. We should allow writes to signals in this effect, which
would be consumed by downstream observers.

PR Close #49769
2023-04-12 09:35:55 -07:00
Andrew Scott
53d019ab7d fix(core): catch errors from source signals outside of .next (#49769)
From Ben:

> When dealing with any reactive function call you don't control
> like `observer.next()` (or anything similar), you want to catch the error
> in the producer call, in this case `signal()`. You don't want to catch errors
> in the `observer.next` call itself.

PR Close #49769
2023-04-12 09:35:55 -07:00
Andrew Scott
f1d5896ff3 refactor(core): rename from[Observable/Signal] => to[Signal/Observable] (#49769)
Based on feedback in the RFC, most would prefer `toSignal` and
`toObservable`.

PR Close #49769
2023-04-12 09:35:55 -07:00
Andrew Scott
5c415e9dae refactor(core): Update signal signature with respect to initial values (#49769)
The initial value used for signals by default is now `undefined`. In
addition, there is a new option to express that the signal should emit a
value synchronously (`requireSync: true`). When this value is specified,
the function will throw _on creation_ if the subscribing to the
`Observable` does not result in a synchronous emit.

PR Close #49769
2023-04-12 09:35:55 -07:00
Andrew Scott
d966fdd438 refactor(router): Ensure data is bound to components in change detection following navigation (#49741)
`RouterOutlet` components can initialize _during_ change detection (for
example, if they exist in an embedded view). When this happens, data
from the router should be bound immediately to the routed components
rather than not being available until the next round of change
detection. This is mostly just a problem for testing because change
detection is triggered manually. It would be surprising to have to
detect changes _twice_ on the fixture in order to get data bound to the
routed component.

PR Close #49741
2023-04-12 09:33:11 -07:00
Andrew Scott
332f0b870d refactor(router): Correct types of ActivatedRoute Observables (#49741)
The `ActivatedRoute` exposes several `Observable` members that are
`BehaviorSubject` under the hood. In order to update the values of those
subjects, we cast the `Observable` type internally. Instead, the
`BehaviorSubject` should be kept and re-exposed as public API
separately.

PR Close #49741
2023-04-12 09:33:11 -07:00
Angular Robot
c190fbb15c build: update dependency rimraf to v5 (#49757)
See associated pull request for more information.

PR Close #49757
2023-04-12 09:28:25 -07:00
Angular Robot
85c1a6463f build: update github/codeql-action action to v2.2.11 (#49775)
See associated pull request for more information.

PR Close #49775
2023-04-12 09:26:02 -07:00
Paul Gschwendtner
7e8b968b7c ci: update pullapprove config to reflect currrent availability (#49786)
Updates the pullapprove config to reflect the current availability.

PR Close #49786
2023-04-12 09:25:22 -07:00
Jessica Janiuk
1f7f7598d5 docs: add information on how to run universal in conjunction with service worker (#49795)
PR Close #49795
2023-04-12 09:24:49 -07:00
Alan Agius
a1e0f86c1e docs: remove preboot reference from universal doc (#49808)
This package is no longer actively maintained and in general is not needed.

PR Close #49808
2023-04-12 09:24:04 -07:00
Alan Agius
f9b821f07d fix(http): delay accessing pendingTasks.whenAllTasksComplete (#49784)
Accessing `pendingTasks.whenAllTasksComplete` too early causes the `InitialRenderPendingTasks` to return a resolved promise too early. This commit changes the way we access `whenAllTasksComplete` to only happen when the application is stabilized.

PR Close #49784
2023-04-11 14:12:38 -07:00
Alan Agius
1026552c01 fix(core): resolve InitialRenderPendingTasks promise on complete (#49784)
Current in the `InitialRenderPendingTasks` when the `collection` size is 0 a new promise is created a the status is changed to completed. This causes the promise that is created during the class initialization phase to never be resolved which causes SSR to hang indefinitely.

PR Close #49784
2023-04-11 14:12:37 -07:00
Andrew Scott
e949548561 fix(compiler): Produce diagnositc if directive used in host binding is not exported (#49527)
The compiler currently does not check to make sure that directives in
the host bindings are exported. These directives are part of the public
API of the component so they do have to be.

PR Close #49527
2023-04-11 14:02:51 -07:00
Andrew Scott
8a75a8ad26 fix(compiler-cli): Catch FatalDiagnosticError during template type checking (#49527)
This commit updates the type checking operation to catch
`FatalDiagnosticError` and surface them as diagnostics rather than
crashing.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1881

PR Close #49527
2023-04-11 14:02:51 -07:00
Alan Agius
079f4bc1ef fix(http): wait for all XHR requests to finish before stabilizing application (#49776)
Previously, since the `HttpXhrBackend` is a singleton, the macrotask was created and completed only for the initial request since it was stored as in property in the class instance. This commit replaces this logic to create a macro task for every XHR request.

Closes #49730

PR Close #49776
2023-04-11 13:44:30 -07:00
Pawel Kozlowski
ce38be03ce fix(core): allow async functions in effects (#49783)
This change makes is possible to use async functions
(ones returning a promise) as effect run functions.

To make it possible, the signature of the effect function
changed: effect cleanup function is registered now
(using a dedicated callback passed to the effect creation)
instead of being returned from the effect function.

PR Close #49783
2023-04-11 12:49:10 -07:00
Alex Rickabaugh
b8a4075187 refactor(core): fix privately imported symbol from signals package (#49789)
The signals package is a separate target, and imports from it should go
through its index.ts entrypoint.

PR Close #49789
2023-04-11 12:47:53 -07:00
Andrew Kushnir
7ee542d263 refactor(platform-server): include info about enabled features into ng-server-context (#49773)
This commit updates the logic that adds the "ng-server-context" attribute to the root elements to also include information about SSR feature enabled got an application.

PR Close #49773
2023-04-11 12:46:09 -07:00
Matthieu Riegler
1da3e5f0bd refactor(platform-browser-dynamic): Drop IE related workarounds. (#49761)
IE is not supported by Angular anymore, we can drop IE specific code !

PR Close #49761
2023-04-11 12:45:10 -07:00