Commit Graph

30934 Commits

Author SHA1 Message Date
Jessica Janiuk d58ffd6d90 release: cut the v19.0.0-next.4 release 19.0.0-next.4 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
Matthieu Riegler 1698bd3ed8 refactor(compiler-cli): Do extract symbols from private modules. (#57611)
Modules like `core/primitives` are considered private and their symbols shouldn't be exposed nor linked in the docs.

PR Close #57611
2024-09-06 14:15:18 +00:00
Dylan Hunn f063a75eae refactor(language-service): Allow language service diagnostics to be ignored (#57675)
Add a check to the language service that ignores specified diagnostic codes. This will be useful in g3.

The codes to ignore are exposed as part of the PluginConfig.

Fixes github.com/angular/vscode-ng-language-service/issues/1243

PR Close #57675
2024-09-06 14:14:47 +00:00
Matthieu Riegler 6f0d05fac0 docs(docs-infra): remove unused standalone imports (#57680)
PR Close #57680
2024-09-06 14:13:35 +00:00
Paul Gschwendtner 227d13b86d refactor(migrations): preserve brace spacing when applying imports (#57672)
Currently the import manager always add a space after the import clause
brace. We should only do this if the existing import did the same.

PR Close #57672
2024-09-05 19:33:04 +00:00
Paul Gschwendtner 00852118cc refactor(migrations): preserve multi-line imports if possible when editing imports (#57672)
Currently whenever we apply the import manager changes in migations, we
leave the decision of multi-line or single-line to the TS printer.

This works, but in practice can cause signficiant file jumps/changes if
there are large imports that aren't wrapped for example, or the other
way around. We should try to be minimal here and preserve the existing
formatting, assuming that a multi-line import remains multi-line, while
a single-line import remains single-line if it already had many items in
a single line, intentionally.

PR Close #57672
2024-09-05 19:33:04 +00:00
Paul Gschwendtner 8f40b25635 docs(migrations): clarify usage of shouldMigrateInput config option (#57672)
Clarifies some details of the `shouldMigrateInput` configuration option
of the signal input migration.

PR Close #57672
2024-09-05 19:33:04 +00:00
Paul Gschwendtner b0f5d5549e refactor(migrations): best effort mode should respect ignored inputs (#57672)
Whenever the signal input migration runs in VSCode, other inputs are
marked as incompatible via the config. Best effort mode currently skips
those incompatibilities and still migrates them. This is incorrect as
the config intends to skip those inputs, regardless of best effort mode.

PR Close #57672
2024-09-05 19:33:04 +00:00
Paul Gschwendtner cf88d8a8c1 refactor(language-service): align signal input refactoring messages (#57672)
This ensures they follow the same pattern.

PR Close #57672
2024-09-05 19:33:04 +00:00
Paul Gschwendtner 7e54a944cc refactor(migrations): avoid comments leaking from TCB into input migration (#57672)
The migration took a type from the directive handler metadata, and
inserted it into a synthetic node for the new input() call. This works
perfectly fine, but in some cases, I saw some `T:VAE` comments attached
🤯  These are from the type checker which attached
synthetic comments to the exact same node.

PR Close #57672
2024-09-05 19:33:03 +00:00
Sheik Althaf 4fa25cf328 refactor(devtools): use signal apis in visualizer and devtools-tabs (#57192)
Refactor the visualizer and devtools-tabs components to use signal apis, in future we can make the components onPush and zoneless

PR Close #57192
2024-09-05 17:23:34 +00:00
Matthieu Riegler e3919e7b9d docs: display property details (#57622)
In case there are no signatures (like in an bare interface method), we display the implementation information.

PR Close #57622
2024-09-05 17:22:32 +00:00
Pawel Kozlowski 68e5370a66 feat(migrations): remove complete calls for migrated outputs (#57671)
This change removes superflous .complete calls for the migrated outputs.

PR Close #57671
2024-09-05 14:13:42 +00:00
Pawel Kozlowski f1bbbeab0c test(migrations): add more tests to output migration (#57671)
This change contains an additonal test that captures scenario
of the problematic .pipe usage outside of the directive class.

PR Close #57671
2024-09-05 14:13:42 +00:00
Jan Olaf Martin c3e5b0a0b0 docs: clarify behavior of ng serve with server.ts (#57658)
See: https://stackoverflow.com/questions/77468756/how-to-use-express-server-in-dev-mode-in-angular-17-application-builder
See: https://github.com/angular/angular/issues/52929#issuecomment-1818078952

PR Close #57658
2024-09-05 14:06:31 +00:00
Matthieu Riegler 1b7571f404 docs(docs-infra): enable tests for api-gen (#57618)
PR Close #57618
2024-09-05 14:05:04 +00:00
Sheik Althaf 7a4199a29a refactor(devtools): use signal apis for directive forest (#56998)
Refactor the directive-forest components to use signal apis, in future we can make the components onPush and zoneless

PR Close #56998
2024-09-04 21:00:12 +00:00
Paul Gschwendtner f6c40f1ba1 refactor(migrations): expose all input migration helpers (#57659)
Instead of encouraging deep imports, we should expose commonly accessed
exports in a `index.ts` barrel file.

PR Close #57659
2024-09-04 20:07:18 +00:00
Paul Gschwendtner c3f2420877 refactor(migrations): use proper suffix for object expansion input variables (#57659)
Whenever we migrate object expansion patterns, we may need a temporary
variable to generate a construct like:

```ts
const {bla: blaValue} = this;
const bla = blaValue();
```

We should instead use `blaInput` as the name for the temporary
variable. For narrowing constants, `blaValue` is correct, but here
it's an actual reference to the input / signal.

PR Close #57659
2024-09-04 20:07:18 +00:00
Paul Gschwendtner aa439662af refactor(migrations): speed up migration for subset of signal inputs (#57659)
With the preparation work from previous commits, we are able to reduce
analysis time of the migration from e.g. whole Material repo 7seconds to
0.1seconds when the migration is invoked via the VSCode extension.

This is possible because we can avoid many expensive type checking
lookups if we know what inputs are actually migrated. We do this by
adding some naive pre-check to see if identifiers are possibly pointing
to a migrated input.

This is possible now because we no longer migrate aliased identifiers
for object expansion, but instead migrate directly at object
expansion declaration. This allows us to assume that all possible
references to inputs must go through identifiers that are named like
the original input class field name.

PR Close #57659
2024-09-04 20:07:18 +00:00
Paul Gschwendtner f694acb587 refactor(language-service): improve error messaging for signal input refactoring (#57659)
Instead of printing the enum name as the reason why migration did not
complete, we should print some human-readable descriptions.

This commit implements this. This logic may also be useful for the
devkit comment generation, or CLI usage.

In addition, we expose another VSCode refactoring to try via best effort
mode. There is no way for prompting, or adding multiple actions for the
same refactoring, so we expose a new refactoring.

PR Close #57659
2024-09-04 20:07:18 +00:00
Paul Gschwendtner 9c31ba95e5 refactor(migrations): properly apply edits in signal input refactoring action (#57659)
The language service expects absolute paths, but Tsurge only deals with
project relative paths. This commit fixes this.

PR Close #57659
2024-09-04 20:07:18 +00:00
Paul Gschwendtner d8338b5f87 refactor(migrations): generate blocks to support narrowing inside arrow function (#57659)
Whenever the signal migration discovers multiple references in the same
control flow container, it assumes narrowing and wants to preserve this
functionality. It does this by introducing temporary variables.

This works fine, but currently there is an edge case with arrow
functions, as those can also turn into blocks, but aren't considered as
such in the current code. This commit fixes this, so that arrow
functions will be converted to be block-based if necessary.

PR Close #57659
2024-09-04 20:07:17 +00:00
Pawel Kozlowski 9da21f798d feat(migrations): replace .next usage on outputs (#57654)
This commits extends the decorator-based output migration
to replace .next usage (not supported with the output function)
with .emit (supported in both decorator-based and function based
outputs).

PR Close #57654
2024-09-04 17:05:56 +00:00
Pawel Kozlowski 71f5ef2aa5 fix(migrations): change imports to be G3 compatible (#57654)
A set of fixes to the import paths - the goal is to make the
output migration compatible with the G3 infrastructure.

PR Close #57654
2024-09-04 17:05:56 +00:00
twerske 89d7351f81 docs: update top level banner styles (#57503)
PR Close #57503
2024-09-04 17:05:26 +00:00
Angular Robot 69c2ef7a2d build: update io_bazel_rules_sass digest to 5a7e3f4 (#57649)
See associated pull request for more information.

PR Close #57649
2024-09-04 17:04:53 +00:00
Arshjeet2003 e2d64947cd docs: Add fallback content for <ng-content> in content projection guide (#57513)
Angular 18 introduced fallback content for <ng-content>. This commit updates the docs of content projection guide to contain fallback content for <ng-content>.

PR Close angular#57083

PR Close #57513
2024-09-04 17:04:22 +00:00
Andrew Kushnir 3c756848f7 release: cut the v19.0.0-next.3 release 19.0.0-next.3 2024-09-04 08:32:56 -07:00
Andrew Kushnir c19b02f6f4 docs: release notes for the v18.2.3 release 2024-09-04 08:27:50 -07:00