Commit graph

30202 commits

Author SHA1 Message Date
Aristeidis Bampakos
d57257514d docs: update blog link in new Angular Docs (#56022)
PR Close #56022
2024-05-23 11:41:08 +02:00
Jens Kuehlers
cc12be47ed docs: change robots.txt to allow crawling (#56023)
PR Close #56023
2024-05-23 11:34:25 +02:00
Jens Kuehlers
45d6865c22 docs: update robots.txt to allow crawlers (#56023)
PR Close #56023
2024-05-23 11:34:25 +02:00
mgechev
c122f07149 docs: update the roadmap to reflect latest work (#55979)
PR Close #55979
2024-05-23 11:24:33 +02:00
arturovt
a27600c463 fix(zone.js): do not mutate event listener options (may be readonly) (#55796)
Prior to this commit, event listener options were mutated directly, for example,
`options.signal = undefined` or `options.once = false`.

This issue arises in apps using third-party libraries where the responsibility lies
with the library provider. Some libraries, like WalletConnect, pass an abort controller
as `addEventListener` options. Because the abort controller has the `signal` property,
this is a valid case. Thus, mutating options would throw an error since `signal`
is a readonly property.

Even though zone.js is being deprecated as Angular moves towards zoneless change detection,
this fix is necessary for apps that still use zone.js and cannot migrate to zoneless change
detection because they rely on third-party libraries and are not responsible for the code
used in them.

Closes #54142

PR Close #55796
2024-05-22 16:20:34 -07:00
Matthieu Riegler
b960aad863 refactor(core): remove unused preventDefault on listener (#55879)
`wrapListener` was only invoked with `wrapWithPreventDefault` set to `false`.

PR Close #55879
2024-05-22 16:08:40 -07:00
Emma Twersky
ed5065e958 docs: add the v18 blog post link to the changelog (#56015)
PR Close #56015
2024-05-22 16:06:51 -07:00
Tom Wilkinson
9f63df9d1b refactor(core): Add a new EventDispatcher class. (#55837)
`EventDispatcher` emulates the browser's event dispatch (mostly).
It supports:
 - Bubbling and `stopPropagation`/`stopImmediatePropagation`.
 - `currentTarget` during dispatch.
 - Throwing errors for `preventDefault` if the event is being dispatched
   in replay.
 - Throwing errors for `composedPath()` if event is being dispatched in
   replay.

PR Close #55837
2024-05-22 15:24:01 -07:00
cexbrayat
985a215b10 fix(core): typo in zoneless warning (#55974)
The warning introduced in ae0baa25 mispelled `applications`.

PR Close #55974
2024-05-22 15:22:19 -07:00
Joey Perrott
774b4239ac ci: don't add redirect from next.angular.dev to vX sites (#56012)
Don't redirect from vX.angular.dev version to the next.angular.dev instance

PR Close #56012
2024-05-22 15:11:22 -07:00
Emma Twersky
e67cb09404 docs: update robots.txt (#56010)
PR Close #56010
2024-05-22 15:09:38 -07:00
twerske
5d64589e4c docs: add angular.dev release banners (#56014)
PR Close #56014
2024-05-22 15:09:10 -07:00
Dylan Hunn
d6391eed23 release: cut the v18.0.0 release 2024-05-22 10:54:42 -07:00
Paweł Kubiak
e3aa2b59ba fix(docs-infra): calculate list of Angular Docs versions based on VERSION (#56002)
fix(docs-infra): calculate the list of Angular Docs versions based on VERSION, append --config=release to docs build and serve the script. Support displaying the right color of navigation for the deprecated state.
fix(docs-infra): add scrollbar to version picker
fix(docs-infra): set initial adev docs version to 18
fix(docs-infra): remove --config=release from scripts for local development, write unit tests
fix(docs-infra): update CI tests step
fix(docs-infra): remove rc from the list
fix(docs-infra): update unit test to check count of versions

PR Close #56002
2024-05-22 17:27:05 +00:00
Andrew Scott
a6eedbc2e8 docs: Add experimental and zoneless to nav (#55834)
PR Close #55834
2024-05-22 10:18:54 -07:00
Kristiyan Kostadinov
b7f2fd4739 fix(language-service): use type-only import in plugin factory (#55996)
Fixes that the plugin factory was causing TypeScript to be bundled into the language service.

PR Close #55996
2024-05-22 09:52:33 -07:00
Matthieu Riegler
f8a2ad6e99 docs: Add v18 to update guide (#55993)
PR Close #55993
2024-05-22 16:03:02 +00:00
Joey Perrott
3ac0511aad fix(docs-infra): use separate templates for the from and to selectors in update guide (#55992)
Use separate template names for the from and to selector dropdowns, otherwise we are only able to change the from value.

PR Close #55992
2024-05-22 15:59:33 +00:00
Dylan Hunn
ef96158899 release: cut the v18.0.0-rc.3 release 2024-05-21 14:37:26 -07:00
arturovt
e598634c10 fix(service-worker): remove controllerchange listener when app is destroyed (#55365)
This commit updates the `ngswAppInitializer` implementation and removes the `controllerchange`
listener upon the destruction of the `ApplicationRef`. This adjustment aims to prevent memory
leaks. In a zone.js environment, neglecting to do so could lead to the perpetual creation of
a zone task, which captures the zone and obstructs proper garbage collection.

PR Close #55365
2024-05-21 14:04:22 -07:00
twerske
58b2fc4f81 docs: update robot.txt to index angular.dev (#55617)
PR Close #55617
2024-05-21 13:41:06 -07:00
Tom Wilkinson
b79b6c14de refactor(core): Add a bit to EventInfo to mark resolution. (#55864)
This will prevent running `ActionResolver` logic multiple times while
migrating to use `Dispatcher` to resolve actions rather than
`EventContract`.

PR Close #55864
2024-05-21 12:20:48 -07:00
Angular Robot
999bfac737 build: update actions/checkout digest to a5ac7e5 (#55889)
See associated pull request for more information.

PR Close #55889
2024-05-21 12:19:37 -07:00
Sasidharan SD
cbe3a029fa docs: fix broken publish library link (#55895)
PR Close #55895
2024-05-21 12:15:12 -07:00
Ben Hong
81c99ac5b9 docs: add missing border on embedded editor (#55926)
PR Close #55926
2024-05-21 12:14:18 -07:00
Matthieu Riegler
0c75267ebf docs(docs-infra): Add update guide to adev (#55638)
PR Close #55638
2024-05-21 12:01:59 -07:00
Joey Perrott
a44a4689ca ci: properly redirect during rc phase (#55972)
Properly redirect to next.angular.dev during rc phase

PR Close #55972
2024-05-21 11:59:45 -07:00
Kristiyan Kostadinov
33d0102304 fix(compiler): allow comments between connected blocks (#55966)
Fixes that the logic which looks for connected blocks didn't allow for comments between them.

Fixes #55954.

PR Close #55966
2024-05-21 10:37:58 -07:00
garrettld
5052d4c998 docs(common): fix FormatWidth.Short description (#55821)
PR Close #55821
2024-05-20 23:39:24 -07:00
Andrew Kushnir
77eb4ca061 docs: declare provideAnimationsAsync() function stable (#55871)
This commit removes the `@developerPreview` label from the `provideAnimationsAsync()` function, effectively declaring it stable.

PR Close #55871
2024-05-20 23:38:19 -07:00
cexbrayat
4f4f41016e fix(compiler-cli): dom property binding check in signal extended diagnostic (#54324)
The compiler now checks if a signal is properly called on dom property bindings.
The ideal solution would be for the compiler to check if dom property bindings in general are properly typed,
but this is currently not the case, and it is a bigger task to land this change.
In the meantime, the signal diagnostic is augmented to catch cases like the following:

```
<div [id]="mySignal"></div>
```

PR Close #54324
2024-05-20 23:37:57 -07:00
Thomas Nguyen
c881c3e0c6 refactor(core): Add additional cleanups to PR- Simplify event handler extraction logic. (#55752)
This should have been part of an earlier commit, but was not merged.

PR Close #55752
2024-05-20 23:37:34 -07:00
Kristiyan Kostadinov
0cbd73c6e9 fix(core): add warning when using zoneless but zone.js is still loaded (#55769)
Users may be using zoneless, but are still loading Zone.js in which case they won't get the full benefits like reduced bundle size. These changes detect such a case and log a warning.

PR Close #55769
2024-05-20 23:37:12 -07:00
Tom Wilkinson
e923a76400 refactor(core): Remove legacy_dispatcher.ts which is no longer needed. (#55784)
Also use `dispatchDelegate` by default for `eventReplayer`.

PR Close #55784
2024-05-20 23:36:51 -07:00
Pawel Kozlowski
9f7227cb8f refactor(docs-infra): notify on data change inside OnPush component (#55830)
The SecondaryNavigation component was updating state outside of an event handler
without notifying about this change. Modeling state as signal should take
care of proper UI updates (note that I did just a mechanical change here, maybe
there are better ways of dealing with this animations case).

PR Close #55830
2024-05-20 23:33:42 -07:00
arturovt
3657358270 docs: update zone-pollution.md (#55876)
Provide a thorough explanation of why third-party libraries should be created outside
of the Angular zone. Using a statement like "authored with Zone.js in mind" may seem
unusual because third-party libraries typically do not have knowledge of Zone.js, nor
should they be developed with it in mind. Therefore, we revise this explanation accordingly.
Additionally, include a section on handling events originating from third-party APIs.

PR Close #55876
2024-05-20 23:30:30 -07:00
Charles Lyding
b7f67b4453 docs: update build system migration URL for CLI (#55891)
The URL for the Angular CLI has been updated to `build-system-migration`
to better reflect the content of the documentation.

PR Close #55891
2024-05-20 23:29:22 -07:00
Rahat Ahmed
239d4f0c9e refactor(core): Cleanup dead jsnamespace code (#55795)
Support for the jsnamespace attribute was removed in #55619.

PR Close #55795
2024-05-17 12:59:41 -07:00
Hyun Don Moon
a78144ac21 docs: fix broken link in signals/model (#55811)
PR Close #55811
2024-05-17 12:25:46 -07:00
Jens Kuehlers
f0f85dbe2f docs: Include info about experimental on adev (#55857)
Copy information about meaning of "experimental"
from angular.io to angular.dev.

PR Close #55857
2024-05-17 12:25:19 -07:00
Andrew Scott
0147e0b85a fix(core): exhaustive checkNoChanges should only do a single pass (#55839)
Because exhaustive checks traverse the whole tree regardless of the
dirty state, it breaks some expectations around how change detection
should be running. When a view has transplanted views, it
unconditionally marks all ancestors for traversal, assuming this is fine
because the loop will just traverse them and find nothing dirty.
However, exhaustive checkNoChanages actually refreshes everything during
traversal.

This update ensures the exhaustive check only does a single pass and
also prevents some unnecessary marking of transplanted views for
refresh since we know they're going to be reached.

PR Close #55839
2024-05-17 12:24:36 -07:00
Alex Rickabaugh
8d93597a82 fix(compiler-cli): fix type narrowing of @if with aliases (#55835)
When an `@if` expression has an alias, only the type of the alias is
currently narrowed. So for example, suppose `value` is `string|undefined`:

```
@if (value; as alias) {
  {{ value.length }} <!-- error, value may be undefined -->
  {{ alias.length }} <!-- no error, alias is narrowed -->
}
```

This is especially noticeable when the expression contains guards which are
preconditions for the aliased expression:

```
@if (a && b; as alias) {...}
```

In this case, `a` would not be narrowed within the body, even though the
`@if` condition forces it to be truthy. This is a bug.

The reason is that aliased expressions were previously type-checked as:

```
var alias = a && b;
if (alias) {
  // nothing other than alias is narrowed
  ...
}
```

One option considered was to emit `const alias` instead of `var alias`.
TypeScript _does_ trace `const` expressions and narrow their individual
components when the overall expression is guarded:

```
const alias = a && b;
if (alias) {
  // a, b are also narrowed
}
```

However, this narrowing has different semantics than if `a && b` appeared
directly in the guard expression. For example, object properties aren't
narrowed with this approach, so component properties (which are referenced
as e.g. `this.a`) would not be narrowed.

Instead, we amend the guard expression to include both the expression _and_ the
alias variable, enforcing that both are narrowed.

```
var alias = a && b;
if ((a && b) && alias) {
  // a, b, and alias all narrowed correctly.
}
```

This form ensures all conditions within the guard expression get narrowed
while also narrowing the alias variable type.

Fixes #52855

PR Close #55835
2024-05-17 10:15:05 -07:00
Matthieu Riegler
0e16654be4 refactor(forms): remove deprecated symbols (#55723)
Follow-up of #55698 to help remove the symbols from G3.

PR Close #55723
2024-05-17 10:12:08 -07:00
Thomas Nguyen
f8a6ebd977 docs: Add documentation for event replay (#55802)
PR Close #55802
2024-05-17 10:10:08 -07:00
Paul Gschwendtner
69a83993b3 fix(compiler-cli): do not throw when retrieving TCB symbol for signal input with restricted access (#55774)
Currently when attempting to retrieve a TCB symbol for an input binding
that refers to a signal input with e.g. `protected`, while the
`honorAccessModifiersForInputBindings` flag is `false`, Angular will
throw a runtime exception because the symbol retrieval code always
expects a proper field access in the TCB.

This is not the case with `honorAccessModifiersForInputBindings =
false`, as TCB will allocate a temporary variable when ignoring the
field access. This will then trigger the runtime exception (which we
added to flag such "unexpected" cases). This commit handles it
gracefully, as it's valid TCB, but we simply cannot generate a proper
TCB symbol (yet). This is similar to `@Input` decorator inputs.

In the future we may implement logic to build up TCB symbols for
non-property access bindings, for both signal inputs or `@Input`
inputs. This commit just avoids a build exception.

Related to: #54324.

PR Close #55774
2024-05-16 09:33:02 -07:00
Charles Lyding
6025424fea docs: Update build system migration title to reflect user action (#55782)
The Angular CLI documentation topic for migrating to the new build system
now has a navigation label of "Migrating to new build system" instead of
"esbuild". This new label better reflects the action a user may want to
take rather than one of the tools used by the new build system.

PR Close #55782
2024-05-16 09:32:29 -07:00
Bouguima, Walid
eba92cfa55 fix(compiler): prevent usage of reserved control flow symbol in custom interpolation context. (#55809)
* Fixes the issue where using a reserved control flow @ symbol in a custom interpolation context yields improper parser feedback.

PR Close #55809
2024-05-16 09:28:13 -07:00
Alan Agius
3055b924af fix(zone.js): correctly bundle zone-patch-rxjs (#55826)
https://github.com/angular/angular/pull/53443 caused the a local `rxjs` file to be imported from an entry-point which caused this to be excluded from being bundled due to the name matching `rxjs`.

Closes #55825

PR Close #55826
2024-05-16 09:21:18 -07:00
Alan Agius
a768c90ee7 refactor(zone.js): remove tslib from dependencies (#55827)
Iif needed `tslib` code is included directly in the bundled FESM2015 hence making the dependency redundant.

PR Close #55827
2024-05-16 09:15:33 -07:00
cexbrayat
69085ea26e fix(core): error about provideExperimentalCheckNoChangesForDebug uses wrong name (#55824)
The error about `provideExperimentalCheckNoChangesForDebug` mentions `provideCheckNoChangesForDebug` instead.

PR Close #55824
2024-05-16 09:02:29 -07:00