Commit graph

31877 commits

Author SHA1 Message Date
Matthieu Riegler
a426bdf4d5 docs: update class & style binding recommendation (#59240)
This commit introduces an update to the official recommendations when it comes to class & styles bindings.

`[class]` & `[style]` bindings are now recommended for basic uses cases.

`[ngClass]` and `[ngStyle]` allow more advanced bindings (like space separated keys) or keys with units (for `ngStyle`) which are not supported by the native bindings. They still require the dedicated directives.

PR Close #59240
2025-01-15 12:27:12 -05:00
Jeremy Elbourn
9bd5b4ad9c docs: clarify that @for doesn't support break/continue (#59533)
We recently saw some confusion around this, so it's worth adding a
sentence to clarify

PR Close #59533
2025-01-15 12:00:22 -05:00
carimatics
f012494e1e docs(forms): escape inequality signs of input tags in flowchart (#59517)
The input tags written within the flowcharts in the document were not being escaped, so we did that.
This change will ensure that the flowcharts in the document are properly displayed.

PR Close #59517
2025-01-15 10:17:22 -05:00
Sandeep Salwan
8ce3e774c0 docs: fix typos in let.md (#59526)
PR Close #59526
2025-01-15 09:44:25 -05:00
Andrew Kushnir
990ce59f58 Revert "refactor: initialize headers map directly in HttpHeaders class (#59268)" (#59523)
This reverts commit e15226a444.

PR Close #59523
2025-01-14 17:48:35 -05:00
Abdul Wahab
601994d842 docs: fix property wrong usage inside afterNextRender in lifecycle.md (#59521)
PR Close #59521
2025-01-14 16:27:39 -05:00
hawkgs
5a2d0ed541 docs: set syntax highlighting to the remaining Markdown code examples blocks (#59088)
There are some code blocks that slipped through the initial Regex-es.

Related to #59026

PR Close #59088
2025-01-14 15:14:03 -05:00
hawkgs
e44bf24bb3 docs(docs-infra): fix scrolling issues in the API reference (#59207)
Fix issues related to scrolling in the API reference:
- Scroll to the top of the page when navigating to the API details page
- Preserve scroll position when navigating back from the API details page

PR Close #59207
2025-01-14 14:56:43 -05:00
arturovt
e9e1a63621 refactor(common): tree-shake lcpObserver in NgOptimizedImage (#59481)
Prior to this commit, the `this.lcpObserver?.updateImage` expression was still preserved in the production code because it wasn't wrapped with `ngDevMode`. The observer is injected only in development mode. Additionally, we moved the logic from `ngOnDestroy` to avoid having an empty method in production.

PR Close #59481
2025-01-14 14:54:17 -05:00
arturovt
fb3aebaf6c refactor(common): tree-shake transfer cache interceptor stuff (#59439)
In this commit, we replace `isPlatformServer` runtime call with the `ngServerMode` in the `transferCacheInterceptorFn` in order to make the functionality tree-shakable between client and server bundles.

PR Close #59439
2025-01-14 14:40:06 -05:00
Kristiyan Kostadinov
f893d07232 fix(core): destroy renderer when replacing styles during HMR (#59514)
Currently when we swap out the component during HMR, we remove the renderer from the cache, but we never destroy it which means that its styles are still in the DOM. This can cause the old styles to leak into the component after they're replaced. These changes add a `destroy` call to ensure that they're removed.

PR Close #59514
2025-01-14 11:22:06 -05:00
hawkgs
bb35df43b9 docs(docs-infra): change API reference list items order to top-down (#58655)
Change the order from left-right to top-down (columns) and additionally make columns equal width.

PR Close #58655
2025-01-14 11:10:53 -05:00
hawkgs
e9d02d5ccf docs(docs-infra): fix SCSS build-time warnings (#59115)
Fix SCSS "declarations after nested rules" and `@import` warnings.

PR Close #59115
2025-01-14 11:09:24 -05:00
Matthieu Riegler
b568dd4eba refactor(compiler): remove unused AstVisitors (#59297)
Those 2 clases weren't imported anywhere.

PR Close #59297
2025-01-14 11:08:26 -05:00
Andrew Kushnir
f7ff00084d refactor(core): do not serialize parent block id for top level blocks (#59190)
This commit updates incremental hydration-related annotation logic to avoid serializing parent block id when it's `null` (for top-level blocks).

PR Close #59190
2025-01-14 11:06:59 -05:00
Angular Robot
2872a0cd1f build: update io_bazel_rules_sass digest to adeaf81 (#59508)
See associated pull request for more information.

PR Close #59508
2025-01-14 11:03:21 -05:00
hawkgs
580dd65425 docs(docs-infra): generate errors and extended-diagnostics route NavigationItem-s (#59355)
Generate the `NavigationItem`-s as part of adev/shared-docs pipeline and use the output JSON files instead of the hardcoded objects in the `sub-navigation-data.ts`.

PR Close #59355
2025-01-14 11:00:07 -05:00
Angular Robot
e44f5757aa build: update all non-major dependencies (#59510)
See associated pull request for more information.

PR Close #59510
2025-01-14 10:57:24 -05:00
Angular Robot
2d99a9f2c5 build: update dependency @babel/generator to v7.26.5 (#59511)
See associated pull request for more information.

PR Close #59511
2025-01-14 10:55:24 -05:00
Angular Robot
14cc5612ff build: update scorecard action dependencies (#59513)
See associated pull request for more information.

PR Close #59513
2025-01-14 10:53:22 -05:00
Pawel Kozlowski
800835d82f ci: update Ethan Cline GitHub user name (#59516)
Use case-sensitive user name.

PR Close #59516
2025-01-14 10:52:05 -05:00
RafaelJCamara
e31eb89a93 refactor: initialize headers map directly in HttpHeaders class (#59268)
Improved the initialization of the headers map to enhance performance
and code readability.

No breaking changes.

PR Close #59268
2025-01-14 10:50:16 -05:00
arturovt
8f7615c8d6 refactor(docs-infra): lazy-load EmbeddedTutorialManager in editor UI state (#59509)
In this commit, we lazy-load the `EmbeddedTutorialManager` in the editor UI state as done in other parts of the code.

PR Close #59509
2025-01-14 10:15:13 -05:00
arturovt
5ee7f85394 refactor(docs-infra): lazy-load EmbeddedTutorialManager in code editor (#59505)
In this commit, we lazy-load the `EmbeddedTutorialManager` in the code editor component as done in other parts of the code.

PR Close #59505
2025-01-13 15:00:26 -05:00
AleksanderBodurri
8a1dcaaedc fix(devtools): remove property tab css that is hiding directive metadata (#59493)
It looks like this height property was redundant prior to upgrading to angular/material 19.1.0-rc.0. An interaction between this property and that update caused elements inside of material expansion panels to be hidden.

This PR removes this unnecessary height assignment entirely.

PR Close #59493
2025-01-13 14:48:01 -05:00
arturovt
7d273a1125 refactor(common): prevent duplicating Accept header (#59467)
In this commit, we extract content types into a variable to eliminate extra bytes, as these values are duplicated in multiple places.

PR Close #59467
2025-01-13 12:38:47 -05:00
arturovt
9b7cb227ff refactor(common): drop enums by changing to const enum (#59468)
Note: this enums are not a part of the public API.

Prior to this commit, the compiler produced:

```js
var DateType;
(function (DateType) {
    DateType[DateType["FullYear"] = 0] = "FullYear";
    DateType[DateType["Month"] = 1] = "Month";
    DateType[DateType["Date"] = 2] = "Date";
    DateType[DateType["Hours"] = 3] = "Hours";
    DateType[DateType["Minutes"] = 4] = "Minutes";
    DateType[DateType["Seconds"] = 5] = "Seconds";
    DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds";
    DateType[DateType["Day"] = 7] = "Day";
})(DateType || (DateType = {}));
```

With these changes, we allow objects to be dropped entirely and inlined.

PR Close #59468
2025-01-13 11:14:27 -05:00
Kristiyan Kostadinov
4866cbde60 refactor(compiler): fix typo in method name (#59479)
Fixes a typo in the `AstVisitor.visitTypeofExpresion` method's name.

PR Close #59479
2025-01-13 10:57:52 -05:00
Amy Sorto
64f1bd7946 docs: add component harnesses guides (#59078)
PR Close #59078
2025-01-13 10:46:44 -05:00
arturovt
eadc8a333a refactor(docs-infra): lazy-load EmbeddedTutorialManager in home editor (#59491)
In this commit, we lazy-load `EmbeddedTutorialManager` in the home editor component via `injectAsync` as done in other parts of the code.

PR Close #59491
2025-01-13 10:45:44 -05:00
Bobokhuja
fea5c27a59 docs: fix typo example code in pipes documentation (#59312)
PR Close #59312
2025-01-13 10:38:07 -05:00
RafaelJCamara
343912e3b7 docs: add $default to path (#59383)
Closes: #59378

PR Close #59383
2025-01-13 10:36:18 -05:00
Matthieu Riegler
a27463cc42 docs(docs-infra): remove sorting from API manager (#59427)
fixes #59423

PR Close #59427
2025-01-13 10:33:38 -05:00
PhilippMDoerner
64ad44e845 docs: Adjust lines of server.ts example in server-side-rendering docs (#59490)
docs: Adjust lines of server.ts example in ssr docs

The server.ts excerpt used in the server-side-rendering docs
(https://angular.dev/guide/ssr#configure-server-side-rendering)
does not fully encapsulate the commonEngine code-block.

It begins too early in line 31, leading to the inclusions of lines
from another codeblock that is not intended to be shown here:
```
 );  

// All regular routes use the Angular engine
```
It should be beginning with the line
`// All regular routes use the Angular engine`.

It also ends too soon, cutting off these parts of the code-block:
```
      .catch((err) => next(err));
  });
```
PR Close #59490
2025-01-13 10:32:15 -05:00
Matthieu Riegler
63ef2acc26 docs(docs-infra): prevent the host class from being replaced (#59460)
When removing the binding, the class defined on the host element is being replaced

fixes #59442

PR Close #59460
2025-01-10 14:03:39 -05:00
Paul Gschwendtner
eb2fcd1896 fix(migrations): incorrect stats when migrating queries with best effort mode (#59463)
We previously did count forcibly ignored queries as incompatible. This
resulted in incorrect migration stats that are printed upon migration
completion.

See: #58657

PR Close #59463
2025-01-10 11:52:14 -05:00
Paul Gschwendtner
09a9fafc53 test: add test to verify extending tsconfig works in signal input migration (#59463)
Related to https://github.com/angular/angular/issues/59348

PR Close #59463
2025-01-10 11:52:13 -05:00
Paul Gschwendtner
8820a6fd97 test: improve typescript version coverage for signal input migration (#59463)
This ensures the migration works for these TypeScript versions. The
migration is very sensitive to the TS version and its internals; so it
makes sense to test all of these.

PR Close #59463
2025-01-10 11:52:13 -05:00
Aristeidis Bampakos
534368ce48 docs: update component scenarios guide (#59461)
PR Close #59461
2025-01-10 10:55:40 -05:00
Matthieu Riegler
178c619209 docs: update linkedSignal. (#59221)
The commit adds the mention that it is intentionnal that the computation is reactive even if there is an explicit `source`.

fixes #59094

PR Close #59221
2025-01-10 10:41:19 -05:00
arturovt
a1069a39da refactor(common): prevent duplicating X-Request-URL (#59420)
The `X-Request-URL` string is duplicated in multiple places. It is worth moving it to a shared constant that would be minified to something like `const a = "X-Request-URL"` and referenced in all the used places.

PR Close #59420
2025-01-09 18:18:25 -05:00
Doug Parker
3dc359eaf5 release: bump Angular DevTools version to 1.0.20 (#59454)
PR Close #59454
2025-01-09 15:41:54 -05:00
arturovt
068f4fb68a refactor(animations): drop warning functions in production (#59408)
Prior to this commit, functions that issued warnings were not wrapped with `ngDevMode` at the point
of invocation but had the `ngDevMode` check inside. This meant they acted as no-ops in production.
In this commit, we wrap them externally with `ngDevMode`, so they are entirely removed.

PR Close #59408
2025-01-09 13:15:06 -05:00
arturovt
8243c6eac4 refactor(platform-browser): remove Console from Hammer gestures (#59409)
Injecting the `Console` is redundant because it directly calls the global `console` object.
There is no reason to reference this class in Hammer gestures, as it is only used in development
mode. We can safely call the `console` object directly.

PR Close #59409
2025-01-09 13:09:52 -05:00
arturovt
a5ee32591d refactor(common): tree-shake fetch backend (#59418)
This commit updates the code of the HTTP code to make the `FetchBackend` class tree-shakable. The class is only needed with `withFetch()` is called and it should not be included into bundles that do not use that feature.

PR Close #59418
2025-01-09 13:05:57 -05:00
arturovt
57a98c38e4 refactor(platform-browser): drop Hammer token names in production (#59438)
In this commit, we drop `HAMMER_GESTURE_CONFIG` and `HAMMER_LOADER` injection token names in production.

PR Close #59438
2025-01-09 12:38:07 -05:00
arturovt
8b3c9aaff3 refactor(common): drop NullViewportScroller for client bundles (#59440)
In this commit, we replace the `isPlatformBrowser` runtime call with the `ngServerMode` in order to drop the `NullViewportScroller` for client bundles.

PR Close #59440
2025-01-09 12:33:05 -05:00
arturovt
9ab74540ab refactor(core): drop platform injection token names in production (#59400)
In this commit, we tree-shake the injection token names in production.

PR Close #59400
2025-01-09 12:28:18 -05:00
Kristiyan Kostadinov
2b4b7c3ebf fix(compiler-cli): handle more node types when extracting dependencies (#59445)
Fixes that the HMR dependency extraction logic wasn't handling some node types. Most of these are a bit edge-case-ey in component definitions, but variable initializers and arrow functions can realistically happen in factories.

PR Close #59445
2025-01-09 12:22:46 -05:00
Ethan Cline
fb67b10388 ci: Add self (Ethan Cline) as primitives-shared reviewer. (#59437)
Add self (Ethan Cline) as primitives-shared reviewer.

PR Close #59437
2025-01-09 10:31:30 -05:00