Commit graph

12629 commits

Author SHA1 Message Date
Angular Robot
e305b45627 build: lock file maintenance (#58998)
See associated pull request for more information.

PR Close #58998
2024-12-02 16:29:03 +01:00
Timon
1b6204dd2a docs(core): fix eventCoalescing comment (#57097)
PR Close #57097
2024-12-02 11:34:26 +01:00
Kristiyan Kostadinov
1cfbfc66d3 fix(platform-server): remove peer dependency on animations (#58997)
The `@angular/platform-server` package had a peer dependency on `@angular/animations` which wasn't being used anywhere.

PR Close #58997
2024-12-02 11:33:04 +01:00
Kristiyan Kostadinov
35165d152d fix(migrations): inject migration dropping code if everything except super is removed (#58959)
Fixes that in some cases the internal version of the migration was dropping code when all the statements after the `super` call are deleted.

PR Close #58959
2024-12-02 08:56:21 +01:00
Kristiyan Kostadinov
7191aa6e09 fix(migrations): don't migrate classes with parameters that can't be injected (#58959)
Updates the inject migrations to skip over classes that have uninjectable class parameters.

PR Close #58959
2024-12-02 08:56:21 +01:00
Kristiyan Kostadinov
68e5ba7a3a fix(migrations): preserve type literals and tuples in inject migrations (#58959)
Updates the inject migration to preserve type literals and tuple types, based on some internal feedback.

PR Close #58959
2024-12-02 08:56:21 +01:00
Kristiyan Kostadinov
a4924af6d5 fix(migrations): inject migration aggressively removing imports (#58959)
Fixes that the inject migration would remove imports even if they're still used by classes that aren't being migrated.

PR Close #58959
2024-12-02 08:56:21 +01:00
Kristiyan Kostadinov
508d3a1b3b fix(migrations): correctly strip away parameters surrounded by comments in inject migration (#58959)
Fixes that the inject migration was sometimes producing invalid code if there are comments around the parameters.

PR Close #58959
2024-12-02 08:56:21 +01:00
Kristiyan Kostadinov
e31e52e177 fix(migrations): class content being deleted in some edge cases (#58959)
Fixes that the inject migration was deleting the class' content if a property exists after the constructor that is being rewritten.

PR Close #58959
2024-12-02 08:56:20 +01:00
Kristiyan Kostadinov
21b993c8df refactor(compiler): remove allowInvalidAssignmentEvents flag (#58988)
Deletes the `allowInvalidAssignmentEvents` which was added to facilitate a migration away from invalid two-way bindings. Since the migration doesn't exist anymore, we don't need the flag either.

PR Close #58988
2024-12-02 08:55:42 +01:00
Gustav Blomqvist
d5f9d0284c docs(core): grammatical fix (#58204)
PR Close #58204
2024-11-28 17:38:35 +01:00
arturovt
a4b86b23cf refactor(core): preventing resolving renderer factory every tick (#58618)
Prevents the `RendererFactory2` from being resolved each time the tick runs, as it only needs to be requested once.

PR Close #58618
2024-11-28 15:17:28 +01:00
Kristiyan Kostadinov
f280467398 fix(compiler-cli): account for multiple generated namespace imports in HMR (#58924)
The current HMR compiler assumes that there will only be one namespace import in the generated code (`@angular/core`). This is incorrect, because the compiler may need to generate additional imports in some cases (e.g. importing directives through a module). These changes adjust the compiler to capture all the namespaces in an array and pass them along.

Fixes #58915.

PR Close #58924
2024-11-28 10:00:56 +01:00
arielbackenroth
3b765367f3 fix(core): Explicitly manage TracingSnapshot lifecycle and dispose of it once it's been used. (#58929)
Provide a callback to the TracingService implementation when a Snapshot can be disposed.
The underlying tracing implementation may use refcounting and needs to release resources
to enable the trace to complete.

While change detection uses the snapshot for exactly one callback, after render runs
multiple hooks in the sequence so we need a more predictable way to indicate that the snapshot
can be finalized.s

PR Close #58929
2024-11-27 18:11:13 +01:00
Matthieu Riegler
b0c30f9756 docs(docs-infra): remove unused api-examples (#58885)
PR Close #58885
2024-11-27 18:05:07 +01:00
Jessica Janiuk
30891d8dec refactor(core): Consolidates shouldTrigger* methods down to one (#58833)
This cleans up the triggering code base and consolidates it down to one
function that outlines the logic. This also resolves the `hydrate when`
behavior issue.

fixes: #58709

PR Close #58833
2024-11-27 17:00:06 +01:00
Jessica Janiuk
38fe180d34 refactor(compiler): Adds ingest and flags for defer details (#58833)
This adds TDeferDetailsFlags to indicate the presence of hydration triggers, and any future flags we add to defer.

PR Close #58833
2024-11-27 17:00:05 +01:00
Vincent
4e4bbb00ad refactor(core): Make wording of effect-allowSignalWrites deprecation warning more accurate (#58792)
The previous warning contained a typo and also somewhat implied that allowSignalWrites did something. However, setting allowSignalWrites to false has no impact at all in Angular 19.

Closes #58790

PR Close #58792
2024-11-27 16:59:05 +01:00
Enea Jahollari
0c009077af refactor(docs-infra): use interpolation instead of innerHTML for better perf (#58913)
Using innerHTML will cause the browser to parse the HTML and then create a DOM tree instead of just using normal interpolation.

PR Close #58913
2024-11-27 10:59:18 +01:00
Utku Gultopu
0f1c71869e docs: capitalize webpack with a lowercase W (#56812)
PR Close #56812
2024-11-26 22:24:11 +00:00
Alan Agius
0499e1b27d refactor(core): remove private whenStable (#58891)
The `@angular/ssr` package no longer depends on this symbol.

PR Close #58891
2024-11-26 18:10:50 +00:00
Jelle Bruisten
61ae17a419 refactor(router): remove unused default error handler function (#58819)
with v19 the `defaultErrorHandler` has become unused, so could be removed

PR Close #58819
2024-11-26 14:49:37 +00:00
arielbackenroth
785c6116cc fix(core): Ensure _tick is always run within the TracingSnapshot. (#58881)
Fix a bug where calls to _tick are called without running through the snapshot.
This helps ensure that all snapshots that are requested are resumed.

PR Close #58881
2024-11-25 21:19:52 +00:00
Kristiyan Kostadinov
bd1f1294ae feat(core): support TypeScript 5.7 (#58609)
Updates the repo to allow for TypeScript 5.7 to be used.

PR Close #58609
2024-11-25 17:12:10 +00:00
Andrew Kushnir
c56ec5eef9 refactor(core): invoke setActiveConsumer in ɵɵdeferHydrateWhen at the right time (#58864)
This commit updates the code of the `ɵɵdeferHydrateWhen` function to invoke the `setActiveConsumer` function at the right time (currently, we invoke it in the `finally` block, which is too late).

PR Close #58864
2024-11-25 16:12:37 +00:00
Andrew Kushnir
f6a84f0224 refactor(core): remove unused field in ApplicationRef class (#58864)
This commit removes an unused field in the `ApplicationRef` class. Most likely the usage of the field was removed earlier.

PR Close #58864
2024-11-25 16:12:37 +00:00
Matthieu Riegler
901fd1c09b fix(core): Ensure resource sets an error (#58855)
Before this commit, a resource with a previous value wouldn't set the error state correctly.
This commit fixes this. A resource will set its status to error even when there was a previous valid value.

PR Close #58855
2024-11-25 15:28:17 +00:00
Matthieu Riegler
58c0b36d84 docs: add standalone example for ErrorHandler (#58859)
fixes #55579

PR Close #58859
2024-11-25 15:26:50 +00:00
Kristiyan Kostadinov
4f1f4a1728 refactor(migrations): skip TS version check in tsurge (#58866)
Skips the TS version check in tsurge since it's blocking some internal changes and generally isn't necessary since the app will be checked when it's built anyways.

PR Close #58866
2024-11-25 15:26:18 +00:00
Kristiyan Kostadinov
4e9244990a fix(compiler-cli): more accurate diagnostics for host binding parser errors (#58870)
Currently host bindings are in a bit of a weird state, because their source spans all point to the root object literal, rather than the individual expression. This is tricky to handle at the moment, because the object is being passed around as a `Record<string, string>` since the compiler needs to support both JIT and non-JIT environments, and because the AOT compiler evaluates the entire literal rather than doing it expression-by-expression. As a result, when we report errors in one of the host bindings, we end up highlighting the entire expression which can be very noisy in an IDE.

These changes aim to report a more accurate error for the most common case where the `host` object is initialized to a `string -> string` object literal by matching the failing expression to one of the property initializers. Note that this isn't 100% reliable, because we can't map cases like `host: SOME_CONST`, but it's still better than the current setup.

PR Close #58870
2024-11-25 15:25:48 +00:00
Andrew Kushnir
7f6f5f95ea refactor(core): use ApplicationRef.whenStable instead of a custom util function (#58834)
This commit removes a custom `whenStable` util in favor of standard `ApplicationRef.whenStable` API.

There is also an important different between the custom `whenStable` function and `ApplicationRef.whenStable` implementation: the `whenStable` was caching the "stable" promise on per-ApplicationRef basis, which resulted in unexpected behavior with zoneless, when some code ended up getting a stale resolved promise, when an application was not stable yet, this causing order of operations issues. This commit also has an extra test that covers that case.

PR Close #58834
2024-11-25 15:25:10 +00:00
kirjs
15f07166eb refactor(core): make lView[Injector] non-nullable (#58805)
There actually no cases, where it can be null. Also update all usages.

PR Close #58805
2024-11-25 15:24:40 +00:00
Angular Robot
a534fa5f46 build: lock file maintenance (#58867)
See associated pull request for more information.

PR Close #58867
2024-11-25 15:21:02 +00:00
Andrew Kushnir
834c7c3ccc fix(core): make component id generation more stable between client and server builds (#58813)
For components with i18n in templates, the `consts` array is generated by the compiler as a function. If client and server bundles were produced with different minification configurations, the serializable contents of the function body would be different on the client and on the server. This might result in different ids generated. To avoid this issue, this commit updates the logic to not take the `consts` contents into account if it's a function.

Resolves #58713.

PR Close #58813
2024-11-22 19:36:50 +00:00
Angular Robot
aca8cc0e16 build: lock file maintenance (#58711)
See associated pull request for more information.

PR Close #58711
2024-11-22 14:46:21 +00:00
Jessica Janiuk
bd08d1ddac fix(core): Prevents race condition of cleanup for incremental hydration (#58722)
When hydrating a tree of blocks, this prevents cleanup from firing more than once per tree. It also ensures the cleanup happens after hydration has finished.

fixes: #58690

PR Close #58722
2024-11-21 21:39:37 +00:00
Younes Jaaidi
1fe001e18b fix(migrations): fix provide-initializer migration when using useFactory (#58518)
Priori to this commit, initializer functions with dependencies were not migrated correctly.
With this commit, the function is executed in a injection context to allow the usage of `inject`.

PR Close #58518
2024-11-21 20:59:35 +00:00
Ryan Russell
3fc14ecc81 fix(migrations): Mark hoisted properties as removed in inject migration (#58804)
Before, in a situation like shown in the test, all of the initializers
would be dropped, as the code would try to insert it at the hoisted
property which is going to be deleted.

PR Close #58804
2024-11-21 20:58:26 +00:00
JoostK
21f757c1c4 fix(core): correctly perform lazy routes migration for components with additional decorators (#58796)
This fixes an issue where the lazy-routes migration would crash for component classes a
decorator without arguments in front of the `@Component` decorator (in particular, it needed
to be the first decorator).

Fixes #58793

PR Close #58796
2024-11-21 16:43:30 +00:00
Kristiyan Kostadinov
cebf2555e7 refactor(forms): work around another TypeScript 5.7 issue (#58782)
Reworks the changes from #58731, because they didn't cover all use cases.

PR Close #58782
2024-11-21 16:36:15 +00:00
Kristiyan Kostadinov
7eeae9f170 refactor(core): adjust tracing service (#58771)
Adjusts the tracing service based on internal requirements.

PR Close #58771
2024-11-21 16:34:53 +00:00
Alex Rickabaugh
d27f97ddab refactor(core): introduce TracingService for snapshot-based tracing (#58771)
This commit introduces a private API, the `TracingService` DI token. By
providing this token, Angular can be configured to capture tracing snapshots
for certain operations such as change detection notifications, and to run
downstream operations within the context of those snapshots.
`TracingService` abstracts this context propagation and makes it pluggable.

PR Close #58771
2024-11-21 16:34:53 +00:00
Mark Axisa
6ad30593b9 docs(core): add descriptive usage line for projectableNodes param in createComponent docs (#58727)
PR Close #58727
2024-11-20 08:12:32 -08:00
Charles Lyding
67a4a7b27e refactor(language-service): reuse code fixes map for has fix check (#58759)
The error codes that have fixes are present in a Map instance and
can be directly leveraged to determine if an error code can be fixed.
This avoids multiple levels of iteration that would otherwise be needed.

PR Close #58759
2024-11-20 08:10:15 -08:00
Kristiyan Kostadinov
e4c50b3bea feat(common): expose component instance in NgComponentOutlet (#58698)
Exposes the current instance of the component in the `NgComponentOutlet` directive.

PR Close #58698
2024-11-20 08:08:21 -08:00
Kristiyan Kostadinov
18991d3210 fix(migrations): handle parameters with initializers in inject migration (#58769)
Adds some logic to the `inject()` migration that allows is to handle parameter declarations with initializers. This was omitted initially, because we don't officially support such cases, but it came up internally.

PR Close #58769
2024-11-20 08:07:39 -08:00
Angular Robot
71549dd461 build: update cross-repo angular dependencies (#58666)
See associated pull request for more information.

PR Close #58666
2024-11-19 16:51:40 -08:00
Kristiyan Kostadinov
dcd27d7921 fix(language-service): add fix for individual unused imports (#58719)
Fixes that `getCodeActions` wasn't implemented for the unused imports fixer which meant that it wouldn't show up in the most common cases.

PR Close #58719
2024-11-19 12:19:14 -08:00
Kristiyan Kostadinov
f5b2b58b3b fix(language-service): allow fixes to run without template info (#58719)
Currently the code fixes won't run if the template information can't be resolved on the diagnostic node. This is incorrect for diagnostics that are reported within `.ts` files. These changes make the `templateInfo` nullable and leave the early exit up to the individual fixes.

PR Close #58719
2024-11-19 12:19:14 -08:00
Charles Lyding
d33af5cba6 fix(core): correctly clear template HMR internal renderer cache (#58724)
The internal renderer cache within the renderer factory was not being
correctly cleared due to a type-casting error. This prevented template
HMR from correctly updating the component. A more explicity cast has
now been used to mitigate this problem.
Component template HMR is currently considered experimental.

PR Close #58724
2024-11-19 12:18:39 -08:00