637 Commits

Author SHA1 Message Date
Angular Robot 82269f92ec build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-04 09:34:33 -07:00
Angular Robot 5e1d535868 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-03 08:56:14 -07:00
hawkgs e23541b263 fix(zone.js): vitest patching of describe/it curried calls
Separate direct from curried calls of `describe`/`it` modifiers
(direct: `skip`, `only`, etc.; curried: `runIf`, `each`, etc.)
and perform the required patching to them.

Fixes: #69748
2026-07-22 12:34:00 +02:00
Angular Robot 4cf5135743 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-07-09 16:04:43 -07:00
Angular Robot c3e688f102 build: update all non-major dependencies
See associated pull request for more information.
2026-07-07 11:04:31 -07:00
arturovt 2d33fd55ff fix(zone.js): harden zoneSymbolEventNames and patches against __proto__ key
Initialize `zoneSymbolEventNames` and `patches` with `Object.create(null)` instead of `{}`.

This is a hardening change rather than a fix for an exploitable vulnerability. Calling `addEventListener('__proto__', fn)` is not directly attacker-controlled; its presence already implies an application bug. However, if such a call does occur, the current implementation can behave unexpectedly depending on the environment.

For `zoneSymbolEventNames`, accessing `zoneSymbolEventNames['__proto__']` on a plain object invokes the inherited `__proto__` accessor and returns `Object.prototype`, which is truthy. This causes `prepareEventNames()` to be skipped, leaving `symbolEventName` undefined and eventually leading to a runtime error when `window['undefined'] = []` is executed.

In Node.js environments running with `--disable-proto=throw`, the assignment:

```ts id="z8n4qm"
zoneSymbolEventNames['__proto__'] = {};
```

throws immediately because it triggers the disabled `__proto__` setter.

The `patches` registry has a similar issue. A `__proto__` key passed to `__load_patch()` bypasses the duplicate-patch check and reaches:

```ts id="f3v7kx"
patches['__proto__'] = fn(...);
```

which invokes the `__proto__` setter and changes the prototype of the `patches` object.

Using `Object.create(null)` removes the inherited `__proto__` accessor entirely, causing these keys to behave like ordinary properties rather than interacting with JavaScript's prototype machinery.

As part of this change, `patches.hasOwnProperty(name)` is also updated to:

```ts id="n2c8wp"
Object.prototype.hasOwnProperty.call(patches, name)
```

since null-prototype objects do not inherit `hasOwnProperty`.
2026-06-24 12:19:30 -04:00
arturovt fd7c2daf4d fix(zone.js): harden zoneSymbolEventNames against __proto__ key (defense-in-depth)
Initialize zoneSymbolEventNames with Object.create(null) instead of {}.

This is hardening only. addEventListener('__proto__', fn) is not
directly attacker-controllable — its presence in an application is
itself an application bug and a prerequisite for any issue here.

Without this change, if that application bug exists, two unexpected
behaviors follow depending on environment:

Browser: zoneSymbolEventNames['__proto__'] reads the __proto__ getter
and returns Object.prototype (truthy), bypassing prepareEventNames.
symbolEventName resolves to undefined and window['undefined'] = []
throws TypeError.

Node.js + --disable-proto=throw: the assignment
zoneSymbolEventNames['__proto__'] = {} inside prepareEventNames
triggers the disabled __proto__ setter and throws.

Using Object.create(null) removes the __proto__ accessor from the
map so the key is treated as a plain missing property in both cases.
2026-06-11 09:41:07 -07:00
Angular Robot 393a71f4ad build: update all non-major dependencies
See associated pull request for more information.
2026-06-11 09:28:12 -07:00
Angular Robot 0a9ff4ea47 build: update all non-major dependencies
See associated pull request for more information.
2026-06-09 11:07:34 -07:00
arturovt e50f504b2f fix(zone.js): validate __Zone_symbol_prefix to prevent DOM clobbering attacks
Previously, `__Zone_symbol_prefix` was read directly from `globalThis` without validating its type:

const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';

This made it possible for DOM clobbering to interfere with Zone’s internal symbol handling. If an attacker injected a DOM element with the same name (for example via a form field or anchor ID), `global['__Zone_symbol_prefix']` could resolve to a DOM element instead of a string. Because DOM elements are truthy, the fallback would not be used, and Zone would construct invalid internal keys (e.g. “[object HTMLFormElement]...”), breaking patching and lookup logic in subtle ways.

This prevents DOM clobbering from influencing Zone’s internal symbol generation and keeps the patching system stable even in the presence of malicious or unexpected global values.
2026-05-29 14:54:13 +02:00
Christian Oliff 76dfb94e03 docs: changelog typo fixes 2026-05-29 11:56:26 +02:00
Angular Robot 5f62a95bab build: update cross-repo angular dependencies
See associated pull request for more information.
2026-05-29 11:49:44 +02:00
Angular Robot 74d5886c46 build: update all non-major dependencies
See associated pull request for more information.
2026-05-29 11:47:46 +02:00
Angular Robot db59909c06 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-05-27 16:39:56 -07:00
Andrew Scott fa7580061b fix(zone.js): avoid type error on custom object rejection with rejection property
Ensure that when a custom object with a 'rejection' property is thrown as a raw promise rejection, the unhandled promise rejection error logger does not crash with a TypeError while trying to access undefined zone properties.

Also wrap microtask queue draining and task frame counter updates with defensive try-finally blocks to guarantee internal scheduler states are properly reset under any potential call stack exception unwinding scenarios.
2026-05-27 10:45:13 -07:00
Alex Rickabaugh 4f9ee3c056 refactor: add g3-only and 3p-only markers to replace specific g3 patches
Replace specific file patches applied during google3 sync with generic comment-based mechanisms.

By adding `// g3-only` prefix comments to g3-specific exports and declarations, and appending `// 3p-only` context to `@internal` tags, we enable generic tooling to handle these modifications during the sync process.

Additionally, wrap 3rd-party-only imports and exports (which should be stripped in google3) with `// 3p-only-start` and `// 3p-only-end` comment markers.

This reduces the need for maintaining custom file-specific patches in google3.

Also, add a comprehensive guide to these sync comment markers in `contributing-docs/google-markers.md` to assist external contributors.

Specifically:
- Add `// 3p-only` context to `@internal` in `directives.ts` for `foreignImports` and `deferredImports`.
- Add `// g3-only` commented exports in `core.ts`.
- Add `// g3-only-start`/`// g3-only-end` commented global declaration block in `zone.ts`.
- Wrap 3p-only imports in `fake_navigation.ts` with `// 3p-only-start` and `// 3p-only-end`.
- Wrap 3p-only exports in `compiler-cli/index.ts` with `// 3p-only-start` and `// 3p-only-end`.
- Add `// g3-only` and `// 3p-only` markers to `shared.ts` for `setDisabledStateDefault` configuration.
- Add `// g3-only` and `// 3p-only` markers to `feature_detection.ts` for semver dependency.
- Add `// g3-only` and `// 3p-only` markers to `domino_adapter.ts` for domino import path.
- Add `// 3p-only` marker to `ng_dev_mode` import in `event_dispatcher.ts`.
- Add `// g3-only` and `// 3p-only` markers to `MOUSE_SPECIAL_SUPPORT` in `event_contract_defines.ts`.
- Add `// g3-only` and `// 3p-only` markers to `BrowserModule` imports in `module.ts` (animations) and `browser.ts` (testing).
- Add `// 3p-only` marker to `goog.d.ts` reference tags in `util.ts` (platform-browser), `types.d.ts`, `ng_i18n_closure_mode.ts`, `tokens.ts`, and `global_utils.ts`.
- Wrap `Default` enum value of `ChangeDetectionStrategy` in `constants.ts` with `// 3p-only-start` and `// 3p-only-end`.
- Add `// g3-only` and `// 3p-only` markers to `LEGACY_OPTIONAL_CHAINING_DEFAULT` in `legacy_optional_chaining_default.ts` and `legacyOptionalChaining` in `directive.ts`.
- Add `// g3-only` and `// 3p-only` markers to `DEFAULT_PARAMS_INHERITANCE_STRATEGY` in `router_state.ts`.
- Add `// g3-only` and `// 3p-only` (and block variants) markers to `@mcp-b/webmcp-types` imports in `declare_tool.ts`, `provide_tools.ts`, and `types.ts`.
- Add `contributing-docs/google-markers.md` guide.

TAG=agy
CONV=cd09a4f3-869a-4f41-949b-c91f1b8f1c51
2026-05-26 16:09:37 -07:00
Angular Robot 2864fed214 build: update all non-major dependencies
See associated pull request for more information.
2026-05-15 11:38:00 -07:00
Alex Rickabaugh e3dc87cbd8 release: cut the zone.js-0.16.2 release 2026-05-06 16:44:48 -07:00
Angular Robot 4f048e7de3 build: update dependency typescript to v6.0.3
See associated pull request for more information.
2026-05-04 13:05:58 -07:00
hawkgs 9fa4be9d09 test(zone.js): vitest patch for testing (#68395)
Test `fakeAsync` API in Vitest when Zone.js `vitest` patch applied.

PR Close #68395
2026-04-30 15:44:35 -07:00
Charles Lyding 62c6e3b7ee feat(zone.js): support vitest patching in zone.js/testing (#68395)
To support `fakeAsync` usage while using `vitest` as a test runner, Zone.js
now provides patching when using the `zone.js/testing` package import.
This patching is similar to that of the existing jasmine, mocha, and jest
functionality.

PR Close #68395
2026-04-30 15:44:35 -07:00
Matthieu Riegler 7f3f3d7da1 ci: remove remainings of saucelabs tests
Those haven't been used for a while.
2026-04-22 14:41:03 -07:00
Angular Robot 56ff89c92d build: update all non-major dependencies
See associated pull request for more information.
2026-04-17 14:26:35 -07:00
arturovt fc6a7eea68 fix(zone.js): allow draining microtasks in Promise.then (through flag)
These changes are essentially the same as those introduced in
angular#45273, but they include backward compatibility
for applications that explicitly rely on the order in which microtasks are drained.

This is critically important for our code and other third-party code, which is
beyond our control, to work properly. If a microtask is scheduled within an event
listener to be executed "later", it should indeed be executed later and not synchronously,
as this would break the expected flow of code execution.

The simple code that reproduces the behavior that exists now:

```ts
Zone.current.fork({name: 'child'}).run(() => {
  const div = document.createElement('div');
  div.style.height = '200px';
  div.style.width = '200px';
  div.style.backgroundColor = 'red';
  document.body.appendChild(div);

  function listener() {
    Promise.resolve().then(() => {
      div.style.height = '400px';
    });
  }

  div.addEventListener('fakeEvent', listener);
  div.dispatchEvent(new Event('fakeEvent'));
  console.log(div.getBoundingClientRect().height); // 400
});
```

The code above logs 400 as the height, but it should actually log 200 because the
height is updated in a microtask within the event listener.

When using Angular with microfrontend applications, especially when other apps might be
using React, zone.js can disrupt the classical order of operations. For example, when using a
`react-component/trigger`, it schedules a microtask within an event listener using
`Promise.resolve().then(...)` to determine whether the event needs to be re-dispatched.
The event is re-dispatched when the layout has changed, which is why a microtask is used.

With this change, we introduce a global configuration flag,
`__zone_symbol__enable_native_microtask_draining`, to allow consumers to enable
microtask draining within a browser microtask.

This flag is necessary to prevent any breaking changes resulting from this modification.
The previous attempt to address this issue caused a significant number of failures in g3.
Therefore, we are hiding that fix behind the configuration flag.

Closes angular#44446
Closes angular#55590
Closes angular#51328
2026-04-15 10:31:28 -04:00
Angular Robot 0007723a03 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-03-25 13:32:59 -07:00
Kristiyan Kostadinov 9ee4f83705 build: update to TypeScript 6 stable
Updates the repo to the stable version of TypeScript 6.
2026-03-25 12:57:49 -07:00
Angular Robot 621c9083de build: update cross-repo angular dependencies
See associated pull request for more information.
2026-03-20 15:22:17 -07:00
Angular Robot ada150c693 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-03-13 16:26:41 -06:00
Angular Robot 81d0807242 build: update all non-major dependencies
See associated pull request for more information.
2026-03-12 16:08:35 -06:00
Alan Agius 667219230a test: remove duplicate tests (#67518)
These tests are duplicate and have been removed.

PR Close #67518
2026-03-11 13:37:33 -07:00
Alan Agius 4febb8ad31 build: update aspect_rules_js to 3.0.2 (#67518)
This updates the major version of `aspect_rules_js`.

PR Close #67518
2026-03-11 13:37:33 -07: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
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
Andrew Scott ac8b5ff938 release: cut the zone.js-0.16.1 release 2026-02-19 00:26:30 +00:00
Andrew Scott 98610aabaf docs(zone.js): update release and publish commands in DEVELOPER.md 2026-02-18 08:47:53 -08:00
Andrew Scott d99e336a03 docs(zone.js): update build command in DEVELOPER.md 2026-02-18 08:47:53 -08:00
Andrew Scott c2f7eaa833 docs(zone.js): update instructions to use pnpm 2026-02-18 08:47:53 -08:00
Andrew Scott fc557f0276 fix(zone.js): support passthrough of Promise.try API
When Zone patches Promise, it uses ZoneAwarePromise. The new Promise.try API was undefined on ZoneAwarePromise, making it unavailable when zone was present. This change gracefully passes through Promise.try to the native Promise implementation, if available, without patching it to execute in the right zone (our stance is not to add new patches but avoid destructively making new APIs unavailable).

Fixes #67057
2026-02-17 11:32:49 -08:00
Kristiyan Kostadinov 81cabc1477 feat(core): add support for TypeScript 6
Updates the project to support TypeScript 6 and accounts for some of the breakages.
2026-02-17 08:40:38 -08:00
Angular Robot 11767cabe4 build: update Jasmine to 6.0.0
Jasmine enables `forbidDuplicateNames: true` by default. So we also need to desambiguate duplicate spec names.
2026-02-09 12:15:57 -08:00
Shuaib Hasan Akib 0c6604f478 refactor(common): update copyright to Google LLC
Replaces outdated Google Inc copyright headers with Google LLC to align with current licensing standards.
2026-02-09 07:51:36 -08:00
Angular Robot df3258cfc4 build: update all non-major dependencies
See associated pull request for more information.
2026-01-29 12:22:40 -08:00
Angular Robot 9989c5fb78 build: update dependency @csstools/css-color-parser to v4
See associated pull request for more information.
2026-01-16 10:30:20 -08:00
Kristiyan Kostadinov 52bc0208f9 build: move zone.js build off deprecated flag
The Zone.js build was depending on the `--outFile` flag from TypeScript which is deprecated. These changes switch to using `--outDir` and copying the files out of the directory instead.
2026-01-16 09:28:47 -08:00
Angular Robot 54fc393d27 build: update dependency @csstools/css-calc to v3
See associated pull request for more information.
2026-01-16 09:20:05 -08:00
Angular Robot ebc52ff434 build: update all non-major dependencies
See associated pull request for more information.
2026-01-15 10:52:48 -08:00
SkyZeroZx 85ce5f3ce7 docs: update copyright year 2026-01-07 12:28:34 -05:00
Matthieu Riegler 6270bba056 ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 14:44:19 -08:00
Matthieu Riegler af77b89e2a ci: reformat files
This is after we've slightly changed a rule in #66056
2025-12-16 09:24:36 -08:00
Joey Perrott 349133374f build: update repository to use node 22.21.1 in bazel
The repository was updated to use node 22.21.1 via nvm, but bazel had not been updated to match
2025-12-09 09:19:13 -08:00