Commit graph

31498 commits

Author SHA1 Message Date
Kristiyan Kostadinov
c421ffdbfb fix(compiler): control flow nodes with root at the end projected incorrectly (#58607)
Fixes an edge case where a control flow node that has non-projectable nodes followed by an element node at the end would cause the entire control flow node to be project. For example if we have a projection target of `Main: <ng-content/> Slot: <ng-content select="[foo]"/>`, inserting a node of `@if (true) {Hello <span foo>world</span>}` would project the entire `Hello world` into the `[foo]` slot.

In the process of working on the issue, I also found that `@let` declarations at the root of the control flow node would prevent content projection as well.

PR Close #58607
2024-11-12 18:05:00 +00:00
Jessica Janiuk
f2bda8e3fc fix(core): prevent errors on contract cleanup (#58614)
If contract cleanup is called more than once, the assertion that the container manager will be present results in exceptions.

PR Close #58614
2024-11-12 17:25:50 +00:00
arturovt
4df352b77e fix(core): clean up event contract once hydration is done (#58174)
In this commit, we clean up the event contract once hydration is complete, which removes event
listeners registered through the container manager. If we do not clean up the contract, the listeners
will remain on the `document.body`. When incremental hydration is enabled, we cannot clean up the event
contract immediately; instead, we schedule its cleanup when the app is destroyed. This is because the
event contract is required for deferred blocks, of which we are unaware, that need to be hydrated.

PR Close #58174
2024-11-12 15:05:45 +00:00
Jessica Janiuk
e3343620b5 test(core): add incremental hydration tests (#58601)
This adds some additional tests for incremental hydration around registry and contract cleanup.

PR Close #58601
2024-11-12 14:49:06 +00:00
ashish
ee010d1dfb docs(docs-infra): Fixed grammatical error (#58611)
PR Close #58611
2024-11-12 14:48:10 +00:00
Angular Robot
511fe57fef build: update github/codeql-action action to v3.27.2 (#58604)
See associated pull request for more information.

PR Close #58604
2024-11-12 14:47:17 +00:00
Kristiyan Kostadinov
7e5f705213 refactor(migrations): handle fake async catalyst (#58608)
Fixes that the standalone migration wasn't handling the `fake_async` path for Catalyst.

PR Close #58608
2024-11-12 14:45:40 +00:00
Matthieu Riegler
8bf9156f93 docs: fix link in 6-property-binding tutorial (#58594)
fixes #58588

PR Close #58594
2024-11-12 14:44:58 +00:00
Jessica Janiuk
42c99763f5 refactor(core): reorganize defer codebase (#58598)
This moves all the helpers out of the instructions file, keeping the instructions limited to the actual instruction set. This adds files for defer block rendering functions and triggering functions, respectively.

PR Close #58598
2024-11-11 19:11:02 +00:00
Angular Robot
3b34073228 build: update cross-repo angular dependencies (#58597)
See associated pull request for more information.

PR Close #58597
2024-11-11 19:02:07 +00:00
Sheik Althaf
ff734fd3ef refactor(devtools): use reactive APIs for queries and linkedSignal (#58464)
migrated the viewChild to signal api and used linkedSignal in place of effect and little code refactoring

PR Close #58464
2024-11-11 19:01:18 +00:00
Joey Perrott
869df8e11c docs: remove "getting started" from headers on API ref page (#58595)
Remove the "Getting Started" text from the headers as it is unnecessary and confusing

PR Close #58595
2024-11-11 17:53:20 +00:00
Angular Robot
33e62c423c build: update cross-repo angular dependencies (#58593)
See associated pull request for more information.

PR Close #58593
2024-11-11 17:24:46 +00:00
Angular Robot
dc3a68bf67 build: update dependency marked to v15 (#58573)
See associated pull request for more information.

PR Close #58573
2024-11-11 17:11:27 +00:00
Matthieu Riegler
750432337b ci: re-enable adev tests (#58574)
Previously we disabled the tests to land some breaking changes.
We can now update the dependencies and re-enable the tests.

PR Close #58574
2024-11-11 16:52:09 +00:00
Kristiyan Kostadinov
086cb2c40e fix(compiler-cli): report individual diagnostics for unused imports (#58589)
Initially the unused imports check was implemented so that it reports one diagnostic per component with the individual unused imports being highlighted through the `relatedInformation`. This works fine when reporting errors to the command line, but vscode appears to only show `relatedInformation` when the user hovers over a diagnostic which is a sub-par experience.

These changes switch to reporting a diagnostic for each unused import instead.

PR Close #58589
2024-11-11 15:31:00 +00:00
Paul Gschwendtner
5ac0538870 refactor(migrations): improve temporary variable generation in signal migrations (#58581)
This commit improves the temporary variable generation in signal
migrations, whenever references are "shared" inside property
declarations.

PR Close #58581
2024-11-11 15:29:20 +00:00
Paul Gschwendtner
4fe080f04d refactor(migrations): improve control flow analysis for loops in signal migration (#58581)
Currently whenever we would come across a code snippet like this, where
`maxCellsPerRow` is an input, the control flow analysis would fall apart
because the first occurence of the node points to a control flow node
that is offset-wise "after" the first occurence. This commit makes the
logic more robust.

PR Close #58581
2024-11-11 15:29:20 +00:00
Jessica Janiuk
e1c5d839b3 Revert "ci: re-enable adev tests (#58574)" (#58592)
This reverts commit 7263917793.

PR Close #58592
2024-11-11 15:28:37 +00:00
Matthieu Riegler
7263917793 ci: re-enable adev tests (#58574)
Previously we disabled the tests to land some breaking changes.
We can now update the dependencies and re-enable the tests.

PR Close #58574
2024-11-11 14:50:59 +00:00
Charles Lyding
4327aa8c86 docs: add define option and prebundling info for application builder (#58569)
The application builder documentation now contains information about the
`define` option and its usage as well as development server prebundling.

PR Close #58569
2024-11-11 14:36:41 +00:00
Sheik Althaf
53341a3b8f refactor(docs-infra): use reactive APIs in shared components (#58425)
Migrated the input, output and queries to reactive APIs for better support of zoneless.

PR Close #58425
2024-11-11 14:36:05 +00:00
Jessica Janiuk
47224fb3c1 refactor(core): clean up incremental code base (#58553)
This re-organizes the code to be a bit cleaner with no more need for the onTriggerFn function.

PR Close #58553
2024-11-11 14:35:36 +00:00
Jessica Janiuk
277afc2333 refactor(core): Ensure registry and map are empty on view destroy (#58553)
This cleans up the memory usage of the defer block registry and jsactionmap when a view is destroyed that contains a defer block that is not yet hydrated.

PR Close #58553
2024-11-11 14:35:36 +00:00
Alan Agius
bc5aa3ceda docs: update hybrid rendering docs to remove RenderMode.AppShell (#58564)
More context in https://github.com/angular/angular-cli/pull/28818

PR Close #58564
2024-11-08 18:56:36 +00:00
Angular Robot
e847c9f009 build: update cross-repo angular dependencies (#58571)
See associated pull request for more information.

PR Close #58571
2024-11-08 18:54:26 +00:00
Anner Visser
ff11551060 docs: Fix menu label for ng cache clean, clear -> clean (#58560)
PR Close #58560
2024-11-08 17:28:02 +00:00
Paul Gschwendtner
55fde8dbac refactor(migrations): support running existing migrations with plain TS programs (#58541)
Previously we always ran Tsurge migrations with an Angular program, even
if it's a plain `ts_library` target. This has changed now, so we also
need to properly handle the case where a `ts_library` is analyzed, but
no Angular program is available.

PR Close #58541
2024-11-08 17:22:06 +00:00
Paul Gschwendtner
1a0cee543e refactor(migrations): conditionally create plain TS programs for Tsurge analyzers (#58541)
Tsurge can run against the full Google3 depot, and will often also deal
with plain `ts_library` targets. Those shouldn't be constructed with the
Angular compiler as this could cause out of memory breakages etc. The
targets are simply not "proven" to be compatible with the Angular
compiler; so we shouldn't use them when not necessary.

PR Close #58541
2024-11-08 17:22:06 +00:00
Angular Robot
70036fabd8 build: update cross-repo angular dependencies (#58550)
See associated pull request for more information.

PR Close #58550
2024-11-08 17:18:16 +00:00
Charles Lyding
98b39377b9 docs: add initial new feature info for application builder (#58547)
Adds information about loader option, loader import
attributes, and import/export condition features.

PR Close #58547
2024-11-08 17:17:36 +00:00
Teun Willems
4cc10cfb1f docs: remove foreach from testing.md as it's not a JS function (#58565)
Foreach was present in the documentation even though it's not valid Javascript

PR Close #58565
2024-11-08 17:16:42 +00:00
Alan Agius
c2a9b75045 fix(docs-infra): retain function keyword in API definitions (#58561)
**Before:**
```ts
animate(
  timings: string | number,
  styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null
): AnimationAnimateMetadata;
```

**Now:**
```ts
function animate(
  timings: string | number,
  styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null
): AnimationAnimateMetadata;
```

PR Close #58561
2024-11-08 17:16:04 +00:00
Alan Agius
d271c4422a fix(compiler-cli): correct extraction of generics from type aliases (#58548)
**Before:**
```ts
type HttpEvent = | HttpSentEvent
  | HttpHeaderResponse
  | HttpResponse<T>
  | HttpProgressEvent
  | HttpUserEvent<T>
```

**After:**
```ts
type HttpEvent<T> = | HttpSentEvent
  | HttpHeaderResponse
  | HttpResponse<T>
  | HttpProgressEvent
  | HttpUserEvent<T>
```

PR Close #58548
2024-11-08 17:15:06 +00:00
Alan Agius
c95aca1f17 docs(docs-infra): update default generic values and add constraints for type parameters in functions (#58548)
Before
```typescript
createNodeRequestHandler(
  handler: T
): T;
```

```typescript
class NgIf<T> {
  @Input() set ngIf(value: T);
  @Input() set ngIfThen(value: TemplateRef<NgIfContext<T>> | null);
  @Input() set ngIfElse(value: TemplateRef<NgIfContext<T>> | null);
  static ngTemplateGuard_ngIf: "binding";
  static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): boolean;
}
```

Now
```typescript
createNodeRequestHandler<T extends NodeRequestHandlerFunction>(
  handler: T
): T;
```

```typescript
class NgIf<T = unknown> {
  @Input() set ngIf(value: T);
  @Input() set ngIfThen(value: TemplateRef<NgIfContext<T>> | null);
  @Input() set ngIfElse(value: TemplateRef<NgIfContext<T>> | null);
  static ngTemplateGuard_ngIf: "binding";
  static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): boolean;
}
```

PR Close #58548
2024-11-08 17:15:06 +00:00
Alan Agius
4c3e1a99c1 ci: add packages/ssr in pullappove (#58556)
This directory was not included in the pullapprove config.
PR Close #58556
2024-11-07 22:43:23 +00:00
Alan Agius
641d57fb00 build: remove redundant file (#58556)
This file is incorrect.

PR Close #58556
2024-11-07 22:43:23 +00:00
Angular Robot
48be715878 build: lock file maintenance (#58450)
See associated pull request for more information.

PR Close #58450
2024-11-07 21:29:52 +00:00
Alan Agius
ade9ba789c refactor(compiler-cli): Improved filterMethodOverloads to Include Members without body (#58445)
Previously, `filterMethodOverloads` excluded all members without a body, causing issues with the extraction of functions and members in TypeScript types.

PR Close #58445
2024-11-07 21:28:54 +00:00
Alan Agius
3ecf0f6701 docs: add hybrid rendering API guide (#58445)
This commit introduces a new guide for hybrid rendering APIs, which are currently in developer preview. This documentation provides insights into the usage and features of the APIs, helping developers understand their capabilities and limitations during the preview phase.

PR Close #58445
2024-11-07 21:28:54 +00:00
Alan Agius
2627b29110 docs: update SSR documentation to include API references (#58445)
This update removes hard-coded options and enhances the SSR documentation to incorporate API references.

PR Close #58445
2024-11-07 21:28:54 +00:00
Alan Agius
c11ef4fade build(docs-infra): include API references for @angular/ssr entry points (#58445)
This commit utilizes the `@angular/ssr` NPM package to generate an API reference for its entry points using the `generate_api_docs` Bazel rule, which will be included in http://angular.dev/api.

PR Close #58445
2024-11-07 21:28:54 +00:00
mgechev
9aff978fac docs: add v19 instructions in the update guide (#58268)
The first draft is mostly Gemini with some
rephrasing from me. Please have a look and suggest
edits :)

PR Close #58268
2024-11-07 19:00:04 +00:00
Alan Agius
55c442033f ci: add myself to the renovate-changes PullApprove group (#58537)
I frequently need to ping others to approve Renovate PRs, so this should streamline the process.

PR Close #58537
2024-11-07 18:51:48 +00:00
Alan Agius
c5ce302e0b docs(docs-infra): add support for @remarks (#58523)
In TSDoc, we currently handle the `@usageNotes` annotation, but this is not a standard TSDoc tag. Instead, the `@remarks` annotation is the correct standard, which is used in the Angular CLI repo and on the SSR package.

This change ensures that `@remarks` is treated the same as `@usageNotes` during the transform process.

PR Close #58523
2024-11-07 15:49:13 +00:00
Charles Lyding
d076c32059 refactor(core): always create new renderer when applying HMR metadata update (#58527)
The DOM renderer classes perform initialization that captures state from
the component definition during construction. To ensure that the state is
kept synchronized with any newly applied metadata from an HMR `applyMetadata`
call, each renderer is now recreated during the apply process. This also
allows inline component styles to be updated in cases where external component
stylesheets may not be viable.

PR Close #58527
2024-11-07 14:30:31 +00:00
Alan Agius
1035b47d0b test(platform-server): fix issue with ngServerMode when focusing fit tests (#58538)
This commit addresses a problem with tests that use the `fit` function to focus on individual test cases. While these tests run successfully in the full suite, they fail when focused individually using `fit`.

The issue lies in the behavior of `withEventReply` and other hydration-related functions (i.e., `provideX`, `withX`). These functions return platform-specific providers based on the `ngServerMode` setting, causing inconsistencies between server and browser environments. As a result, provider instances cannot be reused across server and browser applications.

**Example of problematic code:**
```ts
const hydrationFeatures = [withEventReply()];
const html = await ssr(SimpleComponent, { hydrationFeatures });
// Expected behavior ...

const appRef = await prepareEnvironmentAndHydrate(doc, html, SimpleComponent, {
  hydrationFeatures,
});
// Expected behavior ...
```

**Solution:**
To address this, we define `hydrationFeatures` as a function instead of a static array. This ensures that a new instance of `withEventReply` is created separately for each environment, eliminating platform-specific mismatches between server and browser contexts:

```typescript
const hydrationFeatures = () => [withEventReply()];  // Define as a function
const html = await ssr(SimpleComponent, { hydrationFeatures: hydrationFeatures() });
// Expected behavior ...

const appRef = await prepareEnvironmentAndHydrate(doc, html, SimpleComponent, {
  hydrationFeatures: hydrationFeatures(),
});
// Expected behavior ...
```

PR Close #58538
2024-11-07 14:29:59 +00:00
Joey Perrott
637126cf6f fix(docs-infra): update search provider link (#58542)
Update the link used to reference algolia as the search provider on our documentation site. Adds a few URL parameters
for algolia to map back to our usage.

PR Close #58542
2024-11-07 14:27:12 +00:00
Angular Robot
e27d764a54 build: update cross-repo angular dependencies (#58544)
See associated pull request for more information.

PR Close #58544
2024-11-07 14:26:27 +00:00
Charles Lyding
b371384d8a docs: add component HMR information to application build system (#58528)
Add background and usage information for the new component HMR features
available in v19.

PR Close #58528
2024-11-07 13:26:55 +01:00