Commit Graph

30886 Commits

Author SHA1 Message Date
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
Kristiyan Kostadinov 8da9fb49b5 feat(language-service): add code fix for unused standalone imports (#57605)
Adds an automatic code fix to the language service that will remove unused standalone imports.

PR Close #57605
2024-09-03 14:30:56 -07:00
Kristiyan Kostadinov a2e4ee0cb3 feat(compiler): add diagnostic for unused standalone imports (#57605)
Adds a new diagnostic that will report cases where a declaration is in the `imports` array, but isn't being used anywhere. The diagnostic is reported as a warning by default and can be controlled using the following option in the tsconfig:

```
{
  "angularCompilerOptions": {
    "extendedDiagnostics": {
      "checks": {
        "unusedStandaloneImports": "suppress"
      }
    }
  }
}
```

**Note:** I'll look into a codefix for the language service in a follow-up.

Fixes #46766.

PR Close #57605
2024-09-03 14:30:56 -07:00
Paul Gschwendtner a777bee3de refactor(migrations): improve element binding migration for input migration (#57645)
Currently we detect element bindings as normal references and inside
usages we simply unwrap its usages. This works, but breaks in situations
like the following:

- When the expressions are narrowed. Narrowing analysis does not support
  aliased inputs. E.g. `const {myInput: alias} = this`. We could add
  this, but it would complexify the logic.

- When binding patterns deeply access value properties directly. E.g.
  `const {myInput: {value}} = this;`

In addition, the current approach requires us to understand that aliases
may point to inputs. This means we need to check all identifiers if they
point to Angular inputs. We could optimize this, but it's much easier if
we can simply assume that we only need to "verify" identifiers that have
names of "known inputs". This would significantly speed up turnaround in
the language service integration.

In addition, it would be more _correct_, semantically to directly access
the value of the input at object expansion, versus later.

PR Close #57645
2024-09-03 14:29:55 -07:00
Paul Gschwendtner 0764981f3a refactor(migrations): add performance logging for input reference lookups (#57645)
Adds logic to capture performance timings when resolving input
references. This is useful for debugging and improving integration in
the VSCode extension.

PR Close #57645
2024-09-03 14:29:55 -07:00
Paul Gschwendtner 61dfb2b03f refactor(migrations): share ts.Printer for signal input migration (#57645)
Instead of re-creating printers everywhere, we should re-use the same
printer throughout the migration.

PR Close #57645
2024-09-03 14:29:54 -07:00
Paul Gschwendtner ec94e1ecb0 refactor(migrations): move reference signal input migration into dedicated file (#57645)
Moves the rather complicated reference migration logic for the input
migration into a separate method. This cleans up the logic and makes way
for an additional complexity with regards to element bindings.

PR Close #57645
2024-09-03 14:29:54 -07:00
Paul Gschwendtner 1251ee0ac6 refactor(migrations): share logic for looking up property access (#57645)
This commit shares the logic for looking up a property access, using
`ts.Type` information. This is helpful in case where no linked TS
symbols are available; e.g. templates in test files without TCB.

This helper will be useful for handling object expansion in the signal
input migration; resolving references like `const {x} = this`.

PR Close #57645
2024-09-03 14:29:54 -07:00
Paul Gschwendtner 108a88ca61 refactor(language-service): support caching in code refactorings (#57645)
Instead of creating instances of refactoring whenever the language
service loads, we should lazily create these upon first "application".

This will speed up loading of the language service, while it also gives
us the ability to implement caching in code refactorings to speed up
subsequent applications; leveraging e.g. the `script versions` from the
TS server project.

PR Close #57645
2024-09-03 14:29:54 -07:00
Doug Parker 1f87cba204 release: bump Angular DevTools version to 1.0.18 (#57585)
PR Close #57585
2024-09-03 10:43:21 -07:00
Alex Rickabaugh be2e49639b feat(core): introduce afterRenderEffect (#57549)
Implement the `afterRenderEffect` primitive, which creates effect(s) that
run as part of Angular's `afterRender` sequence. `afterRenderEffect` is a
useful primitive for expressing DOM operations in a declarative, reactive
way.

The API itself mirrors `afterRender` and `afterNextRender` with one big
difference: values are propagated from phase to phase as signals instead of
as plain values. As a result, later phases may not need to execute if the
values returned by earlier phases do not change.

PR Close #57549
2024-09-03 10:40:45 -07:00
Matthieu Riegler c2892fee58 fix(http): Dynamicaly call the global fetch implementation (#57531)
Instead of using the reference that existing when `FetchBackend` is setup.

fixes #57527

PR Close #57531
2024-09-03 09:10:23 -07:00
Alex Rickabaugh fe5c4e086a fix(elements): support output()-shaped outputs (#57535)
Previously Elements was assuming that every output was an RxJS `Subject` and
supports `.pipe()`. This is not true for `output()`-based outputs which
have `.subscribe()` but not `.pipe()`. This commit fixes such outputs by
using a `new Observable` instead of `map` to forward outputs.

PR Close #57535
2024-09-03 09:08:29 -07:00
Alan Agius 3896f86865 refactor(migrations): switch from esbuild to Rollup for schematics bundling (#57602)
Replaces esbuild with Rollup for bundling schematics to support code splitting, as esbuild does not handle code splitting when targeting CommonJS modules.

**Before:**
```
du -sh dist/bin/packages/core/npm_package/schematics
7.7M    dist/bin/packages/core/npm_package/schematics
```

**After:**
```
du -sh dist/bin/packages/core/npm_package/schematics
3.1M    dist/bin/packages/core/npm_package/schematics
```

PR Close #57602
2024-09-03 09:07:03 -07:00
Andrew Scott 36d8d19dc1 refactor(core): removing a pending task delays stability until the next tick (#57570)
This commit updates the public API for pending tasks to schedule an
application tick, effectively making the stability async when the last
task is removed.

PR Close #57570
2024-09-03 08:50:42 -07:00
Ilia Brahinets 9e83ca8bc6 docs: Fix 'EnvironmentInjector' description (#57582)
PR Close #57582
2024-09-03 08:50:04 -07:00
Kristiyan Kostadinov aa8eb15ddf build: delete v18 migrations (#57603)
We don't need to ship the migrations for v18 once we're in v19.

PR Close #57603
2024-09-03 07:59:10 -07:00
Pawel Kozlowski e6e5d29e83 feat(core): initial version of the output migration (#57604)
Initial version of the migration that changes decorator-based
outputs to the equivalent form using new authoring functions.

PR Close #57604
2024-09-03 07:58:20 -07:00
Paul Gschwendtner 2679dcfd44 refactor(migrations): simplify signal input migration language-service integration (#57606)
Instead of some special hook that relies on mutation to filter inputs in
the signal input migration, we are now introducing a new configuration
interface where the language-service can pass a filter method.

This makes the code more readable. We also need the filter method to
support filtering based on directories. E.g. when the migration runs
against sub-folders, all inputs outside of the folder should be
considered incompatible; to not migrate incorrectly.

PR Close #57606
2024-09-03 07:57:04 -07:00
Paul Gschwendtner a8e3ba9550 refactor(migrations): properly handle cases of --strict=false in signal input migration (#57629)
Sometimes `--strictPropertyInitialization` is not enabled, while strict
null checks is enabled. In those cases, `undefined` cannot be used as
initial value with `input()`, nor can we expand the type of the input.

We can migrate those instances to `undefined!` to preserve the original
semantics and behavior. In addition, in the future we may leave a TODO
or we may consider skipping migration of such inputs.

PR Close #57629
2024-09-03 07:55:09 -07:00
Paul Gschwendtner a65e87457e refactor(migrations): add explicit test for non-null assertions (#57629)
Adds an explicit test to state the situation about non-null assertions
and that we don't remove the exclamation marks here for now.

PR Close #57629
2024-09-03 07:55:09 -07:00
Angular Robot 5ce9abfd63 build: update babel dependencies to v7.25.6 (#57634)
See associated pull request for more information.

PR Close #57634
2024-09-03 07:52:12 -07:00
Angular Robot 5a2faed13d build: update scorecard action dependencies (#57636)
See associated pull request for more information.

PR Close #57636
2024-09-03 07:51:21 -07:00
Angular Robot 4c82eb23cb build: update all non-major dependencies (#57633)
See associated pull request for more information.

PR Close #57633
2024-09-03 07:49:47 -07:00
Angular Robot fc1734441b build: update dependency diff to v6 (#57631)
See associated pull request for more information.

PR Close #57631
2024-09-03 07:49:04 -07:00
Alfredo González 7defbb1642 docs(upgrade): change example wording on Input tutorial (#57625)
PR Close #57625
2024-09-03 07:48:15 -07:00
Matthieu Riegler a84cecfc99 docs(docs-infra): add support for extends/implements on API entries (#57588)
PR Close #57588
2024-09-03 07:47:25 -07:00
Matthieu Riegler 39b7be8588 refactor(compiler-cli): Add support for inheritance in API extraction (#57588)
This commit adds the `extends` and `implements` properties to the `ClassEntry` & `InterfaceEntry`

PR Close #57588
2024-09-03 07:47:24 -07:00
Matthieu Riegler 3bafda20c3 docs(docs-infra): fix navigation between API pages (#57492)
PR Close #57492
2024-08-30 11:12:25 -07:00
Matthieu Riegler b031b640b9 docs(docs-infra): Add set of unit tests to the API markdown parsing (#57492)
PR Close #57492
2024-08-30 11:12:25 -07:00
Matthieu Riegler b96e75b89a docs(docs-infra): Improve styling around API pages (#57492)
PR Close #57492
2024-08-30 11:12:25 -07:00
Matthieu Riegler 55387c5b56 docs(docs-infra): Improve support for deprecated methods (#57492)
PR Close #57492
2024-08-30 11:12:25 -07:00
Matthieu Riegler 5e42769ee9 docs: ensure the all _ are replaced by slash for API entry urls. (#57600)
fixes #57599

PR Close #57600
2024-08-30 07:39:36 -07:00
Andrew Kushnir 001f319865 Revert "refactor(compiler-cli): extract function overload separatly (#56489)" (#57594)
This reverts commit 37b88a5a98.

PR Close #57594
2024-08-29 16:21:46 -07:00
David Valentine 1d79cbde3b docs: update common-router-tasks to include sample dynamic fragment (#57590)
Remove specific reference to "Tour of Heroes" tutorial and add sample route for use in the example for reference.

Co-authored-by: Andrew Scott <atscott01@gmail.com>

PR Close #57590
2024-08-29 15:20:05 -07:00
Matthieu Riegler 466e21399f docs: api sub-entries should have / in urls. (#57593)
`@angular/animations/browser` => `api/animations/browser/xyz`

PR Close #57593
2024-08-29 15:18:59 -07:00
Paul Gschwendtner 2ad9609a8d refactor(migrations): pass project-relative paths for tsurge replacements (#57584)
This allows for the replacements to be conveniently passed between
migration stages. This is especially relevant in 1P where stages may
have different root directories.

Tsunami attempts to relativize paths in general, similar to how we do
here, but this doesn't work with e.g. Funnel-based migrations where
replacements are serialized in between stages; and where the migration
stage at the end doesn't know about the previous root directory anymore.

PR Close #57584
2024-08-29 14:28:02 -07:00
Matthieu Riegler b226dab0f6 docs: revert changes on API entries urls (#57589)
The name `angular_` shouldn't be included in the URL.

fixes #57587

PR Close #57589
2024-08-29 14:25:26 -07:00
Matthieu Riegler 01030d58a7 docs(docs-infra): Add support for cross-links on API pages (#57346)
PR Close #57346
2024-08-29 13:39:58 -07:00
Matthieu Riegler ea3d37687b refactor(compiler-cli): Add a map of every symbols used inside a package (#57346)
This commit changes the structure of the API extraction files to include all symbols used inside a package.

The structure is a `Map`, Symbol => package
eg: 'ApplicationRef' => '@angular/core'

PR Close #57346
2024-08-29 13:39:58 -07:00
Kristiyan Kostadinov 8bcc663a53 feat(core): drop support for TypeScript 5.4 (#57577)
TypeScript 5.4 is no longer supported.

BREAKING CHANGE:
* TypeScript versions less than 5.5 are no longer supported.

PR Close #57577
2024-08-29 10:19:20 -07:00
Matthieu Riegler 6c2beba63d docs(docs-infra): Add dev-mode only mention for core/global (#57365)
PR Close #57365
2024-08-29 10:17:35 -07:00
Joey Perrott 8bddab6e95 ci: use version 13.15.1 of firebase-tools for deployment of doc sites (#57583)
Use 13.15.1 instead of tracking to latest to prevent unexpected and unbisectable changes.

PR Close #57583
2024-08-29 10:14:42 -07:00
Paul Gschwendtner 6e28f96d5f refactor(migrations): ensure control flow analysis of signal input migration works with all TS versions (#57566)
Ensures that the control flow analysis version of the signal input works
with all TS versions currently supported.

PR Close #57566
2024-08-29 07:51:38 -07:00
Paul Gschwendtner 5319d67d83 refactor(migrations): cleanup TODOs in signal input migration (#57566)
Cleans up remaining TODOs in the signal input migration, and other
small clean ups.

PR Close #57566
2024-08-29 07:51:38 -07:00
Paul Gschwendtner 82f4590216 refactor(migrations): avoid relative imports in schematic code (#57214)
This allows us to bundle e.g. the signal input migration into
language-service without duplicating code. Rollup with Bazel may end up
duplicating because it isn't able to associate the local sources with
the linked modules from `node_modules/@angular/compiler-cli`.

PR Close #57214
2024-08-29 07:50:41 -07:00
Paul Gschwendtner 1f067f4507 feat(language-service): add code reactoring action to migrate @Input to signal-input (#57214)
(experimental at this point)

Language service refactoring action that can convert `@Input()`
declarations to signal inputs.

The user can click on an `@Input` property declaration in e.g. the VSCode
extension and ask for the input to be migrated. All references, imports and
the declaration are updated automatically.

PR Close #57214
2024-08-29 07:50:41 -07:00
Paul Gschwendtner 56ee47f2ec feat(language-service): allow code refactorings to compute edits asynchronously (#57214)
VSCode explicitly split code actions into two stages:

 - what actions are active?
 - what are the edits, if the user presses the button.

The latter stage may take longer to compute complex edits, perform
analysis. This stage is currently implemented via our non-LSP standard
`applyRefactoring` method. We should make it asynchronous, so that it
can easily integrate with migrations that aren't synchronous/or compute
in parallel.

Long-term we may want to revisit this given integration in 1P with the
language service as an actual TS server plugin; but it's not necessary
right now and we shouldn't block the effort on this for now.

PR Close #57214
2024-08-29 07:50:40 -07:00
Paul Gschwendtner 4900225aee build: move language-service utils into its own bazel target (#57214)
This allows us to split up the BUILD rules a bit further, so that
refactorings can be their own BUILD target. This is beneficial as
e.g. refactorings may rely on migration code from Angular core etc.
and this allows for more fine-grained visibility and a better conceptual
split.

PR Close #57214
2024-08-29 07:50:40 -07:00