Commit graph

36863 commits

Author SHA1 Message Date
Jessica Janiuk
69fc5ae922 feat(core): Add incremental hydration public api (#58249)
This exposes the public api to utilize incremental hydration.

PR Close #58249
2024-10-22 09:37:31 -07:00
Henry Zhang
8ddce80a0b feat(service-worker): allow specifying maxAge for entire application (#49601)
This commit adds an `applicationMaxAge` to the service worker configuration. When set, it will only assign a cached version to clients within the `maxAge`. Afterwards, it will ignored any expired application versions and fetch exclusively from the network. The default is `undefined`, for which the behaviour is the same as it currently is.

PR Close #49601
2024-10-22 07:45:21 -07:00
Matthieu Riegler
925de81490 refactor(core): remove ComponentFactoryResolver related dead code (#58274)
`getComponent` wasn't used anymore, we can remove `ERROR_COMPONENT`.

PR Close #58274
2024-10-22 07:43:52 -07:00
Matthieu Riegler
c1aa9c6041 docs(docs-infra): fix CLI commands (#58294)
With this commit the CLI doc will display the correct arguments for the subcommands

fixes #58279

PR Close #58294
2024-10-22 07:42:21 -07:00
Alan Agius
35954455e2 build(migrations): skip source map generation (#58299)
Remove the usage of MagicString and the generation of intermediate sourcemaps,
as sourcemaps are never included in the schematic bundles. Peparing source maps
is a CPU / memory intensive and was causing OoO errors in rollup.

PR Close #58299
2024-10-22 07:41:41 -07:00
Pawel Kozlowski
2bfc64daf1 feat(migrations): expose output as function migration (#58299)
This commit exposes a new ng generate schematic that migrates
outputs from the decorator version to the output function.

PR Close #58299
2024-10-22 07:41:41 -07:00
Pawel Kozlowski
ab25a192ba feat(core): allow running output migration on a subset of paths (#58299)
This change introduces a new configuration parameter to the
output as function migration - it is now possible to restrict
a set of migrated paths.

PR Close #58299
2024-10-22 07:41:41 -07:00
Doug Parker
8b5e5f76a4 test: update protractor builder usage to private-protractor (#58254)
This fixes any existing usage of `@angular-devkit/build-angular:protractor` which would be broken by the CLI `-next.12` upgrade.

PR Close #58254
2024-10-22 07:37:14 -07:00
Doug Parker
e4a5989700 build: update Angular CLI dependencies to 19.0.0-next.12 (#58254)
This includes the Protractor builder rename.

PR Close #58254
2024-10-22 07:37:14 -07:00
Emmanuel Roux
b0c4c1fd2b test(forms): add unit test (#50750)
Add unit test for statusChange events

PR Close #50750
2024-10-22 07:36:22 -07:00
Emmanuel Roux
3e7d724037 feat(forms): add ability to clear a FormRecord (#50750)
Add new `clear()` method to `FormRecord`

PR Close #50750
2024-10-22 07:36:22 -07:00
emmanuelroux
18b6f3339f fix(forms): fix FormRecord type inference (#50750)
Updates type inference in `ɵElement` to make `FormRecord` take precedence over `FormGroup`

PR Close #50750
2024-10-22 07:36:22 -07:00
Alex Rickabaugh
9762b24b5e feat(core): experimental impl of rxResource() (#58255)
Implementations of two rxjs-interop APIs which produce `Resource`s from
RxJS Observables. `rxResource()` is a flavor of `resource()` which uses a
projection to an `Observable` as its loader (like `switchMap`).

PR Close #58255
2024-10-21 13:25:58 -07:00
Alex Rickabaugh
18d8d44b1f feat(core): experimental resource() API for async dependencies (#58255)
Implement a new experimental API, called `resource()`. Resources are
asynchronous dependencies that are managed and delivered through the signal
graph. Resources are defined by their reactive request function and their
asynchronous loader, which retrieves the value of the resource for a given
request value. For example, a "current user" resource may retrieve data for
the current user, where the request function derives the API call to make
from a signal of the current user id.

Resources are represented by the `Resource<T>` type, which includes signals
for the resource's current value as well as its state. `WritableResource<T>`
extends that type to allow for local mutations of the resource through its
`value` signal (which is therefore two-way bindable).

PR Close #58255
2024-10-21 13:25:58 -07:00
Alex Rickabaugh
cd59e5da2b refactor(core): avoid removing pending tasks twice (#58255)
Optimizes `PendingTasks` slightly to avoid notifying the scheduler if the
disposal function of a pending task is called twice.

PR Close #58255
2024-10-21 13:25:58 -07:00
Jessica Janiuk
95449302e9 refactor(core): add incremental hydration infrastructure (#58193)
This adds the bulk of the infrastructure to support
incremental hydration.

PR Close #58193
2024-10-21 12:05:06 -07:00
Matthieu Riegler
2e3e9b137a refactor(platform-server): replace patch by CLI option. (#58256)
The CLI introduced a new option `experimentalPlatform` to disable loading a polyfill from node. We don't need to patch it anymore.

PR Close #58256
2024-10-21 09:09:07 -07:00
Alan Agius
59ce1531d0 refactor(core): wrap AFTER_RENDER_PHASE_EFFECT_NODE in an IIFE for Tree-shaking (#58283)
Currently, `AFTER_RENDER_PHASE_EFFECT_NODE` is not tree-shakable. By wrapping it in an IIFE, it will be annotated as pure, allowing unused code to be removed during the tree-shaking process.

This issue was discovered while investigating: https://github.com/angular/angular-cli/issues/28676.

PR Close #58283
2024-10-21 09:07:54 -07:00
Pawel Kozlowski
00e2001351 fix(migrations): migrate more .next output usages (#58282)
This commits makes sure that .next usages of outputs are
migrated in templates and host bindings.

PR Close #58282
2024-10-21 09:06:48 -07:00
Pawel Kozlowski
518627438c build: expose signal-migrations to output-migrations (#58282)
This build change makes it possible to share code between
existing input / query migrations and output migrations.

PR Close #58282
2024-10-21 09:06:48 -07:00
Angular Robot
3924a70e1c build: update io_bazel_rules_sass digest to 6e23fb1 (#58270)
See associated pull request for more information.

PR Close #58270
2024-10-19 17:44:56 +02:00
Todd Palmer
a0b4725a4b docs: fix typo in tutorial - change style.css to styles.css to correct style sheet file name (#58269)
PR Close #58269
2024-10-19 17:43:17 +02:00
Matthieu Riegler
8c3ed8d172 refactor(migrations): removee standalone:true (#58234)
This commit re-enables the code that removes `standalone: true` in the `explicit-standalone-flag` migration

PR Close #58234
2024-10-19 17:42:34 +02:00
Paul Gschwendtner
7c74f43901 refactor(migrations): improve query migration type detection (#58265)
* Improves handling of the query migration is `strict = false` w/
  `strictNullChecks` is configured in the project. There is a special
  case that needs to be handled; similar to the input migration.

* Improves readability of the code for normal type generic insertion.
  The current logic was a little confusing.

PR Close #58265
2024-10-19 17:41:44 +02:00
Daniel Kimmich
01e6fc1bab docs: update default asset paths (#58246)
PR Close #58246
2024-10-18 14:35:30 +00:00
Paul Gschwendtner
c1432f939b refactor(language-service): improve name of input full class refactoring action (#58263)
Prefixing the full class refactoring actions with `Full class` makes
them less confusing along with the individual field actions.

PR Close #58263
2024-10-18 14:34:47 +00:00
Paul Gschwendtner
6342befff8 feat(language-service): support migrating full classes to signal queries (#58263)
Adds a similar code action as for inputs, where users can migrate full
classes to signal queries.

PR Close #58263
2024-10-18 14:34:47 +00:00
Paul Gschwendtner
15ca29fed4 docs: add queries and input migration to angular.dev migration overview (#58260)
Adds queries and input migration to the angular.dev migration overview.

PR Close #58260
2024-10-18 14:34:21 +00:00
Paul Gschwendtner
78b08cf0d1 docs: move signal queries migration readme into adev (#58260)
Moves the signal queries migration `README.md` into adev.i

PR Close #58260
2024-10-18 14:34:21 +00:00
Paul Gschwendtner
ffa621bcd0 docs: move signal input migration readme into adev (#58260)
Moves the signal input migration `README.md` into adev.

PR Close #58260
2024-10-18 14:34:21 +00:00
Paul Gschwendtner
c89855437f docs(migrations): add missing options to queries migration documentation (#58260)
Adds missing options to the queries migration documentation.

PR Close #58260
2024-10-18 14:34:21 +00:00
Kristiyan Kostadinov
dff4de0f75 feat(migrations): add a combined migration for all signals APIs (#58259)
Adds a combined `@angular/core:signals` migration that combines all of the signals-related migrations into one for the apps that want to do it all in one go.

All of the heavy-lifting was already done by the individual migrations, these changes only chain them together for a more convenient developer experience.

PR Close #58259
2024-10-18 11:52:54 +00:00
TupiC
b542f15204 docs: removed typos of withHttpTransferCacheOptions description (#58244)
Removed two typos in the withHttpTransferCacheOptions function description.

- Corrected spelling of "whether"
- Changed spelling from "a an" to "an"
PR Close #58244
2024-10-18 10:14:09 +00:00
Angular Robot
8876b9e3fa build: update io_bazel_rules_sass digest to 43a9cda (#58253)
See associated pull request for more information.

PR Close #58253
2024-10-18 10:04:44 +00:00
Kristiyan Kostadinov
d0c74f3891 fix(compiler-cli): report when NgModule imports or exports itself (#58231)
Reports a diagnostic if an NgModule refers to itself in its `imports` or `exports`. Previously the compiler would go into an infinite loop.

Fixes #58224.

PR Close #58231
2024-10-18 09:26:44 +00:00
wlotherington
22021bc0de docs(docs-infra): fix playground terminal/console (#58257)
xterm was not resizing correctly when terminal/console component was resized.
- Load fitAddon for each terminal instance to enable resize.
- Use `ResizeObserver` to detect changes to the component size changes (window resize does not catch `as-split` events).
- Move padding from `.xterm-screen` to `.xterm` ancestor to fix text alignment.

Fixes #52645

PR Close #58257
2024-10-18 09:25:35 +00:00
Pawel Kozlowski
8311f00faa feat(core): introduce the reactive linkedSignal (#58189)
This change introduces the new reactive primitive: linkedSignal.

A linkedSignal represents state (hence the signal in the name)
that is reset based on the provided computation. Conceptually
it is a state that is maintained / valid only in the context of
another source signal (context is deteremined by a computation).

Closes #55673

PR Close #58189
2024-10-18 08:12:51 +00:00
Jessica Janiuk
e603e5616d test(core): fix flaky hydration test (#58252)
This clears the DebugConsole between each test, which should address cross-test console noise.

PR Close #58252
2024-10-17 15:58:30 -07:00
Pawel Kozlowski
dd407a7132 refactor(core): expose producerMarkClean utility (#58228)
This commit exposes the new producerMarkClean utility that
makes it possible to mark a reactive node as clean following
changes to the node's value. In practice it resets the dirty
flag and all other internal flags as need. Prior to this change
the cleanup code was duplicated.

The new utility will be used in the linkedSignal implementation.

PR Close #58228
2024-10-17 18:09:16 +00:00
Matthieu Riegler
141f3107e1 refactor(core): standalone by default for JIT compiled directives (#58236)
This commit fixes the standalone by default for JIT compiled directives (like in unit tests)

PR Close #58236
2024-10-17 13:26:21 +00:00
Paul Gschwendtner
94bc69aa03 refactor(migrations): do not migrate inputs or queries when declared with @HostBinding (#58243)
The `@HostBinding` decorator may be currently applied to inputs
directly, or queries. This is not great and should be replaced with
`host: {}` usages that are more close to template expressions anyway.

Migrating the inputs or queries to signals would break with
`@HostBinding`, because the signals need to be invoked to access their
underlying values. The `@HostBinding` does not do this automatically,
expectedly.

PR Close #58243
2024-10-17 13:02:17 +00:00
cexbrayat
a8d4eb8c25 refactor(core): test EventEmitter completion on destroy with outputToObservable (#58239)
A unit test has been added to check that `EventEmitter` properly completes upon component/directive destrouction when used with `outputToObservable`.
It explains why `destroyRef` has to be injected in `EventEmitter` in the first place.

PR Close #58239
2024-10-17 11:37:57 +00:00
Matthieu Riegler
4b9accdf16 feat(http): promote withRequestsMadeViaParent to stable. (#58221)
Introduced back in v15 by #47502, its usage with fix with #55652 for the `FetchBackend` which will become the default `HttpBackend` with #58212

PR Close #58221
2024-10-17 10:14:38 +00:00
Angular Robot
590105d055 build: update io_bazel_rules_sass digest to 9fa2d50 (#58235)
See associated pull request for more information.

PR Close #58235
2024-10-17 10:13:58 +00:00
Sebastian Barfurth
13c13067bc feat(common): disable keyvalue sorting using null compareFn (#57487)
The keyvalue pipe sorts the entries of the input by key. This has been the subject of debate in the past (https://github.com/angular/angular/issues/42490). The core of the discussions is that it is often desirable (and perhaps expected) that they natural ordering of the input is respected. There are at least two workarounds to restore natural ordering, such as a `compareFn` that simply returns `1` or a custom pipe. However, both of these require code for pipe consumers to maintain or  copy around to many places.

Allowing `null` as `compareFn` and treating it as "natural order" is fairly simple to understand, backward compatible and was suggested a few times on https://github.com/angular/angular/issues/42490 where it seemed to be received well. Using `null` is also possible in templates without any component code changes.

PR Close #57487
2024-10-16 18:18:19 +00:00
wlotherington
d3f8153917 docs(docs-infra): change mermaid diagram colors (#58223)
Change diagram colors to:

- Better match the overall site theme.
- Improve dark theme.
- Make the diagram easier to understand. "Unchecked" nodes have no color and "Checked" nodes match the color of the "Event" node that triggered the change detection.

Fixes #56314

PR Close #58223
2024-10-16 16:46:16 +00:00
Paul Gschwendtner
b05c266f7b release: cut the v19.0.0-next.10 release 2024-10-16 18:14:39 +02:00
Matthieu Riegler
819ff034ce
feat(core): treat directives, pipes, components as by default (#58229)
BREAKING CHANGE: Angular directives, components and pipes are now standalone by default. Specify  for declarations that are currently declared in s.  for v19 will take care of this automatically.
2024-10-16 17:43:24 +02:00
Dzhavat Ushev
9097b734e5 docs(language-service): fix link URLs (#58143)
PR Close #58143
2024-10-16 14:48:13 +00:00
Matthieu Riegler
3f1e7ab6ae feat(core): promote outputFromObservable & outputToObservable to stable. (#58214)
Alongside the promotion of `output()` to stable, we promote those 2 related interops.

PR Close #58214
2024-10-16 14:45:10 +00:00