Commit graph

31403 commits

Author SHA1 Message Date
Andrew Kushnir
600ef5eff2 refactor(core): tree-shake defer block registry (#58424)
This commit updates the code of the incremental hydration feature to make the `DeferBlockRegistry` class tree-shakable. The class is only needed for hydration cases and it should not be included into client bundles for client-only apps.

PR Close #58424
2024-10-31 18:12:03 +01:00
Jessica Janiuk
0ca14e2c72 refactor(core): More cleanup of incremental hydration code (#58430)
This cleans up much of incremental.ts and adds documentation.

PR Close #58430
2024-10-31 11:26:58 +01:00
Jessica Janiuk
8d00d0fe85 refactor(core): Eliminate recursion in incremental hydration (#58419)
This implements a queue rather than a recursive call, which enables
proper cleanup timing for defer block registry.

PR Close #58419
2024-10-31 11:22:58 +01:00
Kristiyan Kostadinov
ea9bfff739 refactor(migrations): attempt to correct initialization order in internal inject migration (#58427)
Updates the internal part of the `inject` migration to attempt to correct some cases where the declaration order of properties doesn't match the initialization order.

PR Close #58427
2024-10-31 09:17:51 +01:00
Kristiyan Kostadinov
bb6e0aab1b refactor(migrations): make it easier to delete nodes including comments (#58427)
We were repeating the logic that deletes a node together with all its comments in a few different places. These changes consolidate the logic under `ChangeTracker.removeNode`.

PR Close #58427
2024-10-31 09:17:51 +01:00
Kristiyan Kostadinov
b5b0b4af29 refactor(migrations): internal inject migration applying some changes to abstract classes (#58427)
We were filtering out abstract classes pretty late in the migration which led to the internal part of it to make some changes that aren't finalized later. These changes fix the issue by filtering out abstract classes during analysis.

PR Close #58427
2024-10-31 09:17:51 +01:00
Alan Agius
ea086905c3 fix(docs-infra): reduce margin-block-start from doc anchor headers (#58431)
This change reduces the spacing between headers, which is currently excessive.

PR Close #58431
2024-10-31 09:15:36 +01:00
Alex Rickabaugh
ee1d06c8fa release: cut the v19.0.0-rc.0 release 2024-10-30 13:20:44 -07:00
Matthieu Riegler
dcd16b43f3 refactor(migrations): Make the explicit standalone migration idempotent (#58418)
With this commit the  explicit standalone migration uses the presents of imports to make sure that we can safely remove the standalone prop
and not adding it again when re-run.

PR Close #58418
2024-10-30 11:55:11 -07:00
Alan Agius
3230d78c54 refactor(core): introduce ngServerMode as global (#58386)
This commit adds the `ngServerMode` as global, which allows for the tree-shaking of server-only code from the bundles. When this flag is unset at runtime, server-specific code will be excluded by Closure, optimizing bundle size.

**Internal Angular Flag:** This is an internal Angular flag (not a public API), avoid relying on it in application code.

PR Close #58386
2024-10-30 10:13:28 -07:00
Pawel Kozlowski
616b411a6d fix(migrations): properly migrate output aliases (#58411)
Before this fix the output migration was incorrectly assuming
that the @Output decorator takes its params as an object.
What happens in reality is that the @Output decorator is taking
alias as the only argument, without any object literal wrapper.

PR Close #58411
2024-10-30 10:01:28 -07:00
Pawel Kozlowski
d504452e2f fix(migrations): properly replace imports across files (#58414)
This change fixes a bug where the output migration was interacting
with the InputManager utility in the way that was resulting in
incorrect import replacements.

The fix consists of making sure that a new ImportManager instance
is created for each and every file containing @Output declarations.

PR Close #58414
2024-10-30 09:24:06 -07:00
Paul Gschwendtner
ddef41e897 refactor(migrations): gracefully handle metadata parsing errors in signal migration (#58413)
In 1P, we saw that a type of a target wasn't resolvable, referenced in a
`hostBindings#directive` field. This breaks the entire pipeline; so we
should handle gracefully but report an error.

Worst case scenario here is that we would miss some references to the
given directive/component. This is acceptable and we can continue
investigation why that given target was broken; especially since the
file was part of the target inputs- but seemingly not in the `tsconfig`.

PR Close #58413
2024-10-30 09:23:39 -07:00
Paul Gschwendtner
8709359a1f refactor(migrations): improve temporary variable insertion in signal migrations (#58413)
Fixes that the migrations weren't properly determing the highest block
of multiple shared references. The logic was flawed by checking the
`start` indices; because we also need to respect that the blocks
should enclose all references; and the block practically is a common
ancestor. This is not guaranteed without this commit.

Note: The logic assumes that all references are part of the same control
flow container; this is verified.

PR Close #58413
2024-10-30 09:23:39 -07:00
Kristiyan Kostadinov
dbe612f2cd fix(compiler-cli): disable standalone by default on older versions of Angular (#58405)
Disables the standalone by default behavior in the compiler when running against and older version of Angular. This is necessary, because the language service may be using the latest version of the compiler against and older version of core in a particular workspace.

PR Close #58405
2024-10-30 09:23:12 -07:00
Pawel Kozlowski
3e50842593 refactor(docs-infra): use reactive APIs in adev components (#58357)
This is a relativelly small refactoring to a couple of
adev components. The goal here is to use new reactive
APIs in the idiomatic way.

PR Close #58357
2024-10-30 09:21:25 -07:00
Angular Robot
3d918de05f build: update scorecard action dependencies (#58400)
See associated pull request for more information.

PR Close #58400
2024-10-29 05:10:31 -07:00
Alan Agius
a899623b51 refactor(core): move static AfterRenderImpl.PHASES to a top-level variable (#58402)
Improves code minification.

PR Close #58402
2024-10-29 05:08:13 -07:00
Jessica Janiuk
7cb6adcb50 refactor(core): prevent unnecessary hydration work in csr cases (#58366)
This adds a shouldHydrate check that prevents any additional work in cases when hydration is not necessary.

PR Close #58366
2024-10-29 05:07:37 -07:00
Jessica Janiuk
fd7716440b fix(core): Prevents trying to trigger incremental hydration on CSR (#58366)
hydrate triggers were firing in CSR cases and attempting to find parent defer blocks. This prevents that from happening. In these cases, the defer block id will be empty.

fixes: #58359

PR Close #58366
2024-10-29 05:07:37 -07:00
Angular Robot
98f54cb134 docs: update Angular CLI help [19.0.x] (#58395)
Updated Angular CLI help contents.

PR Close #58395
2024-10-28 12:50:53 -07:00
george looshch
23531f249e docs: remove an unnecessary whitespace (#58388)
Remove an unnecessary whitespace between an opening parenthesis and a
word in the documentation on lifecycle.

Closes #58380

PR Close #58388

PR Close #58388
2024-10-28 12:49:38 -07:00
george looshch
c6a21cc7f9 docs: fix backtick escaping in a Markdown file (#58387)
Fix backtick escaping for the template string example in the
documentation on expression syntax.

Closes #58382

PR Close #58387

PR Close #58387
2024-10-28 12:49:01 -07:00
Jeevan Mahesha
df14cb6f8e docs: update ProfileEditorComponent to use inject() for FormBuilder (#58378)
PR Close #58378
2024-10-28 12:48:29 -07:00
Jessica Janiuk
f815d7b8c8 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
90c7ec39a0 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:04 -07:00
Kristiyan Kostadinov
eafe9040a2 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:04 -07:00
Kristiyan Kostadinov
7a65cdd911 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
1806fcce82 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
598c397c85 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
98804fd4be 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
ad3fbe6d97 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:54 -07:00
Angular Robot
2de5314400 build: update actions/checkout digest to 11bd719 (#58329)
See associated pull request for more information.

PR Close #58329
2024-10-28 12:31:14 -07:00
David LJ
c0d606195c docs: fix errata in provideEnvironmentInitializer API docs (#58355)
PR Close #58355
2024-10-28 12:29:53 -07:00
Alan Agius
1efc4bb9e6 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:06 -07:00
Alan Agius
2d3a689660 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:06 -07:00
Alan Agius
cf7f8c7c03 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:06 -07:00
Alan Agius
7dfb127c03 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:06 -07:00
Alan Agius
93c3f7a931 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:06 -07:00
Jessica Janiuk
395cb34599 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
00b79f8157 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
50e99b66e5 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
0b2f18ff25 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
Matthieu Riegler
77fa588025 ci: disable adev tests (#58367)
The changes in #58288 are responsible for breaking the tests (see #54858). We'll re-enable them on the next release.

PR Close #58367
2024-10-25 18:45:21 +00:00
Yong Su
d7283bf740 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
Yong Su
f34268161b 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
Matthieu Riegler
9c4bcb16ca docs(docs-infra): re-enable adev tests (#58276)
PR Close #58276
2024-10-24 16:42:18 -07:00
Daniel Payet
0730d9d748 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:49 -07:00
Joey Perrott
a49c35ec76 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
917e99db42 docs(platform-browser): update usage notes for incremental hydration (#58339)
PR Close #58339
2024-10-24 16:39:27 -07:00