Commit graph

12504 commits

Author SHA1 Message Date
Jessica Janiuk
db467e10b7 refactor(core): Additional cleanup for incremental hydration (#58394)
This adds comments, removes some duplicate logic, and eliminates some unnecessary complexity of the incremental hydration core logic.

PR Close #58394
2024-10-28 12:40:27 -07:00
Kristiyan Kostadinov
4434f3c7a1 fix(migrations): inject migration always inserting generated variables before super call (#58393)
Fixes that if a class has a `super` call, the `inject` migration would always insert the generated variable before it, even if there's other code before the `super` call.

PR Close #58393
2024-10-28 12:39:03 -07:00
Kristiyan Kostadinov
26be4d64ae refactor(migrations): inject migration internal mode incorrectly migration properties initialized to identifiers (#58393)
Fixes that when the `inject` migration in internal mode was starting to visit the nodes one level down from the root when considering whether an expression contains local references. This lead it to skip over top-level identifiers and migrate some code incorrectly.

PR Close #58393
2024-10-28 12:39:03 -07:00
Kristiyan Kostadinov
b98400f582 fix(migrations): inject migration not inserting generated code after super call in some cases (#58393)
Fixes an issue where the `inject` migration was generating and attempting to insert code after a `super` call, but the string buffering implementation was dropping it if the statement right after the `super` call was deleted as a result of the migration.

PR Close #58393
2024-10-28 12:39:03 -07:00
Kristiyan Kostadinov
a2a9ac76f5 refactor(migrations): hoist uninitialized members to top of class if they are not combined in the internal migration (#58393)
When the internal mode for the `inject` migration is enabled, we find properties without initializers, we add their initializers and we prepend the `inject` calls before them. The remaining properties that couldn't be combined are left in place. This appears to break some internal cases.

These changes work around the issue by hoisting all the non-combined members above the `inject()` calls. This should be safe, because they don't have initializers and as such can't have dependencies.

PR Close #58393
2024-10-28 12:39:03 -07:00
Kristiyan Kostadinov
57db5dda4f refactor(core): account for anonymous classes in internal utility (#58392)
Fixes that the `getClosestComponentName` utility was reporting an empty string if it encounters an anonymous class.

PR Close #58392
2024-10-28 12:38:03 -07:00
Brandon Roberts
992410e928 fix(compiler): add more specific matcher for hydrate never block (#58360)
Fixes an issue where additional characters were allowed afte the "hydrate never" block.

Closes #58358

PR Close #58360
2024-10-28 12:35:11 -07:00
Kristiyan Kostadinov
61203d1d47 refactor(core): remove globalApi tag (#58375)
`@globalApi` was an AIO implementation detail that isn't relevant anymore.

PR Close #58375
2024-10-28 12:33:52 -07:00
David LJ
317d70483a docs: fix errata in provideEnvironmentInitializer API docs (#58355)
PR Close #58355
2024-10-28 12:29:53 -07:00
Alan Agius
924e54ab4a test: update defer symbol test golden file (#58297)
Update the golden file of the defer symbol test

PR Close #58297
2024-10-28 12:26:05 -07:00
Alan Agius
b23e749b5e refactor(core): eliminate top-level property access in ɵɵNgOnChangesFeature (#58297)
Top-level property access was causing dead code elimination (DCE) and tree-shaking issues. This commit modifies `ɵɵNgOnChangesFeature` to prevent these bailouts.

PR Close #58297
2024-10-28 12:26:05 -07:00
Alan Agius
e3762303e6 refactor(core): make AfterRenderImpl tree-shakable by moving PHASES (#58297)
Marked the PHASES constant within AfterRenderImpl as @__PURE__ to enable better tree-shaking during bundling. This optimization ensures that unused code is more effectively eliminated, improving overall bundle size and performance.

Closes #58296

PR Close #58297
2024-10-28 12:26:05 -07:00
Alan Agius
fee9db18a9 refactor: add @__PURE__ next to @pureOrBreakMyCode for improved bundler compatibility (#58297)
Added the `@__PURE__` annotation alongside `@pureOrBreakMyCode` to improve compatibility with third-party bundlers. This refactor follows optimization best practices, ensuring broader support across different tools, as `@pureOrBreakMyCode` was only supported by Closure Compiler.

PR Close #58297
2024-10-28 12:26:05 -07:00
Alan Agius
7de7c52769 build: remove usages of useDefineForClassFields: false (#58297)
When setting `"useDefineForClassFields": false`, static fields are compiled within a block that relies on the `this` context. This output makes it more difficult for bundlers to treeshake and eliminate unused code.

PR Close #58297
2024-10-28 12:26:05 -07:00
Jessica Janiuk
0f2f7ec754 refactor(core): cleanup incremental hydration code (#58363)
This cleans up some minor issues with the incremental hydration implementation and should make maintaining it a little easier.

PR Close #58363
2024-10-28 09:26:45 -07:00
Paul Gschwendtner
35d7ca55b2 test: support parallel tsurge unit combining in batch test infra (#58280)
This allows the batch test for the signal input migration to pass.

PR Close #58280
2024-10-25 18:47:41 +00:00
Paul Gschwendtner
dd686edfe9 refactor(migrations): update migrations to combine analysis data in parallel (#58280)
This is necessary given the previous Tsurge refactorings. It should
speed up migrations in the merge phase signficiantly and reduce memory
pressure. In 1P, we already have workers from analyze phase anyway— so
those can be re-used for parallel metadata merging.

PR Close #58280
2024-10-25 18:47:41 +00:00
Paul Gschwendtner
8143016b91 refactor(migrations): support parallel tsurge metadata merging (#58280)
This is helpful and important for large scale migrations where a single
call for merging _all_ unit data's can be subject to memory / disk
resource constraints. Consider a compilation unit data for every target
in Google3, and those being merged in a single program.

PR Close #58280
2024-10-25 18:47:41 +00:00
Yong Su
bba8cc5d86 refactor(core): allow passing passive option to addEvent (#58316)
For scroll-blocking events like 'touchstart', 'touchmove', 'wheel' and 'mousewheel',
if passive option is not specified when adding the event listener, browser may give
a violation warning.

This PR allows us to set the passive option when calling event lib's addEvent().

PR Close #58316
2024-10-24 17:49:26 -07:00
Daniel Payet
d16a609f50 fix(localize): Adding arb format to the list of valid formats in the localization extractor cli (#58287)
Although the ARB format is supported, it's missing from the command's list of options.

Fix #58286

PR Close #58287
2024-10-24 16:41:47 -07:00
Joey Perrott
bad36519f2 fix(router): remove setter for injector on OutletContext (#58343)
This is a cleanup/completion of the work in #56798

PR Close #58343
2024-10-24 16:41:04 -07:00
Brandon Roberts
48620ad21f docs(platform-browser): update usage notes for incremental hydration (#58339)
PR Close #58339
2024-10-24 16:39:26 -07:00
Alex Rickabaugh
a264c78b34 refactor: cleanup initializers that use ctor params (#58349)
Fix initializer of instance members that reference identifiers declared in
the constructor.

When public class fields are enabled, such cases throw TS2729: property used
before its initialization.

PR Close #58349
2024-10-24 16:38:50 -07:00
Jessica Janiuk
7a5d1292d0 refactor(core): prevent annotating in hydrate never blocks (#58328)
This fixes an issue with hydrate never where jsaction annotations would still hydrate even when they should not.'

PR Close #58328
2024-10-24 16:20:52 -07:00
Matthieu Riegler
5d9cc8f408 refactor(core): remove the standalone feature (#58288)
By removing the standalone feature, we reduce the amount of code generated for components but at the cost of including the `StandaloneService` in the main bundle even if no standalone components are included in it.

PR Close #58288
2024-10-24 16:19:02 -07:00
Kristiyan Kostadinov
c7342bec24 fix(core): avoid breaking change with apps using rxjs 6.x (#58341)
The `rxResource` was using `firstValueFrom` which isn't supported in rxjs 6.x. `@angular/core` currently supports rxjs 6 so we need this to be backwards compatible. This came up when trying to deploy the Material docs site which is still on rxjs 6 ([see](https://github.com/angular/components/actions/runs/11487971079/job/31973721563)).

PR Close #58341
2024-10-24 16:17:47 -07:00
Matthieu Riegler
8af71c05b2 refactor(language-service): support standalone by default (#58238)
`isStandaloneDecorator()` returns `false` only when the component is explicitly not standalone

PR Close #58238
2024-10-24 12:44:13 -07:00
Matthieu Riegler
bc9ef72fae refactor(compiler): update compliance tests. (#58238)
`standalone: true` is now the default at runtime.

PR Close #58238
2024-10-24 12:44:12 -07:00
Matthieu Riegler
a10f7cfbc2 refactor(core): Don't generate standalone: true for definitions (#58238)
The runtime default is now `standalone: true`.
`ɵɵdefineComponent`, `ɵɵdefineDirective` and `ɵɵdefinePipe` now set `standalone` as `true` by default in the definitions.

PR Close #58238
2024-10-24 12:44:12 -07:00
Néstor Sabater
18ddf0de76 docs(router): document segment consumption during route evaluation (#58069)
PR Close #58069
2024-10-24 12:41:38 -07:00
Pawel Kozlowski
cf70d626cd feat(migrations): print output migration stats in ng generate (#58321)
Propagates output migration stats to the ng generate schematic.

PR Close #58321
2024-10-23 08:03:31 -07:00
Pawel Kozlowski
bb286f65e7 feat(migrations): capture output migration stats (#58321)
This change captures different statistics from the run of the
output migration:
- total number of outputs detected
- number of problematic outputs that can't be migrated
- overall success rate

PR Close #58321
2024-10-23 08:03:30 -07:00
Kristiyan Kostadinov
42607bf0f2 fix(migrations): add outputs migration to combined shorthand (#58318)
Adds the `@Output` migration to the combined `@angular/core:signals` migration.

PR Close #58318
2024-10-23 08:02:50 -07:00
Pawel Fras
5fde27b8a4 refactor(core): fix deprecation version for APP_INITIALIZER and PLATFORM_INITIALIZER (#58322)
this commit changes deprecation version mentioned in JSDocs for APP_INITIALIZER and PLATFORM_INITIALIZER from 18.1.0 to 19.0.0

PR Close #58322
2024-10-23 08:01:28 -07:00
Devashish Sarmah
24c6373820 feat(common): add optional rounded transform support in cloudinary image loader (#55364)
Currently, the cloudinary image loader doesn't support rounded transform.
Add a new prop called `rounded` to the existing `ImageLoaderConfig.loaderParams`

test(common): add test case for cloudinary loader rounded option

add test case for the rounded transform option of cloudinary loader

PR Close #55364
2024-10-23 07:59:13 -07:00
Andrew Kushnir
1f4533807e Revert "fix(forms): fix FormRecord type inference (#50750)" (#58315)
This reverts commit 18b6f3339f.

PR Close #58315
2024-10-22 14:04:45 -07:00
Andrew Kushnir
79d9be3e63 Revert "feat(forms): add ability to clear a FormRecord (#50750)" (#58315)
This reverts commit 3e7d724037.

PR Close #58315
2024-10-22 14:04:45 -07:00
Andrew Kushnir
a5b0394313 Revert "test(forms): add unit test (#50750)" (#58315)
This reverts commit b0c4c1fd2b.

PR Close #58315
2024-10-22 14:04:45 -07:00
Andrew Scott
8ebbae88ca feat(core): Add rxjs operator prevent app stability until an event (#56533)
This commit adds an operator to help rxjs observables important for rendering
keep the application unstable (and prevent serialization) until there is
an event (observable emits, completes, or errors, or the subscription is
unsubscribed). This helps with SSR for zoneless and also helps for when
operations are intentionally executed outside the Angular Zone but are
still important for SSR (i.e. angularfire and the zoneWrap helper hacks).

PR Close #56533
2024-10-22 14:01:11 -07:00
Andrew Kushnir
888657a12e Revert "refactor(migrations): support parallel tsurge metadata merging (#58280)" (#58313)
This reverts commit 21b6613b90.

PR Close #58313
2024-10-22 12:27:53 -07:00
Andrew Kushnir
1215927e5b Revert "refactor(migrations): update migrations to combine analysis data in parallel (#58280)" (#58313)
This reverts commit 8735543d06.

PR Close #58313
2024-10-22 12:27:53 -07:00
Andrew Kushnir
9aa686896d Revert "test: support parallel tsurge unit combining in batch test infra (#58280)" (#58313)
This reverts commit cb34e406ba.

PR Close #58313
2024-10-22 12:27:53 -07:00
Paul Gschwendtner
cb34e406ba test: support parallel tsurge unit combining in batch test infra (#58280)
This allows the batch test for the signal input migration to pass.

PR Close #58280
2024-10-22 11:29:16 -07:00
Paul Gschwendtner
8735543d06 refactor(migrations): update migrations to combine analysis data in parallel (#58280)
This is necessary given the previous Tsurge refactorings. It should
speed up migrations in the merge phase signficiantly and reduce memory
pressure. In 1P, we already have workers from analyze phase anyway— so
those can be re-used for parallel metadata merging.

PR Close #58280
2024-10-22 11:29:16 -07:00
Paul Gschwendtner
21b6613b90 refactor(migrations): support parallel tsurge metadata merging (#58280)
This is helpful and important for large scale migrations where a single
call for merging _all_ unit data's can be subject to memory / disk
resource constraints. Consider a compilation unit data for every target
in Google3, and those being merged in a single program.

PR Close #58280
2024-10-22 11:29:15 -07:00
Jessica Janiuk
3b2f6792ba refactor(core): annotate incremental hydration as dev preview (#58308)
This adds the proper developer preview annotation for the withIncrementalHydration api.

PR Close #58308
2024-10-22 11:27:51 -07:00
AleksanderBodurri
ec386e7f12 feat(core): introduce debugName optional arg to framework signal functions (#57073)
Angular DevTools is working on developing signal debugging support. This commit is a step in the direction of making available debug information to the framework that will allow Angular DevTools to provide users with more accurate information regarding the usage of signals in their applications.

Follow up PRs that will use this arg will:
- Develop a typescript transform that will detect usages of signal functions and attempt to add a debugName without the user needing to specify one directly
- Develop debug APIs for discovering signal graphs within Angular applications (using debugName as a way to label nodes on the graph)

PR Close #57073
2024-10-22 11:26:37 -07:00
Jessica Janiuk
08e6ccb758 refactor(core): incremental hydration cleanup (#58290)
This cleans up a few bits of implementation in the incremental hydration code.

PR Close #58290
2024-10-22 09:43:43 -07:00
Matthieu Riegler
308acb95c3 refactor(core): removing error related dead code. (#58272)
we're not invoking `wrappedError` any more, removing all the related code.

PR Close #58272
2024-10-22 09:42:47 -07:00
Sumit Arora
0ea9b8892b test(router): adding test for getLoadedRoutes (#58199)
Added test for getLoadedRoutes with and without loadChildren

PR Close #58199
2024-10-22 09:40:45 -07:00