13562 Commits

Author SHA1 Message Date
Angular Robot e73f2486a1 build: update dependency google-closure-compiler to v20250608 (#61997)
See associated pull request for more information.

PR Close #61997
2025-06-11 10:45:28 +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
Carolina 78910a32ef docs: rework programmatically rendering components section to mention @defer (#61763)
PR Close #61763
2025-06-10 12:01:30 -07:00
Angular Robot ee4acc26a7 build: update dependency google-closure-compiler to v20250603 (#61960)
See associated pull request for more information.

PR Close #61960
2025-06-09 11:57:16 -07:00
Andrew Scott 85e9505020 fix(zone.js): waitForAsync should pass args to the test function (#61755)
This ensures that test functions with arguments (e.g. `it.each` in jest)
are forwarded to the test function. This does not apply to jasmine,
which assumes the only arguments needed would be the `done` function.

fixes #61717

PR Close #61755
2025-06-09 11:22:22 -07:00
Jessica Janiuk bb6ec10cfd Revert "refactor(service-worker): make SwPush and SwUpdate tree-shakable (#61670)" (#61923)
This reverts commit f8c1b6e779.

PR Close #61923
2025-06-06 07:48:45 -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
Paul Gschwendtner 8fc96a7065 build: migrate partial compliance tests to rules_js (#61895)
Migrates the partial compliance tests to `rules_js`. Also as part of
this, we re-enable RBE to see if that fixed the issues, or in case
they are already resolved from the RBE side.

PR Close #61895
2025-06-05 13:33:52 +02:00
Taygan Caldwell f562fd4298 refactor(core): export signal setter and updater types for wiz (#61714)
Export signal setter and updater types for Wiz to use

PR Close #61714
2025-06-05 12:57:23 +02:00
arturovt 1cd23be57e fix(core): unregister onDestroy in outputToObservable (#61882)
We should remove the `onDestroy` listener once subscription is unsubscribed because components might not be destroyed yet, but they still would capture subscribers.

PR Close #61882
2025-06-05 11:16:57 +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
Paul Gschwendtner 426eca50f6 build: migrate packages/localize/schematics to ts_project (#61862)
Migrates `packages/localize/schematics` to `ts_project`.

PR Close #61862
2025-06-05 07:34:50 +00:00
Paul Gschwendtner 8564cf48d8 build: replace all ng_package with new rule from rules_angular (#61862)
Replaces all `ng_package` rule with the new rule from `rules_angular`.

PR Close #61862
2025-06-05 07:34:50 +00:00
Paul Gschwendtner a24fb53a73 build: remove packages/bazel (#61862)
Removes the `@angular/bazel` package as we no longer need it. Yay!

It's replaced by `rules_angular`.

PR Close #61862
2025-06-05 07:34:50 +00:00
Paul Gschwendtner b03a7356a4 build: migrate private/testing to ng_project (#61862)
Migrates `private/testing` to `ng_project`.

PR Close #61862
2025-06-05 07:34:49 +00:00
Paul Gschwendtner f98dfc2842 build: migrate integration and primitives/defer to ts_project (#61862)
Migrates remaining `ts_project` targets (excluding zone.js) to
`ts_project`.

PR Close #61862
2025-06-05 07:34:49 +00:00
Paul Gschwendtner d462051521 build: remove npm_package rule for packages/bazel (#61862)
The bazel npm package is no longer needed and currently breaks
as we started using a 1P pnpm linked package that would otherwise
end up being pulled into this legacy rule.

PR Close #61862
2025-06-05 07:34:49 +00:00
Paul Gschwendtner a9a7654cbf build: migrate packages/compiler-cli to ts_project (#61862)
This commit migrates the remaining pieces of `compiler-cli` to
`ts_project`. This involves a few more things during migration:

- the `ng_module` ngc_wrapped rule broke as part of this change, so we
  switched it to `ts_project` too. This logic is soon gone anyway.

- we needed an extra pnpm "package.json" for the linker babel test. This test is
  loading from the real compiler-cli npm package. Babel needs a real
  node module for this, so this solution seems reasonable. It may be
  worth exploring in the future to move this test into an integration
  test though.

- the older integrationtest in compiler-cli is removed as the coverage
  is much better with the compliance test suite and this test.

PR Close #61862
2025-06-05 07:34:49 +00:00
Angular Robot 49e273a5f9 build: update all non-major dependencies (#61701)
See associated pull request for more information.

PR Close #61701
2025-06-04 17:23:54 -04:00
arturovt ddd22bea48 fix(core): unregister onDestroy in ResourceImpl when destroy() is called (#61870)
This commit unregisters the `onDestroy` listener when `destroy()` is called on the `ResourceImpl`. This prevents memory leaks and ensures that the resource reference is not captured in the destroy callback after it has already been destroyed.

PR Close #61870
2025-06-04 14:23:13 -04:00
arturovt 41b10396d2 refactor(service-worker): make SwPush and SwUpdate tree-shakable (#61670)
In this commit, we mark the `SwPush` and `SwUpdate` classes as root providers. As a result, they are no longer statically referenced in the `provideServiceWorker` providers list, which previously forced them to be explicitly bundled into the main file. These classes might never be used—some consumers may use the service worker only for prefetching and caching assets.

Practically speaking, even if a user injects the `SwPush` class without calling `provideServiceWorker()`, it would result in a DI error because the communication channel dependency is not available. There is no practical reason to keep these classes as non-root providers or to reference them explicitly.

Currently, some users work around this by using `patch-package` to modify the service worker code and remove these classes from the providers list.

PR Close #61670
2025-06-04 14:15:33 -04:00
arturovt 3f7b77dcd6 refactor(common): use ngServerMode in HttpInterceptorHandler (#61605)
Drops `isPlatformServer(platformId)` in favor of `ngServerMode` in the `HttpInterceptorHandler`.

PR Close #61605
2025-06-04 14:13:16 -04:00
Angular Robot bdf882ccd4 build: update dependency google-closure-compiler to v20250601 (#61869)
See associated pull request for more information.

PR Close #61869
2025-06-04 12:20:47 -04: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
Andrew Scott 8c60cbfd1c fix(core): takeUntilDestroyed completes immediately if DestroyRef already destroyed (#61847)
Adds fix directly for `takeUntilDestroyed` to unsubscribe when already
destroyed instead of putting
synchronous behavior on `DestroyRef.onDestroyed` callback as in #58008

fixes #54527

PR Close #61847
2025-06-04 12:14:15 -04:00
cexbrayat 3c644688eb refactor(core): use RefactorStreamItem type in rxResource (#59887)
The `ResourceStreamItem` was introduced in #59851 and can be used to simplify the `rxResource` code.

PR Close #59887
2025-06-04 11:45:05 -04:00
Taygan Caldwell 9e850c80f1 refactor(core): Refactor createSignal to return a tuple contain getter, setter, and updater (#61705)
Refactor createSignal to return a tuple instead of a signal getter. createSignalTuple will be removed in a follow up pr once createSignalTuple usages in google3 are migrated to createSignal.

PR Close #61705
2025-06-04 10:46:12 -04:00
arturovt 5c31e7e28d fix(core): unregister onDestroy when observable errors in toSignal (#61596)
The observable terminates immediately when `error` is called, and no further emissions or completion notifications occur. Thus, we have to remove the listener in both the `error` and `complete` notifications.

PR Close #61596
2025-06-04 09:36:41 -04:00
Matthieu Riegler 2bf724938e docs: update resource docs (#61846)
`value` throws when the resource is in error state.

PR Close #61846
2025-06-03 20:20:47 -04:00
arturovt b93fa22f25 fix(service-worker): prevent duplicate fetches during concurrent update checks (#61443)
Previously, multiple simultaneous calls to `checkForUpdate()` could result in redundant
fetches and hashing of the update manifest, leading to unnecessary network and CPU usage.

This change introduces a mechanism to track an in-progress update check using a cached
promise (`ongoingCheckForUpdate`). Subsequent calls to `checkForUpdate()` while a check
is in progress will return the same promise instead of triggering a new request.

Once the check completes (successfully or not), the cached promise is cleared,
allowing future update checks to proceed normally.

This improves efficiency and prevents overlapping update logic in applications that
may invoke `checkForUpdate()` from multiple sources (e.g. polling, manual triggers).

PR Close #61443
2025-06-03 15:57:30 -04:00
zachend 9743bd1317 fix(service-worker): update service worker to handle seeking better for videos (#60029)
This update ensures that the service worker can handle range requests, allowing video seeking to work correctly when videos are delivered by the service worker.

PR Close #60029
2025-06-03 10:56:07 -04:00
Angular Robot 661b58cb0c build: lock file maintenance (#61814)
See associated pull request for more information.

PR Close #61814
2025-06-03 10:49:42 -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
Matthieu Riegler 0ea831caea refactor(migrations): keep the control flow migration as ng generate. (#61773)
this way `ng generate @angular/core:control-flow` which has been fairly documented, remains valid.

PR Close #61773
2025-06-03 07:13:00 -04:00
Angular Robot 9e16d9cdf6 build: update dependency yargs to v18 (#61770)
See associated pull request for more information.

PR Close #61770
2025-06-03 07:02:12 -04:00
Kristiyan Kostadinov 32230e637d build: add missing import (#61838)
Fixes the `20.0.x` branch, which was broken due to a missing import.

PR Close #61838
2025-06-03 11:07:23 +02:00
Kristiyan Kostadinov 8ecb1ba027 fix(compiler): recover invalid parenthesized expressions (#61815)
When the expression parser consumes tokens inside a parenthesized expression, it looks for valid tokens until it hits and invalid one or a closing paren. If it finds an invalid token, it reports and error and tries to recover until it finds a closing paren. The problem is that in such cases, it would produce the `ParenthesizedExpression` and continue parsing **from** from the closing paren which would then produce more errors that add noise to the output and result in an incorrect representation of the user's code. E.g. `foo((event.target as HTMLElement).value)` would be recovered to `foo((event.target)).value` instead of `foo((event.target).value)`.

These changes resolve the issue by skipping over the closing paren at the recovery point.

Fixes #61792.

PR Close #61815
2025-06-02 15:50:47 -04:00
Andrew Scott 4eb535863e docs(router): Update view transition types to dev preview (#61787)
This updates the documented state of the view transition interfaces. The withViewTransitions feature was already marked dev preview

PR Close #61787
2025-06-02 12:42:20 -04:00
Kristiyan Kostadinov 66a0ec6510 fix(compiler): move defer trigger assertions out of parser (#61747)
When defer blocks have a reference-based trigger without a parameter, we infer it from the placeholder block. This requires some validations like ensuring that there's only one element in the placeholder. The validations are currently implemented at the parser level which can affect tools like linters that need to pass `preserveWhitespaces: true` in order to get accurate source mappings.

These changes move the validations into the template type checker so that they still get flagged, but much later in the process. Moving them over involves a bit more work, because the template type checker also sets `preserveWhitespaces: true`.

Fixes #61725.

PR Close #61747
2025-05-30 13:44:58 -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
Andrew Kushnir b1d960d082 fix(core): produce an error when incremental hydration is expected, but not configured (#61741)
This commit updates runtime logic to produce an error when there are some `@defer` blocks with `hydrate` triggers, but the incremental hydration is not enabled via `withIncrementalHydration()`. Previously the check was only detecting the case when `withIncrementalHydration()` is present on the server, but missing on the client. With the change in this commit, the check would be performed on the server as well.

PR Close #61741
2025-05-30 11:14:23 -04:00
Kristiyan Kostadinov e9820a6d48 fix(migrations): avoid trailing whitespaces in unused imports migration (#61698)
Follow-up to #61674 where we were leaving behind some whitespace, e.g. `[One, Two, Three]` would turn into `[One ]`. These changes only preserve the whitespace if the node is preceded by a newline.

This wasn't caught by tests, because they were stripping away whitespaces before asserting. I've also reworked the tests to be sensitive to formatting changes.

PR Close #61698
2025-05-30 11:07:21 -04:00
Kristiyan Kostadinov 8461488835 refactor(compiler-cli): export type used by migrations (#61697)
Re-exports the `FileSystem` type since it's used by some tsurge migrations and because internally the barrel export from `ngtsc/file_system` is removed.

PR Close #61697
2025-05-30 09:50:58 -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
Paul Gschwendtner c7ac9dfd4f build: ensure compiler is properly picked up as runtime dep of compiler-cli
Currently when linking the `@angular/compiler-cli` package, the peer
dependency to `compiler` is not resolved and we are trying to make the
compiler dependency available via `data`. This is unidiomatic and
brittle. This commit fixes this.
2025-05-30 10:01:23 +02:00