Commit graph

30006 commits

Author SHA1 Message Date
Kristiyan Kostadinov
a5c57c7484 fix(core): resolve error for multiple component instances that use fallback content (#55478)
Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass.

These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty.

Fixes #55466.

PR Close #55478
2024-04-25 09:04:01 -07:00
ice-blaze
5ad2f5f18b refactor(forms): replace errors with hasError() (#55379)
Material documentation use hasError. For homogeneity reason, this commit
will adopt material style.

Fixes #55378

PR Close #55379
2024-04-25 08:57:30 -07:00
Kirk Larkin
242fec847e docs: Update lightweight-injection-tokens.md (#55490)
PR Close #55490
2024-04-25 08:55:46 -07:00
yuichi.imori
10040e99e9 docs: Correct code references in Tutorial 01. (#55506)
PR Close #55506
2024-04-25 08:55:08 -07:00
Ben Hong
1e58aa00b8 docs: update security guide link references (#55514)
PR Close #55514
2024-04-25 08:54:31 -07:00
Ben Hong
dcf737ee56 fix(docs-infra): add cookie consent gtag event default state (#54574)
This PR sets a default state for cookie consent of 'denied'. The other part of the PR exists in the angular/dev-infra repo which will grant permission when the user accepts the cookie banner.

PR Close #54574
2024-04-25 08:53:07 -07:00
Pawel Kozlowski
44c0ed83a6 fix(core): hide implementation details of ExperimentalPendingTasks (#55516)
The ExperimentalPendingTasks service was accidently exposing one of its
internal fields as a public one. This commit fixes this by marking the
field in question as private.

PR Close #55516
2024-04-25 08:51:01 -07:00
Andrew Kushnir
2a3db67cdf release: cut the v18.0.0-next.6 release 2024-04-25 08:34:43 -07:00
Andrew Kushnir
e478180b9b docs: release notes for the v17.3.6 release 2024-04-25 08:28:37 -07:00
Andrew Kushnir
e3d5607caf Revert "refactor(core): Ensure DOM removal happens when no app views need refresh (#55132)" (#55524)
This reverts commit a07ea069e5.

PR Close #55524
2024-04-24 16:35:57 -07:00
Andrew Kushnir
28905ab9ae Revert "refactor(animations): Ensure async animations applies changes when loaded in zoneless (#55132)" (#55524)
This reverts commit 9ab36cfe0a.

PR Close #55524
2024-04-24 16:35:57 -07:00
Andrew Kushnir
70b478ff59 Revert "refactor(core): Omit listeners from out-of-zone scheduling when using ZoneJS (#55492)" (#55524)
This reverts commit 617bc3337d.

PR Close #55524
2024-04-24 16:35:57 -07:00
Andrew Scott
617bc3337d refactor(core): Omit listeners from out-of-zone scheduling when using ZoneJS (#55492)
In Angular today, a bound listener automatically marks the view for
check. When using ZoneJS, these listeners are most often executed in the
Angular Zone as well, so synchronization (`ApplicationRef.tick`) will
eventually happen. _However_, developers can opt out of zone-patching
for events in several ways, and often do this for very frequent
listeners like `mousemove`, `resize`, and `scroll`. We do not want to
break existing expectations that these are now "safe" events to have
listeners for by automatically scheduling change detection regardless of
whether the listener executed inside or outside the Angular zone.

In contrast, in order for developers to more easily transition to zoneless,
we need to be able to ensure that components which are using `OnPush`
are, for the most part, compatible with zoneless as well. Because listeners
automatically mark the component for check, developers using `OnPush`
did not/do not need to also call `ChangeDetectorRef.markForCheck` or a
similar API. Unfortunately, this means that we need to consider the
listener callbacks as a notification to schedule a `tick` when Zoneless
is enabled. In the future, we would like to have an opt-out for this
(i.e. signal components) since it's not really how we _want_ things to work.

PR Close #55492
2024-04-24 12:25:08 -07:00
Pawel Kozlowski
ac863ded48 feat(core): provide ExperimentalPendingTasks API (#55487)
The new ExperimentalPendingTasks API lets developers to add and remove
tasks that control applications stability: a pending task prevents
application from being stable.

This API is important for all the use-cases that depend on the concept
of stability and SSR serialization is a notable example.

Closes #53381

PR Close #55487
2024-04-24 11:23:10 -07:00
Andrew Scott
d0c2e1beb8 docs: fix public API from primitives (#55515)
PR Close #55515
2024-04-24 11:22:05 -07:00
Alan Agius
cf2e1b3e5d refactor(platform-server): add link that explains nonce application/json (#55505)
Add a link to the specs explaining why nonce is not needed for `application/json`.

PR Close #55505
2024-04-24 10:48:38 -07:00
Joey Perrott
b28d0bf704 ci: update @angular/ng-dev (#55513)
Update @angular/ng-dev to latest version

PR Close #55513
2024-04-24 10:46:01 -07:00
Andrew Scott
9ab36cfe0a refactor(animations): Ensure async animations applies changes when loaded in zoneless (#55132)
Async animations currently works in Zones because the render factory
promise resolve causes change detection to happen.

fixes #54919

PR Close #55132
2024-04-24 10:33:47 -07:00
Andrew Scott
a07ea069e5 refactor(core): Ensure DOM removal happens when no app views need refresh (#55132)
This change ensures that `ApplicationRef.tick` flushes animations by
calling `rendererFactory2.end`. This might not have happened before if
there were no views that needed to be refreshed.

This is also likely to fix a potential regression caused by #53718 even
in zone apps where animations don't get flushed when no views attached
to ApplicationRef are dirty.

PR Close #55132
2024-04-24 10:33:47 -07:00
Andrew Kushnir
307bc1d6b6 refactor(platform-server): event contract script should follow event dispatch script (#55502)
This commit fixes an issue where event contract init script was injected into the page before the inlined event dispatch script. That resulted in runtime exceptions, since event contract relies on some code being present on a page already.

PR Close #55502
2024-04-24 10:32:36 -07:00
Andrew Kushnir
fc90549c9b refactor(core): event replay should account for pages with no events (#55502)
This commit updates the logic to take into account a situation when Event Replay feature is enabled (using `withEventReplay()` method), but there were no events configured in an application. In this case, there is no need to setup an event dispatcher and trigger event replay.

PR Close #55502
2024-04-24 10:32:35 -07:00
Andrew Kushnir
bbd0cbfacf refactor(core): disable property renaming for the event dispatch script (#55502)
This commit updates Terser config to disable property renaming for the event delegation script (that we later inline into the HTML during SSR). The problem is that event dispatcher relies on some functions on the EventContract class to have original names after after minification, we loose an ability to call those functions.

PR Close #55502
2024-04-24 10:32:35 -07:00
Tom Wilkinson
4bf3d89dae refactor(core): Remove stop propagation beahavior. (#55435)
This removes stop propagation behavior from `EventContract` and removes
the associated stop propagation logic.

PR Close #55435
2024-04-24 09:12:34 -07:00
Tom Wilkinson
98e861395c refactor(core): Split Dispatcher into base class. (#55372)
This will enable refactoring existing usages of the Dispatcher that use
APIs that we do not intend to support, like registerGlobalHandler and
registerEventInfoHandlers to use the LegacyDispatcher.

PR Close #55372
2024-04-24 09:10:04 -07:00
iteriani
811fe001c9 refactor(core): Replay events from the event contract using the dispatcher. (#55467)
This should accomplish event replay during full page hydration.

PR Close #55467
2024-04-23 16:08:36 -07:00
Angular Robot
2e2ca5e9d9 build: update scorecard action dependencies (#55473)
See associated pull request for more information.

PR Close #55473
2024-04-23 15:17:40 -07:00
fdonzello
c001b05c77 refactor(forms): added control name in console errors (#55397)
When a formControlName is used without a parent formGroup, an error is
logged in the console. Before this commit, there was no information
about which control had the issue. Now, it's reported and the
troubleshoot is much faster.

PR Close #55397
2024-04-23 15:16:57 -07:00
Andrew Scott
c175bca364 fix(core): DeferBlockFixture.render should not wait for stability (#55271)
The `DeferBlockFixture.render` function should not await the
`whenStable` promise of the fixture. This does not allow developers to
test any intermediate states that might occur between rendering the
initial content and the full app stability.

fixes #55235

PR Close #55271
2024-04-23 15:12:39 -07:00
Angular Robot
86967af904 build: lock file maintenance (#55343)
See associated pull request for more information.

PR Close #55343
2024-04-23 13:37:56 -07:00
Leonardo Collazo Klenina
b1e63491bb Update making-requests.md (#55390)
docs(http): change "buffer.length" to "buffer.byteLength"

property "length" does not exist on type "ArrayBuffer" but "byteLength" does
PR Close #55390
2024-04-23 13:34:33 -07:00
Joey Perrott
5a10f405d3 fix(core): complete the removal of deprecation async function (#55491)
Remove the `async` function in favor of using `waitForAsync` instead.

BREAKING CHANGE: `async` has been removed, use `waitForAsync` instead.

PR Close #55491
2024-04-23 13:29:46 -07:00
Kirk Larkin
79a33e4366 docs: Update dependency-injection.md (#55432)
PR Close #55432
2024-04-23 13:29:14 -07:00
Kirk Larkin
86ad37a446 docs: Update dependency-injection-context.md (#55455)
PR Close #55455
2024-04-23 13:27:15 -07:00
Kirk Larkin
62bbed8f5a docs: Update dependency-injection-providers.md (#55454)
PR Close #55454
2024-04-23 13:26:16 -07:00
Kirk Larkin
cd390c26a8 docs: Update creating-injectable-service.md (#55449)
PR Close #55449
2024-04-23 13:25:54 -07:00
Kirk Larkin
89a5c7e6f8 docs: Update creating-injectable-service.md (#55449)
PR Close #55449
2024-04-23 13:25:54 -07:00
Angular Robot
f4d894b58a docs: update Angular CLI help [main] (#55409)
Updated Angular CLI help contents.

PR Close #55409
2024-04-23 13:24:22 -07:00
lilbeqiri
bb673ff458 docs: improve grammar at tutorial steps (#55414)
Fix the grammar issues at some of the tutorial pages making sure they sound correctly.

PR Close #55414
2024-04-23 13:22:58 -07:00
vladboisa
900b5e7dfd docs(docs-infra): fix broken links (#55446)
Add the missing folder's for links

Fixes #55442

docs(docs-infra): fix template reference link

Change the broken link

PR Close #55446
2024-04-23 13:21:48 -07:00
Drew Mares
c773238055 docs: Fix typo in waitForAsync example (#55407)
The previous example had an incomplete code snippet that would not work if copied and pasted as is. There were two missing closing parentheses, one for the `inject` function, and the other for the `waitForAsync` function.

PR Close #55407
2024-04-23 13:16:15 -07:00
Joey Perrott
1f288b269a ci: reenable integration tests (#55463)
Begin running integration tests again after they were unintentionally disabled

PR Close #55463
2024-04-23 13:13:20 -07:00
Alan Agius
5674c644ab fix(platform-server): add nonce attribute to event record script (#55495)
This commit fixes an issue where the nonce attribute was not added when `CSP_NONCE` token was provided.

PR Close #55495
2024-04-23 13:12:47 -07:00
Kristiyan Kostadinov
5948193e13 fix(core): skip defer timers on the server (#55480)
Adds a check that disables the timer scheduling for `placeholder` and `loading` blocks on the server since the underlying timer will delay the server response.

Fixes #55475.

PR Close #55480
2024-04-23 13:06:52 -07:00
Alan Agius
bcce85af72 refactor(animations): remove deprecated matchesElement from AnimationDriver (#55479)
BREAKING CHANGE: Deprecated `matchesElement` method has been removed from `AnimationDriver` as it is unused.

PR Close #55479
2024-04-23 13:06:27 -07:00
Alan Agius
eecde2e413 build: remove no longer required bazel windows patch (#55477)
This patch is no longer required.

PR Close #55477
2024-04-23 13:06:03 -07:00
Alan Agius
cba336d4f1 refactor(platform-browser): remove deprecated transfer state APIs (#55474)
BREAKING CHANGE: Deprecated `StateKey`, `TransferState` and `makeStateKey` have been removed from `@angular/platform-browser`, use the same APIs from `@angular/core`.

PR Close #55474
2024-04-23 13:05:38 -07:00
Angular Robot
1e54956025 build: update actions/checkout action to v4.1.3 (#55472)
See associated pull request for more information.

PR Close #55472
2024-04-23 13:05:13 -07:00
Matthieu Riegler
8f62aac6ea docs(docs-infra): improve filtering performances on API page (#55470)
Identity tracking was not a good choice here 🙃

PR Close #55470
2024-04-23 13:04:51 -07:00
Matthieu Riegler
7aff867c78 docs: fix links to packages. (#55469)
fixes #55458

PR Close #55469
2024-04-23 13:04:21 -07:00
Angular Robot
c4823dfd63 build: update actions/checkout digest to 1d96c77 (#55464)
See associated pull request for more information.

PR Close #55464
2024-04-23 13:03:49 -07:00