Commit graph

36863 commits

Author SHA1 Message Date
Lukas Spirig
ff98ccb193 feat(router): support custom elements for RouterLink (#60290)
PR Close #60290
2025-03-28 12:16:09 +00:00
Andrew Scott
1226eaad51 fix(router): Add missing types to transition (#60307)
The 'types' property was added recently and is available in all browsers that support view transitions

fixes #60285

PR Close #60307
2025-03-28 11:51:06 +00:00
Andrew Scott
0142ae1c8e refactor(router): Update tests to not use deprecated string tokens (#60378)
This replaces string tokens in the router tests with functional guads.

PR Close #60378
2025-03-28 11:50:11 +00:00
Andrew Scott
c57951d58f fix(router): Remove 'any' type from route guards (#60378)
This commit removes `'any'` from the type union for router guards and
replaces it with 'string', which will eventually also be removed. This
change allows TypeScript to infer the parameter types of functions when
using functional guards and enables stricter type-checking to ensure the
guard array contains valid values.

BREAKING CHANGE: The guards arrays on `Route` no longer include `any` in
the type union. The union includes functions for the functional guards
as well as a type matching `Injector.get`: `ProviderToken<T>|string`.
Note that string is still deprecated on both the route guards and
`Injector.get`.

PR Close #60378
2025-03-28 11:50:11 +00:00
Angular Robot
0fedf2cf80 build: update cross-repo angular dependencies (#60553)
See associated pull request for more information.

PR Close #60553
2025-03-28 02:19:16 +00:00
Angular Robot
0b34c58f5a build: lock file maintenance (#60526)
See associated pull request for more information.

PR Close #60526
2025-03-27 23:12:33 +00:00
Andrew Scott
5948cd03c5 fix(compiler-cli): Produce fatal diagnostic on duplicate decorated properties (#60376)
This prevents the compilation and language service from crashing.

fixes https://github.com/angular/vscode-ng-language-service/issues/2091

PR Close #60376
2025-03-27 20:26:42 +00:00
Doug Parker
de5c891404 refactor(devtools): display Wiz non-prop data as "State" (#60475)
This is the more common term for Wiz developers to reduce confusion between Wiz "props" and standard JS "properties".

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
96f36d62c8 refactor(devtools): use ng.getDirectiveMetadata for component name (#60475)
This reads the component name from `ng.getDirectiveMetadata`.

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
d639a8d1f9 refactor(devtools): display directive metadata from Wiz and ACX (#60475)
This updates the DevTools protocol to send Wiz/ACX metadata in addition to Angular metadata. Fortunately we don't need to worry about backwards compatibility here (`framework` is required for example), but the design roughly mirrors `DirectiveDebugMetadata` in `@angular/core`.

Beyond that, this is mostly plumbing through an extra data slice in the form of `props` provided by Wiz. An earlier version implemented `events` as their own slice as well, but was removed as there is currently no generic way to disambiguate events from any other form of callback passed in as a prop. Instead, event callbacks are visualized as functions under the "Props" category.

Working with `DirectiveMetadata` as a union is unfortunately a bit annoying since it requires casting to more specific `{Angular,Acx,Wiz}DirectiveMetadata` types for TS to allow property access, even when the properties are optional anyways.

This commit is mostly for adding Wiz, but does add a bit of ACX functionality which is not fully tested.

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
ebf6516190 refactor(devtools): make component-only properties on DirectiveMetadata optional (#60475)
This type was incorrect, as only components have `encapsulation` and `onPush` values. `ng.getDirectiveMetadata` does not return these properties for directive inputs.

Unfortunately the `| Partial<AngularComponentDebugMetadata>` is necessary to reference these properties or else TypeScript will reject their usage.

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
ab9dd73a92 refactor(devtools): removes unused classes (#60475)
These `cy-*` classes are not referenced in any styles and appear to be unused.

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
61ff42a263 refactor(devtools): remove Props suffix from DirectivePropertyResolver names (#60475)
This suffix will be confusing as we introduce new variants for Wiz in particular.

PR Close #60475
2025-03-27 20:26:12 +00:00
Doug Parker
d47cf58f10 refactor(core): update ng.getDirectiveMetadata to support Wiz and ACX (#60475)
This allows `ng.getDirectiveMetadata` to be implemented by Wiz and ACX with subtly different shapes to match the nuances of those frameworks.

Existing usage of `{Component,Directive}DebugMetadata` was moved over to `Angular{Component,Directive}DebugMetadata` as appropriate, since the implementation of `ng` in `@angular/core` is specific to Angular. Only the types support Wiz and ACX.

I opted to merge `ComponentDebugMetadata` and `DirectiveDebugMetadata` into a single type of all the frameworks including both components and directives (recall that components extend directives). The reasoning for this is because Wiz does not support directives (you can kind of think of "Wiz Directive" as an abstract class extended by "Wiz Components"). I felt that a `DirectiveDebugMetadata` containing only Angular and ACX types would be a bit of a trap and lead to bugs when used. It's safer to just have the single type containing all the possible results from `ng.getDirectiveMetadata`.

I also chose to leave the `ng` type as is internally, since `@angular/core` implements a specific concrete version of it narrowed to Angular types. Separately I defined an expanded `FrameworkAgnosticGlobalUtils` which redefines `ng.getDirectiveMetadata` to include Wiz and ACX. We want this type to exist in the Angular GitHub repo so it can be referenced as a common primitive across all three frameworks. This is sufficient for now, however longer term we will likely want to actually manually define the function types in this framework-agnostic interface and make Angular's version properly implement it rather than extend and overwrite Angular's type.

PR Close #60475
2025-03-27 20:26:12 +00:00
Benjamin Pabst
765ba1e181 fix(core): check ngDevMode for undefined (#60565)
This adds a check to "toSignal" whether ngDevMode is not undefined as this can happen for some MFE applications.

PR Close #60565
2025-03-27 20:25:40 +00:00
Kristiyan Kostadinov
e6d2afbfb9 fix(compiler): throw for invalid "as" expression in if block (#60580)
Adds some validation that the "as" expression in an `@if` block is valid.

Fixes #59939.

PR Close #60580
2025-03-27 20:24:58 +00:00
Ryan Russell
0cd7d3bdf0 fix(core): preserve comments in internal inject migration (#60588)
The internal-only combineMemberInitializers option
for the inject migration sometimes dropped the
doc comments from the members.

PR Close #60588
2025-03-27 20:24:22 +00:00
Pawel Kozlowski
76c60a609f refactor(core): move signal toString to primitives (#60365)
This change pushes the toString implementation of signal getters
down to the primitives package so it can be shared with other
frameworks.

Closes #59990

PR Close #60365
2025-03-27 19:43:19 +00:00
iteriani
4a107ed7af refactor(core): Return NOT_FOUND for retrieve instead of null (#60358)
This fits within the spec of the retrieve.

PR Close #60358
2025-03-27 19:39:59 +00:00
Angular Robot
640727434c build: update dependency firebase-tools to v14 (#60593)
See associated pull request for more information.

PR Close #60593
2025-03-27 19:36:35 +00:00
Shashwat Pathak
88119fac10 docs: update description for AfterRenderPhase.EarlyRead (#60527)
PR Close #60527
2025-03-27 18:33:23 +00:00
Andrew Kushnir
5c0335754a refactor(platform-browser): switching to relative imports within the platform-browser package (#60559)
This commit updates scripts within `packages/platform-browser` to relative imports as a prep work to the upcoming infra updates.

PR Close #60559
2025-03-27 18:31:52 +00:00
Andrew Kushnir
4923400791 refactor(platform-browser-dynamic): switching to relative imports within the platform-browser-dynamic package (#60559)
This commit updates scripts within `packages/platform-browser-dynamic` to relative imports as a prep work to the upcoming infra updates.

PR Close #60559
2025-03-27 18:31:52 +00:00
Andrew Kushnir
f773e08ee5 refactor(platform-server): switching to relative imports within the platform-server package (#60559)
This commit updates scripts within `packages/platform-server` to relative imports as a prep work to the upcoming infra updates.

PR Close #60559
2025-03-27 18:31:51 +00:00
Andrew Kushnir
30a61f12a7 refactor(core): update public API golden files (#60232)
This commit updates public API golden files as a result of switching to the relative import paths within the `@angular/core` package.

PR Close #60232
2025-03-27 18:29:35 +00:00
Andrew Kushnir
e5cc624b87 refactor(core): convert scripts within packages/core/testing to relative imports (#60232)
This commit updates scripts within `packages/core/testing` to relative imports as a prep work to the upcoming infra updates.

PR Close #60232
2025-03-27 18:29:35 +00:00
Andrew Kushnir
33c24624be refactor(core): convert scripts within packages/core/rxjs-interop to relative imports (#60232)
This commit updates scripts within `packages/core/rxjs-interop` to relative imports as a prep work to the upcoming infra updates.

PR Close #60232
2025-03-27 18:29:35 +00:00
Andrew Kushnir
006a14da89 refactor(animations): convert scripts within packages/animations to relative imports (#60230)
This commit updates scripts within `packages/animations` to relative imports as a prep work to the upcoming infra updates.

PR Close #60230
2025-03-27 18:28:01 +00:00
Andrew Kushnir
cfda43b97d refactor(benchpress): convert scripts within packages/benchpress to relative imports (#60230)
This commit updates scripts within `packages/benchpress` to relative imports as a prep work to the upcoming infra updates.

PR Close #60230
2025-03-27 18:28:00 +00:00
Jessica Janiuk
fd5c981a29 fix(core): fix regexp for event types (#60592)
This regexp accidentally worked. It was splitting by individual character and putting a pipe in rather than splitting by set of event types

PR Close #60592
2025-03-27 18:27:03 +00:00
arturovt
f7385b4140 refactor(service-worker): drop fromEvent (#60424)
In this commit, we remove `fromEvent` and replace it with a manually created observable to import fewer symbols from RxJS. Some codebases may not use `fromEvent` at all, but using it in a single place would still include it in the initial bundle.

PR Close #60424
2025-03-27 18:17:21 +00:00
Joey Perrott
e400424563 ci: update bazel RBE setup on CI and use trusted build configuration for upstream CI runs (#60589)
Update to use the latest bazel/configure-remote action from dev-infra and set up trusted builds
for CI runs from upstream branches.

PR Close #60589
2025-03-27 18:16:09 +00:00
Andrew Kushnir
a26904fffe build: add build step to the public API extractor script (#60578)
This commit adds a step where we build all found targets in parallel, which speeds up the process of completing public API extractor test/update.

PR Close #60578
2025-03-27 18:13:40 +00:00
Andrew Kushnir
a16ba58e2b build: add build step to the symbol extractor script (#60573)
This commit adds a step where we build all found targets in parallel, which speeds up the process of completing symbol extractor test/update.

PR Close #60573
2025-03-27 18:13:04 +00:00
Alan Agius
9e8a1c933f refactor(docs-infra): minor clean up in testing helpers (#60581)
Modernize code of testing-helper

PR Close #60581
2025-03-27 18:12:31 +00:00
Alan Agius
d4e73f0fd8 refactor(docs-infra): remove redundant overrides in FakeWebContainer (#60581)
This is required to fix
```
adev/shared-docs/testing/testing-helper.ts💯12 - error TS2416: Property 'on' in type 'FakeWebContainer' is not assignable to the same property in base type 'WebContainer'.
  Type '{ (event: "port", listener: PortListener): Unsubscribe; (event: "server-ready", listener: ServerReadyListener): Unsubscribe; (event: "error", listener: ErrorListener): Unsubscribe; (event: "preview-message", listener: PreviewMessageListener): Unsubscribe; }' is not assignable to type '{ (event: "port", listener: PortListener): Unsubscribe; (event: "server-ready", listener: ServerReadyListener): Unsubscribe; (event: "preview-message", listener: PreviewMessageListener): Unsubscribe; (event: "error", listener: ErrorListener): Unsubscribe; (event: "xdg-open", listener: OpenListener): Unsubscribe; (ev...'.
    Types of parameters 'event' and 'event' are incompatible.
      Type '"xdg-open"' is not assignable to type '"port"'.

100   override on(event: 'server-ready', listener: ServerReadyListener): Unsubscribe;
               ~~
```

See: https://github.com/angular/angular/actions/runs/14098789522/job/39491059550?pr=60526

PR Close #60581
2025-03-27 18:12:31 +00:00
hawkgs
b938f0ce94 docs(docs-infra): fix navigation component UI bugs (#60583)
- Detachment of the navigation from the left window border
- Odd horizontal scroll when there is a URL fragment and the viewport width <900px

PR Close #60583
2025-03-27 18:11:38 +00:00
Manimaran T
79888a54a3 docs(docs-infra): fix correct HTML tag typo in welcome message (#60569)
PR Close #60569
2025-03-27 18:11:02 +00:00
hawkgs
77b5eed024 refactor(devtools): extract and organize colors into themes (#60374)
Extract all colors from the stylesheets, reduce their number by merging the similar ones and organize them into themes represented by CSS variables.

PR Close #60374
2025-03-27 18:10:28 +00:00
Gerome Grignon
c65259c8a5 docs: lint code examples (#59979)
PR Close #59979
2025-03-27 18:09:45 +00:00
Gerome Grignon
2468bd7282 docs: migrate reactive forms to standalone (#59979)
PR Close #59979
2025-03-27 18:09:44 +00:00
Gerome Grignon
bd4cffe1ae docs: migrate reactive forms to standalone (#59979)
PR Close #59979
2025-03-27 18:09:44 +00:00
Joey Perrott
98bf4d5afd build: disable remote upload of local action results to RBE cache (#60568)
disable remote upload for local actions

PR Close #60568
2025-03-26 20:48:16 -07:00
hawkgs
8559c794a8 docs(docs-infra): fix CSS media queries boundaries (#60564)
Make lower boundaries exclusive, so we avoid conflicts with the upper boundaries.

PR Close #60564
2025-03-26 20:47:32 -07:00
Kristiyan Kostadinov
1e6faad479 fix(compiler-cli): correctly parse event name in HostListener (#60561)
Fixes that we weren't accounting for targeted events when creating the AST for `@HostListener`-decorated members.

PR Close #60561
2025-03-26 20:46:45 -07:00
Kristiyan Kostadinov
7e03af898e fix(compiler-cli): set correct target when type checking events (#60561)
Currently the TCB generation code doesn't handle targeted events (e.g. `(document:click)`) which ends up binding to the current element and can have type inference implications. These changes take the event's `target` into account.

PR Close #60561
2025-03-26 20:46:45 -07:00
Kristiyan Kostadinov
ec8c8f827e refactor(compiler): allow name parsing logic to be reused (#60561)
Moves the logic for parsing event names out into methods on the `BindingParser` so we don't have to duplicate it. Also updates the types to more accurately represent the runtime value.

PR Close #60561
2025-03-26 20:46:45 -07:00
Paul Gschwendtner
9f18c7cc74 fix(compiler-cli): support relative imports to symbols outside rootDir (#60555)
By default, the compiler-cli uses the relative import strategy when
there is no `rootDir` or `rootDirs`. This is expected as everything is
assumed to be somehow reachable through relative imports.

With `rootDirs` that allow for a "virtual file system"-like environment,
the compiler is not necessarily able to always construct proper relative
imports. The compiler includes the `LogicalProjectStrategy` for this
reason. This strategy is able to respect `rootDirs` to construct
relative paths when possible.

This logic currently accidentally triggers when there is a `rootDir`
set. This option is not to be confused with the virtual directory
option called `rootDirs`. The compiler currently confuses this and
accidentally enters this mode when there is just a `rootDir`— breaking
in monorepos that imports can point outside the `rootDir` to e.g. other
compilation unit's `.d.ts` (which is valid; just not `.ts` sources can
live outside the root dir).

This is necessary for our Bazel toolchain migration.

PR Close #60555
2025-03-26 20:45:55 -07:00
Jessica Janiuk
309f269e91 docs: add more details about event replay (#60554)
PR Close #60554
2025-03-26 20:45:04 -07:00
Kristiyan Kostadinov
da784a9445 refactor(core): add type to disambiguate event listeners (#60549)
Adds a utility type to make it easier to distinguish wrapped and unwrapped listeners. Also adds a type for event callbacks so we don't need to repeat it everywhere.

PR Close #60549
2025-03-26 20:44:31 -07:00