Commit Graph

14884 Commits

Author SHA1 Message Date
Jessica Janiuk fda08b7a89 refactor(core): account for shadow roots in animations
This adds a util function to get the proper target, properly accounting for shadow roots.
2026-03-04 10:16:40 -08:00
Jessica Janiuk 5338b5912c Revert "refactor(http): Improves base64 encoding/decoding with feature detection (#67002)"
This reverts commit aafeb1d2bd.
2026-03-04 09:19:10 -08:00
Jessica Janiuk 7eb33713b9 Revert "fix(http): correctly cache blob responses in transfer cache (#67002)"
This reverts commit 1f057afaac.
2026-03-04 09:19:10 -08:00
Jessica Janiuk 9e64147b73 fix(core): prevent child animation elements from being orphaned
When routing between two different routes, child animations were not finishing, causing elements to be left behind in the dom. The fix ensures the proper fallback is handled to avoid automatically cancelled custom events. This ensures the animation-fallback cancelling the animation actually completes, and ensures the element is removed.

fixes: #67400
2026-03-04 08:21:37 -08:00
Kristiyan Kostadinov 2c87f21abe fix(compiler-cli): always parenthesize object literals in TCB
This is a follow-up to #67381 which introduced a subtle bug where depending on the type checking configuration, we may put an object literal directly in the TCB body which the TS compiler ends up interpreting as a block. These changes resolve the issue by always wrapping the literal in parentheses.
2026-03-04 08:00:00 -08:00
SkyZeroZx c6f98c723c feat(language-service): Add support for idle timeout in defer blocks
Extends language service parsing and validation to support `@defer on idle(300)`
2026-03-04 07:57:30 -08:00
SkyZeroZx 98eb24cea0 feat(core): Support optional timeout for idle deferred triggers
Allows specifying a timeout parameter for idle-based deferred triggers, enabling more granular control over when deferred actions are executed.

Closes angular#67187
2026-03-04 07:57:30 -08:00
SkyZeroZx 17d3ea44e2 feat(core): add IdleRequestOptions support to IdleService
IdleService now accepts IdleRequestOptions,
enabling configuration of requestIdleCallback behavior in compatible environments.
2026-03-04 07:57:30 -08:00
SkyZeroZx 1f057afaac fix(http): correctly cache blob responses in transfer cache (#67002)
Previously, Blob values were passed to `Uint8Array` this resulted in silently producing an empty array (length = 0) without throwing an error, leading to empty cached data

PR Close #67002
2026-03-04 15:56:59 +00:00
SkyZeroZx aafeb1d2bd refactor(http): Improves base64 encoding/decoding with feature detection (#67002)
Use feature detection for `Uint8Array.prototype.toBase64` and
`Uint8Array.fromBase64`, falling back to the existing implementation
when native support is not available

PR Close #67002
2026-03-04 15:56:59 +00:00
Krueger01 0e9d58ef09 refactor(compiler-cli): update old angular.io references to angular.dev
Update comment references from the old site angular.io to the new site
angular.dev.
2026-03-03 14:22:20 -08:00
Andrew Scott 778b748694 refactor(router): Permit deferring commit of traversal navigations
This updates the state manager to allow intercepting and deferring commits of traversal navigations.
The issues that were encountered in the past appear to be resolved in Chrome.
The behavior of redirect is still undefined in this case, so there is an added TODO.
2026-03-03 14:09:11 -08:00
Kristiyan Kostadinov f28b8f621d refactor(compiler-cli): resolve presubmit issues
Resolves issues caught during the presubmit.
2026-03-03 11:02:49 -08:00
Kristiyan Kostadinov f26308813b refactor(compiler-cli): escape quotes used in string expressions
TypeScript has functionality that automatically escapes quotes in string literals. These changes update the places where we may need to do the same ourselves.
2026-03-03 11:02:49 -08:00
Kristiyan Kostadinov b37fce6066 refactor(compiler-cli): delete unused utilities
Deletes utilities that we no longer use.
2026-03-03 11:02:49 -08:00
Kristiyan Kostadinov befbae0dcf refactor(compiler-cli): initial decoupling from TypeScript factory APIs
Initial pass to move usages of TS `factory` APIs to the new `TcbExpr`.
2026-03-03 11:02:49 -08:00
Kristiyan Kostadinov 3828ef1917 refactor(compiler-cli): introduce new primitive for generating TCB code
Introduces the `TcbExpr` class that will be used to generate TCB code without going through TypeScript's factory APIs.
2026-03-03 11:02:49 -08:00
Andrew Scott b8fb51c462 build(dev-infra): add release automation script for zone.js
This commit introduces a new release automation script for zone.js, located at
packages/zone.js/tools/release.mts.
2026-03-03 09:14:35 -08:00
SkyZeroZx ead6bb1f52 test(http): refactors HTTP client tests to use TestBed and providers
Updates HTTP client, JSONP, and XSRF tests to utilize `TestBed` for setup.
2026-03-03 09:12:36 -08:00
Andrew Scott 54f5b32a13 test(core): Adds and uses a waitFor helper
This adds a waitFor utility inspired by tools like testing-library
and convers a zone-based test to the zoneless waitFor
2026-03-03 09:11:22 -08:00
Jessica Janiuk 9758ea9ee9 refactor(core): ignore infinite animations in animate api
This ensures that when calculating longest animations, we completely ignore infinite animations. This will prevent mistakes with using the API and hopefully catch any unexpected bugs.

fixes: #67350
2026-03-02 11:40:16 -08:00
Matthieu Riegler a2d5048ff3 docs: update doc for provideZoneChangeDetection
fixes #67209
2026-03-02 11:02:30 -08:00
Miles Malerba 2206efa55f feat(core): add special return statuses for resource params
Allows throwing from the resource's params function to transition the
resource to a status other than resolved.

In particular, the following values can be thrown from params:
- `ResourceParamsStatus.IDLE` causes the resource to become `idle`
  (equivalent to returning `undefined`)
- `ResourceParamsStatus.LOADING` causes the resource to become `loading`
- Any `Error` object causes the resource to become `error` and report
  the error that was thrown via `.error()`

To simplify chaining together resources, this PR also introduces a
context object passed into to the `params` functon. This context
contains a `chain` function that can be used to get the value of a
resource that the params want to depend on, while automatically
propagating the idle, loading, and erorr states of the resource forward.
2026-03-02 08:47:14 -08:00
kirjs d2e33e86b9 refactor(forms): address feedback
Refactor the normalizeFormArgs utility to include the internal FieldAdapter
2026-03-02 08:46:43 -08:00
kirjs 985d828f12 refactor(forms): hide adapter in public options
Moves adapter to internal options to prevent exposure but keep compatibility.
2026-03-02 08:46:43 -08:00
Jessica Janiuk 0b59cba85d fix(core): Prevent removal of elements during drag and drop
This addresses a reported issue where elements were being fully removed from the DOM during drag and drop operations.

fixes: #67257
2026-03-02 08:46:09 -08:00
Jessica Janiuk 88685cb3b6 fix(core): adds transfer cache to httpResource to fix hydration
This should prevent the microtask problem with hydration and httpResource.

fixes: #62897
2026-02-27 09:09:23 -08:00
Jessica Janiuk e1bc342856 refactor(core): Ensure idle scheduler batching accounts for change detection
This updates the deadline check in requestIdleCallback to ensure change detection properly dirties the views.
2026-02-27 09:08:59 -08:00
Matthieu Riegler 03db2aefaa fix(compiler): throw on duplicate input/outputs
inputs & outputs cannot be binded to 2 different directives/components properties

Eg
```
data = model();
dataChange = output(); // throws because model already emits on the `dataChange` output

userSomething = input({alias 'user'});
user = input(); // throws because userSomething already binds to the `user` input
````

fixes #65844

BREAKING CHANGE: The compiler will throw when there a when inputs, outputs or model are binding to the same input/outputs.
2026-02-26 13:47:37 -08:00
Matthieu Riegler 3bc095d508 feat(core): Add a schematics to migrate provideHttpClient to keep using the HttpXhrBackend implementation.
Exisiting applications will be migrated to keep using the XHR backend to prevent any breaking changes. `withXhr()` is to the `provideHttpClient` provider function.
2026-02-26 13:47:02 -08:00
Matthieu Riegler 5c432fb8bb feat(http): Use FetchBackend as default for the HttpBackend implementation
This commit replaces the `XhrHttpBackend` with the `FetchBackend` as the default implementation of the `HttpBackend`.
This introduces a breaking change a the `FetchBackend` does not support the report progress for uploads.

The previous behavior (`HttpXhrBackend`) can be restored by setting `withXhr()` in the `provideHttpClient()` provider function.

DEPRECATED: `withFetch` is now deprecated, it can be safely removed.
BREAKING CHANGE: Use the `HttpXhrBackend` with `provideHttpClient(withXhr)` if you want to keep supporting upload progress reports.
2026-02-26 13:47:02 -08:00
Alan Agius 4c4a3db86a refactor: move several schematics from migrations to ng-generate directories
This are not true migrations
2026-02-26 07:54:04 -08:00
Alan Agius 1102ad74f8 refactor(migrations): remove old schematics migrations
These migrations are not needed for v22.
2026-02-26 07:54:04 -08:00
Angular Robot 0af53fbb12 build: update cross-repo angular dependencies
See associated pull request for more information.

Closes #67274 as a pr takeover
2026-02-25 10:17:51 -08:00
Alan Agius 6d07890d63 build: update all non-major dependencies
See associated pull request for more information.

Closes #67035 as a pr takeover
2026-02-25 08:31:32 -08:00
hawkgs f9d8da6924 fix(core): bind global context to idle callback shims in @defer's idle service
Fix a Safari regression caused by `a5981b8` where the browser is unable to properly assign the `window` context to idle callback shims in `@defer` 'on idle' configuration service.
2026-02-25 08:17:57 -08:00
Sonu Kapoor 547ed65b6f docs(forms): transformedValue parse error wiring 2026-02-25 08:13:12 -08:00
Matthieu Riegler 1416eceeea refactor(http): ensure HttpClientModule always uses the xhr backend
This is a follow-up of #67231, in preparation of making the `FetchBackend` the default
2026-02-25 08:12:14 -08:00
SkyZeroZx 97ed3d9e85 refactor(common): log a warning when a KeyValuePipe receives a signal
Add signal warning for `KeyValuePipe` and consolidates the `invalidPipeArgumentError` function into a `utils`
2026-02-25 08:11:29 -08:00
Matthieu Riegler 01a179577b refactor(upgrade): remove getAngularLib/setAngularLib
Both functions were deprecated in v5 and are replaced by `getAngularJSGlobal`/`setAngularJSGlobal`

BREAKING CHANGE: Deprecated `getAngularLib`/`setAngularLib` have been removed use `getAngularJSGlobal`/`setAngularJSGlobal` instead.
2026-02-25 07:58:24 -08:00
Alan Agius d550bf713a build: update minimum supported Node.js versions
This commit updates the minimum supported Node.js versions. Node.js v20 support is dropped, and the minimum version for Node.js v22 is bumped to v22.22.0, and for v24 it is bumped to v24.13.1.

BREAKING CHANGE: Node.js v20 is no longer supported. The minimum supported Node.js versions are now v22.22.0 and v24.13.1.
2026-02-25 07:57:18 -08:00
Jessica Janiuk a5981b83a6 feat(core): support customization of @defer's on idle behavior
This commit makes the behavior of `on idle` in `@defer` configurable via DI.
It defines an `IdleService` interface that an application can implement and
provide to Angular:

```ts
@Injectable({providedIn: 'root'})
export class CustomIdleService implements IdleService {
  requestOnIdle(callback: () => void): number {...}
  cancelOnIdle(id: number): void {...}
}
```

Then the idle service can be used by providing the IDLE_SERVICE token with the custom implementation.
2026-02-24 17:19:09 -08:00
Jaime Burgos 3683902234 feat(router): adds browserUrl input support to router links
Enables specifying a custom browser URL for router links via a new input,
allowing navigation to use an explicit browser URL in navigation options.
2026-02-24 10:51:33 -08:00
Doug Parker 306f367899 fix(core): block creation of sensitive URI attributes from ICU messages
Translators are not allowed to write HTML which creates URI attributes. I opted to ban any values going into an attribute at all, to prevent even links to malicious content, rather than just sanitizing URIs.

I also converted this blocklist into an allowlist. Now, we only allowing setting known attributes (while sanitizing URI attributes). This significantly reduces risk of missing a vulnerable attribute and does not require an exhaustive list of all potential attributes.

BREAKING CHANGE: Angular now only applies known attributes from HTML in translated ICU content. Unknown attributes are dropped and not rendered.
2026-02-24 10:50:37 -08:00
Matthieu Riegler f30ed6bbf6 refactor(http): expose withXhr to prepare for fetch by default
This commit sets up the necessary changes that would allow us to safely migrate G3 before switch to the `FetchBackend` by default.

For now the `HttpXhrBackend` is still the default backend for the `HttpClient`.
2026-02-24 09:26:26 -08:00
Matthieu Riegler bdb6ae9dbc refactor(router): remove deprecated provideRoutes function.
`provideRoutes` was deprecated in v15.

BREAKING CHANGE: `provideRoutes()` has been removed. Use `provideRouter()` or `ROUTES` as multi token if necessary.
2026-02-24 09:25:13 -08:00
Jessica Janiuk dba72b672c refactor(core): Update idle scheduler to respect the Idle Deadline
This updates the idle scheduler to ensure the idle deadline is respected when scheduling tasks. Otherwise the idle callback will respond to the first idle event, which may not be the most optimal time to execute the task.
2026-02-24 09:19:01 -08:00
Angular Robot 8f5214e944 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-02-24 08:59:58 -08:00
Angular Robot 7ac52d8d9b build: update cross-repo angular dependencies to v21.2.0-rc.1
See associated pull request for more information.
2026-02-23 13:38:23 -08:00
Matthieu Riegler 786ef8261f fix(compiler): throw on invalid in expressions
`{{in}}` are not interpreted as `'in'` string expressions anymore.

```
<input #in /> // OK
{{in}} // throws
```

fixes #65244

BREAKING CHANGE: `in` variables will throw in template expressions.
2026-02-23 13:35:07 -08:00