Commit graph

30760 commits

Author SHA1 Message Date
Peter
034b32c133 docs: fix typo of ChangeDetectionStrategy in the zoneless guide (#57482)
PR Close #57482
2024-08-23 12:59:09 -07:00
Kristiyan Kostadinov
2a89e184e0 fix(zone.js): more robust check for promise-like objects (#57388)
Fixes that Zone.js wasn't checking properly if an object is promise-like.

Fixes #57385.

PR Close #57388
2024-08-23 12:58:29 -07:00
Santosh
9b6865ec03 docs: add test for i18n code block and fix rendering (#57210)
PR Close #57210
2024-08-23 12:57:15 -07:00
Alex Rickabaugh
6059ca8f1f refactor(core): restructure AfterRenderManager to connect related phases (#57453) (#57504)
The `afterRender` infrastructure was first implemented around the idea of
independent, singular hooks. It was later updated to support a spec of
multiple hooks that pass values from one to another as they execute, but the
implementation still worked in terms of singular hooks under the hood. This
creates a number of maintenance issues, and a few bugs. For example, when
one hook fails, further hooks in the pipeline should no longer execute, but
this was hard to ensure under the old design.

This refactoring restructures `afterRender` infrastructure significantly to
introduce the concept of a "sequence", a collection of hooks of different
phases that execute together. Overall, the implementation is simplified
while making it more resilient to issues and future use cases, such as the
upcoming `afterRenderEffect`.

As part of this refactoring, the `internalAfterNextRender` concept is
removed, as well as the unused `queueStateUpdate` concept which used it.

PR Close #57453

PR Close #57504
2024-08-23 12:48:01 -07:00
Alex Rickabaugh
800f6c8ca3 refactor(core): track dirtiness bits in ApplicationRef (#57453) (#57504)
Previously the zoneless scheduler had a concept of whether views needed to
be refreshed or not, based on the notification type that was received. It
tracked this information as a boolean.

This commit refactors things to track dirtiness in `ApplicationRef` itself,
as a `dirtyFlags` field with bits corresponding to either view tree
dirtiness or after-render hooks.

PR Close #57453

PR Close #57504
2024-08-23 12:48:01 -07:00
Paul Gschwendtner
87c594b90b refactor(migrations): add support for simpler variant of tsurge migration (#57484)
Introduces a simpler, smaller variant of the current `Tsurge` migration
class. The difference is simply that for the migration phase (the third
stage), some migrations do not need a full set of workers re-analyzing
every compilation unit again to compute the "final migration
replacements".

This can be the case, for example, if a migration eagerly computes all
replacements in the analyze stage, visiting every unit, and then after
deriving the global metadata, problematic replacements are simply
filtered (e.g. via some unique IDs again).

PR Close #57484
2024-08-23 12:01:59 +00:00
Paul Gschwendtner
f133489a16 refactor(migrations): clean up unused google3 code from signal input migration (#57484)
The code was replaced by the automatic Tsurge batch runner. This commit
cleans up the now unused code.

PR Close #57484
2024-08-23 12:01:59 +00:00
Otmane
09deb24d74 docs: fix indentation of file tree in app-shell (#57436)
This commit adds indentations to the file tree section in `app-shell.md`, it makes the tree easier to read. The indentation is now two spaces instead of no spaces.

PR Close #57436
2024-08-22 09:11:50 -07:00
Paweł Kubiak
f1bc6f895b docs(docs-infra): add top level banner component (#57458)
docs(docs-infra): add top level banner component

- create top level banner component
- write unit tests
- close banner and keep state in the local storage
- fix: support screens of tablets and phones

PR Close #57458
2024-08-22 09:06:47 -07:00
Matthieu Riegler
5f95afb331 docs: new date for v19 (#57461)
PR Close #57461
2024-08-22 09:04:41 -07:00
Andrew Kushnir
b30bc4531a refactor(compiler): create an internal util method to detect matching directives and pipes (#57466)
This commit adds an internal util method that allows to detect:

* which selectors are matching nodes in a template
* which pipes are present in a template

Both directives and pipes are split into 2 buckets: eagerly used and the ones that might potentially be defer-loaded.

PR Close #57466
2024-08-22 09:04:04 -07:00
Dylan Hunn
a6225a6cdd release: cut the v18.2.1 release 2024-08-22 09:00:21 -07:00
Matthieu Riegler
69b20d8391 docs(docs-infra): fix regressions around members & deprecations (#57465)
This commit fixes regressions introduced by #57255

PR Close #57465
2024-08-21 11:26:27 -07:00
steciuk
6089772fe8 docs: remove extra space in DI example code (#57472)
PR Close #57472
2024-08-21 11:25:54 -07:00
Angular Robot
1a5f5ee5ce build: update github/codeql-action action to v3.26.3 (#57455)
See associated pull request for more information.

PR Close #57455
2024-08-20 13:20:01 -07:00
Angular Robot
76808cc328 build: update dependency saucelabs to v8 (#57413)
See associated pull request for more information.

PR Close #57413
2024-08-20 13:19:11 -07:00
Adam Koch
980c64abaa docs: remove incorrect documentation around the use of timezone abbreviations (#57425)
The ability to use an abbreviated timezone was removed in v5 (issue https://github.com/angular/angular/issues/20225 discusses this) and no alternative has been merged. See issue https://github.com/angular/angular/issues/40865 and PR https://github.com/angular/angular/pull/48482 The text suggests there is a way to pass in a timezone other than by an offset but there isn't.

PR Close #57425
2024-08-20 10:51:37 -07:00
Paul Gschwendtner
df3e9c1661 refactor(migrations): leverage tsurge for signal input migration (#57451)
This commit simplifies the batching support for the signal input
migration by using the new tsurge framework we've built.

This allows for consistent setup across all possible entry-points and
also simplifies the 1P setup given that we can simply use the Tsurge
macros, instead of having to maintain our own Go-based runner.

PR Close #57451
2024-08-19 22:44:43 -07:00
Paul Gschwendtner
cb7d817edd refactor(migrations): improve generic assignability in tsurge and pass more info (#57451)
* Improves some of the generic assignability for tsurge. Anything is
  allowed to be returned from an overridden `prepareProgram` method.
  This is useful for the signal input migration.
* Passes the absolute root paths to migrations. This is helpful for the
  signal input migration and there is no other way to access it. It's
  better to pass specifically, compared to passing the whole unsafe
  `ParsedConfiguration` object.

PR Close #57451
2024-08-19 22:44:43 -07:00
Angular Robot
8645152f8c build: update dependency ngx-progressbar to v12 (#57452)
See associated pull request for more information.

Closes #57443 as a pr takeover

PR Close #57452
2024-08-19 22:43:49 -07:00
Matthieu Riegler
0979ca0354 docs(docs-infra): Fix heading parsing (#57386)
fixes #57384

PR Close #57386
2024-08-19 09:24:08 -07:00
Matthieu Riegler
af20b2a161 docs(docs-infra): remove remaining ngZone (#57229)
PR Close #57229
2024-08-19 09:22:01 -07:00
Matthieu Riegler
b5719ba5eb docs(docs-infra): Add tests for marked rendering (#57344)
On top of #57338, to make sure we prevent similar regressions on marked rendering.

PR Close #57344
2024-08-19 09:21:17 -07:00
Michael Derfler
c4901d4dfe docs: fix links to docs (#57391)
PR Close #57391
2024-08-19 09:20:16 -07:00
Andrew Kushnir
1682c60938 docs: add eager to lazy route migration (#57421)
PR Close #57421
2024-08-19 09:19:43 -07:00
Andrew Kushnir
c65ab136bf docs: cleanup existing migration docs for consistency (#57421)
PR Close #57421
2024-08-19 09:19:43 -07:00
Andrew Kushnir
c89be37193 docs: drop references to removed typed-forms migration (#57421)
PR Close #57421
2024-08-19 09:19:43 -07:00
Andrew Kushnir
f723288adf docs: drop references to removed module-with-providers migration (#57421)
PR Close #57421
2024-08-19 09:19:42 -07:00
Joey Perrott
58e00deb34 fix(docs-infra): leverage http_server rule from @angular/build-tooling for adev local serving (#57428)
Use the http_server rule to serve adev locally to allow for slightly faster rebuilds and livereload on changes

PR Close #57428
2024-08-19 09:18:21 -07:00
Paul Gschwendtner
57db366522 refactor(migrations): framework to build batchable migrations (#57396)
Introduces a migration framework to build batchable migrations that
can run in Large Scale mode against e.g. all of Google, using workers.

This is the original signal input migration infrastructure extracted
into a more generic framework that we can use for writing additional
ones for output, signal queries etc, while making sure those are not
scoped to a single `ts.Program` that limits them to per-directory
execution in very large projects (e.g. G3).

The migration will be updated to use this, and in 1P we will add
helpers to easily integrate such migrations into a Go-based pipeline
runner.

PR Close #57396
2024-08-17 08:54:16 -05:00
Andrew Kushnir
3e6ee7eaff docs: update CHANGELOG to drop a breaking change note from 18.2.0 version (#57420)
This commit updates the CHANGELOG to remove an entry about a breaking change in Zone.js, since the change was not actually released. It will be released separately in Zone.js package.

PR Close #57420
2024-08-16 11:20:46 -04:00
Andrew Kushnir
086b754cef docs: add withEventReplay and withI18nSupport links to provideClientHydration docs (#57382)
PR Close #57382
2024-08-15 16:10:28 -04:00
vladboisa
4bd9ba714c docs(docs-infra): move link tag for correct view (#57395)
Move the link tag to the down, for correctly parsing of '@link'

Fixes #57332

PR Close #57395
2024-08-15 15:51:53 -04:00
cexbrayat
3b63082384 fix(migrations): avoid migrating route component in tests (#57317)
The migration was migrating all files in a project (like most migrations).
As there is no gain in migrating components used in test files. Excluding the test files reduces the migration noise.

PR Close #57317
2024-08-15 15:51:22 -04:00
David LJ
25bc810f83 docs: update version table for 18.2 (#57414)
PR Close #57414
2024-08-15 15:50:54 -04:00
Andrew Scott
9de30a7b1c fix(core): Allow zoneless scheduler to run inside fakeAsync (#56932)
The zoneless scheduler callback was executed in the root zone rather
than simply in `runOutsideAngular` to allow us to land the hybrid mode
change detection (scheduler always enabled, even for zones) without
breaking a ton of existing `fakeAsync` tests that could/would fail with
the "timer(s) still in queue" error. However, this caused another
problem: when a test executes inside `fakeAsync`, it cannot flush the
scheduled time. A similar problem exists with event and run coalescing (#56767).
This change would allow `fakeAsync` to flush the zoneless-scheduled
change detections and minimize breaking existing tests
by flushing pending timers at the end of the test, which actually now
matches what's done internally.

PR Close #56932
2024-08-15 12:32:24 -04:00
Matthieu Riegler
b1ed7e2b5f docs(docs-infra): Add support for function/method overloads (#57379)
PR Close #57379
2024-08-15 12:12:26 -04:00
Kristiyan Kostadinov
6b4357fae4 fix(migrations): preserve type when using inject decorator (#57389)
Updates the migration so that it passes the type as a generic in the case of `@Inject(SOME_TOKEN) foo: SomeType`. This is done for two reasons:
1. It's a fairly common pattern and it ensures that the code can still be compiled.
2. It avoids leaving behind unused imports.

PR Close #57389
2024-08-15 12:11:59 -04:00
Kristiyan Kostadinov
0bb649b8fa fix(migrations): account for members with doc strings and no modifiers (#57389)
Fixes that the migration was duplicating the doc strings of members that don't have modifiers.

PR Close #57389
2024-08-15 12:11:59 -04:00
Andrew Kushnir
286012fb89 fix(core): handle hydration of components that project content conditionally (#57383)
This commit fixes an issue when hydration serialization tries to calculate DOM path to a content projection node (`<ng-content>`), but such nodes do not have DOM representation.

Resolves #56750.

PR Close #57383
2024-08-15 11:22:05 -04:00
Erik Wegner
9155f75e36 docs(common): fix example code (#57406)
Fix example code for interceptor.

PR Close #57406
2024-08-15 10:46:03 -04:00
Jeremy Elbourn
93410eda0a docs: add small clarification to ng-content (#57408)
This expands the recommendation to avoid conditionally showing `<ng-content>` with additional context

PR Close #57408
2024-08-15 10:45:16 -04:00
Andrew Kushnir
d49e083999 release: cut the v18.2.0 release 2024-08-14 09:40:36 -07:00
Matthieu Riegler
e50d239e80 docs(docs-infra): fix markdown link rendering (#57377)
fixes #57376

PR Close #57377
2024-08-13 15:53:56 -07:00
Thomas Nguyen
e30c60e89f refactor(core): Add experimental support to have one event contract when there are multiple apps on the page. (#57355)
This may be removed if this turns out not to work out so well...

PR Close #57355
2024-08-13 12:10:35 -07:00
Thomas Nguyen
8104fc2126 refactor(core): Call stopPropagation and preventDefault unconditionally within the patched methods. (#57354)
This fixes a few tests in g3 and is a bug fix for the event dispatcher. Otherwise, bubbling might
continue.

PR Close #57354
2024-08-13 12:09:57 -07:00
Thomas Nguyen
7accd9d885 fix(core): Account for addEventListener to be passed a Window or Document. (#57354)
This happened to work for other event listeners since both had a
addEventListener method.

PR Close #57354
2024-08-13 12:09:57 -07:00
Andrew Scott
334c99f968 refactor(docs-infra): Update search results to display content when it is matched (#57298)
This commit updates the search results to query for the content as well
as a snippet of the content for display when it's the content that
matches the query rather than any of the headers.

PR Close #57298
2024-08-13 12:07:49 -07:00
Kristiyan Kostadinov
b1a9d0f4de fix(migrations): avoid duplicating comments when generating properties (#57367)
Updates the logic that generates new component properties to avoid duplicating their doc strings.

PR Close #57367
2024-08-13 09:54:25 -07:00
Kristiyan Kostadinov
5d76401ff5 fix(migrations): preserve optional parameters (#57367)
Makes it so the inject migration preserves the optional token when declaring a parameter. This came up in some testing as something that can be potentially breaking for classes that implement interfaces.

PR Close #57367
2024-08-13 09:54:25 -07:00