Commit graph

32064 commits

Author SHA1 Message Date
Matthieu Riegler
97897eebd8 docs(docs-infra): Remove leading path from zipped files. (#59726)
In certain circonstances, a leading slash in the file paths created a incorrect unarchived project.

fixes #57075

PR Close #59726
2025-01-28 20:33:23 +01:00
Joey Perrott
ccebbbae6e ci: prevent renovate from updating @bazel/ibazel (#59761)
Add @bazel/ibazel to the ignored deps list for renovate to prevent us from updating to a version that
is incompatible with our repository.

PR Close #59761
2025-01-28 19:17:34 +01:00
Luan Gong
b16d8a1c55 docs(core): Fix typo in documentation of linkedSignal (#59752)
PR Close #59752
2025-01-28 19:14:21 +01:00
Angular Robot
3c3620e84a build: update cross-repo angular dependencies (#59669)
See associated pull request for more information.

PR Close #59669
2025-01-28 18:51:00 +01:00
Tyler Luckewicz
3da7e908bb docs(docs-infra): fix gammatical error in two way binding with plain properties section (#59755)
PR Close #59755
2025-01-28 18:48:09 +01:00
Alan Agius
e2987a1d4a fix(service-worker): add missing rxjs peer dependency (#59747)
The `@angular/service-worker` package now explicitly declares `rxjs` as a peer dependency.

PR Close #59747
2025-01-28 13:09:50 +01:00
Alan Agius
c9045aa7fd build: remove @angular/common from Service Worker dependencies (#59747)
The `@angular/service-worker` package no longer directly depends on `@angular/common`.

PR Close #59747
2025-01-28 13:09:49 +01:00
Paul Gschwendtner
a8139f77ea ci: configure merge tool to enforce mandatory PR statuses (#59749)
The merge tool is currently hard-coded to only check `lint` as a
required status. This was added because at some point the old GitHub
robot was replaced with a so-called `unified-statuses` check GitHub
action; but that one never worked/impacted productivity of the team.

I've added support to the merge tool to require specific jobs/checks to
run, before allowing merge (can be forcibly ignored). We are using this
ability now to enforce a few "common" required jobs, as a safety measure
when GitHub didn't trigger CI runs (e.g. for new contributors).

This recently became a more prominent issue as the GitHub org enforces
that CI doesn't run for e.g. first time contributors.

PR Close #59749
2025-01-28 12:53:33 +01:00
hawkgs
3554dbccd1 build: revert back to @bazel/ibazel v0.16 (#59748)
v0.25 is causing issues with adev and devtools – file changes do not trigger a rebuild.

PR Close #59748
2025-01-28 12:42:38 +01:00
Pawel Kozlowski
c202682957 refactor(core): reuse host directive resolution logic (#59685)
Reuse host directive resolution logic in ComponentRef

PR Close #59685
2025-01-28 11:31:29 +01:00
Alex Rickabaugh
6c92d65349 fix(core): add hasValue narrowing to ResourceRef (#59708)
`hasValue` attempts to narrow the type of a resource to exclude `undefined`.
Because of the way signal types merge in TS, this only works if the type
of the resource is the same general type as `hasValue` asserts.

For example, if `res` is `WritableResource<string|undefined>` then
`.hasValue()` correctly asserts that `res` is `WritableResource<string>` and
`.value()` will be narrowed. If `res` is `ResourceRef<string|undefined>`
then that narrowing does _not_ work correctly, since `.hasValue()` will
assert `res` is `WritableResource<string>` and TS will combine that for a
final type of `ResourceRef<string|undefined> & WritableResource<string>`.
The final type of `.value()` then will not narrow.

This commit fixes the above problem by adding a `.hasValue()` override to
`ResourceRef` which asserts the resource is of type `ResourceRef`.

Fixes #59707

PR Close #59708
2025-01-28 09:40:29 +01:00
Alex Rickabaugh
127fc0dc84 fix(core): fix resource()'s previous.state (#59708)
When a resource first starts up, even if it transitions immediately to
`Loading` it should report a `previous.state` of `Idle`. It was reporting
`Loading` as the previous state in such a case because of an oversight in
the migration to `linkedSignal` which this commit addresses.

PR Close #59708
2025-01-28 09:40:29 +01:00
arturovt
b7dd0483d0 refactor(common): drop error messages in production (#59545)
Switches to using `RuntimeError` and drops error messages in production by replacing it with an error code.

PR Close #59545
2025-01-28 09:39:42 +01:00
arturovt
acdde4aa35 refactor(router): remove unused code (#59704)
This code is never used.

PR Close #59704
2025-01-28 09:38:34 +01:00
Angular Robot
3373b4f82a build: update github/codeql-action action to v3.28.6 (#59744)
See associated pull request for more information.

PR Close #59744
2025-01-28 09:08:46 +01:00
arturovt
762e56e210 refactor(common): drop platform check in PreconnectLinkChecker (#59714)
Replaces platform check within the `PreconnectLinkChecker` with the `ngServerMode` global.

PR Close #59714
2025-01-27 17:22:43 +01:00
hawkgs
69fe9163f5 docs(docs-infra): fix header layout for tablets (#59734)
The version picker and the theme and socials buttons were not properly styled.

PR Close #59734
2025-01-27 17:07:53 +01:00
arturovt
b409330223 refactor(service-worker): drop platform checks (#59475)
In this commit, we drop `isPlatformBrowser` checks in favor of `ngServerMode` compile-time variable.

PR Close #59475
2025-01-27 16:41:09 +01:00
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