Commit graph

36863 commits

Author SHA1 Message Date
Paul Gschwendtner
fd081e8ee4 refactor(migrations): add compiler filesystem for devkit virtual tree (#57794)
The file system will be used for dev-kit wiring up of Tsurge migrations
in e.g. `ng generate` and `ng update`

PR Close #57794
2024-09-13 14:13:58 +02:00
Suryaprakash
1b0a6a078e docs: Update guide for version 18 - unclear (possibly incorrect?) instruction for opting out of caching HTTP requests that require authentication (#57799)
PR Close #57799
2024-09-13 13:28:20 +02:00
Andrew Scott
3ebe6b4ad4 feat(core): Add async run method on ExperimentalPendingTasks (#56546)
This helper method is simply a convenience function that reduces some
boilerplate with manually adding and removing a task around some
asynchronous function.

PR Close #56546
2024-09-13 11:10:08 +02:00
Kristiyan Kostadinov
6144612940 fix(migrations): account for explicit standalone: false in migration (#57803)
Fixes that the standalone migration was duplicating the `standalone` flag if the declaration was `standalone: false`.

PR Close #57803
2024-09-13 10:48:42 +02:00
Pascal Weyrich
55e3a3a47c docs: fix example for defer on hover on an alternative element (#57788)
PR Close #57788
2024-09-12 11:23:33 +02:00
Doug Parker
6c8fd3094a docs: add section on removing Zone.js imports/dependency from the build (#57784)
PR Close #57784
2024-09-12 10:54:09 +02:00
Lang
2b3e7f87b9 docs: use correct example (#57783)
PR Close #57783
2024-09-11 21:25:25 +00:00
Simon Knott
ba386c7a24 docs: add Playwright to E2E tools (#57734)
docs: alphabetisize list

PR Close #57734
2024-09-11 21:24:52 +00:00
Jessica Janiuk
488621fd78 release: cut the v19.0.0-next.5 release 2024-09-11 16:27:52 -04:00
Jessica Janiuk
784d4be9d7 docs: release notes for the v18.2.4 release 2024-09-11 16:02:15 -04:00
danielbulic
ada67a34f2 docs: fix link of DEVELOPER.md in CONTRIBUTING.md (#57775)
PR Close #57775
2024-09-11 18:55:21 +00:00
Paul Gschwendtner
73feb0e7bc refactor(migrations): support reference migration in query migration (#57777)
The query migration will now fully re-use the reference resolution and
migration logic from the input migration to reliably migrate references
to the new signal properties, supporing control flow outsourcing etc.

PR Close #57777
2024-09-11 17:48:29 +00:00
Paul Gschwendtner
cf306d7ad7 refactor(migrations): follow-up improvements to shared reference resolution (#57777)
Moves leftover files that are related to resolution into the resolution
logic directory.

PR Close #57777
2024-09-11 17:48:29 +00:00
Paul Gschwendtner
2591b988ce refactor(migrations): add jasmine diff matcher to tsurge testing utilities (#57777)
Commonly when testing Tsurge migrations, we need to diff text content of
files. This commit adds a colored diff helper that makes writing tests
much easier.

PR Close #57777
2024-09-11 17:48:29 +00:00
Paul Gschwendtner
1c663ca820 refactor(migrations): add helper for dedenting to tsurge (#57777)
Dedenting the smallest leading whitespace is useful for conveniently
testing the output of a migration. This commit includes the helper in
Tsurge.

PR Close #57777
2024-09-11 17:48:29 +00:00
JoostK
c93b510f9b feat(core): allow passing undefined without needing to include it in the type argument of input (#57621)
This commit introduces an overload for `input` to accept `undefined` as initial value if only
options are needed to be provided, inferring an input of type `T|undefined`. Prior to this change,
the type argument as specified needed to include `|undefined` explicitly even though that isn't
necessary when passing options isn't needed.

Relates to #53909

PR Close #57621
2024-09-11 14:28:19 +00:00
Matthieu Riegler
c15e72a0eb refactor(core): extract assertNotDestroyed as function. (#57692)
This will allow the mangling of the method name

PR Close #57692
2024-09-11 14:27:35 +00:00
Paul Gschwendtner
ebe0c168e2 refactor(migrations): share reference migration code of signal input migration (#57766)
The reference migration code of the signal input migration should be
re-usable as the queries migration needs the exact same.

This builds on top of the shared reference resolution logic from
previous commits. Similarly this commit introduces a small "host" for
providing necessary configurable information about what references
should be migrated; supporting e.g. "input incompatibilities".

This is important as e.g. queries may also be incompatible for migration
and references to such, should not be migrated.

PR Close #57766
2024-09-11 14:26:58 +00:00
Paul Gschwendtner
acafa3b91d refactor(migrations): add own build file for tsurge AST helpers (#57766)
This separates tsurge from its optional AST helpers more cleanly.

PR Close #57766
2024-09-11 14:26:58 +00:00
Paul Gschwendtner
85018fbd88 refactor(migrations): rename reference migration folder of signal input migration (#57766)
This makes it more aligned with the reference resolution folder that
we've added in the previous commit.

PR Close #57766
2024-09-11 14:26:58 +00:00
Paul Gschwendtner
12f9d2ab5a refactor(migrations): make input migration reference resolution re-usable (#57766)
Allows us to re-use the reference resolution that works within TS code,
Angular templates, or host bindings. This is helpful for queries
migration which also needs to migrate many references, or allows use in
the output migration.

This is achieved by introducing an abstraction of the "known inputs"
registry we have already, but making it more generic to work with _any_
class fields. Known inputs can then implement/extend this. Queries
similarly.

The "known fields" construct gives insight on field unique IDs etc. This
is then used by the reference resolution to determine if it's a
reference that needs to be captured.

We may move all of this code to Tsurge eventually; depending on how
useful it is. We'll discuss.

PR Close #57766
2024-09-11 14:26:58 +00:00
Jessica Janiuk
0ebb2be538 build: bump dev-infra dependencies (#57761)
This bumps the commit hashes for all of the dev-infra related dependencies.

PR Close #57761
2024-09-10 20:47:01 +00:00
Santosh Yadav
bc03f53337 docs: add examples for localize (#57534)
PR Close #57534
2024-09-10 20:33:18 +00:00
Jan Olaf Martin
45575b5ce4 docs: fix link from zoneless to OnPush (#57760)
PR Close #57760
2024-09-10 20:28:00 +00:00
Angular Robot
cc99297e60 docs: update Angular CLI help [main] (#57743)
Updated Angular CLI help contents.

PR Close #57743
2024-09-10 17:17:24 +00:00
Paul Gschwendtner
685866dfb4 refactor(migrations): correct catalyst import in signal input migration (#57750)
The paths changed as part of an LSC a while ago. This commit updates
the migration to reflect this.

PR Close #57750
2024-09-10 16:37:15 +00:00
Kristiyan Kostadinov
c51c0f23bb build: update to TypeScript 5.6 final (#57749)
Updates the repo to the final version of TypeScript 5.6.

PR Close #57749
2024-09-10 16:32:37 +00:00
Angular Robot
5abec28db6 build: update all non-major dependencies to ~5.3.0 (#57748)
See associated pull request for more information.

PR Close #57748
2024-09-10 16:31:12 +00:00
Arnau Gómez Farell
95b8105a1e docs(core): fix typo (#57741)
Fix typo where two variable names should be the same but are different.
PR Close #57741
2024-09-09 18:23:06 +00:00
Jessica Janiuk
d58ffd6d90 release: cut the v19.0.0-next.4 release 2024-09-09 14:15:22 -04:00
Paul Gschwendtner
6fa1b3859c refactor(migrations): do not fail on templates that are string concatenated (#57735)
This is a pattern sometimes seen in test components. We shouldn't fail
the migration unexpectedly here.

PR Close #57735
2024-09-09 17:16:14 +00:00
Paul Gschwendtner
b039aed18f refactor(migrations): gracefully handle resource loading issues (#57735)
This can happen when we manually parse templates and end up with an
invalid URL. We should not fail the migration in those cases.

PR Close #57735
2024-09-09 17:16:14 +00:00
Rachid O
c425c77e88 docs: fix broken link in roadmap page (#57722)
PR Close #57722
2024-09-09 14:40:29 +00:00
Rachid O
f28d8f3785 docs: fix typo in steps/12-enable-routing/README.md (#57722)
PR Close #57722
2024-09-09 14:40:28 +00:00
Jan Martin
9c5b4664b6 docs: add new key/value option syntax in CLI (#57699)
PR Close #57699
2024-09-09 14:32:35 +00:00
Pawel Kozlowski
cbec46a51d feat(migrations): migrate .pipe calls in outputs used in tests (#57691)
This change uses the outputToObservable utility function to
convert migrated outputs to Observables. This happens only
in test files as it is a common practice to use RxJS to listen
to events raised by the component under test.

PR Close #57691
2024-09-09 14:10:37 +00:00
Pawel Kozlowski
3a264db866 fix(migrations): properly handle comments in output migration (#57691)
This change contains a fix that takes into account comments
attached to outputs and preserves / removes those as needed.

PR Close #57691
2024-09-09 14:10:37 +00:00
Kristiyan Kostadinov
40ff18f87a fix(compiler): produce less noisy errors when parsing control flow (#57711)
Currently several parsing errors in the new control flow (e.g. missing `track` expression) produce errors whose span targets the entire block. This can be really noisy in the IDE where the error can span many lines in the template.

These changes switch to highlighting just the start of the block.

PR Close #57711
2024-09-09 14:10:01 +00:00
Shannon V.C.
6f5de5d19f docs: add missing link in templates guide overview (#57718)
This addresses a minor issue where the "See whitespace in templates" phrase was not linked to its corresponding documentation section

PR Close #57718
2024-09-09 14:09:07 +00:00
diamondhero1
ffdcac4e0c docs: extraneous backslashes removed (#57725)
PR Close #57725
2024-09-09 13:58:50 +00:00
Michael Small
01ae0556e2 docs(docs-infra): remove more unused standalone imports (#57703)
PR Close #57703
2024-09-09 13:58:21 +00:00
Angular Robot
8d209ce0d6 build: update dependency diff to v7 (#57705)
See associated pull request for more information.

PR Close #57705
2024-09-09 13:57:41 +00:00
Paul Gschwendtner
4f52678560 refactor(migrations): avoid flow node traversal limit by optimizing traversal (#57719)
Instead of traversing the same paths multiple times, we should avoid
this extra work and optimize. This solves some issues in super large
files with extremely complex flow graphs. E.g. large `ngOnChanges`
functions in Pantheon.

For an example of a flow graph where it doesn't make sense to re-visit
nodes that have multiple incoming edges, see this internal screenshot:
https://screenshot.googleplex.com/6ub4e5e5gbzJAvH

PR Close #57719
2024-09-08 17:11:51 +00:00
Paul Gschwendtner
2e60eb08f4 refactor(migrations): ensure project paths respect root directories (#57677)
Migrations may resolve files in e.g. `blaze-out` and try to compute a
path for the file that is "recognizable" across workers. E.g. in one
worker, it may be the actual `.ts` file inside the source tree, while in
the other, the file may be inside `blaze-out`.

Tsurge currently expects project relative paths to be passed around.
Those project relative paths are currently only based on the single root
directory. Hence paths inside `blaze-out` would actually not be
recognizable.

The fix idea here is that we introduce a structure for Project files.
This structure will contain two fields:

- an ID of a file. This is similar to a module ID in the project. Those
  are resolved with respect to all root directories. This matches the
  conceptual virtual roots of `tsconfig#rootDirs`. The IDs can be used
  for matching files across workers, assuming those are executing using
  the same root directories, and handle the same overall project (e.g.
  google3).

- a path relative to the primary project root. Multiple roots may be
  configured, but the primary project root, is the directory that
  contains all others. See: `tsconfig.rootDir`. This path is NOT
  necessarily useful for matching files between stages etc, but it's
  useful for writing replacements for a given file to disk.

Note that those two things cannot be combind into one conceptual
"project relative path" because a path relative to the most appropriate
root directory cannot be used for safe replacements. E.g. consider a
replacement matches a file from a root directory like `/sub/`. The path
inside `/sub/` would then omit the `/sub/` and later on when writing
replacements, we wouldn't know which root directory it actually was part
of. Hence the concept of a "project root relative path" and the "ID".

ds

PR Close #57677
2024-09-06 19:44:07 +00:00
Matthieu Riegler
dbdd7875dd docs: Enable direct links to class/interface methods for @link (#57615)
PR Close #57615
2024-09-06 16:03:36 +00:00
Seyed Alireza Mirehe
bf5f2e73d3 docs: fix typo in view queries documentation (#57228)
The typo in the [queries document](https://angular.dev/guide/components/queries#content-queries) has been corrected:
Queries never **pierce** through component boundaries.

PR Close #57228
2024-09-06 16:03:02 +00:00
Matthieu Riegler
a829a7e926 docs(docs-infra): Remove focus on navigation (#57695)
PR Close #57695
2024-09-06 16:02:13 +00:00
Matthieu Riegler
6ea8e1e9aa feat(core): Add a schematics to migrate to standalone: false. (#57643)
With the framework enabling `standalone` by default (making module based an opt-in), the migration will migrate none-standalone existing components and add `standalone: false` to the decorator.

PR Close #57643
2024-09-06 15:08:51 +00:00
Matthieu Riegler
9624ab03c9 docs(docs-infra): fix extraction tests (#57694)
PR Close #57694
2024-09-06 15:07:47 +00:00
Kristiyan Kostadinov
fc95a9adff fix(migrations): replace leftover modules with their exports during pruning (#57684)
Currently during the module pruning stage of the standalone migration we assume that any leftover modules which only have `imports` and `exports` can safely be removed. That can be incorrect for the cases where some parts of the app were converted to standalone outside of the migration.

These changes update the logic so that such modules are replaced with the `exports` which are used within the specific component.

Fixes #51420.

PR Close #57684
2024-09-06 14:15:50 +00:00