Commit graph

381 commits

Author SHA1 Message Date
JiaLiPassion
7a28f50711 feat(zone.js): implement Promise.withResolvers() (#53514)
Implement `Promise.withResolvers()`

```
const {promise, resolve, reject} = Promise.withResolvers();
```

PR Close #53514
2023-12-12 09:04:44 -08:00
Charles Lyding
58d2df8856 test: replace nodejs-websocket package with ws package (#53482)
The `nodejs-websocket` package has been replace with the `ws` package.
Both provide `WebSocket` server support and both of zero transitive
dependencies. However, the `ws` package has ~78 million weekly downloads
and was last updated this week (as of the writing of this commit) while
the `nodejs-websocket` package has ~7,600 weekly downloads and was last
update 5 years ago. The `ws` package is also already a transitive dependency
of the repository which allows for a reduction in the total dependency count
for the repository.

PR Close #53482
2023-12-12 09:01:03 -08:00
JiaLiPassion
08b0c87a94 fix(zone.js): Promise.resolve(subPromise) should return subPromise (#53423)
In the original `Promise` impelmentation, zone.js follow the spec from
https://promisesaplus.com/#point-51.

```
const p1 = Promise.resolve(1);
const p2 = Promise.resolve(p1);

p1 === p2; // false
```
in this case, `p2` should be the same status with `p1` but they are
still different instances.

And for some edge case.

```
class MyPromise extends Promise {
  constructor(sub) {
    super((res) => res(null));
    this.sub = sub;
  }
  then(onFufilled, onRejected) {
    this.sub.then(onFufilled, onRejected);
  }
}

const p1 = new Promise(setTimeout(res), 100);
const myP = new MyPromise(p1);
const r = await myP;
r === 1; // false
```

So in the above code, `myP` is not the same instance with `p1`,
and since `myP` is resolved in constructor, so `await myP` will
just pass without waiting for `p1`.

And in the current `tc39` spec here https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promise-resolve
`Promise.resolve(subP)` should return `subP`.

```
const p1 = Promise.resolve(1);
const p2 = Promise.resolve(p1);

p1 === p2; // true
```

So the above `MyPromise` can wait for the `p1` correctly.

PR Close #53423
2023-12-11 10:55:12 -08:00
Alan Agius
1a33a2ca11 release: cut the zone.js-0.14.2 release (#52508)
PR Close #52508
2023-11-03 10:54:12 -07:00
JiaLiPassion
435dd32912 fix(zone.js): disable wrapping unhandled promise error by default (#52492)
Before this commit, zone.js wraps the uncaught promise rejection error
to a new Error object includes more information such as Zone stack
traces. This feature is provided from the very beginning of Zone.js,
but this feature becomes very annoying and make the user difficult to
debug.

So this commit disable this wrapping behavior by default, and user can
enable this feature back by setting
`DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION` to `false`.

PR Close #52492
2023-11-03 09:33:20 -07:00
Angular Robot
7888819063 build: update cross-repo angular dependencies (#52191)
See associated pull request for more information.

PR Close #52191
2023-10-26 14:12:34 -07:00
Andrew Kushnir
8599e1892e build: update zone.js version to 0.14.1 (#52385)
This commit updates the `package.json` of the zone.js package.

PR Close #52385
2023-10-26 09:28:32 -07:00
Susheel Thapa
31c7bc1cf4 docs: fixed typos (#52297)
PR Close #52297
2023-10-25 16:39:04 -07:00
Alan Agius
16bf04b1f4 release: cut the zone.js-0.14.1 release (#52374)
PR Close #52374
2023-10-25 14:39:43 -07:00
Alan Agius
def719e2ca fix(zone.js): use globalThis instead of global and window (#52367)
`globalThis` global property contains the global `this` value, which is usually akin to the global object. This is needed for better compatibility with CloudFlare workers were global nor window are defined as globals.

PR Close #52367
2023-10-25 09:31:17 -07:00
Joey Perrott
5436890d4c build: lock file maintenance (#52353)
See associated pull request for more information.

PR Close #52353
2023-10-24 14:29:17 -07:00
Kristiyan Kostadinov
c07805612f test(core): clean up unnecessary nesting in old tests (#52239)
A lot of our tests are wrapped in `{}` which serves no purpose, aside from increasing the nesting level and, in some cases, causing confusion. The braces appear to be a leftover from a time when all tests were wrapped in a `function main() {}`. The function declaration was removed in #21053, but the braces remained, presumably because it was easier to search&replace for `function main()`, but not to remove the braces at the same time.

PR Close #52239
2023-10-19 09:26:15 -07:00
Joey Perrott
5269cae788 build: lock file maintenance (#51834)
Update the lock file.

PR Close #51834
2023-10-04 11:31:27 -07:00
Angular Robot
068b38a05d build: update cross-repo angular dependencies (#51996)
See associated pull request for more information.

(cherry picked from commit e169b2da2e)

PR Close #51996
2023-10-03 08:07:48 -07:00
Alan Agius
9bd1551c3f release: cut the zone.js-0.14.0 release (#51774)
PR Close #51774
2023-09-18 11:56:17 +02:00
Alan Agius
a8efc605ea feat(zone.js): remove legacy files and access to deep imports (#51752)
This commit removes access to deep imports and `zone-testing-bundle` and `zone-testing-node-bundle`

This commit removed access to deep and legacy `dist` imports. `zone-testing-bundle` and `zone-testing-node-bundle` are also no longer generated.

BREAKING CHANGE:
Deep and legacy `dist/` imports like `zone.js/bundles/zone-testing.js` and `zone.js/dist/zone` are no longer allowed. `zone-testing-bundle` and `zone-testing-node-bundle` are also no longer part of the package.

The proper way to import `zone.js` and `zone.js/testing` is:
```js
import 'zone.js';
import 'zone.js/testing';
```

PR Close #51752
2023-09-14 12:11:05 +02:00
Kristiyan Kostadinov
52cc7f839b build: align with internal tsconfig options (#51728)
Currently internally Angular has some customized tsconfig files, because we don't align with the tsconfig of the rest of g3. These changes enable `noImplicitReturns` and `noPropertyAccessFromIndexSignature` to align better with the internal config.

PR Close #51728
2023-09-12 11:39:42 -07:00
Alan Agius
caaabd8efe release: cut the zone.js-0.13.3 release (#51742)
PR Close #51742
2023-09-12 11:16:20 -07:00
Alan Agius
e86d6dba27 fix(zone.js): temporary allow deep imports (#51737)
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream.

See: https://github.com/thymikee/jest-preset-angular/issues/2162

PR Close #51737
2023-09-12 08:07:58 -07:00
Alan Agius
74755c4b5e fix(zone.js): rename typings conditional export to types (#51737)
`typings` is not valid for TypeScript. See: https://www.typescriptlang.org/docs/handbook/esm-node.html for more information.

PR Close #51737
2023-09-12 08:07:57 -07:00
JiaLiPassion
ac56efa410 release: cut the zone.js-0.13.2 release (#51689)
PR Close #51689
2023-09-11 09:22:12 -07:00
Alan Agius
4798ec4166 fix(zone.js): add conditional exports to zone.js package (#51652)
This is needed to better support native ESM modules and avoid the otherwise necessary deep imports like `zone.js/fesm2015/zone-node.js` due to disallowed directory imports.

PR Close #51652
2023-09-06 16:37:26 +00:00
Angular Robot
690c8325cd build: lock file maintenance (#51628)
See associated pull request for more information.

PR Close #51628
2023-09-01 20:44:06 +00:00
Joey Perrott
0907f396d5 build: migrate to node 18 (#51609)
Migrate to use node version 18

PR Close #51609
2023-09-01 15:12:43 +00:00
Angular Robot
c439a40db2 build: update dependency google-closure-compiler to v20230802 (#51265)
See associated pull request for more information.

PR Close #51265
2023-08-31 16:34:49 +00:00
Kristiyan Kostadinov
bf9663847d build: update type TypeScript 5.2 final (#51503)
Bumps up the repo to the stable version of TypeScript 5.2.

PR Close #51503
2023-08-28 17:02:30 +00:00
Kristiyan Kostadinov
9cc52b9b85 feat(core): support TypeScript 5.2 (#51334)
Updates the project to support TypeScript 5.2.

PR Close #51334
2023-08-18 07:55:16 -07:00
aanchal
6691c497e2 docs: add lang attributes to the files (#51200)
PR Close #51200
2023-08-01 11:58:44 -07:00
Angular Robot
27d43a4a7f build: lock file maintenance (#51134)
See associated pull request for more information.

PR Close #51134
2023-07-24 08:12:51 -07:00
Angular Robot
a5bd5ddbaa build: lock file maintenance (#50877)
See associated pull request for more information.

PR Close #50877
2023-06-28 13:33:22 -07:00
Angular Robot
17dec5bbe7 build: lock file maintenance (#50532)
See associated pull request for more information.

PR Close #50532
2023-06-13 11:46:07 +02:00
Pawel Kozlowski
d773589ed2 build: bump up zone.js version for the release (#50680)
The zone.js release commit didn't update the zone.js version
in the package.json so this change fixes it.

PR Close #50680
2023-06-12 17:50:31 +02:00
JiaLiPassion
8eecc0f773 release: cut the zone.js-v0.13.1 release (#50636)
PR Close #50636
2023-06-12 15:48:54 +02:00
Alan Agius
7837f7119f fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50530)
Similar to the browser, now we also monkey patch `queueMicrotask` in Node.js. This API was added in Node.js 11.

PR Close #50530
2023-06-07 12:42:33 -07:00
Alan Agius
cb31dbc75c fix(zone.js): patch entire promise in node (#50552)
In https://github.com/angular/angular/pull/49144 we introduced a change to only path `Promise.prototype.then` due to Node.js `SafePromise` complaining about `Promise.prototype.then` called on incompatible receiver. This however introduced a number of regressions. This commit reverts this change and re-introduces the changes to patch the entire promise on Node.

The original `SafePromise` problem is no longer reproducible as of Node.js version 18.13+ as it was addressed as part of https://github.com/nodejs/node/pull/45175.

While the Angular CLI does not yet generate ESM server bundles, users using ESM with dynamic imports will require using Node.js 18.13 or later.

Closes #50513, closes #50457, closes #50414 and closes #49930

PR Close #50552
2023-06-02 14:07:18 -07:00
Jessica Janiuk
7567348c54 Revert "fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50467)" (#50529)
This reverts commit 381cb98226.

PR Close #50529
2023-05-31 09:57:42 -07:00
Alan Agius
381cb98226 fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50467)
Similar to the browser, now we also monkey patch `queueMicrotask` in Node.js. This API was added in Node.js 11.

PR Close #50467
2023-05-30 12:57:45 -07:00
BrianDGLS
2d411430e3 refactor(router): run spell check on router package (#50445)
Fix typos in router package.

PR Close #50445
2023-05-24 13:56:56 +00:00
BrianDGLS
19993a490c refactor(zone.js): run spell check on zone.js package (#50445)
Fix typos found in zone.js CHANGELOG.md

PR Close #50445
2023-05-24 13:56:55 +00:00
Angular Robot
b68306e616 build: update dependency google-closure-compiler to v20230502 (#50153)
See associated pull request for more information.

PR Close #50153
2023-05-19 14:18:36 +00:00
Greg Magolan
5a9059be38 build: share Saucelabs browsers between karma test targets using background Saucelabs daemon and custom karma launcher (#49200)
This upgrades the Saucelabs Bazel step on CI to use the more efficient Saucelabs daemon

PR Close #49200
2023-05-15 09:21:46 -07:00
Angular Robot
f2926b19e8 build: lock file maintenance (#49879)
See associated pull request for more information.

PR Close #49879
2023-05-11 14:27:01 -07:00
Alan Agius
cd5946bccd build: lock file maintenance (#50227)
See associated pull request for more information.

(cherry picked from commit d5f92bdd64)

PR Close #50227
2023-05-10 11:32:43 -07:00
JiaLiPassion
dccfcb7a40 test(zone.js): update zone.js test for jasmine upgrade (#49914)
Update test cases to pass jasmine 6.x update.

PR Close #49914
2023-05-09 14:38:45 -07:00
Angular Robot
84a2e7db55 build: lock file maintenance (#49914)
See associated pull request for more information.

PR Close #49914
2023-05-09 14:38:45 -07:00
Angular Robot
50de000cf7 build: update dependency google-closure-compiler to v20230411 (#49892)
See associated pull request for more information.

PR Close #49892
2023-04-18 19:07:14 +00:00
Angular Robot
1c16be4728 build: update domino digest to aa8de34 (#49716)
See associated pull request for more information.

PR Close #49716
2023-04-05 10:52:49 -07:00
Matthieu Riegler
1f3f5642f5 refactor(zone.js): remove #9100 todos. (#49409)
This commit assigns the correct type instead of `any`.

PR Close #49409
2023-04-04 15:10:58 -07:00
Angular Robot
a218ef5bf2 build: update domino digest to 89bec1a (#49703)
See associated pull request for more information.

PR Close #49703
2023-04-04 15:04:50 -07:00
Angular Robot
d11f5d70d3 build: update dependency google-closure-compiler to v20230228 (#49663)
See associated pull request for more information.

PR Close #49663
2023-04-03 19:12:14 -07:00