Commit graph

32046 commits

Author SHA1 Message Date
Pawel Kozlowski
df143b486b refactor(core): remove unused LifecycleHooksFeature (#59678)
LifecycleHooksFeature seems to be unused and can be deleted.

PR Close #59678
2025-01-27 13:15:21 +01:00
Pawel Kozlowski
cfa9fc2098 refactor(core): simplify ComponentRef creation (#59678)
Move more logic to a constructor of a ComponentRef.

PR Close #59678
2025-01-27 13:15:21 +01:00
Pawel Kozlowski
9af14b25d1 refactor(core): simplify attributes extraction logic for ComponentRef (#59678)
Make extractAttrsAndClassesFromSelector to return TAttributes directly to
simplify the overall logic and remove unecessary code.

PR Close #59678
2025-01-27 13:15:21 +01:00
Sebastian Ochoa
fd7ee47bf7 fix(platform-browser): Update pseudoevent created by createMouseSpecialEvent to populate _originalEvent property (#59690)
This fixes an internal bug

PR Close #59690
2025-01-27 10:28:58 +01:00
Sebastian Ochoa
65cf061feb fix(platform-browser): Update pseudoevent created by createMouseSpecialEvent to populate _originalEvent property (#59690)
This fixes an internal bug

PR Close #59690
2025-01-27 10:28:58 +01:00
Sebastian Ochoa
af9d74710c fix(platform-browser): Update pseudoevent created by createMouseSpecialEvent to populate _originalEvent property (#59690)
This fixes an internal bug.

PR Close #59690
2025-01-27 10:28:58 +01:00
arturovt
5c1690f07d refactor(docs-infra): allow home to be cleaned up (#59683)
In this commit, we're using the `from()` in the `adev-home` component, which allows us to invert a dependency and avoid memory leaks. Because an `async` function would be executed even if the component is already destroyed.

PR Close #59683
2025-01-27 10:27:20 +01:00
arturovt
14ceec60fe refactor(docs-infra): prevent leak in tutorial component (#59675)
In this commit, we're using the `from()` in the `adev-tutorial` component, which allows us to invert a dependency and avoid memory leaks. Because `then()` would be executed even if the component is already destroyed.

PR Close #59675
2025-01-27 10:26:36 +01:00
Aaditree Jaisswal
c65c609491 docs: Add link to Language Service page from the Installation page (#59654)
PR Close #59654
2025-01-27 10:25:21 +01:00
Andrew Seguin
b8948f219c docs: fix broken material.angular.io test harness links (#59709)
PR Close #59709
2025-01-27 10:22:49 +01:00
waify
6d6708c5b9 docs: fix typo in signals-interop.md (#59724)
PR Close #59724
2025-01-27 09:55:42 +01:00
Kristiyan Kostadinov
0c3b75558a docs: add template string to supported literals (#59710)
Updates the docs since we'll have support for template strings in 19.2. Also mentions that tagged template string aren't supported.

Fixes #59160.

PR Close #59710
2025-01-27 09:26:14 +01:00
Matthieu Riegler
7daf268cff docs(docs-infra): bump tutorials to 19.1 (#59642)
PR Close #59642
2025-01-24 20:43:15 +01:00
arturovt
10cdf0afae refactor(common): tree-shake PreloadLinkCreator for client bundles (#59431)
In this commit, we tree-shake the `PreloadLinkCreator` for client bundles because it's targeting only server code. We use the pending tasks service to contribute to app stability by waiting for the module to load.

PR Close #59431
2025-01-24 17:17:58 +01:00
Kristiyan Kostadinov
82876242e5 fix(core): ensure type is preserved during HMR (#59700)
Fixes an internal HMR issue where the type might be replaced when swapping out the definition. Externally this is a no-op.

PR Close #59700
2025-01-24 17:16:58 +01:00
arturovt
d634ca7633 refactor(common): simplify joinWithSlash (#59484)
The new version is 2x smaller in the reduced code size; as thus this eliminates extra bytes. Refactors `joinWithSlash` function to reduce code size and improve readability. Added checks to handle leading and trailing slashes more concisely and provided comments for clarity.

PR Close #59484
2025-01-24 17:16:11 +01:00
arturovt
e271639022 refactor(core): re-use isDetachedByI18n (#59668)
We already have a function called `isDetachedByI18n` which checks whether a `tNode` is in `isDetached` state; as thus, there's no reason to apply those checks manually.

PR Close #59668
2025-01-24 17:15:08 +01:00
Alex Rickabaugh
168516462a feat(core): support default value in resource() (#59655)
Before `resource()` resolves, its value is in an unknown state. By default
it returns `undefined` in these scenarios, so the type of `.value()`
includes `undefined`.

This commit adds a `defaultValue` option to `resource()` and `rxResource()`
which overrides this default. When provided, an unresolved resource will
return this value instead of `undefined`, which simplifies the typing of
`.value()`.

PR Close #59655
2025-01-24 13:39:02 +01:00
arturovt
edb8407d4f refactor(common): simplify null/undefined check in keyvalue pipe (#59696)
In this commit, we remove the separate `a === undefined` and `a === null` checks and replace them with `a == null`. Using `a == null` is better and more concise because it checks for both `null` and `undefined` in a single operation. The loose equality `==` is specifically designed to treat `null` and `undefined` as equivalent. This change only reduces some bytes in the code and simplifies it, with no performance impact, as modern JavaScript engines handle `a == null` efficiently. Additionally, comments have been added for clarification.

PR Close #59696
2025-01-24 12:45:04 +01:00
Angular Robot
434568ba28 docs: update Angular CLI help [main] (#59699)
Updated Angular CLI help contents.

PR Close #59699
2025-01-24 12:31:36 +01:00
arturovt
e4838310c9 refactor(forms): wrap _checkParentType with ngDevMode (#59489)
The `_checkParentType` bodies are wrapped with `ngDevMode`, meaning they act as no-ops in production. We can wrap the actual calls to `_checkParentType` with `ngDevMode` to prevent calling no-op functions in production

PR Close #59489
2025-01-24 11:51:36 +01:00
Ezequiel Cicala
819795bf51 docs: replace word in using-component-harnesses.md (#59687)
PR Close #59687
2025-01-24 11:29:19 +01:00
Doug Parker
3f53dd1129 docs: sort application and browser-esbuild builders first (#59686)
This emphasizes these as the default/preferred options over `browser` builder.

PR Close #59686
2025-01-23 14:27:52 -08:00
Ezequiel Cicala
6d9bc7654d docs: add missing word on components-scenarios.md (#59681)
PR Close #59681
2025-01-23 14:26:23 -08:00
Ezequiel Cicala
f68e81ea2c docs: add another missing word on components-scenarios.md (#59680)
PR Close #59680
2025-01-23 14:25:50 -08:00
arturovt
8897e96fa6 refactor(core): prevent duplicating componentOffset checks (#59611)
The `type_checks` module already exposes a utility function that checks whether `TNode.componentOffset` is greater than -1. There is no need to check that property manually in other places, as we can reuse the helper function.

PR Close #59611
2025-01-23 14:23:29 -08:00
arturovt
6fc180b3ff refactor(common): prevent duplicating Accept header name (#59546)
Drops some bytes by moving `Accept` into a variable, which is then minified to something like `var a="Accept"` and reused in all the places.

PR Close #59546
2025-01-23 14:21:51 -08:00
arturovt
c7b6e1107c fix(router): prevent error handling when injector is destroyed (#59457)
In this commit, we prevent error handling when the root injector is already destroyed. This may happen when the observable completes before emitting a value, which would trigger a `catchError` block that attempts to call `runInInjectionContext` on a destroyed injector.

PR Close #59457
2025-01-23 14:21:07 -08:00
hawkgs
6ce8ed7404 refactor(devtools): select the root element by default (#59626)
Select the application root element when you start Angular DevTools.

PR Close #59626
2025-01-22 13:34:40 -08:00
Pawel Kozlowski
3f6d9ff113 refactor(core): reuse directive instantiate logic (#59633)
This refactor reuses the existing directive instantiation
logic for a given component.

PR Close #59633
2025-01-22 13:27:48 -08:00
Jessica Janiuk
f862ace181 fix(core): fixes test timer-based test flakiness in CI (#59674)
This converts two tests that rely on timers to use fakeAsync. This resolves the flakiness.

PR Close #59674
2025-01-22 13:27:05 -08:00
arturovt
ae1dfdf82a refactor(core): prevent duplicating isRootView checks (#59614)
The `type_checks` module already exposes a utility function that checks whether `LView` is marked as a root view. There is no need to check flags in other places, as we can reuse the helper function.

PR Close #59614
2025-01-22 12:30:27 -08:00
Pawel Kozlowski
afd8df3522 refactor(core): use linkedSignal primitives (#59599)
This change refactors the linkedSignal to use implementation
from the shared primitives package.

PR Close #59599
2025-01-22 12:29:37 -08:00
Pawel Kozlowski
a0b5fdfe02 test(core): additional linkedSignal tests (#59599)
Adds a test veryfing that downstream dependencies are
not recomputed when the source of the linkedSignal is
equal to its current value.

PR Close #59599
2025-01-22 12:29:37 -08:00
Andrew Kushnir
2ed633a259 release: cut the v19.2.0-next.0 release 2025-01-22 11:49:18 -08:00
Andrew Kushnir
ec8c288968 docs: release notes for the v19.1.3 release 2025-01-22 11:43:44 -08:00
Jens Kuehlers
61302cb4b6 docs: add Bluesky links (#59661)
PR Close #59661
2025-01-22 07:58:15 -08:00
Kristiyan Kostadinov
d66881d172 fix(migrations): avoid applying the same replacements twice when cleaning up unused imports (#59656)
If a file ends up in multiple programs, the unused imports migration was counting it twice. This was fine since the string replacements were handling it correctly, but it was printing out incorrect data.

These changes rework the migration to de-duplicate the replacements and produce the data from the de-duplicated results.

PR Close #59656
2025-01-22 07:57:38 -08:00
Pawel Kozlowski
6c96d795bc Revert "refactor(core): reuse directive instantiate logic (#59633)" (#59659)
This reverts commit c089d21eb0.

PR Close #59659
2025-01-22 12:19:17 +01:00
Pawel Kozlowski
c089d21eb0 refactor(core): reuse directive instantiate logic (#59633)
This refactor reuses the existing directive instantiation
logic for a given component.

PR Close #59633
2025-01-21 13:33:09 -08:00
Andrew Kushnir
4f46b02f29 test(zone.js): reduce flakiness of a timer-related test (#59653)
This commit updates a flaky test to increase the amount of work (more `for` loop iterations) to minimize the chance of getting the same timestamp after that work.

PR Close #59653
2025-01-21 13:20:24 -08:00
Kristiyan Kostadinov
fe8a68329b feat(compiler): support untagged template literals in expressions (#59230)
Updates the compiler to support untagged template literals inside of the expression syntax (e.g. ``hello ${world}``).

PR Close #59230
2025-01-21 12:04:53 -08:00
Kristiyan Kostadinov
6960ec0c03 refactor(compiler-cli): handle template literals in ngtsc (#59230)
Updates the translators that convert expression ASTs to account for template literals.

PR Close #59230
2025-01-21 12:04:53 -08:00
Kristiyan Kostadinov
4016aa3229 refactor(compiler): clean up tagged templates in output AST (#59230)
Makes the following cleanups in the output AST:
* The `TemplateLiteral` and `TemplateLiteralElement` nodes have been renamed to `TemplateLiteralExpr` and `TemplateLiteralElementExpr` respectively for consistency and to avoid overlaps with the expression AST nodes.
* The `TemplateLiteralExpr` and `TemplateLiteralElementExpr` have been refactored to be `Expression`s for correctness. This involves updating some existing code.
* The `TaggedTemplateExpr` has been renamed to `TaggedTemplateLiteralExpr` for consistency.

PR Close #59230
2025-01-21 12:04:52 -08:00
Kristiyan Kostadinov
eb7e765e2f refactor(compiler): produce AST for template literals (#59230)
Updates the compiler to parse the template literal tokens into the new `TemplateLiteral` and `TemplateLiteralElement` AST nodes.

PR Close #59230
2025-01-21 12:04:52 -08:00
Kristiyan Kostadinov
353005b97f refactor(compiler): tokenize template literals (#59230)
Reworks the lexer to produce tokens for template literal expressions.

PR Close #59230
2025-01-21 12:04:52 -08:00
Kristiyan Kostadinov
98998bbd42 refactor(compiler): allow lexer to produce multiple tokens (#59230)
Reworks the lexer's scanner to produce more than one token at a time. This can be useful for the cases where one token means the end of another one.

Also cleans up the scanner by making all non-essential methods private and using strict equality everywhere.

PR Close #59230
2025-01-21 12:04:52 -08:00
Pawel Kozlowski
76c4a77af7 refactor(core): move TNode manipulation logic to its own file (#59601)
Move TNode manipulation logic to its own file and update existing refereces.

PR Close #59601
2025-01-21 10:48:44 -08:00
Charles Lyding
5a13dff22c fix(compiler-cli): handle new expressions when extracting dependencies (#59637)
Updates the HMR dependencies extraction logic to handle new expressions.
For example, `deps: [[new Optional(), dep]]`.

PR Close #59637
2025-01-21 10:47:43 -08:00
Charles Lyding
8de0f3f79b fix(compiler-cli): handle conditional expressions when extracting dependencies (#59637)
Updates the HMR dependencies extraction logic to handle conditional expressions.
For example, `providers: [condition ? providersA : providersB]`.

PR Close #59637
2025-01-21 10:47:43 -08:00