30718 Commits

Author SHA1 Message Date
Miles Malerba 38effcc63e fix(core): Add back phase flag option as a deprecated API (#55648)
Adds back the ability to set the phase of an `afterRender` /
`afterNextRender` callback using the `phase` option. However, this API
is now deprecated, and the phase should instead be specified by passing
a spec object rather than a callback function.

PR Close #55648
2024-06-10 13:53:39 -07:00
Miles Malerba a655e46447 feat(core): Redesign the afterRender & afterNextRender phases API (#55648)
Previously `afterRender` and `afterNextRender` allowed the user to pass
a phase to run the callback in as part of the `AfterRenderOptions`. This
worked, but made it cumbersome to coordinate work between phases.

```ts
let size: DOMRect|null = null;

afterRender(() => {
  size = nativeEl.getBoundingClientRect();
}, {phase: AfterRenderPhase.EarlyRead});

afterRender(() => {
  otherNativeEl.style.width = size!.width + 'px';
}, {phase: AfterRenderPhase.Write});
```

This PR replaces the old phases API with a new one that allows passing a
callback per phase in a single `afterRender` / `afterNextRender` call.
The return value of each phase's callback is passed to the subsequent
callbacks that were part of that `afterRender` call.

```ts
afterRender({
  earlyRead: () => nativeEl.getBoundingClientRect(),
  write: (rect) => {
    otherNativeEl.style.width = rect.width + 'px';
  }
});
```

This API also retains the ability to pass a single callback, which will
be run in the `mixedReadWrite` phase.

```ts
afterRender(() => {
  // read some stuff ...
  // write some stuff ...
});
```

PR Close #55648
2024-06-10 13:53:39 -07:00
Angular Robot 6db94d51db docs: update Angular CLI help [main] (#56280)
Updated Angular CLI help contents.

PR Close #56280
2024-06-07 09:45:58 -07:00
Preston West 257d94211c docs: fix typo in testing/services.md (#56316)
PR Close #56316
2024-06-07 09:34:15 -07:00
Kristiyan Kostadinov 96aa5c8a2c fix(migrations): resolve error in standalone migration (#56302)
This is related to an issue that was reported internally. We were assuming that `hasNgModuleMetadataElements` will return true only for property assignments initialized to arrays, but that's not the case.

These changes update the type and our assertions to more accurately reflect the AST and to avoid the error.

PR Close #56302
2024-06-07 09:33:41 -07:00
Andrew Scott a13f5da773 feat(router): Allow UrlTree as an input to routerLink (#56265)
This commit adds `UrlTree` as a valid input to `routerLink`. It
disallows using this together with any inputs that come from
`UrlCreationOptions`, such as `queryParams` or `fragment`.

We could, in the future, decide on a different approach for these, like merging or
replacing those in `urlTree` input. We cannot, however, go the other way
(decide to prevent those inputs if we've already decided to allow it and
using a merging/replacing strategy). For this reason, an error seems the
most reasonable approach to start and we can re-evaluate if there's a
compelling reason to.

fixes #34468

PR Close #56265
2024-06-07 09:33:14 -07:00
Aristeidis Bampakos a7e4a578d8 docs: use new link for update guide (#56054)
PR Close #56054
2024-06-07 09:32:46 -07:00
arturovt 2781b20567 docs: update NG0506 (#55973)
Provide a thorough explanation of why an application may remain unstable and
why developers should consider not running asynchronous code on the server outside
of the Angular zone, as this may lead to memory leaks.

PR Close #55973
2024-06-07 09:32:18 -07:00
Matthieu Riegler 7b0777b304 docs(docs-infra): Go zoneless and enable the zoneless scheduler (#55161)
PR Close #55161
2024-06-07 09:31:15 -07:00
Alan Agius 81486c2f47 fix(localize): add @angular/localize/init as polyfill in angular.json (#56300)
This commit addresses an issue where the `@angular/localize/init` polyfill is not included when there are no polyfills specified in the `angular.json` file.

PR Close #56300
2024-06-06 13:41:11 -07:00
Jessica Janiuk 181ed2a84a release: cut the zone.js-0.14.7 release (#56306)
PR Close #56306
zone.js-0.14.7
2024-06-06 13:40:34 -07:00
Jessica Janiuk 101edda018 release: cut the v18.1.0-next.1 release 18.1.0-next.1 2024-06-05 13:18:05 -07:00
Jessica Janiuk cc97f11891 docs: release notes for the v18.0.2 release 2024-06-05 12:58:08 -07:00
Dylan Hunn 117a26bac3 docs(zone.js): update release guide for zone.js (#55846)
Update the releasing guide for zone.js, because one of the release commands was outdated.
PR Close #55846
2024-06-05 19:33:27 +00:00
Kristiyan Kostadinov dd869e4d68 refactor(language-service): integrate let declarations (#56270)
Integrates let declarations in the various places within the language service (quick info, completions etc).

PR Close #56270
2024-06-05 18:45:23 +00:00
Angular Robot 1653b40d14 build: update dependency @rollup/plugin-commonjs to v26 (#56281)
See associated pull request for more information.

PR Close #56281
2024-06-05 18:36:50 +00:00
Thomas Nguyen 6e89ef1ebf refactor(core): Refactor parts of event_replay into a shared library that will be used with global event delegation. (#56172)
This also moves the code that stashes the jsaction more closely to the code that actually sets the event listener.

PR Close #56172
2024-06-05 16:35:23 +00:00
marktechson 4766233f16 docs: remove v18 developer event banner (#56278)
PR Close #56278
2024-06-05 15:56:29 +00:00
Tom Wilkinson a65c1cf109 refactor(core): Add and move tests for Dispatcher. (#56193)
Move tests from `eventcontract_test.ts` to `dispatcher_test.ts` for
functionality that lives in `Dispatcher`.

Add an extra test for `preventDefault` behavior for `CLICKMOD` that
covers a previous bug case.

PR Close #56193
2024-06-04 18:05:39 +00:00
arturovt 4a3800a6a0 fix(zone.js): store remove abort listener on the scheduled task (#56160)
Prior to this commit, a memory leak occurred when the `abort` listener was
not removed from the `AbortSignal`. We introduced a fix to remove the event
listener, but it was erroneously stored on the `taskData`, which is a shared
global object. Consequently, when something attempted to remove an event listener,
it immediately removed the last stored abort listener. As a result, events would
never be canceled.

We have now rectified this by storing the remove abort listener function directly on
the task itself. This adjustment ensures that the abort listener is tied only to the
specific task. When the `abort` function is called, it cancels the task. Therefore, it
is safe to associate the cleanup function directly with the task.

Closes: #56148

PR Close #56160
2024-06-04 17:29:05 +00:00
Kristiyan Kostadinov 9aea8a0576 refactor(compiler-cli): add diagnostic for duplicate let declarations (#56199)
Adds a template diagnostic that will flag cases where multiple `@let` declarations use the same name.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov cb165923e0 refactor(compiler-cli): account for let declarations in two-way binding check (#56199)
Updates the check that prevent writes to template variables in two-way bindings to account for let declarations.

Also fixes some old tests that weren't properly setting up two-way bindings.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov ea4feb2721 refactor(compiler-cli): support completions for let declarations (#56199)
Adds support for let declarations inside the `CompletionEngine`.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov 18ea7417a0 refactor(compiler-cli): support resolving the symbol of let declaration (#56199)
Updates the symbol builder to handle resolving the symbol of a let declaration.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov 152430fa0f refactor(compiler-cli): integrate let declaration into the indexer (#56199)
Adds support for let declarations in the template indexer.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov 695126453e refactor(compiler-cli): integrate let declarations into the template type checker (#56199)
Integrates let declarations into the template type checker by producing corresponding constants in the TCB.

This also includes a couple of custom diagnostics to flag usages of let before they're declared and illegal writes to let declarations. We can't rely on TS for these checks, because it includes the variable name in the diagnostic.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov b7fc7fdba9 refactor(compiler): integrate let declarations into the template binder (#56199)
Integrates the let declarations into the template binder which will be used to power the scoping behavior of the new syntax.

PR Close #56199
2024-06-04 17:28:03 +00:00
Kristiyan Kostadinov 6cef0ed3ed refactor(compiler-cli): add compiler flag for testing let declarations (#56199)
Adds a private `_enableLetSyntax` flag that allows for let declarations to be enabled in tests.

PR Close #56199
2024-06-04 17:28:02 +00:00
Paweł Kubiak c8951ab57f fix(docs-infra): remove config release from test scripts (#56062)
fix(docs-infra): remove config release from test scripts

As we discussed in one of the previous PRs we should remove `--config=release` from test scripts on CI
fix(docs-infra): use DI to inject current VERSION.major

PR Close #56062
2024-06-04 17:27:27 +00:00
Angular Robot 0e2d80d5d4 build: update io_bazel_rules_sass digest to 61dde52 (#56168)
See associated pull request for more information.

PR Close #56168
2024-06-04 16:34:20 +00:00
Angular Robot d40cc85344 build: update cross-repo angular dependencies (#56259)
See associated pull request for more information.

Closes #56184 as a pr takeover

PR Close #56259
2024-06-04 16:27:46 +00:00
Alvaro Junqueira 8a24b83155 docs: fixing typo :ng-deep to ::ng-deep (#56251)
PR Close #56251
2024-06-04 16:14:50 +00:00
Pawel Kozlowski 73d0f77c34 refactor(docs-infra): mark adev-root component as OnPush (#56254)
After inspecting and testing the adev-root component is seems like
it could be marked as OnPush.
This change gets us closer to enabling zoneless for adev.

PR Close #56254
2024-06-04 13:52:37 +00:00
Pawel Kozlowski 45c56ad3df refactor(docs-infra): mark code editors components as OnPush (#56254)
After inspecting and testing the embedded-editor and adev-code-editor
components it
seems like those could be marked as OnPush.
This change gets us closer to enabling zoneless for adev.

PR Close #56254
2024-06-04 13:52:37 +00:00
Pawel Kozlowski f0ea936630 refactor(docs-infra): mark the update component as OnPush (#56254)
After inspecting and testing the adev-update-guide component it
seems like it could be marked as OnPush. This change gets us closer
to enabling zoneless for adev.

PR Close #56254
2024-06-04 13:52:37 +00:00
Sasidharan SD b0546dad83 docs: fix docs links (#56234)
PR Close #56234
2024-06-04 13:52:04 +00:00
Matthieu Riegler 73e84e2d22 refactor(core): Use Nullish coalescing assignment for view getters. (#56242)
Micro optim, this wasn't minified by the optimizer.

PR Close #56242
2024-06-03 20:10:35 +00:00
Ben Hong 3d2f963a90 docs: fix vertical playground spacing issue (#55689)
PR Close #55689
2024-06-03 19:26:09 +00:00
Ben Hong e5928e671c docs: resolve extra padding on tutorial editor (#54828)
As of this commit, there is a visual discrepancy between the height of the content on the left compared to the separator and editors on the right. It appears that the cause of this is an additional computation of layout padding which is unnecessary for these particular elements.

PR Close #54828
2024-06-03 19:24:39 +00:00
Alan Agius 01172b84d9 build: update Node.js to match Angular CLI engines (#56187)
The current supported Node.js engines by the Angular CLI are `^18.19.1 || ^20.11.1 || >=22.0.0`

PR Close #56187
2024-06-03 18:00:46 +00:00
Tomasz Ducin 8a993de4cb refactor(devtools): update links to the new docs (angular.dev) (#56138)
This PR replaces all links available within the devtools to point
to the new docs.
The links to Input/Output (decorators) have been replaced with
their function (signal) counterparts: input, output.

PR Close #56138
2024-06-03 17:38:11 +00:00
Dylan Hunn c673a0288d ci: add dylhunn@ to language-service pullapprove (#55999)
Add dylhunn@ as an approver for language service code.

PR Close #55999
2024-06-03 16:19:49 +00:00
Payam Valadkhan 9e21582456 fix(compiler-cli): Show template syntax errors in local compilation modified (#55855)
Currently the template syntax errors are extracted in the template type check phase. But in local compilation mode we skip the type check phase. As a result template syntax errors are not displayed. With this change we show the template syntax diagnostics in local mode.

PR Close #55855
2024-05-31 13:59:02 +00:00
Paweł 9d034f629f refactor(core): remove doubled line (#56091)
remove doubled line of titlecase pipe in commonModulePipes array

PR Close #56091
2024-05-31 13:24:55 +00:00
Sasidharan SD c0ad070e49 docs: fix alternate configuration link (#56201)
PR Close #56201
2024-05-31 13:24:15 +00:00
Angular Robot c1e3165ade build: update scorecard action dependencies (#56119)
See associated pull request for more information.

PR Close #56119
2024-05-31 13:15:41 +00:00
Alan Agius d530b09e40 docs: update file-structure doc (#56202)
Replace `/assets` with `public/`, this was replaced in version 18 of the Angular CLI.

PR Close #56202
2024-05-31 13:13:55 +00:00
Matthieu Riegler 398092b207 docs: update version support (#56034)
fixes #56033

PR Close #56034
2024-05-31 13:13:01 +00:00
Tyler Tierney fa7bef5b9b docs: edit sentence grammar in style-guide (#56173)
PR Close #56173
2024-05-31 13:12:29 +00:00
Andrew Scott 80f472f9f4 refactor(core): provide zone token in prod as well (#56197)
This allows us to make decisions based on whether zone is provided for
when zoneless is the default.

PR Close #56197
2024-05-30 19:24:23 -07:00