3168 Commits

Author SHA1 Message Date
Shuaib Hasan Akib 85d6474d8c refactor(core): update NG0303 error message (#62363)
This adds mention of the `input()` signal function
to the error message.

PR Close #62363
2025-06-30 08:15:12 +00:00
Joey Perrott 31e3eb20f9 build: migrate to use web test runner rules (#62294)
Migrate karma tests throughout the repo to use the new web test runner based rule instead

PR Close #62294
2025-06-26 17:20:49 +00:00
Angular Robot 8822d6c1bc build: update cross-repo angular dependencies (#62274)
See associated pull request for more information.

PR Close #62274
2025-06-26 08:18:51 +00:00
Matthieu Riegler a2e6f317a7 fix(core): allow to set a resource in an error state (#62253)
A resource is error state should still remain writable.

fixes #62241

PR Close #62253
2025-06-25 13:20:43 +00:00
arturovt b40c9d0e59 refactor(common): move ngServerMode check outside tap() to enable tree-shaking (#62238)
In this commit, the `ngServerMode` check is moved outside the RxJS `pipe()` to ensure that server-only logic is excluded from client bundles. Previously, the `tap()` operator and its closure were always included in the output, even though `ngServerMode` was false on the client and the side effect was never triggered.

By guarding the observable chain earlier, this reduces the RxJS stack frame depth, which simplifies debugging by avoiding unnecessary operator noise in client-side stack traces.

The resulting logic is also easier to reason about and avoids evaluating `HttpResponse` instances where not needed.

PR Close #62238
2025-06-25 11:13:22 +00:00
arturovt 4c00238a69 fix(core): avoid injecting ErrorHandler from a destroyed injector (#61886)
This commit prevents lazy injection of the internal `ErrorHandler` from a destroyed injector, as it would result in another "destroyed injector" error.

PR Close #61886
2025-06-24 14:13:34 +00:00
Kristiyan Kostadinov 369f03ad7f fix(core): unable to retrieve defer blocks in tests when component injects ViewContainerRef (#62156)
Fixes that `getDeferBlocks` wasn't accounting for the case where a component might be injecting `ViewContainerRef`. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes #62047.

PR Close #62156
2025-06-23 14:24:47 +02:00
Andrew Scott ae212b51ee fix(core): Wrap ErrorEvent with no error property (#62081)
This commit updates the global error listener to wrap the global ErrorEvent in a new Error with cause
if the error property is undefined.

fixes #62078

PR Close #62081
2025-06-18 13:57:25 +02:00
Angular Robot 4aa262b425 build: update cross-repo angular dependencies (#62116)
See associated pull request for more information.

PR Close #62116
2025-06-18 13:28:13 +02:00
Paul Gschwendtner 43ef2ea628 build: fix hermetic execution of packages/core/test/... (#62027)
Due to a bug that is currently in progress of being resolved in the
`rules_js` toolchain (see:
https://github.com/aspect-build/rules_js/issues/362), we were seeing
subtle differences between `main` and PRs/local builds as RBE is a
strict sandbox environment while the normal linux/darwin sandbox isn't
necessarily.

This commit fixes the issue by avoiding the interop targets that don't
bring in the actual transitive node modules.

PR Close #62027
2025-06-12 12:16:56 +02:00
Angular Robot 44468bfe48 build: update cross-repo angular dependencies (#62008)
See associated pull request for more information.

PR Close #62008
2025-06-12 10:03:41 +02:00
Paul Gschwendtner d16c1cf462 build: migrate packages/core/test to new jasmine_test rule (#61902)
Migrates `packages/core/test` to the new `jasmine_test` rule. As part of
this, we are also removing an unnecessary/unused test fixture.

PR Close #61902
2025-06-12 10:00:10 +02:00
Joey Perrott 135c594443 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61978)
Use zone.js from npm isntead of from the repo going forward

PR Close #61978
2025-06-10 12:02:36 -07:00
Taygan Caldwell 6ae07ad9a1 refactor(core): Delete createSignalTuple (#61907)
Delete createSignalTuple because it is no longer needed. creatSignal has the same behavior.

PR Close #61907
2025-06-06 13:46:16 +02:00
Joey Perrott 8ccd496014 build: remove unnecessary zone.js dep from various build targets (#61903)
Remove unnecessary zone.js dep from various build targets

PR Close #61903
2025-06-05 09:13:01 -07:00
kristilw 1e8158baee fix(core): components marked for traversal resets reactive context (#61663)
when marked for traversal the reactive context has to be set to null to avoid inheriting the reactive context of the parent component

PR Closes #61662

PR Close #61663
2025-06-05 14:49:02 +02:00
kristilw 1e4ce31da4 refactor(core): update tests to use standalone (#61663)
update tests to use standalone components for easier test setup

PR Close #61663
2025-06-05 14:49:02 +02:00
Angular Robot f6841ea089 build: update cross-repo angular dependencies (#61881)
See associated pull request for more information.

PR Close #61881
2025-06-05 10:17:01 +02:00
AleksanderBodurri b4ed62ddf6 fix(core): properly handle the case where getSignalGraph is called on a componentless NodeInjector (#60772)
Previously this would throw an error on the assertLView when we try to discover the templateLView.

Now this properly returns null for the template consumer and continues discovering other effects on the injector.

PR Close #60772
2025-06-04 12:16:47 -04:00
Angular Robot 30ea478be4 build: update cross-repo angular dependencies (#61704)
See associated pull request for more information.

PR Close #61704
2025-06-03 07:33:33 -04:00
Kristiyan Kostadinov 3817459f9e build: add missing symbol (#61783)
Fixes a broken symbol test.

PR Close #61783
2025-05-30 13:34:46 -04:00
Paul Gschwendtner 4fa276214c build: rework benchmarks and examples in modules/ to new optimization rule
We are dropping the custom ESBuild and Terser pipeline from dev-infra
and instead leverage the Angular CLI directly. This commit adjusts
the benchmarks to use this new rule.
2025-05-30 10:01:23 +02:00
Paul Gschwendtner e910893fa6 build: adjust bundling tests to use Angular CLI
Instead of dev-infra maintaining a custom ESBuild + Terser pipeline that
tries to emulate the Angular CLI, we are switching the bundling core
tests to a new rule that really leverages the Angular CLI.

This involves some file renames and small adjustments. In addition, we
leverage the updated symbol tracking rule to output new goldens that can
work with multiple bundle files (as generated by the Angular CLI;
especially with defer and its "lazy" chunks).
2025-05-30 10:01:23 +02:00
Paul Gschwendtner 845f8dfd38 build: fix app_bundle rule after migrating packages/compiler
The `app_bundle` rule does not work after the migration of
`packages/compiler` to `ts_project` because the `.mjs` extensions are
now missing in the non npm-package output.

This causes runtime errors as `.js` is not recognized as ESM. Switching
to the real npm package for usage, fixes this issue.
2025-05-30 10:01:23 +02:00
Matthieu Riegler 925a41c285 Revert "fix(core): call DestroyRef on destroy callback if view is destroyed (#58008)" (#61625)
This reverts commit 5f7f04634f.

PR Close #61625
2025-05-27 15:21:21 -07:00
arturovt 833c69b618 refactor(platform-browser): replace isPlatformServer with ngServerMode (#59496)
In this commit, we switch from using the `isPlatformServer` runtime call to the `ngServerMode`.

Note: constructors haven't been touched in order to prevent any breaking changes for the public API.

PR Close #59496
2025-05-26 11:14:28 +00:00
Kristiyan Kostadinov 117e570ded refactor(core): replace propertyInterpolateX with property (#61639)
Replaces the `propertyInterpolateX` instructions with calls to `property` and the `interpolate` helper. This allows us to drop the dedicated interpolation instructions and simplify the runtime for future work.

PR Close #61639
2025-05-26 09:21:24 +00:00
Joey Perrott 14f2648302 build: migrate platform-server to rules_js (#61589)
Migrate platform-server to use ts_project and ng_project.

PR Close #61589
2025-05-22 11:35:56 -07:00
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
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
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
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 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
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
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
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
Pawel Kozlowski ca6295e90b fix(core): handle different DI token types in Chrome DevTools integration (#61333)
This small refactor makes the DI events reporting code more resiliant
with respect to finding names for different token types.

PR Close #61333
2025-05-15 10:15:33 -07:00
arturovt 4fe34f4cfe fix(core): enable stashing only when withEventReplay() is invoked (#61077)
This commit brings the necessary event replay code code in tree-shakable manner.

PR Close #61077
2025-05-14 10:35:58 -07:00
Matthieu Riegler e3deb90b3f refactor(core): remove compileComponents invocations (#61032)
Those weren't necessary.

PR Close #61032
2025-05-09 10:27:15 -07:00
Paul Gschwendtner b07a2dfce1 build: prepare for compiler-cli to be using ts_project (#61181)
Prepare the compiler-cli package for being ready for migration
to `ts_project`.

PR Close #61181
2025-05-09 15:59:47 +00:00
Paul Gschwendtner 051d90a4cc build: remove irrelevant madge circular deps tests (#61197)
We don't need this tooling anymore because we are already validating
that there are no circular dependencies via the `ng-dev` tooling that
checks `.ts` files directly.

Also these tests never actually failed to my knowledge.

PR Close #61197
2025-05-08 09:24:30 -07:00
Andrew Scott 2c5ed5109f refactor(router): Update RouterLink href to use host binding and signals (#60875)
This commit updates the method of setting the href attribute on
`RouterLink` to use built in host binding rather than custom attribute
setting and sanitization. The advantage here would be automatic handling
of the sanitization and avoiding of writing the same value to the DOM
that we had before.

This change does mean that we _always_ write to the href attribute where
before we only wrote to it when the elemnt was known to support `href`.
That said, the implementation attempts to retain behavior that is as
close as possible: the original value of `href` is used and never updated.

PR Close #60875
2025-05-07 11:31:09 -07:00
Andrew Scott 33f2ea83fc refactor(core): Remove use of private export PendingTasksInternal where possible (#61049)
This commit removes the use of the privately exported
PendingTasksInternal everywhere except for Router. A follow-up change
will be done to remove that one as well and delete the private export.

PR Close #61049
2025-05-05 08:56:20 -07:00
Matthieu Riegler 205fc7a181 refactor(core): remove module bootstrap code when using standalone. (#59208)
This commit improves tree shaking in standalone apps.

PR Close #59208
2025-05-01 08:39:34 -07:00
Alan Agius 017cc0a37c fix(core): properly handle app stabilization with defer blocks (#61040)
Previously, the app was marked as stable prematurely. For more details, see https://github.com/angular/angular/issues/61038#issuecomment-2837917180

Closes: #61038

PR Close #61040
2025-04-30 12:37:02 -07:00
arturovt 624be2ef0c fix(core): prevent stash listener conflicts (#59635)
The stash event listener is a global function that might be unsafely overridden if multiple microfrontend applications exist on the page.

In this commit, we create a map of `APP_ID` to stash event listener functions. This map prevents conflicts because multiple applications might be bootstrapped simultaneously on the client (one rendered on the server and one rendering only on the client).

I.e., the code that might be used is:

```ts
// Given that `app-root` is rendered on the server
bootstrapApplication(AppComponent, appConfig);

bootstrapApplication(BlogRootComponent, appBlogConfig);
```

Two bootstrapped applications would conflict and override each other's code.

PR Close #59635
2025-04-30 08:53:06 -07:00
Matthieu Riegler 8f803aa81a build: Run browsers tests without platform-browser-dynamic (#60937) (#61060)
Use the regular `platform-browser` providers instead.

PR Close #61060
2025-04-30 08:21:02 -07:00