Commit Graph

13476 Commits

Author SHA1 Message Date
Maciej Sawicki 6e79eaf739 fix(core): reading resource value after reload in the error state (#61441)
When the resource is loading after reloading from the error state reading `Resource.value()` would return the default value instead of throwing an error.
This change prevents `Resource.hasValue()` from throwing an error in such a case.

PR Close #61441
2025-05-21 12:06:42 -07:00
Maciej Sawicki 3ba39bc28f fix(core): getting resource value throws an error instead of returning undefined (#61441)
When there is an underlying error state it would not be possible to swallow the error with:
`computed(() => res.value()?.inner);`

PR Close #61441
2025-05-21 12:06:42 -07:00
Maciej Sawicki a89f1cff24 fix(core): narrow error type for resources API (#61441)
`Resource.error` used to return `unknown`. Now it's `Error | undefined`.
For non-`Error` types they are encapsulated with the `Error` type.

PR Close #61441
2025-05-21 12:06:42 -07:00
Maciej Sawicki d62379bb13 fix(core): move reload method from Resource to WritableResource (#61441)
Now only mutable resources can be reloaded.

PR Close #61441
2025-05-21 12:06:42 -07:00
Maciej Sawicki 36af9213ac build: use es2022 lib (#61441)
It was set to es2022 for build tsconfig in https://github.com/angular/angular/pull/60066/files#diff-7ec658aedc62a693cc513accc8f360938d90bcbdb09aa79c1401e56fe84f5fd3, but was missed for the main one.

PR Close #61441
2025-05-21 12:06:42 -07:00
Steven Nguyendoan 10c1b8236a refactor(migrations): update references for dom_trigger functions onInteract, onHover, onViewport to point to new location in core/primitives/defer (#61342)
Moves the onInteract, onHover, onViewport dom_trigger functions to /packages/core/primitives/defer to be used as a shared library

PR Close #61342
2025-05-21 17:30:11 +00:00
Steven Nguyendoan 387199098e refactor(migrations): moved onInteraction, onHover (#61342)
, onViewport to core/primitives

PR Close #61342
2025-05-21 17:30:11 +00:00
Joey Perrott 3db2927b6f build: add comment explaining path maps (#61584)
Add a commend explaning why the path mappings are in place.

PR Close #61584
2025-05-21 17:27:20 +00:00
cexbrayat c9b7a0bde5 docs: fix descendants default explanation for contentChild (#61580)
See #61534

PR Close #61580
2025-05-21 16:15:07 +00:00
Joey Perrott 43c208c7ab build: remove unnecessary export from @angular/compiler/schematics (#61579)
Remove the unused export to match how this is done in the main branch

PR Close #61579
2025-05-21 16:12:52 +00:00
arturovt 7efb3384a7 fix(core): cleanup rxResource abort listener (#58306)
The observable terminates immediately when `error` is called, and no further emissions or completion notifications occur. Thus, we have to remove the `abort` listener in both the `error` and `complete` notifications.

PR Close #58306
2025-05-21 15:17:25 +00:00
Kristiyan Kostadinov 33a432cb21 refactor(core): handle NO_CHANGE in bindingUpdated (#61557)
Updates the `bindingUpdated` function to handle `NO_CHANGE` instead of throwing. This will allow us to reuse instructions across more cases.

PR Close #61557
2025-05-21 15:13:48 +00:00
Kristiyan Kostadinov 180b92d02e refactor(core): remove attribute interpolation instructions (#61557)
The attribute interpolation instructions aren't used anymore so we can remove them.

PR Close #61557
2025-05-21 15:13:48 +00:00
Kristiyan Kostadinov 68af4586b1 refactor(compiler): replace attribute interpolation instructions (#61557)
Replaces the attribute interpolation instructions with `attribute` plus the new `interpolateX` instruction. This allows to reduce our overall instruction footprint.

PR Close #61557
2025-05-21 15:13:47 +00:00
Kristiyan Kostadinov a25ecad561 refactor(core): add instructions for interpolating values (#61557)
Adds the new `interpolate*` instructions that can be passed into other instructions and used to replace our existing flavors of interpolations.

PR Close #61557
2025-05-21 15:13:47 +00:00
Jan Martin 8ba6562ad1 refactor(core): expose Binding for easier use of inputBinding (#61351)
When passing bindings as arguments or storing them before use in
`createComponent`, it's handy to be able to reference this type.

The current workaround is to use `ReturnType<typeof inputBinding>`.

PR Close #61351
2025-05-21 15:11:47 +00:00
arturovt af7881abac fix(common): cancel reader when app is destroyed (#61528)
Streams left in a pending state (due to `break` without cancel) may continue consuming or holding onto data behind the scenes. Calling `reader.cancel()` allows the browser or the underlying system to release any network or memory resources associated with the stream.

PR Close #61528
2025-05-21 15:07:20 +00:00
Andrew Scott 350776b412 fix(core): TestBed.tick should ensure test components are synchronized (#61382)
This ensures that `TestBed.tick` updates any components created with
`TestBed.createComponent`, regardless of whether autoDetectChanges is
on.

PR Close #61382
2025-05-21 15:02:53 +00:00
Joey Perrott 6187b5b0b3 build: migrate language service to use rules_js (#61575)
Migrate language service to build using ts_project

PR Close #61575
2025-05-21 14:58:21 +00:00
arturovt abdade95e0 refactor(common): drop httpResource error message (#61570)
Drops `httpResource` error message in production and replaces with an error code.

PR Close #61570
2025-05-21 14:16:54 +00:00
Matthieu Riegler 88c70ebc7b refactor(platform-browser): replace platform-browser-dynamic with platform-browser (#61498)
The former isn't needed anymore and is now deprecated.

PR Close #61498
2025-05-21 14:01:50 +00:00
arturovt 47f4a8edbe refactor(core): drop rxResource error messages (#61565)
Drops `rxResource` error messages in production and replaces with error codes.

PR Close #61565
2025-05-21 12:43:00 +00:00
arturovt 15e16aa475 refactor(core): drop injection context assertion in production (#61564)
In other parts of the code, calls to the `assertInInjectionContext` function are guarded with `ngDevMode`. This change aligns these parts of the code with other implementations that drop such assertions in production.

PR Close #61564
2025-05-21 12:42:11 +00:00
Kristiyan Kostadinov e74266b108 fix(compiler): avoid conflicts between HMR code and local symbols (#61550)
Currently we construct the HMR replacement URL inline by calling into the native `URL` constructor. This can cause conflicts with user code that defines a symbol called `URL`.

These changes resolve the issue by moving the URL construction into a separate function. This has a secondary benefit of making the generated code easier to follow and allowing us to update the URL without changing the compiled code.

Fixes #61517.

PR Close #61550
2025-05-21 12:25:28 +00:00
arturovt b90160d10a fix(core): cleanup testability subscriptions (#61261)
This commit prevents leaking memory when the application is destroyed and subscriptions are still alive.

PR Close #61261
2025-05-21 12:06:25 +00:00
arturovt 00f34edb02 refactor(core): drop injection context assertion in production (#61560)
In other parts of the code, calls to the `assertInInjectionContext` function are guarded with `ngDevMode`. This change aligns these parts of the code with other implementations that drop such assertions in production.

PR Close #61560
2025-05-21 11:35:48 +00:00
Matthieu Riegler 4e5d6de7a1 refactor(core): Merge R3TemplateRef implementation and TemplateRef interface (#61455)
This was an artifact of the Ivy migration.

PR Close #61455
2025-05-21 10:07:12 +00:00
Angular Robot 460a9272d1 build: update dependency google-closure-compiler to v20250519 (#61552)
See associated pull request for more information.

PR Close #61552
2025-05-21 10:03:08 +00:00
Paul Gschwendtner f636cc90d8 refactor(migrations): ensure tsurge configures file system properly (#61553)
Currently in 1P, without this commit, the tsconfig parsing picks up the
default file system (InvalidFS) and results in runtime errors.

PR Close #61553
2025-05-21 10:01:19 +00:00
Joey Perrott 58532c7602 build: migrate router to use rules_js (#61543)
Use ts_project and ng_project for building router

PR Close #61543
2025-05-21 09:54:27 +00:00
Andrew Scott 641411b767 refactor(core): Remove _cdRefInjectingView from markForRefresh (#60918)
The code was not compatible with property renaming so it was always
using _lView. This didn't matter because they're always the same for the
only place the function is used. Casting to any would fix the
renaming problem but introduce a risk of getting "broken" by a refactor
that changes the private variable name. This change removes the
private member access entirely.

PR Close #60918
2025-05-21 09:46:50 +00:00
Joey Perrott 3cc0910928 build: update compiler-cli to not be stamped when used for the compiler in ng_project (#61535)
The compiler-cli package needs to be unstamped and will the resulting generated code will be stamped as expected.

PR Close #61535
2025-05-21 09:16:06 +00:00
Joey Perrott f6b4602e1e build: migrate forms to rules_js (#61535)
Migrate forms to use ng_project and ts_project

PR Close #61535
2025-05-21 09:16:06 +00:00
Matthieu Riegler 0a82e58c21 docs: fix info about descendants for content queries. (#61534)
- `descendants` option  is `true` for `contentChild`
- `descendants` option is `false` for `contentChildren`

PR Close #61534
2025-05-21 09:06:07 +00:00
Andrew Scott b57084267e fix(compiler-cli): Always retain prior results for all files (#61487)
This change ensures that prior results for all files are retained even when
a request is made such that we only need a shim for a single file. Prior
to this change, any prior results that were not part of the request were discarded.

PR Close #61487
2025-05-21 08:56:55 +00:00
Joey Perrott 5009278a23 build: migrate angular-in-memory-web-api to use rules_js (#61524)
Use ts_project and ng_project for building angular-in-memory-web-api

PR Close #61524
2025-05-20 16:53:22 +00:00
arturovt 966df84351 fix(common): prevent reading chunks if app is destroyed (#61354)
Prevents processing response chunks after the application has been destroyed.

PR Close #61354
2025-05-20 15:09:46 +00:00
Joey Perrott 6aa1d06efb build: migrate common to use rules_js based toolchain (#61433)
Migrate packages/common to use ts_project and ng_project.

PR Close #61433
2025-05-20 15:07:57 +00:00
Matthieu Riegler 5dbeb42308 fix(core): unregister onDestroy in toSignal. (#61514)
We cleanup if the observable completes before the onDestroy fires.

fixes #61511

PR Close #61514
2025-05-20 14:43:33 +00:00
Alan Agius 30e081287d fix(core): update min Node.js support to 20.19, 22.12, and 24.0 (#61500)
This is to match the versions of the Angular CLI.

See: https://github.com/angular/angular-cli/pull/30349

PR Close #61500
2025-05-20 14:17:20 +00:00
Paul Gschwendtner df05049b6b refactor(compiler): avoid duplication between FactoryTarget type (#61476)
Avoids duplication of the `FactoryTarget` enums. This is necessary
now because we are exposing the previously deeply-imported JIT facade
now via the exports; and the typing integration tests surface a type
conflict due to the different duplicated enums.

PR Close #61476
2025-05-20 13:46:16 +00:00
Paul Gschwendtner 81b2b516e9 build: migrate all ng_module in packages/core/test (#61476)
Migrates all `ng_module` to `ng_project` in `packages/core/test/`.

PR Close #61476
2025-05-20 13:46:16 +00:00
Paul Gschwendtner 809aad842e build: migrate all ts_library in packages/core/test (#61476)
This commit migrates all `ts_library` in `package/core/test` to
`ts_project`, and fixes deep module, or relative imports inside.

PR Close #61476
2025-05-20 13:46:16 +00:00
Paul Gschwendtner 3433021475 build: move private testing helpers outside platform-browser/testing (#61476)
These helpers are often imported by various tests throughout the
repository, but the helpers aren't exported/exposed from the public
entry-point; even though they confusingly reside in there.

This commit fixes this, and moves the helpers into
`packages/private/testing`. This is a preparation for the `ts_project`
migration where we don't want to leverage deep imports between packages.

PR Close #61476
2025-05-20 13:46:15 +00:00
Angular Robot b55fa4ee4d build: update dependency google-closure-compiler to v20250518 (#61492)
See associated pull request for more information.

PR Close #61492
2025-05-20 10:08:27 +00:00
Andrew Scott 9585ed3a6c refactor(core): Disallow autoDetectChanges(false) in zoneless (#61430)
This removes the ability to use `autoDetectChanges(false)` when
`provideZonelessChangeDetection` is used.

PR Close #61430
2025-05-20 08:49:06 +00:00
Joey Perrott 2651ac1a77 build: use an unstamped version of compiler-cli for running the angular compiler in ng_project (#61479)
Use an unstamped version of the compiler when it runs in `ng_project` as it will get stamped appropriately
whenever the generated code gets stamped after its usage."

PR Close #61479
2025-05-20 08:46:36 +00:00
Joey Perrott 6f74458e53 build: migrate animations to use rules_js based toolchain (#61479)
Migrate animations to use `ts_project` and `ng_project`

PR Close #61479
2025-05-20 08:46:36 +00:00
Joey Perrott 62435f6a18 build: migrate benchpress to use rules_js (#61486)
Use ts_project to build targets in benchpress package

PR Close #61486
2025-05-20 08:44:56 +00:00
Pawel Kozlowski fcd4355ab0 refactor(core): expose enableProfiling() on from @angular/core (#61465)
This commit exposes the experimental enableProfiling() API that
enables Angular integration with the Chrome DevTools performance
panel. Previously this integration was exposed on the ng. namespace
only but there are legitimate cases where developers might want to
expose the integration earlier (ex.: bootstrap profiling).

PR Close #61465
2025-05-19 14:22:34 +00:00