Compare commits

...

663 Commits

Author SHA1 Message Date
Andrew Kushnir 3bafe23c34 release: cut the v20.3.11 release 2025-11-12 08:24:17 -08:00
Matthew Beck 9419ea348a fix(compiler): support complex selectors in :nth-child()
:nth-child() (and its siblings) support complex expressions, e.g.
`:nth-child(2n of :is(.foo, .bar))`. Previously we'd choke because of
the `:is()`. Now, we reuse the `_parenSuffix` subexpression to match
nested parentheses the same way we do for :host() and :host-context().
Note that we only support 3 levels of nesting, so a selector like
`:nth-child(n of :is(:has(:not(.foo))))` will still break.

I'll say yet again that we really should add a proper parser so we stop
getting bug reports like this :)

Fixes #64913

(cherry picked from commit 24cfd5a0ed)
2025-11-11 14:03:36 -08:00
Andrew Scott f00fb46347 Revert "feat(service-worker): notify clients about version failures (#62718)"
This reverts commit 6d011687ec.

issue #63500 reproduces at head on the main branch in the dev app.
Reverting this change along resolves it.

fixes https://github.com/angular/angular/issues/63500

(cherry picked from commit 4af408afcb)
2025-11-11 12:48:48 -08:00
SkyZeroZx a8c577d3af docs: add reference to Built-in Pipes in multiple pipe files
(cherry picked from commit d999667b57)
2025-11-11 08:47:11 -08:00
RobinReinecke 0baa28b886 docs: correct mermaid code block formatting
(cherry picked from commit 07703875b5)
2025-11-11 08:33:31 -08:00
SkyZeroZx c59fa8b85a docs: improve discoverability in service worker documentation
(cherry picked from commit dde18c2303)
2025-11-11 08:32:18 -08:00
Devin Chasanoff e0407c0fe3 docs: add links to SDUI example and livestream
(cherry picked from commit 5af33724a4)
2025-11-10 14:16:22 -08:00
Andrew Kushnir 8922cae0f9 Revert "refactor(http): migrate XSRF classes to use inject() function"
This reverts commit 2ad6b729a1.

Revert reason: the change relies on the code that is not available in the `20.3.x` branch (the `HttpXsrfCookieExtractor` class is not marked as `providedIn: "root"`).
2025-11-10 13:56:23 -08:00
arturovt 5047849a4a fix(common): remove placeholder image listeners once view is removed
Prior to this commit, attempting to resolve a `ChangeDetectorRef` after views or app have been destroyed would result in an error. In this commit, we clean up listeners once the view is destroyed, before the placeholder loads or fails to load.

(cherry picked from commit feb86e3fde)
2025-11-10 12:05:23 -08:00
arturovt 4c66fe4796 refactor(core): mark VERSION as @__PURE__ for better tree-shaking
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively retain the `VERSION` instantiation even when unused. With the annotation, the constant can be tree-shaken away in production builds if not referenced, reducing bundle size.

(cherry picked from commit d3f67f6ca8)
2025-11-10 12:04:08 -08:00
Alan Agius 742122d5a7 docs: use markdown code fences in service worker docs
Replaces the <docs-code> component with standard markdown code fences in the service worker documentation. This improves the readability and maintainability of the documentation.

(cherry picked from commit d42f9ce3a9)
2025-11-10 12:03:35 -08:00
SkyZeroZx 2ad6b729a1 refactor(http): migrate XSRF classes to use inject() function
Remove constructor injection in favor of inject() calls

(cherry picked from commit 55be477979)
2025-11-10 09:49:13 -08:00
Shuaib Hasan Akib b20bf5dc70 docs: add shell language to CLI installation examples
Added `language="shell"` to installation command examples to display
the shell prompt `$` icon consistently across npm, pnpm, yarn, and bun
code blocks.

(cherry picked from commit 27d54654e3)
2025-11-10 08:01:33 -08:00
Shuaib Hasan Akib 77ca0d7534 docs(docs-infra): simplify file headers in <docs-code> blocks
Removed redundant "src/app/" prefix from file headers (e.g.,
"src/app/open-close.component.ts" → "open-close.component.ts")
to make code examples cleaner and more focused.

(cherry picked from commit e0a4bdd72b)
2025-11-10 08:00:37 -08:00
Shuaib Hasan Akib c5a41aae34 docs(docs-infra): removed unused import and use self-closing syntax for component
(cherry picked from commit 8c6619a531)
2025-11-10 08:00:10 -08:00
SkyZeroZx 7b1a47866a docs: improve discoverability of forms
(cherry picked from commit e3fc57e8fc)
2025-11-10 07:57:47 -08:00
jnizet fedb0831c5 fix(docs-infra): avoid double slash in sitemap urls
Previously, the URLs in the  generated sitemap contained double slashes between the host and the path. It's not the case anymore.

fix #65022

(cherry picked from commit afe5fc0399)
2025-11-10 07:53:43 -08:00
SkyZeroZx 63f1d94c2f docs: correct import path and self-closing tag in ng-content example
(cherry picked from commit 6a2f4a88de)
2025-11-10 07:52:50 -08:00
Matthew Beck 2531863909 test(compiler): add test for :host:has(> .foo)
I took a quick look at my recent changes to see if I had inadvertently
fixed this bug, but I couldn't seem to reproduce it even before my
changes. Seems like it's working, though.

Closes #58436

(cherry picked from commit 4b871b139b)
2025-11-10 07:51:20 -08:00
Matthew Beck 106b9040df fix(compiler): support commas in :host() argument
This change adds support for commas in :host() arguments (e.g.
`:host(:not(.foo, .bar))` as well as in nested parens when the argument
is applied without parens (e.g. `:host:not(:has(.foo, .bar))`).
Previously these selectors would receive an extra `[nghost]` attr, e.g.
`[nghost]:not(.foo, [nghost].bar)`.

I didn't file a bug for this one, but it's also blocking on an internal
LSC. Like the other CSS changes, I'll run a TGP to confirm this isn't
breaking.
2025-11-10 07:49:19 -08:00
Matthew Beck f9d0818087 fix(compiler): support arbitrary nesting in :host-context()
Previously we supported one level of nested pseudo-element selectors
inside :host-context(), e.g. :host-context(:is(.foo, .bar)). This was
based on a regex-based approach. We could support deeper levels of
nesting by updating the regex, but using a regex approach prohibits us
from supporting arbitrary nesting.

Rather than just adding one more level to the existing expression, I've
added a new generator function which splits selectors on commas in a
parenthesis-aware way. This allows us to support arbitrary nesting.

It's likely we'll want to reuse this in other places where we're not as
careful today. We'll probably do this on a request-based basis, though.

Fixes #59176
2025-11-10 07:49:19 -08:00
Andrew Kushnir b47054c52e Revert "fix(compiler): support commas in :host() argument"
This reverts commit 1e09bdc114.

Revert reason: the change relies on helper functions that do not exist in `20.3.x` branch (only exist in `main`).
2025-11-07 16:03:07 -08:00
Danny Koppenhagen f04cf2299b docs(core): add a11y considerations related to @defer()
closes #53466

(cherry picked from commit d2b854b37e)
2025-11-07 15:27:13 -08:00
Matthew Beck 1e09bdc114 fix(compiler): support commas in :host() argument
This change adds support for commas in :host() arguments (e.g.
`:host(:not(.foo, .bar))` as well as in nested parens when the argument
is applied without parens (e.g. `:host:not(:has(.foo, .bar))`).
Previously these selectors would receive an extra `[nghost]` attr, e.g.
`[nghost]:not(.foo, [nghost].bar)`.

I didn't file a bug for this one, but it's also blocking on an internal
LSC. Like the other CSS changes, I'll run a TGP to confirm this isn't
breaking.

(cherry picked from commit 680c3c7bff)
2025-11-07 10:43:36 -08:00
Shuaib Hasan Akib 143883afe3 docs(docs-infra): use self-closing syntax for component examples
Replaced multiple component tags such as `<example></example>` with
self-closing syntax (`<example />`) across documentation examples.
This improves readability and aligns with the current Angular
style conventions.

(cherry picked from commit a2cd36777a)
2025-11-07 10:24:40 -08:00
SkyZeroZx b8972dad85 refactor(devtools): replace HostListener with host metadata for keydown handling
Uses host metadata instead of the HostListener decorator for keydown events

(cherry picked from commit c74367c5de)
2025-11-07 15:44:45 +00:00
khanhkhanhlele 7f8336d9e0 docs: Fix typos in some files
(cherry picked from commit a625f6bb20)
2025-11-07 15:44:07 +00:00
tsc036 41466a7bbf refactor(core): move profile_types.ts to primtives
move profile_types.ts so the types can be used in Wiz code

(cherry picked from commit cf47ce2db9)
2025-11-06 22:22:37 +00:00
SkyZeroZx 1dcecdf823 refactor(platform-browser): remove unused Platform ID dependency from DomRendererFactory2
Eliminates the unnecessary injection and usage of Platform ID in the renderer factory logic, along with related test scaffolding cleanup

(cherry picked from commit 5343001835)
2025-11-06 20:00:49 +00:00
Matthew Berry 036c5d2a07 fix(compiler): support one additional level of nesting in :host()
Previously we supported one level of nested parentheses inside of a
`:host()` selector, e.g. `:host(:not(p))`. This caused a breakage in g3
when I migrated a selector from `:host:not(:has(p))` to
`:host(:not(:has(p)))`. This change adds support for just one more level
of nesting.

It'd be nice to move everything to a real CSS parser (or even update it
to count parentheses like I did with :host-context()), but I wasn't able
to get that to work in ~20 minutes and I'm focusing on other things at
the moment.

This change punts the problem until somebody tries to use just one more
level of nesting in a selector.

Fixes #64830

(cherry picked from commit 444143758e)
2025-11-06 18:53:46 +00:00
Alan Agius ee578d3e86 build: format md files
Format all md files
2025-11-06 10:10:22 -08:00
Jessica Janiuk dcdd1bcdbb fix(core): skip leave animations on view swaps
We accounted for skipping leave animations during moves, but not swaps.
This accounts for the swap cases and updates how we deal with swaps and
moves. Now we always queue animations and then essentially dequeue them
if we attach them back in the same render pass.

fixes: #64818
fixes: #64730
2025-11-06 09:46:52 -08:00
tsc036 d6ef181f6c refactor(core): export types from primitives
export Version type and a type for linkedSignal previous value so they can be used for the Wiz implementations

(cherry picked from commit 104f7d57c1)
2025-11-06 16:34:57 +00:00
SkyZeroZx feab482684 docs: correct formatting in dependency injection guides
(cherry picked from commit 61066071cf)
2025-11-06 16:34:29 +00:00
Erik Wegner ab94cd2b95 docs: Add the missing function call to use the signal's actual value
(cherry picked from commit e18aac88d4)
2025-11-05 11:47:17 -08:00
Andrew Scott 098ed8cf16 release: cut the v20.3.10 release 2025-11-05 18:36:23 +00:00
Matthieu Riegler 22d190c0b9 docs(docs-infra): fix heading layout on mobile
Long code blocks overflow the headings on narrow screen (like mobiles), this messes up the global layout of the page. With the ellipsis with fix that.

fixes #64845

(cherry picked from commit 7f44345db3)
2025-11-05 09:49:50 -08:00
SkyZeroZx 744cd5c51c refactor(http): simplifies destruction tracking using destroyed property
Replaces the manual destroyed state with destroyed property

(cherry picked from commit 44435ea97b)
2025-11-05 09:05:32 -08:00
Lukas Matta a45e6b2b66 fix(migrations): Prevent removal of templates referenced with preceding whitespace characters
In https://github.com/angular/angular/pull/64745, a fix was introduced for templates referenced with a trailing semicolon. However, templates are still incorrectly removed when there are whitespace characters before the template name.

This commit updates the control flow migration logic to ensure templates referenced with preceding whitespace are not removed.

Fixes #64854

(cherry picked from commit 5b210e97af)
2025-11-04 15:26:06 -08:00
SkyZeroZx c374e80655 docs(docs-infra): add missing meta tags for author, keywords, and Twitter
(cherry picked from commit b5e37ffb77)
2025-11-04 14:58:31 -08:00
Joey Perrott 43f7f41d67 fix(docs-infra): properly join url parts
Properly join the url parts in the sitemap as path.join removed one of the slashes in the base url
2025-11-04 22:49:36 +00:00
Joey Perrott ec9b0742a8 fix(docs-infra): properly expose the prerendered routes for sitemap generation
Properly expose the prerendered routes for sitemap generation rather than only copying the browser directory
2025-11-04 19:18:36 +00:00
Matthieu Riegler 0a0fe44e61 feat(docs-infra): generate the sitemap for angular.dev
We automatically generate the sitemap for the angular.dev deployment and include it in the assets pushed
to firebase.

Co-authored-by: Joey Perrott <josephperrott@gmail.com>
2025-11-04 18:41:01 +00:00
Angular Robot dd7cb3d3da docs: update Angular CLI help
Updated Angular CLI help contents.
2025-11-04 18:06:43 +00:00
Gerome Grignon 1b6d0cff40 docs(router): uniformize lazy loading syntax
(cherry picked from commit 8f49af90d0)
2025-11-04 09:39:19 -08:00
SkyZeroZx 7438b9cc26 refactor(core): Removes unused flag for onDestroy
Eliminates an unnecessary configuration flag

(cherry picked from commit 2ad1b5979f)
2025-11-03 20:21:04 -08:00
SkyZeroZx 4f7b97cc21 docs: simplify tutorial signals with self-closing component tags
(cherry picked from commit b61847f877)
2025-11-03 16:34:44 -08:00
SkyZeroZx d0b1dfaf0d docs: Update highlight inputs & code block formatting in component guides
(cherry picked from commit 82a579c7e6)
2025-11-03 16:32:46 -08:00
Shuaib Hasan Akib 3d6a206e9b docs: remove standalone: true since it's now the default
Removes redundant `standalone: true` declarations from code examples.
Standalone components are now the default in Angular, so the flag is
no longer necessary in documentation snippets.

(cherry picked from commit c4c7fb88ac)
2025-11-03 16:27:02 -08:00
Jan Martin 192eb35212 ci: update handle for jkrems/hybrist
The username was changed earlier today and the old username is no
longer in use.
2025-11-04 00:22:15 +00:00
marktechson 65c78055cb docs: add v21 landing page
Adds a new landing page for developer events, starting with the v21 page. It also includes an ICS file link for calendar invites. Also updated the tests for the docs-pill to support two new attributes so developers can add the event to their calendars.

(cherry picked from commit 7a422c209a)
2025-11-03 15:59:28 -08:00
SkyZeroZx a57c03da85 docs(docs-infra): Improve font loading performance with preconnect
Adds preconnect links for Google Fonts domains to establish early
connections, reducing latency and improving font loading speed

(cherry picked from commit ffa19ddd3f)
2025-11-03 14:31:06 -08:00
SkyZeroZx 88952b5060 docs(docs-infra): Updates page title strategy to sync meta tags
Ensures that page title changes are reflected in relevant meta tags for improved SEO and sharing support

(cherry picked from commit 429672d6ab)
2025-11-03 13:30:19 -08:00
Kristiyan Kostadinov 840db59dc1 fix(compiler-cli): make required inputs diagnostic less noisy
Currently when a required input is missing, we produce a diagnostic on the entire start tag. This can be really noisy if there are already some attributes on the element.

This change switch to only highlighting the tag name instead.

(cherry picked from commit f233f7420a)
2025-11-03 13:27:51 -08:00
Matthieu Riegler 3409fe8e40 docs(docs-infra): ensure all redirections are absolute
fixes #64824

(cherry picked from commit 434ddbcfc9)
2025-11-03 13:01:53 -08:00
Matthieu Riegler 1572bafa45 refactor(core): Replace usages of the Function type for animations
`Function` is usually not recommended as its not specific enough.

(cherry picked from commit 79b7ac722a)
2025-11-03 12:05:06 -08:00
Matthieu Riegler debc41f038 ci: fix typings on exit
`exit` doesn't accept `null` as argument
2025-10-30 19:42:59 +00:00
SkyZeroZx 136883ab48 docs(devtools): Removes comment about enum deprecation
Removes comment about enum deprecation

(cherry picked from commit a0fe177682)
2025-10-30 12:40:18 -07:00
SkyZeroZx 90884be59f refactor(devtools): Removes redundant input undefined in angularVersion
Simplifies the initialization of the version input by removing
an unnecessary undefined

(cherry picked from commit bd27e96273)
2025-10-30 12:40:17 -07:00
Ben Hong a832b1c44e docs: update dependency injection guides (part 1) (#63652)
PR Close #63652
2025-10-30 19:22:41 +00:00
Matthieu Riegler a3b08ea0a4 docs(docs-infra): allow cors for json files (#64783)
fixes #64710

PR Close #64783
2025-10-30 17:50:06 +00:00
SkyZeroZx d7f8319704 docs: Standardize route parameter input signal & code block tags in routing docs (#64788)
PR Close #64788
2025-10-30 17:47:59 +00:00
Joey Perrott 040585d222 ci: make the github action fail when a firebase command fails (#64801)
When a firebase command line execution fails, the github action should be shown as failing instead of continuing to attempt to run and resulting in
an exit code of 0 and success

PR Close #64801
2025-10-30 17:24:26 +00:00
paszesoft 54ad3f6da2 docs: Rename TodoListItem to UserProfile and fix usage of isValidUserId
(cherry picked from commit 6cc6d93e70)
2025-10-29 18:49:46 +01:00
paszesoft 0bf40c446b Update button disabled property logic in template logical bug fix
isValidUserId = true is logically wrong to use to disable the Save button.
So is logically wrong to use isValidUserId = false to enable the Save button.
Also the default state of this button should be most likely disabled, if we are bothering to check, so the initial value of the signal should most likely be set to true.
To resolve these 2 issues, I propose to use:
- isInValidUserId instead of isValidUserId and:
- isInValidUserId = signal(true); // isValidUserId = signal(false);
After these 2 changes the snippet should make logical sense.

(cherry picked from commit b5dae85b27)
2025-10-29 18:49:45 +01:00
SkyZeroZx a5d9b3ff0e docs(docs-infra): Prevent empty extends clause in interface documentation
Interfaces with no extends clause were incorrectly rendered with a trailing extends keyword followed by nothing, resulting in invalid TypeScript syntax

(cherry picked from commit f3d056a065)
2025-10-29 18:48:34 +01:00
Shuaib Hasan Akib 16191e7f53 fix(docs-infra): extract header attribute as title in multifile code snippets
The DocViewer component's getCodeSnippetsFromMultifileWrapper method was not
extracting the header attribute from nested <docs-code> elements, causing the
ExampleViewer to fall back to displaying file paths instead of custom headers
in tab labels.

This change adds title extraction from the header attribute when processing
multifile code snippets, ensuring that custom headers are properly displayed
in the code viewer tabs.

Fixes #64760

(cherry picked from commit 5d8b76b4fa)
2025-10-29 18:48:04 +01:00
Kristiyan Kostadinov b517c9ca0a release: cut the v20.3.9 release 2025-10-29 18:35:27 +01:00
Kristiyan Kostadinov 77bc6eebee release: cut the v20.3.8 release 2025-10-29 18:12:56 +01:00
Kristiyan Kostadinov 9123e3d445 fix(docs-infra): fix broken adev tests (#64761)
Fixes some adev tests that are broken on main.

PR Close #64761
2025-10-29 14:11:54 +01:00
Lukas Matta 2edc82abe0 fix(migrations): Do not remove a template if it is referenced even with a trailing semilocon
This commit fixes a behavior where under certain conditions, the migration script ignored
a template reference with a trailing semicolon and incorrectly removed the definition
of a referenced template.

Fixes #64741

(cherry picked from commit 64cb08529d)
2025-10-29 10:51:00 +01:00
Matthieu Riegler adae565cbf docs(docs-infra): allow cors for json files
fixes #64710

(cherry picked from commit f2de963bf3)
2025-10-28 16:55:56 +01:00
Shuaib Hasan Akib 766559e08c fix(docs-infra): update guide navigation to remain active with query params
The navigation list component was using `routerLinkActive` with
`{ exact: true }`, which required an exact URL match including query
parameters. When visiting `/update-guide?v=19.0-20.0&l=1`, the link
`/update-guide` didn't match, so the active class wasn't applied.

Updated `routerLinkActiveOptions` to ignore query parameters while
maintaining exact path matching so the navigation item stays highlighted
when interacting with the update guide form.

(cherry picked from commit 33a872d90a)
2025-10-28 15:58:28 +01:00
tjshiu 92d189770b docs: align adev best practices with llm-eval
(cherry picked from commit 763db3a70b)
2025-10-28 15:08:16 +01:00
Shuaib Hasan Akib f96df920f9 docs: remove shell language from terminal output block
Changed terminal output code block in installation.md from shell
language to plain text to prevent rendering of shell prompt ($).
The block displays read-only log output that users should not
execute as commands.

(cherry picked from commit e9b29c359d)
2025-10-28 10:26:52 +01:00
Matthieu Riegler b03182075e docs: callout for provide function order
(cherry picked from commit be731deb7c)
2025-10-28 10:24:59 +01:00
Shuaib Hasan Akib 385bcbc2c0 refactor(router): remove redundant default value from routerOutletData input
Since `input()` defaults to `undefined`, the explicit initializer was unnecessary.
This improves clarity and reduces boilerplate.

(cherry picked from commit 8291760f9b)
2025-10-28 10:24:26 +01:00
Matt Lewis ca3fd7847f fix(core): Clear lView from IcuIteratorState when stack is empty to prevent memory leak
If a component template contains an icu expression it is being retained until the next change detection cycle for that template. This results in a net retention of only ever a single copy of the given lView but that creates an opportunity for compounding leaks.

Change the icu i18n_icu_container_visitor to free the IcuIteratorState retained lView when the stack is empty so that garbage collection can occur when the view is discarded.

(cherry picked from commit 59e648913c)
2025-10-27 19:42:21 +01:00
Shuaib Hasan Akib 14b5590f80 fix(docs-infra): preserve shell class for multifile code blocks
The ExampleViewer component was extracting only innerHTML from code
blocks in multifile examples, which lost the shell class applied by
the formatCode function. This caused the $ prompt to not appear for
shell commands in multifile blocks even when language="shell" was set.

Modified the Snippet interface to track shell language state and
updated getCodeSnippetsFromMultifileWrapper and getStandaloneCodeSnippet
methods to preserve the shell class. Updated example-viewer template
to conditionally apply the shell class to the code wrapper element.

Fixes inconsistency between standalone and multifile shell code blocks.

(cherry picked from commit 27e183330e)
2025-10-27 09:29:40 +01:00
idembele70 9b3574b9b9 docs: fix accessibility of @empty block message
(cherry picked from commit 202fceed73)
2025-10-27 09:29:14 +01:00
SkyZeroZx 5ce9d881e3 docs: Adds guide links to HTTP API docs for better discoverability
(cherry picked from commit c5e6b8bdc8)
2025-10-27 09:25:59 +01:00
aparziale 1fd8592d9c refactor: inject an instance of typescript-vfs.worker
Modified tsVfsWorker worker initialization logic

(cherry picked from commit e155a1e9d7)
2025-10-27 09:24:59 +01:00
Alan Agius 6daabb08e6 Revert "build: refactor location of best-practices.md"
This reverts commit 07a51872d5.

(cherry picked from commit 620e2c4926)
2025-10-24 19:02:41 +02:00
Matthieu Riegler 07d91d76de docs(docs-infra): Support linking to individual playground templates
(cherry picked from commit 6e7b3c2aa6)
2025-10-24 18:47:13 +02:00
SkyZeroZx 020f17694b feat(common): Blocks IPv6 localhost from preconnect checks
Prevents unnecessary preconnect warnings by adding IPv6 loopback ('[::1]') to the blocklist.

(cherry picked from commit a3639e2258)
2025-10-24 18:46:47 +02:00
SkyZeroZx 752986bfc2 refactor(common): Add missing OnDestroy interface in PreconnectLinkChecker
The OnDestroy interface was implemented but not declared; this adds the missing interface declaration

(cherry picked from commit 207baad322)
2025-10-24 18:46:47 +02:00
Andrew Scott 4b318d0cc0 fix(zone.js): Support jasmine v6
This fixes the jasmine patch to ensure we are patching the private APIs
off of the right location, which changed in v6.

see https://github.com/jasmine/jasmine/commit/168ff0a751b6280b170ce097410d77a4c7c1f449

(cherry picked from commit 48abe007d9)
2025-10-24 18:46:08 +02:00
Alan Agius 18c70315d7 build: refactor location of best-practices.md
This commit moves the best-practices.md file from adev/src/context to packages/core/resources. The BUILD.bazel files and other configuration files have been updated to reflect this change.

(cherry picked from commit 07a51872d5)
2025-10-24 18:45:35 +02:00
jase88 b97a677730 docs: update workspace configuration link in security documentation
(cherry picked from commit cdfd073448)
2025-10-24 15:25:14 +02:00
Matthieu Riegler b3f2ff1e07 docs(docs-infra): enable strict templates
(cherry picked from commit 57af0d7e1b)
2025-10-24 15:23:30 +02:00
SkyZeroZx 50d2670495 docs: Add router config options (#64529)
PR Close #64529
2025-10-23 12:34:57 +02:00
Andrew Scott bfa53cdd3f fix(router): handle parenthesized outlets without a name in DefaultUrlSerializer (#64507)
Previously, the `DefaultUrlSerializer` would incorrectly parse URLs with a parenthesized outlet that did not have a name, such as `/(left)`. This would result in an `undefined` outlet name in the serialized URL.

This commit fixes the issue by ensuring that parenthesized outlets without a name are treated as primary outlets.

fixes #58516. Based on the description, either the URL was constructed
manually or by custom serializer.

PR Close #64507
2025-10-23 12:33:58 +02:00
Andrew Scott 2a249b742c refactor(zone.js): Improve missing proxy zone error for jest imported (#64497)
test functions

This improves the fakeAsync error message when importing it, describe,
etc from jest

We will not be further expanding the ZoneJS patches to support
additional use-cases.

fixes #47603

PR Close #64497
2025-10-22 23:26:24 +00:00
Jessica Janiuk fbb0056563 release: cut the v20.3.7 release 2025-10-22 14:06:13 -07:00
Jessica Janiuk 2fad4d4ab6 fix(core): prevent duplicate nodes from being retained with fast animate.leave` calls (#64592)
We were clearing duplicate nodes when `animate.enter` fired fast, but not when solely `animate.leave` is fired and rapid toggles occur. This ensures that the `cancelLeavingNodes` function is called in all cases instead of just enter animations.

fixes: #64581

PR Close #64592
2025-10-22 19:07:35 +00:00
Angular Robot c85be3b2de build: update cross-repo angular dependencies to v20.2.10 (#64591)
See associated pull request for more information.

PR Close #64591
2025-10-22 18:14:52 +00:00
Angular Robot b05d8d9f09 build: update cross-repo angular dependencies (#64588)
See associated pull request for more information.

PR Close #64588
2025-10-22 15:53:41 +00:00
Angular Robot 4bc69159ca build: update cross-repo angular dependencies (#64586)
See associated pull request for more information.

PR Close #64586
2025-10-22 15:20:59 +00:00
Matthieu Riegler 00842026c4 docs(docs-infra): fix example viewer (#64580)
It was a regression introduced by #63915

PR Close #64580
2025-10-22 14:35:04 +00:00
SkyZeroZx 8244f187de docs(docs-infra): Add OnPush change detection for components (#64570)
Improves Angular's OnPush change detection strategy for main and search history components

PR Close #64570
2025-10-22 14:34:27 +00:00
Jessica Janiuk acadefbba9 docs: update animation guide with compatibility details (#64567)
This adds a section about using legacy animations alongside animate.enter and leave.

PR Close #64567
2025-10-22 14:30:45 +00:00
Angular Robot 24cc18686a build: update cross-repo angular dependencies (#64577)
See associated pull request for more information.

PR Close #64577
2025-10-22 14:28:14 +00:00
Angular Robot e0fb49c75f build: update dependency rules_nodejs to v6.6.0 (#64573)
See associated pull request for more information.

PR Close #64573
2025-10-22 14:26:48 +00:00
Jessica Janiuk 4c89a267c3 fix(core): pass element removal property through in all locations (#64565)
The `requireSynchronousElementRemoval` property was not being passed in all the locations it was needed. This was preventing leave animation timing from behaving properly in some cases.

fixes: #64525

PR Close #64565
2025-10-21 18:08:34 +00:00
Angular Robot e3f1c529f5 build: update cross-repo angular dependencies (#64564)
See associated pull request for more information.

PR Close #64564
2025-10-21 17:37:21 +00:00
JoostK bd38cd45a5 fix(animations): account for Element.animate exceptions (#64506)
In certain scenarios `Element.animate` fails, manifesting in an exception (Firefox)
or a null return value (Chromium). The null value is not conform WebIDL but handled
gracefully in this commit regardless.

Closes #64486

PR Close #64506
2025-10-21 16:49:43 +00:00
Angular Robot 50e2c54a14 build: update rules_browsers digest to 6a699bf (#64559)
See associated pull request for more information.

PR Close #64559
2025-10-21 16:43:34 +00:00
Angular Robot 67e25f6010 build: update dependency node to v22.21.0 (#64560)
See associated pull request for more information.

PR Close #64560
2025-10-21 16:42:17 +00:00
SkyZeroZx e568ddb2d2 docs: Standardizes code example formatting in Angular Tools and fixed highlight (#64554)
PR Close #64554
2025-10-21 15:19:28 +00:00
Jessica Janiuk 139b622957 refactor(core): clarify comments on enter animation queuing (#64550)
This just updates the comments and adds some tests to verify some of the queuing behavior for enter animations.

PR Close #64550
2025-10-21 15:17:14 +00:00
SkyZeroZx b0551419cd refactor(core): Removes unused trigger parameter from scheduleDelayedPrefetching (#64517)
Simplifies delayed prefetching calls by eliminating an unnecessary trigger argument

PR Close #64517
2025-10-21 15:16:40 +00:00
SkyZeroZx b11617dbab docs(docs-infra): Improves navigation list readability by balancing text wrapping (#64512)
Balances text wrapping for navigation items to enhance readability

PR Close #64512
2025-10-21 15:14:36 +00:00
SkyZeroZx 9b494c7de5 docs: Add DestroyRef.destroyed and usage in lifecycle guide (#64422)
PR Close #64422
2025-10-21 15:12:50 +00:00
SkyZeroZx ed99bc96f1 docs: add references to SSR guide for caching options (#64347)
PR Close #64347
2025-10-21 15:12:15 +00:00
Andrew Scott cfd8ed3fff fix(router): Fix outlet serialization and parsing with no primary children (#64505)
this fixes tree creation, serialization, and parsing of trees created with
children outlets and no primary path

fixes #62384

PR Close #64505
2025-10-20 21:18:47 +00:00
Matthieu Riegler de8af17951 docs(docs-infra): Extract multiple extends statements for interfaces (#64539)
fixes #64528

PR Close #64539
2025-10-20 21:18:14 +00:00
Angular Robot b645b64067 build: update cross-repo angular dependencies (#64548)
See associated pull request for more information.

PR Close #64548
2025-10-20 21:17:01 +00:00
Andrew Scott 182fe78f91 fix(router): Surface parse errors in Router.parseUrl (#64503)
logs error in addition to fallback parse

fixes #54937

PR Close #64503
2025-10-20 17:51:30 +00:00
Angular Robot 4063082811 build: update cross-repo angular dependencies (#64545)
See associated pull request for more information.

PR Close #64545
2025-10-20 17:09:55 +00:00
Angular Robot e4e6b92db3 build: lock file maintenance (#64534)
See associated pull request for more information.

PR Close #64534
2025-10-20 16:04:25 +00:00
Angular Robot 4073dc5592 build: update rules_browsers digest to 0e0949d (#64537)
See associated pull request for more information.

PR Close #64537
2025-10-20 14:49:38 +00:00
Matthieu Riegler 3bb4b3d05b docs: add more details on critical inlining. (#64292)
fixes #42682

PR Close #64292
2025-10-20 14:45:38 +00:00
Angular Robot 544ea5322f build: update github/codeql-action action to v3.30.9 (#64521)
See associated pull request for more information.

PR Close #64521
2025-10-20 14:42:26 +00:00
Jessica Janiuk 5fb7c318bd Revert "fix(compiler-cli): missingStructuralDirective diagnostic produces false negatives (#64470)" (#64542)
This reverts commit 371274bfc6.

PR Close #64542
2025-10-20 14:39:52 +00:00
Matt Lewis 371274bfc6 fix(compiler-cli): missingStructuralDirective diagnostic produces false negatives (#64470)
Fixes a bug in the missingStructuralDirective diagnostic where structural directives with missing imports were not reported when the element using the structural directive contained other directives

Fixes #64467

PR Close #64470
2025-10-17 19:58:00 +00:00
SkyZeroZx 891f180262 fix(compiler): correctly compile long numeric HTML entities (#64297)
Fixes an issue where long numeric HTML entities (e.g. &#x1F6C8;) were incorrectly compiled due to the use of 4-digit

PR Close #64297
2025-10-17 18:23:45 +00:00
SkyZeroZx 0f81ef405b docs: Update FormArray.push usage (#64499)
PR Close #64499
2025-10-17 17:40:52 +00:00
Angular Robot 086857c2f8 build: update cross-repo angular dependencies (#64496)
See associated pull request for more information.

PR Close #64496
2025-10-17 16:06:00 +00:00
SkyZeroZx 56afa3d70d docs(docs-infra): Corrects repo name typo in entry parsing logic (#64487)
Ensures the repository reference uses the correct name to prevent confusion and maintain consistency across generated documentation entries.

PR Close #64487
2025-10-17 14:52:25 +00:00
SkyZeroZx ccaa9e5eb3 docs: add matrix parameters docs and examples (#64459)
PR Close #64459
2025-10-17 14:45:57 +00:00
SkyZeroZx e1699006bf docs: Documents sourcesContent option for source maps (#64482)
PR Close #64482
2025-10-17 14:29:52 +00:00
Uaena_Alex_John aeda431ecb docs: Change import statement to use 'inject' function (#64491)
PR Close #64491
2025-10-17 14:29:13 +00:00
Jessica Janiuk e1a6375f67 release: cut the v20.3.6 release 2025-10-16 13:28:31 -07:00
Matthieu Riegler b99d028cb9 refactor(platform-browser): remove unecessary export. (#64469)
The usage has been removed from g3.

PR Close #64469
2025-10-16 18:52:54 +00:00
Angular Robot d342601077 build: update cross-repo angular dependencies (#64475)
See associated pull request for more information.

PR Close #64475
2025-10-16 18:22:36 +00:00
Jessica Janiuk 911d6822cb fix(core): update animation scheduling (#64441)
In some rare cases, it seems the animation queue disappears despite being afterEveryRender. This updates the animation scheduler to be afterNextRender instead and only schedules it when we need to.

fixes: #64423

PR Close #64441
2025-10-16 17:35:51 +00:00
SkyZeroZx 80907b20c1 docs: Fixes DI guide reference missing ')' in see tag (#64457)
PR Close #64457
2025-10-16 17:34:18 +00:00
Angular Robot 957fc0527f build: update cross-repo angular dependencies (#64473)
See associated pull request for more information.

PR Close #64473
2025-10-16 17:29:30 +00:00
SkyZeroZx 2d159afa1b docs: Add docs for EVENT_MANAGER_PLUGINS (#64453)
PR Close #64453
2025-10-16 14:54:48 +00:00
SkyZeroZx 136e3de3aa docs: Add dataurl and base64 in atrribute loader (#64419)
PR Close #64419
2025-10-16 14:38:50 +00:00
Matthieu Riegler 2ece42866d fix(platform-browser): DomEventsPlugin should always be the last plugin to be called for supports(). (#50394)
This fixes the issues when `BrowserModule` is not the first module imported.

Fixes #37149 #37850

PR Close #50394
2025-10-15 21:12:46 +00:00
SkyZeroZx dbcc281b79 docs: Adds documentation for accessing parent resolver data (#64398)
PR Close #64398
2025-10-15 21:10:07 +00:00
Angular Robot 60eba9b0a4 build: update cross-repo angular dependencies (#64447)
See associated pull request for more information.

PR Close #64447
2025-10-15 21:09:30 +00:00
Angular Robot e6c0223a59 docs: update Angular CLI help (#64434)
Updated Angular CLI help contents.

PR Close #64434
2025-10-15 11:47:49 -07:00
Angular Robot 43fe755654 build: update cross-repo angular dependencies (#64439)
See associated pull request for more information.

PR Close #64439
2025-10-15 10:50:39 -07:00
Danny Koppenhagen 684ad17a34 docs: fix closing tag for whitespace examples (#64425)
PR Close #64425
2025-10-15 10:48:46 -07:00
SkyZeroZx 68d1e290d4 docs: update service worker documentation with additional references (#64353)
PR Close #64353
2025-10-15 10:47:49 -07:00
Angular Robot 7b65a49f78 build: update pnpm to v10.18.3 (#64432)
See associated pull request for more information.

PR Close #64432
2025-10-15 10:45:20 -07:00
SkyZeroZx 69dabdba99 docs: Add injection context for lazy route loading (#64412)
PR Close #64412
2025-10-15 10:41:54 -07:00
Matthieu Riegler b3643e5e83 docs(docs-infra): fix mobile banner layout (#64408)
PR Close #64408
2025-10-15 10:41:05 -07:00
aparziale 0bf157c7fb refactor(migrations): unit test signal migration adjustment (#64393)
Move unit test from spec file to golden test

PR Close #64393
2025-10-15 10:38:58 -07:00
Matthieu Riegler 67531d39cb refactor(devtools): remove "changes" entry. (#64338)
This is just the same value as total time spent. Also it is confusing to some users.

fixes #51206

PR Close #64338
2025-10-15 10:38:21 -07:00
Andrew Kushnir 6a7c27eafb release: cut the v20.3.5 release 2025-10-15 10:07:28 -07:00
Angular Robot 07d8c60ca1 build: update cross-repo angular dependencies (#64416)
See associated pull request for more information.

PR Close #64416
2025-10-14 15:43:42 -07:00
Matthieu Riegler 43cb583f70 refactor(devtools): add debug router APIs (#64411)
This is a patch backport of #63081

PR Close #64411
2025-10-14 15:41:11 -07:00
Andrew Kushnir 5f4f624477 Revert "refactor(core): add debug name to resource (#64172)" (#64418)
This reverts commit 63180067aa.

PR Close #64418
2025-10-14 14:28:17 -07:00
Andrew Kushnir 3ae0d1bcf5 Revert "refactor(compiler-cli): add a resource debugName transform (#64172)" (#64418)
This reverts commit e941e6b80f.

PR Close #64418
2025-10-14 14:28:17 -07:00
JoostK c2e817b0ef perf(compiler-cli): fix performance of "interpolated signal not invoked" check (#64410)
This fixes a performance regression from #63754, which is almost a revert of the
prior performance fix in #57291; the latter was provided as quick fix to address
the severe performance overhead this extended diagnostic used to have, with #57337
as follow-up change to address the false negatives that were introduced in #57291.
That follow-up never landed, though, so this commit is re-applying the changes
from #57337 to fix the performance regression.

Fixes #64403

PR Close #64410
2025-10-14 13:47:21 -07:00
Jessica Janiuk f15cfa4cc4 fix(core): fixes regression in animate.leave function bindings (#64413)
When adding and removing items in a `@for` loop, the `animate.leave` event binding instruction was not updated to use the same logic as the class function when the animation queue was added. We were not returning the correct signature for the `animate.leave` function, which caused the animation to not trigger correctly. This updates the event binding instruction to use the same logic as the class function when adding the animation to the queue.

fixes: #64336

PR Close #64413
2025-10-14 13:46:39 -07:00
Angular Robot 285dad4463 build: lock file maintenance (#64377)
See associated pull request for more information.

PR Close #64377
2025-10-14 12:22:10 -07:00
Matthieu Riegler 5b0363c1ee refactor(core): warning when hydration trigger is used without hydration being enabled (#64185)
This replaces the error we were throwing before the change. This allows component with defer triggerrs to be used on both SSR'd and CSR.

fixes #64184

PR Close #64185
2025-10-14 11:55:22 -07:00
hawkgs 11b006ed83 refactor(compiler-cli): add a resource debugName transform (#64172)
Add a TS transform for `resource` (and `httpResource`) `debugName`. Test the transformations.

PR Close #64172
2025-10-14 09:31:42 -07:00
hawkgs 623c2847be refactor(core): add debug name to resource (#64172)
Decorate `resource` (and `httpResource`) with `debugName`, along with all of its internal signals.

PR Close #64172
2025-10-14 09:31:42 -07:00
Jessica Janiuk d54dd674ca fix(core): Prevents early style pruning with leave animations (#64335)
In some cases, the leave animation stylesheets were getting pruned too early due to the renderer removal happening before the animation function was run. This ensures that while queuing a leave animation, we guarantee the lView is referenced in the leaving animations set. This guarantees the style sheet pruning knows about the animations existing and skips the prune step.

fixes: #64326

PR Close #64335
2025-10-14 09:30:33 -07:00
Angular Robot 4f89ec396e build: update cross-repo angular dependencies (#64406)
See associated pull request for more information.

PR Close #64406
2025-10-14 09:28:05 -07:00
Alan Agius 8391d57808 build: remove ANGULAR_PACKAGE file from snapshot builds (#64402)
This was needed for NGCC which has been removed a long time ago.

PR Close #64402
2025-10-14 09:26:20 -07:00
Matthieu Riegler 1cb1fffce3 docs: Add mentions of the autoCsp option (#64290)
And also in the incompatibility of `CSP_NONCE` with `inlineCritical`.

fixes #61037

PR Close #64290
2025-10-14 09:23:21 -07:00
Andrew Kushnir a2773b5ed1 ci: update symbol golden file for @defer test case (#64396)
This commit updates the golden file, which got affected by this change: https://github.com/angular/angular/commit/eb80c3075f546c43f0ed2636bc6323d4b9d0a898

PR Close #64396
2025-10-13 16:49:27 -07:00
SkyZeroZx fdd0856dd1 docs: Removes standalone flag from drag-drop examples (#64395)
PR Close #64395
2025-10-13 15:58:33 -07:00
Angular Robot 0c58b5f5e3 build: update cross-repo angular dependencies (#64391)
See associated pull request for more information.

PR Close #64391
2025-10-13 11:30:38 -07:00
Joey Perrott f23df716a8 build: update symbol extractor tests to stabalize the order of the symbols listed (#64389)
Update to ensure that the symbols in the list of extracted symbols is consistent even when multiple bundle files are extracted from.

PR Close #64389
2025-10-13 11:12:56 -07:00
Oliver Lang e54f41e43a docs: improve clarity of self-closing tag migration example (#64388)
Replaces inline comments with structured Before and After sections
to enhance readability and consistency. This helps developers better
understand the transformation from non-self-closing to self-closing
tags during migration.

PR Close #64388
2025-10-13 10:01:03 -07:00
Alan Agius 51066cc077 ci: remove cache-node-modules from checkout-and-setup-node (#64387)
This option no longer exists and the new default is to cache the PNPM store.

PR Close #64387
2025-10-13 09:29:07 -07:00
Matthieu Riegler b4b19b60af refactor(compiler): Improve pipe in track expression error (#64321)
Throw a parse error for a better context awareness.

fixes #64316

PR Close #64321
2025-10-13 08:59:57 -07:00
Angular Robot 9cbe5b650a build: update pnpm to v10.18.2 (#64359)
See associated pull request for more information.

PR Close #64359
2025-10-13 08:44:03 -07:00
Angular Robot a5a6d3f852 build: update github/codeql-action action to v3.30.8 (#64371)
See associated pull request for more information.

PR Close #64371
2025-10-13 08:41:03 -07:00
aparziale 554573e524 fix(migrations): migrating input with more than 1 usage in a method (#64367)
When the migration command was run for inputs, if the input had more than one reference in a method the migration would generate incorrect code

Fixes #63018

PR Close #64367
2025-10-13 08:37:11 -07:00
Shuaib Hasan Akib 09b37d30c6 docs: update MDN reference links to main documentation pages (#64383)
Replaces old deep-linked MDN tutorial URLs with top-level documentation
links for JavaScript, HTML, and CSS to provide more general and reliable references.

PR Close #64383
2025-10-13 08:34:53 -07:00
Matthieu Riegler bbc0f81aff docs(docs-infra): Add user to the open files (#64380)
fixes #64345

PR Close #64380
2025-10-13 08:33:57 -07:00
SkyZeroZx 897d25cf9c docs: update router behavior to correct syntax highlighting (#64375)
PR Close #64375
2025-10-13 08:33:19 -07:00
SkyZeroZx 56270c36e5 docs: Documents utility functions for narrowing form control types (#64373)
PR Close #64373
2025-10-13 08:32:30 -07:00
aparziale 9f49b2ad24 docs: fix typo in route-guards guide (#64366)
Fix typo in route-guards guide: “useres” → “users”

Fixes #64363

PR Close #64366
2025-10-13 08:31:48 -07:00
Oswin Sutton c55f9b2c3b docs: add missing code formatting around @defer in templates/defer guide (#64357)
PR Close #64357
2025-10-13 08:31:14 -07:00
SkyZeroZx 7cc6af9ae7 docs: Add example Unhandled errors in Angular documentation (#64356)
PR Close #64356
2025-10-13 08:30:26 -07:00
Shuaib Hasan Akib 1502b1bc82 refactor(common): sync examples with Angular style guide (#64167)
Updated examples to align with the latest Angular style:
- Removed `standalone: false` since it is unnecessary.
- Dropped module-based implementation in favor of standalone.

PR Close #64167
2025-10-13 08:29:44 -07:00
SkyZeroZx edbd533de0 docs: refactor popup example to use inject function (#64349)
PR Close #64349
2025-10-13 08:27:51 -07:00
Matthieu Riegler 9437ff3504 docs(docs-infra): Fix animation bug on iPhones (#64342)
PR Close #64342
2025-10-13 08:25:47 -07:00
Matthieu Riegler da5073358e docs: add a callout that adding/removing to formArray doesn't not mark dirty (#64337)
fixes #36788

PR Close #64337
2025-10-10 08:13:56 -07:00
Angular Robot 448ba75579 build: update bazel dependencies (#64332)
See associated pull request for more information.

PR Close #64332
2025-10-10 08:13:16 -07:00
SkyZeroZx da38cd9679 docs: add example for assertInInjectionContext (#64325)
PR Close #64325
2025-10-10 06:51:45 -07:00
Angular Robot c4812fef14 build: update dependency bazel to v7.6.2 (#64331)
See associated pull request for more information.

PR Close #64331
2025-10-10 06:47:31 -07:00
Shuaib Hasan Akib 656715c365 docs: fix rxResource example to return object from params function (#64327)
Previously, the example returned a plain value instead of an object,
causing destructuring in the `stream` function to fail. Updated to
`params: () => ({ userId: this.userId() })` for correctness.

fixes: #64313

Update adev/src/content/ecosystem/rxjs-interop/signals-interop.md

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #64327
2025-10-10 06:45:18 -07:00
SkyZeroZx 5a4f8261b5 docs: Add unified control state change events (#64279)
PR Close #64279
2025-10-10 06:42:36 -07:00
SkyZeroZx 1ca0d05af9 docs: Adds documentation for image decoding attribute (#64261)
Expands the image optimization guide to explain browser image decoding strategies

PR Close #64261
2025-10-10 06:41:32 -07:00
SkyZeroZx 302faa447f docs: Add programmatic component input/output/directive binding (#64240)
Expands the guide to explain how inputs, outputs, and directives can be provided when creating components programmatically

PR Close #64240
2025-10-10 06:39:57 -07:00
Kristiyan Kostadinov 8dec92ff9f fix(compiler-cli): capture metadata for undecorated fields (#63957) (#64317)
Currently if `TestBed.overrideComponent` is used on a class that uses initializer APIs (e.g. `input()`), the initializer metadata will be wiped out, because `overrideComponent` re-compiles the class with the information set by `setClassMetadata`. `setClassMetadata` only captures decorated members at the moment.

These changes introduce some logic to capture the new initializer-based APIs in `setClassMetadata` as well.

Fixes #57944.

PR Close #63957

PR Close #64317
2025-10-09 11:57:57 -07:00
Kristiyan Kostadinov 2342de8fac refactor(compiler): expose member decorator identifiers (#63957) (#64317)
Adds the member decorators to the map of exposed compiler symbols.

PR Close #63957

PR Close #64317
2025-10-09 11:57:57 -07:00
Kristiyan Kostadinov bb241ee28b refactor(compiler-cli): track member metadata using output AST (#63957) (#64317)
Reworks the logic that tracks the decorator metadata for members to do so using the output AST, rather than wrapping the TypeScript AST. This makes it easier to programmatically generate new members that weren't part of the TypeScript AST before.

PR Close #63957

PR Close #64317
2025-10-09 11:57:57 -07:00
Kristiyan Kostadinov 2c79ca0b57 fix(migrations): remove error for no matching files in control flow migration (#64253) (#64314)
Now that the control flow migration is running as a part of `ng update`, we need to be a bit forgiving about there not being any matching files since it can break the entire update process.

These changes switch the error to a warning and it counts the files for the entire workspace, not the individual projects.

PR Close #64253

PR Close #64314
2025-10-09 11:57:24 -07:00
Andrew Scott 6e4bcc7d22 fix(router): Scroll restoration should use instant scroll behavior for traversals (#64299)
When the scroll position is being restored, this change upates the
behavior to use 'instant' rather than the default 'auto', which will
be whatever the browser behavior is for 'window.scrollTo'. The 'smooth'
behavior does not match how browsers behavior when performing a
traversal navigation for MPAs, which is 'instant'.

related to #58258

PR Close #64299
2025-10-09 11:13:46 -07:00
Matthieu Riegler fa25dadae9 refactor(core): use the ValueEqualityFn from core (#64247)
Instead of the non-public primitive one.

PR Close #64247
2025-10-09 05:31:35 -07:00
Shuaib Hasan Akib 19cd52f421 docs(docs-infra): add rel="noopener" to external links with target="_blank" in ExternalLink directive (#64276)
PR Close #64276
2025-10-09 05:29:31 -07:00
Angular Robot 950a05c8e1 build: update cross-repo angular dependencies (#64308)
See associated pull request for more information.

PR Close #64308
2025-10-09 05:28:32 -07:00
Angular Robot 4ea008e683 build: update github/codeql-action action to v3.30.7 (#64286)
See associated pull request for more information.

PR Close #64286
2025-10-09 05:26:50 -07:00
SkyZeroZx e8de1b481c refactor(docs-infra): replace @Input with signal input for ignoredElementsIds in ClickOutside directive (#64302)
replace @Input with signal input for ignoredElementsIds in ClickOutside directive

PR Close #64302
2025-10-09 05:21:03 -07:00
SkyZeroZx 5baaf979db docs: Replace ngIf programmatic rendering to control flow (#64301)
PR Close #64301
2025-10-09 05:20:21 -07:00
Angular Robot fdb2a95929 build: update bazel dependencies (#64196)
See associated pull request for more information.

PR Close #64196
2025-10-09 05:18:36 -07:00
Matthieu Riegler 3658f211f8 docs: update banner with AI RFC (#64107)
PR Close #64107
2025-10-09 05:17:07 -07:00
Matthew Berry 79604819c3 test(compiler): fix a @keyframes style encapsulation test (#64036)
I've updated the test to assert what I believe it was trying to assert
before. Without this change, the CSS is invalid so it's unclear what
behavior we're demonstrating.

PR Close #64036
2025-10-09 05:16:19 -07:00
Miles Malerba 28b0d536e8 release: cut the v20.3.4 release 2025-10-08 10:49:59 -04:00
Angular Robot 11d83d1bb0 build: update cross-repo angular dependencies (#64272)
See associated pull request for more information.

PR Close #64272
2025-10-07 20:41:53 -04:00
Matthieu Riegler b568bc1ef8 docs: add providers caveat on the service (#64269)
fixes #60955

PR Close #64269
2025-10-07 20:40:20 -04:00
Matthieu Riegler 0f7b877412 docs: add mentions host style bindings (#64257)
Also adds a section about css custom properties

fixes #64256

PR Close #64257
2025-10-07 20:39:41 -04:00
utshow-rehman 67bffa264b docs(docs-infra): refactor navigation code based on angular style guide (#64177)
PR Close #64177
2025-10-07 20:29:55 -04:00
Alan Agius 89f5748f6e build: remove empty globs (#64270)
Remove globs that do not match any files.

PR Close #64270
2025-10-07 20:28:12 -04:00
Angular Robot 0d8fe3e4c2 build: update pnpm to v10.18.1 (#64266)
See associated pull request for more information.

PR Close #64266
2025-10-07 20:26:12 -04:00
Jessica Janiuk 3b959105be fix(core): prevent early exit from leave animations when multiple transitions are present (#64225)
Our code ensuring host binding composition for animations was causing the early exit and removal of
elements when multiple transitions were present on the same element. This commit fixes the issue by
ensuring that we properly keep track of all the promise resolvers on the LView and then only
call them once we've properly waited for the longest animation to finish.

fixes: #64209

PR Close #64225
2025-10-06 15:34:28 -04:00
Jessica Janiuk 24906249e6 refactor(core): allow animationend to process if we don't have a longest animation (#64225)
There may be cases where the longest animation info has been cleaned up before the end animation fires. We should still do the end processing in that case.

PR Close #64225
2025-10-06 15:34:28 -04:00
Jessica Janiuk 08b8b13185 refactor(core): fix animations host binding tests (#64225)
These tests were not properly validating against the host binding changes due to the fact that the styles were on the wrong components in some of the host binding cases.

PR Close #64225
2025-10-06 15:34:27 -04:00
Shuaib Hasan Akib 962bac2533 refactor(docs-infra): improve CustomErrorHandler for clarity and best practices (#64237)
Use `implements ErrorHandler` instead of extending the base class to follow Angular
conventions. Marked injected dependencies as `readonly`, made `openErrorSnackBar`
private, and improved overall code consistency.

PR Close #64237
2025-10-06 15:33:43 -04:00
Angular Robot 9be76ad0a4 build: update cross-repo angular dependencies (#64258)
See associated pull request for more information.

PR Close #64258
2025-10-06 15:25:00 -04:00
Jaime Burgos c63de7057b docs: add documentation for routerOutletData input and its usage (#64242)
PR Close #64242
2025-10-06 15:20:06 -04:00
SkyZeroZx 57e375b62b docs: Adds guide for customizing page titles with TitleStrategy (#64238)
Improves documentation by explaining how to implement and configure a custom title strategy for centralized control over page titles

PR Close #64238
2025-10-06 15:17:59 -04:00
Matthieu Riegler 8528bb5e75 docs(docs-infra): fix @example in class members (#64249)
eg: ApplicationRef

PR Close #64249
2025-10-06 15:11:32 -04:00
SkyZeroZx c1cfba0624 docs: add equal option to toSignal for custom value comparison (#64241)
PR Close #64241
2025-10-06 15:09:50 -04:00
Angular Robot 6e5be385b2 build: update pnpm to v10.18.0 (#64233)
See associated pull request for more information.

PR Close #64233
2025-10-06 14:57:56 -04:00
Jessica Janiuk 853ed169a8 fix(core): ensure missing leave animations don't queue leave animations (#64226)
There was a bug in the logic for checking if a leave animation exists for a node. This was affecting timing of nodes with enter animations.

PR Close #64226
2025-10-03 13:28:55 -07:00
Matthieu Riegler 28668a58ec docs: add info about disabling request caching (#64216)
fixes #64210

PR Close #64216
2025-10-03 17:19:00 +00:00
Angular Robot 3fe6416ae3 build: update cross-repo angular dependencies (#64213)
See associated pull request for more information.

PR Close #64213
2025-10-02 14:21:28 -07:00
SkyZeroZx 65884895ff fix(migrations): preserve component imports when pruning NgModules in standalone migration (#64186)
This fix preserves component imports by adding missing  statements and replacing module references with the correct component

PR Close #64186
2025-10-02 13:54:15 -07:00
Shuaib Hasan Akib e2820d1a2d docs(docs-infra): keep file name visible when code block is hidden (#64204)
Ensures that file names remain visible even if the associated code block
is collapsed or hidden, improving readability and context in the docs.

PR Close #64204
2025-10-02 17:30:46 +00:00
Jessica Janiuk 6fed986b7a fix(core): Fixes animations in conjunction with content projection (#63776)
Content Projected nodes are not destroyed and recreated, like every other
situation. Enter and Leave animations were ephemeral and are
expected to run once, and then be cleared. This means that for content projection
cases, the animations would only ever work the first time they were shown / hid.

In order to resolve this, we move to an animation queue that re-runs the animation
functions stored in the LView. In most cases, this animation will run once on creation.
For content projection, the enter and leave animations will fire more than once. Animations
are stored on the LView, but indexed and scheduled by whichever RNode needs to be animated.
So we only run animations for an affected RNode, rather than potentially all in the LView.

This also moves the queue to afterRender, which is safer than right after template
execution in refreshView.

fixes: #63418
fixes: #64065
fixes: #63901

PR Close #63776
2025-10-02 16:56:01 +00:00
Yasin Aslan 76fe5599fe fix(core): handle undefined CSS time values in parseCssTimeUnitsToMs function (#64181)
Improve error handling when `rawDelays` contains fewer items than `transitionedProperties`, preventing a toLowerCase of undefined error in `parseCssTimeUnitsToMs`.

PR Close #64181
2025-10-02 08:13:49 -07:00
Shuaib Hasan Akib 5e6d2860cd docs(docs-infra): update styles to align checkbox with label (#64202)
Removed extra spacing and removed center alignment so that checkboxes and
their labels are visually consistent.

PR Close #64202
2025-10-02 08:12:00 -07:00
Alan Agius b687d9c51a docs: update website URL in license banners (#64183)
Replace angular.io with angular.dev
PR Close #64183
2025-10-02 07:56:59 -07:00
kirjs c314ccba0c release: cut the v20.3.3 release 2025-10-02 08:05:44 -04:00
kirjs a453b1de08 Revert "fix(core): Fixes animations in conjunction with content projection (#63776)" (#64189)
This reverts commit 1cb16fddb5.

PR Close #64189
2025-10-01 22:42:41 +00:00
Angular Robot 952e3b1ead build: update cross-repo angular dependencies to v20.2.7 (#64182)
See associated pull request for more information.

PR Close #64182
2025-10-01 22:21:04 +00:00
Angular Robot 96b35727b0 build: update bazel dependencies (#64149)
See associated pull request for more information.

PR Close #64149
2025-10-01 13:40:04 -04:00
Shuaib Hasan Akib 94c9003093 refactor(common): update NgIf, ngComponentOutlet and ngTemplateOutlet examples and remove redundant standalone flag (#64155)
Removed `standalone: true` since it is now the default
and no longer necessary.

refactor(common): update ngComponentOutlet and ngTemplateOutlet examples and remove redundant standalone flag

Removed `standalone: true` since it is now the default
and no longer necessary.

PR Close #64155
2025-10-01 13:22:44 -04:00
Angular Robot cc8f5e1e00 build: update ossf/scorecard-action action to v2.4.3 (#64166)
See associated pull request for more information.

PR Close #64166
2025-10-01 10:42:04 -04:00
SkyZeroZx 1710cbd7d4 fix(migrations): handle shorthand property declarations in NgModule (#64160)
The migration now correctly detects shorthand declarations in NgModule metadata

PR Close #64160
2025-10-01 10:41:17 -04:00
Jessica Janiuk 0e928fbc4a fix(core): Fixes animations in conjunction with content projection (#63776)
Content Projected nodes are not destroyed and recreated, like every other
situation. Enter and Leave animations were ephemeral and are
expected to run once, and then be cleared. This means that for content projection
cases, the animations would only ever work the first time they were shown / hid.

In order to resolve this, we move to an animation queue that re-runs the animation
functions stored in the LView. In most cases, this animation will run once on creation.
For content projection, the enter and leave animations will fire more than once. Animations
are stored on the LView, but indexed and scheduled by whichever RNode needs to be animated.
So we only run animations for an affected RNode, rather than potentially all in the LView.

This also moves the queue to afterRender, which is safer than right after template
execution in refreshView.

fixes: #63418
fixes: #64065
fixes: #63901

PR Close #63776
2025-10-01 09:07:38 -04:00
Matthieu Riegler 24c979da1f docs: add allowed-host mention (#64145)
and other dev-server options

PR Close #64145
2025-10-01 09:03:08 -04:00
Kristiyan Kostadinov f51ab32fb3 fix(compiler): recover template literals with broken expressions (#64150)
Fixes two issues that were preventing template literals from being recovered properly if one of the interpolated expressions is broken:
1. We weren't updating the expected brace counter when an interpolation starts which in turn was throwing off the recovery logic in `skip`.
2. When producing tokens for template literals, we were treating the closing brace as an operator whereas other places treat it as a character. Even after fixing the first issue, this was preventing the recovery logic from working correctly.

Fixes #63940.

PR Close #64150
2025-09-30 16:01:50 -04:00
aparziale 77b6305a4b fix(migrations): skip migration for inputs with 'this' references (#64142)
Prevents migration of @input() properties that contain references to 'this' in their initializer functions. This ensures that functions accessing class members via 'this' remain unchanged, preventing potential build errors.

PR Close #64142
2025-09-30 15:32:45 -04:00
Shuaib Hasan Akib 479a6f269a refactor(common): update pipe examples and remove redundant standalone flag (#64135)
Updated pipe examples to explicitly import the pipe for clarity and
correctness. Also removed `standalone: true` since it is now the default
and no longer necessary.

PR Close #64135
2025-09-30 15:31:12 -04:00
hawkgs 612ce99457 refactor(compiler-cli): include linkedSignal in the signal debugName transformer (#64106)
Add support for `linkedSignal`s in the signal `debugName` transformer. Continuation of #63346

PR Close #64106
2025-09-30 14:52:16 -04:00
Matthieu Riegler 8e800837ee refactor(core): Add custom formatters for Signals (#64000)
This commit adds a devmode only formatter for Angular signals

Custom formatters must also be enabled in the browser devtools.

PR Close #64000
2025-09-30 13:49:27 -04:00
Matthieu Riegler c1a922a04e docs: add mention of host-context() being spec deprecated but still supported (#64153)
PR Close #64153
2025-09-30 13:36:52 -04:00
Matthieu Riegler 3db8ef004f docs(docs-infra): fix app-scroller offset. (#64144)
Guide heading need different scroll offsets depending on the width of the screen. (The menu position varies).

PR Close #64144
2025-09-30 11:05:27 -04:00
Matthieu Riegler ced186fafb docs(docs-infra): prevent to call section.scrollIntoView on the server side (#64038)
PR Close #64038
2025-09-30 11:00:58 -04:00
Shuaib Hasan Akib 3598855d73 docs(docs-infra): clean up code and use inferred types where possible (#64139)
PR Close #64139
2025-09-29 16:48:13 -04:00
Angular Robot 5c50e0b0ef build: update cross-repo angular dependencies (#64115)
See associated pull request for more information.

PR Close #64115
2025-09-29 13:51:47 -04:00
SkyZeroZx aa28aa274c docs: Adds guide for custom HTTP parameter encoding (#64119)
PR Close #64119
2025-09-29 13:30:57 -04:00
Matthieu Riegler 4b3f7a0e5f refactor(devtools): guard value reads in the serializer (#64096)
Some properties (like gets) might throw when we try to read them.
With this commit we fail gracefuly and show a warning message for the property that can't be read.

fixes #56755

PR Close #64096
2025-09-29 13:08:12 -04:00
Angular Robot 633db24ca2 build: update bazel dependencies (#64100)
See associated pull request for more information.

PR Close #64100
2025-09-29 11:49:19 -04:00
Angular Robot e6c0d7eba1 build: update github/codeql-action action to v3.30.5 (#64121)
See associated pull request for more information.

PR Close #64121
2025-09-29 09:53:02 -04:00
Matthieu Riegler c0bb52829a refactor(devtools): themed devtool tab icons for firefox (#64122)
With this change, Firefox get a different tab icon when the dark theme is enabled

fixes #52980

PR Close #64122
2025-09-29 09:31:04 -04:00
Alan Agius 495211084e docs: remove note about node.js 17+ (#64129)
This note is pretty old and the mentioned behaviour has been the default for a number of major version.

PR Close #64129
2025-09-29 09:25:02 -04:00
Angular Robot c6809273b0 build: update cross-repo angular dependencies (#64108)
See associated pull request for more information.

PR Close #64108
2025-09-26 17:42:20 -04:00
Jessica Janiuk d900dba595 Revert "refactor(compiler): Remove the interpolation config (#64071)" (#64110)
This reverts commit 768a09d3c3.

PR Close #64110
2025-09-26 15:16:54 -04:00
Matthieu Riegler 71cde35f5e refactor(compiler): throw on attribute bindings for ng-container (#64072)
They are never valid on ng-container.
fixes #53760

PR Close #64072
2025-09-26 13:53:01 -04:00
Matthieu Riegler 9dbcff8794 refactor(compiler): Remove the interpolation config (#64071)
After #63474, we don't need that anymore.

PR Close #64071
2025-09-26 12:36:51 -04:00
Angular Robot 8cf95ceb11 build: update cross-repo angular dependencies (#64094)
See associated pull request for more information.

PR Close #64094
2025-09-26 12:02:08 -04:00
Jens Kuehlers e02985ac5b docs: add StateOfJS survey banner (#64083)
PR Close #64083
2025-09-26 09:37:24 -04:00
Ankita Sood ba28b3764c docs: update text (#64095)
replace `above` with `below`
PR Close #64095
2025-09-26 09:34:01 -04:00
Matthieu Riegler b12e5e62f2 docs: add warning to AbstractControl.setErrors (#64063)
fixes #38191

PR Close #64063
2025-09-25 16:29:53 -04:00
Angular Robot 7d720d52ec build: update cross-repo angular dependencies (#64077)
See associated pull request for more information.

PR Close #64077
2025-09-25 15:38:02 -04:00
Jad Chahed bd2b841e39 docs: fix XLIFF 1.2 specification URL in i18n translation files guide (#64075)
PR Close #64075
2025-09-25 15:36:19 -04:00
Jessica Janiuk e5157bd933 fix(core): prevents unintended early termination of leave animations and hoisting (#64088)
The event listeners for animationstart and animationend weren't properly checking whether the animation event fired matched the node we're bound to, since animation events bubble. This resulted in child node animation events bubbling up and causing elements to get prematurely removed.

fixes: #64084

PR Close #64088
2025-09-25 15:33:31 -04:00
Angular Robot 36c4b3f2b1 build: update all github actions (#64082)
See associated pull request for more information.

PR Close #64082
2025-09-25 14:58:33 -04:00
Matthieu Riegler 542cd0019a fix(core): do not rename ARIA property bindings to attributes (#64089)
angular#62630 made it so that all ARIA
property bindings would write to their corresponding attribute instead.
The primary motivation for this change was to ensure that ARIA
attributes were always rendered correctly on the server, where the
emulated DOM may not correctly reflect ARIA properties as attributes.
Furthermore, this change added support for binding to ARIA attributes
using the property binding syntax (e.g. `[aria-label]`).

Unfortunately, angular#62630 relied on
the incorrect assumptions that an ARIA property name could be converted
to its attribute name (without hardcoding the conversion), and that the
value of an ARIA property matched its corresponding attribute. For
example, the `ariaLabelledByElements` property's value is an array of
DOM elements, while the corresponding `aria-labelledby` attribute's
value is a string containing the IDs of the DOM elements.

This partially reverts angular#62630 so
that only property bindings with ARIA attribute names (begin with
`aria-`) are converted to attribute bindings.

* `[ariaLabel]` will revert to binding to the `ariaLabel` property.
* `[aria-label]` will continue binding to the `aria-label` attribute.

Note the only difference between `[aria-label]` and `[attr.aria-label]`
is that the former will attempt to bind to inputs of the same name while
the latter will not.

PR Close #64089
2025-09-25 14:51:13 -04:00
Matthieu Riegler a74d74bfec docs: fix homepage width (#64087)
Long term, we probably need to rework how adev behave on very large screen.

PR Close #64087
2025-09-25 14:28:33 -04:00
Doug Parker 076ccbf7fe refactor(devtools): remove hard newlines from reviewer note (#64062)
These newlines aren't necessary and potentially forced undesired formatting on the reviewer.

PR Close #64062
2025-09-25 10:36:42 -04:00
Doug Parker 0270ed232e refactor(devtools): update release script to use /pull/new endpoint (#64062)
This jumps straight to the "Open a pull request" screen rather than having the user click through the compare screen to start a PR.

PR Close #64062
2025-09-25 10:36:42 -04:00
Doug Parker 46eed6a0fb refactor(devtools): update DevTools release script to resolve origin URL (#64062)
`git config` only lists the configured value, but `git remote get-url` actually resolves the URL and is more stable.

I had a local configuration which aliased `gh:` to the appropriate GitHub URL:

```
[url "git@github.com:"]
    insteadOf = "gh:"
    pushInsteadOf = "git@github.com"
```

In this scenario, `git config` returns `gh:dgp1130/angular`, but `git remote get-url` returns `git@github.com:dgp1130/angular`, which is what the subsequent regex expects.

PR Close #64062
2025-09-25 10:36:42 -04:00
Jessica Janiuk 31f2030320 release: cut the v20.3.2 release 2025-09-24 16:22:22 -07:00
Angular Robot c525a5a890 build: update dependency node to v22.20.0 (#64061)
See associated pull request for more information.

PR Close #64061
2025-09-24 21:23:21 +00:00
Matthieu Riegler f04a78a4fc docs(docs-infra): scroll offset for headings (#64039)
PR Close #64039
2025-09-24 20:23:41 +00:00
Matthieu Riegler ea6c51f355 docs(docs-infra): fix playground layout (#64037)
PR Close #64037
2025-09-24 20:21:06 +00:00
hawkgs ce6c7d94da docs(docs-infra): align docs-step number to the heading (#64035)
Fix misaligned number element.

PR Close #64035
2025-09-24 18:31:42 +00:00
Matthieu Riegler 1fd8d5d446 fix(forms): Emit FormResetEvent when resetting control (#64034)
Prior to this change, the event was emitted by the Form Directive. With the change, it is now emitted at the control level.

fixes #58894

PR Close #64034
2025-09-24 16:49:04 +00:00
aparziale 3ebaeccb46 fix(migrations): handle reused templates in control flow migration (#63996)
The control flow migration was incorrectly removing `ng-template` elements in scenarios where they were referenced by multiple `*ngIf` directives' `else` clauses and also used independently via `ngTemplateOutlet`.

PR Close #63996
2025-09-24 16:01:58 +00:00
Matthieu Riegler 3c14d0523c refactor(compiler-cli): Don't emit optional chain non nullable diagnostics on indexed access. (#64007)
When `noUncheckedIndexedAccess` is not enabled, indexed accesses do not include `undefined` in the type.
This makes the OptionalChainNotNullableCheck inconvenient when wanting to safe guard an indexed access (and when the typings isn't helping you).

Ideally project should enable `noUncheckedIndexedAccess` for better typesafety, but this is often inconveninent (we do not enable it by default) and often not the resort of the developer.

So more better coding convinience,  `OptionalChainNotNullableCheck` will not raise an error/warning on indexed Acessed followed by an optional chaining when `noUncheckedIndexedAccess` is not enabled.

See also #63809 which will detect more cases

PR Close #64007
2025-09-24 15:08:06 +00:00
Joey Perrott 9f0c6bcf24 ci: use release config when deploying adev (#64030)
Use the release config when deploying to adev to ensure that the version stamping is in place and correct

PR Close #64030
2025-09-24 14:50:46 +00:00
Matthieu Riegler 301155b96f docs(docs-infra): tutorial navigation list component (#64027)
fixes #63516

PR Close #64027
2025-09-24 14:30:14 +00:00
Shuaib Hasan Akib 522587d236 docs: not external link (#64025)
PR Close #64025
2025-09-24 14:24:58 +00:00
Angular Robot be55f8d5de build: update cross-repo angular dependencies (#64021)
See associated pull request for more information.

PR Close #64021
2025-09-24 14:22:20 +00:00
Angular Robot 71955dcf7e build: update pnpm to v10.17.1 (#64016)
See associated pull request for more information.

PR Close #64016
2025-09-23 21:41:48 +00:00
Angular Robot bc2b819e1d build: update cross-repo angular dependencies (#64012)
See associated pull request for more information.

PR Close #64012
2025-09-23 19:59:05 +00:00
Avcharov Hryhorii 8d1891a532 refactor(core): improve linkedSignal type definitions, add debugName to options (#63346)
Add debugName for having ability to visualize linkedSignal name in devtools signal graph

PR Close #63346
2025-09-23 18:15:49 +00:00
Joey Perrott 0ebf1afb16 build: update to latest version of rules_browsers (#64009)
Update to latest version to address firefox timeout issues

PR Close #64009
2025-09-23 18:00:41 +00:00
cexbrayat 5d75219102 docs: angular does not support BigInt literal values (#64010)
PR Close #64010
2025-09-23 17:58:12 +00:00
JoostK 9515a70933 fix(core): fix narrowing of Resource.hasValue() (#63994)
This commit changes `Resource.hasValue()` and its derived types to improve narrowing
of resources whose generic type either does not include `undefined` (i.e. when a default
value has been provided) or when the generic type is `unknown`. This fixes the undesirable
behavior where `hasValue()` would cause the `else` branch of an `hasValue()` conditional
to have a narrowed type of `never`, given that the `hasValue()`'s type guard covers the
entire type range already (meaning that the type in the else-branch cannot be inhabited
in the type system, yielding the `never` type).

By making the `hasValue()` method only a type guard when the generic type includes `undefined`
these problems are avoided.

Fixes #60766
Fixes #63545
Fixes #63982

PR Close #63994
2025-09-23 14:20:55 +00:00
hawkgs 388d25e57a docs(docs-infra): fix home page UI issues on Firefox and Safari (#64006)
Fix broken banners and "Learn More" icons.

PR Close #64006
2025-09-23 14:19:03 +00:00
Cheng-Hsuan Tsai 0f85742fe7 docs(docs-infra): fix docs-card padding (#64004)
PR Close #64004
2025-09-23 14:18:31 +00:00
Angular Robot 6fa4ac7681 build: update dependency aspect_bazel_lib to v2.21.2 (#64003)
See associated pull request for more information.

PR Close #64003
2025-09-23 14:17:01 +00:00
Angular Robot 2d0761062c build: update cross-repo angular dependencies (#63999)
See associated pull request for more information.

PR Close #63999
2025-09-22 22:37:21 +00:00
Milo a67d82254f refactor(core): use version>0 instead of hasRun (#62467)
this saves a field for effect and watch nodes

PR Close #62467
2025-09-22 16:51:51 +00:00
SkyZeroZx 1d4f81c8ee fix(compiler-cli): resolve import alias in defer blocks (#63966)
Fixes an error where using an alias in a defer block caused the compiler CLI to fail when parsing. The resolution logic in ComponentDecoratorHandler was updated to correctly handle deferred dependencies with aliased imports.

PR Close #63966
2025-09-22 15:52:17 +00:00
Angular Robot 2d215246c8 build: lock file maintenance (#63985)
See associated pull request for more information.

PR Close #63985
2025-09-22 14:48:56 +00:00
Ezequiel Cicala ca104b32e9 docs: add missing signal function (#63974)
The `buttonClasses` variable should be a signal according to the example, so we added the call.
PR Close #63974
2025-09-22 14:41:18 +00:00
Steven Chim 64a36757e5 docs: fix typo in component bindings jsdoc (#63969)
PR Close #63969
2025-09-22 14:33:07 +00:00
Shuaib Hasan Akib 80962f69fa docs: fix typo "DO" → "Do" (#63988)
PR Close #63988
2025-09-22 14:30:56 +00:00
Shuaib Hasan Akib 12daa0b52f docs(docs-infra): makes property signal (#63976)
PR Close #63976
2025-09-22 14:30:12 +00:00
hawkgs 12b95774bd docs(docs-infra): fix nav menu for tablets (#63990)
Make broken nav menu visible for tablets.

PR Close #63990
2025-09-22 14:25:04 +00:00
hawkgs 78b4ddcfff docs(docs-infra): fix home page sections padding for smaller viewports (#63990)
Fix paddings for smaller viewports.

PR Close #63990
2025-09-22 14:25:04 +00:00
hawkgs 2cd4fb10c0 docs(docs-infra): don't discard favorites in search history when reselected (#63906)
Do not downgrade favorites to recent search results when you reselect them via the search results list.

PR Close #63906
2025-09-22 14:22:19 +00:00
Alan Agius d09ef683b7 build: remove yarn from integration tests, switch to pnpm (#63986)
This commit removes Yarn as a package manager for integration tests and migrates to pnpm. This change aims to standardize package management across the project, leveraging pnpm's efficiency and consistent behavior for dependency resolution and installation.

PR Close #63986
2025-09-22 14:21:11 +00:00
Matthieu Riegler 923c81c4a8 docs: remove api grouping toggle (#63961)
PR Close #63961
2025-09-19 22:13:22 +00:00
Matthieu Riegler dbb8dbc50b docs: callout for HMR+Defer (#63958)
fixes #60846

PR Close #63958
2025-09-19 21:35:37 +00:00
Jessica Janiuk e78451cf8a fix(core): prevent animations renderer from impacting animate.leave (#63921)
This adds an optional flag to the renderer on `removeChild` called `requireSynchronousElementRemoval`, which can tell any downstream renderer that elements need to be removed synchronously. This gets passed down to the legacy animation renderer to ensure that any elements that set this flag aren't impacted by that renderers changes to timing.

fixes: #63893

PR Close #63921
2025-09-19 21:26:20 +00:00
Matthieu Riegler b04e6b1869 refactor(core): drop the usage of PromiseSettledResult<void> (#63955)
`PromiseSettledResult<void>` requires the ES2020 typings. Those might not be provided (or `skipLibCheck` is not enabled).

fixes #63931

PR Close #63955
2025-09-19 20:27:26 +00:00
Matthieu Riegler de18875a4b docs: add mention of the output structure. (#63916)
fixes #57247

PR Close #63916
2025-09-19 19:55:47 +00:00
Jessica Janiuk 8858e3c908 Revert "refactor(compiler-cli): track member metadata using output AST (#63904)" (#63952)
This reverts commit ffe94b3a89.

PR Close #63952
2025-09-19 18:59:43 +00:00
Jessica Janiuk 720f0dbd13 Revert "refactor(compiler): expose member decorator identifiers (#63904)" (#63952)
This reverts commit ef0ff78de2.

PR Close #63952
2025-09-19 18:59:43 +00:00
Jessica Janiuk 172e44bdc2 Revert "fix(compiler-cli): capture metadata for undecorated fields (#63904)" (#63952)
This reverts commit 4c091abba6.

PR Close #63952
2025-09-19 18:59:43 +00:00
Alan Agius 150ed2b569 docs: add documentation for NG0401 error (#63947)
PR Close #63947
2025-09-19 17:01:21 +00:00
Matthieu Riegler d0c7ea8491 refactor(core): fix MockRenderer in unit tests. (#63936)
This allows us to drop a test only check in the runtime.

PR Close #63936
2025-09-19 14:50:08 +00:00
Matt Lewis 16d0d43ad4 fix(migrations): handle import aliases to the same module name (#63934)
Fixes a bug in the standalone migration where 2 imported modules have the same class name but 1 is imported with an alias and would not be added to the component imports array when migrating

Fixes #63913

PR Close #63934
2025-09-19 14:48:33 +00:00
Matthieu Riegler 5d9de59194 docs(docs-infra): use Github theme colors for the code edition (#63944)
fixes #52654

PR Close #63944
2025-09-19 14:46:41 +00:00
Shuaib Hasan Akib e987d94276 docs(docs-infra): removed unused common module (#63915)
PR Close #63915
2025-09-19 14:44:45 +00:00
Matthieu Riegler fe50e3647d docs: Introduce API category sorting (#63914)
PR Close #63914
2025-09-19 14:44:11 +00:00
Angular Robot fcec9a2233 build: update cross-repo angular dependencies (#63930)
See associated pull request for more information.

PR Close #63930
2025-09-19 14:40:55 +00:00
Alan Agius 3c66209e0a ci: optimize adev CI workflows (#63941)
This commit introduces several optimizations to the adev CI workflows:

- The adev preview build now uses a more powerful runner and creates a production build.
- Remote execution is disabled for adev builds to improve performance.

Note: Bazel cache is still being used, and the built times are reduces by about 10mins when the cache is missed.

PR Close #63941
2025-09-19 14:38:12 +00:00
Kristiyan Kostadinov ba40153ac0 fix(compiler-cli): capture metadata for undecorated fields (#63904)
Currently if `TestBed.overrideComponent` is used on a class that uses initializer APIs (e.g. `input()`), the initializer metadata will be wiped out, because `overrideComponent` re-compiles the class with the information set by `setClassMetadata`. `setClassMetadata` only captures decorated members at the moment.

These changes introduce some logic to capture the new initializer-based APIs in `setClassMetadata` as well.

Fixes #57944.

PR Close #63904
2025-09-18 21:30:16 +00:00
Kristiyan Kostadinov a3094f2cb5 refactor(compiler): expose member decorator identifiers (#63904)
Adds the member decorators to the map of exposed compiler symbols.

PR Close #63904
2025-09-18 21:30:16 +00:00
Kristiyan Kostadinov ba00432068 refactor(compiler-cli): track member metadata using output AST (#63904)
Reworks the logic that tracks the decorator metadata for members to do so using the output AST, rather than wrapping the TypeScript AST. This makes it easier to programmatically generate new members that weren't part of the TypeScript AST before.

PR Close #63904
2025-09-18 21:30:16 +00:00
Matthieu Riegler d40867c8d9 docs: re-add ai event banner on homepage (#63922)
PR Close #63922
2025-09-18 20:15:31 +00:00
SkyZeroZx 96a070e9e0 refactor(core): Remove duplicate code getSelectedTNode (#63897)
clean up duplicate functions

PR Close #63897
2025-09-18 16:04:26 +00:00
Damian Sire ccdb340d0d docs: apply grammar fixes to ai/overview.md (#63896)
PR Close #63896
2025-09-18 15:08:20 +00:00
Angular Robot 205d5276b0 build: update cross-repo angular dependencies (#63908)
See associated pull request for more information.

PR Close #63908
2025-09-18 15:00:56 +00:00
Angular Robot efd76c13e7 build: update rules_sass digest to 4a54e0e (#63899)
See associated pull request for more information.

PR Close #63899
2025-09-18 14:59:38 +00:00
Devin Chasanoff ef57d616af docs: add web codegen scorer to docs (#63886)
PR Close #63886
2025-09-17 21:15:42 +00:00
Jessica Janiuk 2a15d7856d release: cut the v20.3.1 release 2025-09-17 13:55:02 -07:00
Angular Robot 669c7c0249 build: update cross-repo angular dependencies (#63880)
See associated pull request for more information.

PR Close #63880
2025-09-17 20:12:03 +00:00
Angular Robot 79a818bd50 build: update cross-repo angular dependencies (#63877)
See associated pull request for more information.

Closes #63873 as a pr takeover

PR Close #63877
2025-09-17 17:37:28 +00:00
JoostK 8843707919 fix(compiler-cli): only bind inputs that are part of microsyntax to a structural directive (#52453)
Prior to this change the template type-check generator would incorrectly apply inputs
and attributes to a structural directive, where only the bindings as present in microsyntax
are actually bound to the directive. This introduced a problem where usages of template
variables could not be resolved, because the template variables are out-of-scope of the
template element itself.

Closes #49931

PR Close #52453
2025-09-17 16:05:05 +00:00
Alan Agius bd2caa4eba build: update pnpm to v10.17.0 (#63870)
pnpm v10.17.0 adds support for wildcards in 'minimumReleaseAgeExclude'. This simplifies the configuration by allowing the use of '@angular-devkit/*' and '@angular/*' instead of listing each package individually.

PR Close #63870
2025-09-17 16:04:19 +00:00
Matthieu Riegler dcdca98f5d refactor(core): remove usages of Promise.withResolvers (#63856)
Promise.withResolvers is Baseline 2024. Our policy is to support browsers in the scope of Basline widely available.

Fixes #63855

PR Close #63856
2025-09-17 15:21:52 +00:00
Matthieu Riegler 423cc17a76 refactor(common): trim undefined from locale data. (#63520)
This is an optimization to shave of unecessary data.

fixes #42315

PR Close #63520
2025-09-17 14:57:17 +00:00
hawkgs 5cc6c42acc docs(docs-infra): store search result fragment in search history (#63866)
Store the search result page fragment/sub-label in the search history and render it in the history items.

PR Close #63866
2025-09-17 14:56:32 +00:00
hawkgs 97969b1c54 docs(docs-infra): always include fragment in search results (#63866)
Always include page fragment/sub-title in the search dialog results.

PR Close #63866
2025-09-17 14:56:32 +00:00
Walter Breakell 1c7106a79c docs: fix pluralization error in templates guide (#63854)
PR Close #63854
2025-09-17 14:52:32 +00:00
Angular Robot 8cd2d8bd4c build: update cross-repo angular dependencies (#63865)
See associated pull request for more information.

PR Close #63865
2025-09-17 14:33:30 +00:00
Matthieu Riegler e3627d38e9 docs: fix homepage typos (#63868)
fixes #63867

PR Close #63868
2025-09-17 14:31:55 +00:00
Paul Gschwendtner b3434302d5 ci: remove myself from unavailability (#63863)
Removes myself from unavailability.

PR Close #63863
2025-09-17 14:27:43 +00:00
Alan Agius 4aef17def4 build: enable minimumReleaseAge to mitigate dependency chain attacks (#63862)
This change configures pnpm's `minimumReleaseAge` setting to 1 day (1440 minutes). This is a security measure to mitigate dependency chain attacks, where malicious actors publish a new version of a dependency with malicious code and then trick users into updating to it before it can be discovered and reported.

By delaying the adoption of new releases, we reduce the window of opportunity for such attacks. The list of excluded packages contains trusted and frequently updated dependencies from the Angular team, which are considered safe to use without this delay.

PR Close #63862
2025-09-17 14:27:11 +00:00
Joey Perrott 4cd56c26a2 build: remove bazel flag usage for adev (#63845)
Previously we used a configuration flag for adev, instead we now separate into two different targets since our flag didn't
need to cause a full reanalysis to run since everything before the final target should be a cache hit.

PR Close #63845
2025-09-16 20:49:04 +00:00
Matthieu Riegler dd6e1c3494 refactor(core): prevent input migration from introducing a breaking change (#63547)
Non-typed `transform` functions were stripped by the migration prior to this commit (while still logging an error).
This behavior will now only happen with `--best-effort`.

#63541

PR Close #63547
2025-09-16 18:53:51 +00:00
Matthieu Riegler f612437075 docs(docs-infra): Show package name for API references (#63831)
PR Close #63831
2025-09-16 17:36:50 +00:00
Matthieu Riegler 4bd20697fa docs(docs-infra): fix colors (#63842)
fixes #63841

PR Close #63842
2025-09-16 17:36:19 +00:00
Angular Robot 83dbf0edfa build: update cross-repo angular dependencies (#63840)
See associated pull request for more information.

PR Close #63840
2025-09-16 16:49:50 +00:00
Matthieu Riegler 049b67246f docs(docs-infra): new home page (#63662)
ADEV is getting a new home page!
This is a first iteration.

PR Close #63662
2025-09-16 16:21:32 +00:00
aparziale 6e54bdfdcb fix(migrations): fix route-lazy-loading migration (#63818)
route-lazy-loading migration now supports routes when exported by default

PR Close #63818
2025-09-16 15:53:48 +00:00
arturovt 0afd9c5632 refactor(core): swap dev/prod error handling order in injector for tree-shaking (#63354)
In production builds, `ngDevMode` is replaced with `false`, so the guard compiles to `return;`. However, bundlers like ESBuild still keep the remaining statements after the return as unreachable code instead of removing them. This leaves behind unnecessary dead code in the output.

Technically, the body is unreachable. But to prove that, the bundler must be 100% certain that:

- `return` cannot be removed by some transform
- there's no later transformation that changes control flow

As thus, it's always conservative.

This also allows dropping `assertDefined`, which was previously
referenced only inside `prependTokenToDependencyPath`. With the
function now fully inlined and dev-only, `assertDefined` is also
eliminated from production builds, further reducing bundle size.

PR Close #63354
2025-09-16 15:53:11 +00:00
Matthieu Riegler 444fd01acc docs(docs-infra): Use port 4201 for adev (#63834)
Having a changing port might be annoying. The best compromise is probably to use a less common port than the default used by the CLI.

PR Close #63834
2025-09-16 15:18:12 +00:00
Matthieu Riegler 9f64d1a1de docs: add alert about routelinkactive being a content query (#63829)
This commit also fixes an issue with alert that we're parse correctly if they were at the end of the markdown string

fixes #52877

PR Close #63829
2025-09-16 15:15:24 +00:00
Rahul Kamat 27b2a4af3a refactor(core): Update async-test.ts to use globalThis polyfill (#57505)
This updates async-test to use globalThis instead of what it was using.

PR Close #57505
2025-09-16 15:10:05 +00:00
Matthieu Riegler c80d9baf81 docs: update doc to clear up difference between toObservable/ outputToObservable (#63836)
TLDR: only `toObservable` emits synchronously on subscription.

fixes #57224

PR Close #63836
2025-09-16 15:00:54 +00:00
Matthieu Riegler 89e6636d18 docs: high level architecture mention in readme (#63828)
fixes #59293

PR Close #63828
2025-09-16 15:00:16 +00:00
Shuaib Hasan Akib 7eb5f9a999 docs: remove leading $ from script examples (#63795)
Copy-pasting commands like `$ pnpm lint` caused errors in shells (e.g. zsh). Updated docs to use `pnpm lint` directly so they run without modification.

PR Close #63795
2025-09-16 14:54:03 +00:00
Angular Robot 881fe73209 build: update dependency aspect_rules_js to v2.6.0 (#63822)
See associated pull request for more information.

PR Close #63822
2025-09-16 14:52:33 +00:00
arturovt 4a23f6e79d refactor(core): wrap checkNoChanges body in if (ngDevMode) for better tree-shaking (#63387)
The `checkNoChanges` method previously used an early-return guard:

  if (!ngDevMode) return;
  // dev-only code ...

In production builds, `ngDevMode` is replaced with `false`, so the
guard compiles to `return;`. However, bundlers like ESBuild
still keep the remaining statements after the return as unreachable
code instead of removing them. This leaves behind unnecessary dead
code in the output.

This commit updates the method to instead wrap the full body:

  if (ngDevMode) {
    // dev-only code ...
  }

With this change, the method collapses to an empty function in
production builds:

  checkNoChanges() {}

This ensures that the dev-only logic and its dependencies
(e.g. `checkNoChangesInternal`, `UseExhaustiveCheckNoChanges`) can be
fully tree-shaken, reducing bundle size.

PR Close #63387
2025-09-15 21:11:40 +00:00
SkyZeroZx 19462fc807 docs(benchpress): Remove TODOs in Statistic (#63534)
Remove TODOs in Statistic

PR Close #63534
2025-09-15 20:36:18 +00:00
hawkgs 636cd0d3ae fix(devtools): router tree legend overflow (#63813)
Set `overflow` to `hidden` so the router tree legend doesn't overflow its parent container.

PR Close #63813
2025-09-15 19:37:20 +00:00
Matthieu Riegler 5fd0082ccf refactor(compiler-cli): Add a diagnostic to detect forbiden invocations of required initializers (#63614)
The diagnostic will raise an error when required initializers (input, model, queries) are invoked the context of property initializers and contructors.

Docs will be provided in a follow-up

fixes #63602

PR Close #63614
2025-09-15 19:34:32 +00:00
Matthieu Riegler 7fb5a8087e fix(compiler): Add support for aria-invalid (#63748)
The `aria-invalid` attribute was supported but the `ariaInvalid` property was unknown by the schema.

fixes #63744

PR Close #63748
2025-09-15 18:41:17 +00:00
Uaena_Alex_John a2ea2ec615 docs: Update outputs.md to demonstrate how to use event data (#63732)
PR Close #63732
2025-09-15 17:09:19 +00:00
Jessica Janiuk cd36189ba7 ci: update pullapprove public-api rules (#63737)
This reduces the required reviews to 1 and requested reviewers to 2 to reduce friction.

PR Close #63737
2025-09-15 17:03:43 +00:00
Kristiyan Kostadinov 38c9921ff3 fix(compiler-cli): signal not invoked diagnostic not raised when input has same name in template (#63754)
The diagnostic that flags signals which haven't been invoked has some logic to skip over inputs, however it was looking at the used directives across the entire template, not the ones on the specific node.

Fixes #63739.

PR Close #63754
2025-09-15 15:50:45 +00:00
Walter Breakell e0b9ecbad4 docs: correct grammar in next steps intro paragraph (#63803)
PR Close #63803
2025-09-15 15:50:10 +00:00
Matthieu Riegler 233094e425 docs: fix detail about linkedSignal's previous value. (#63811)
fixes #63655

PR Close #63811
2025-09-15 15:46:23 +00:00
Damian Sire f4a1572861 docs: update Gemini model version in AI overview (#63800)
This change updates the Gemini model version from 2.0 Flash to 2.5 Flash on the AI overview page to align with the official Genkit documentation.

The source documentation at https://genkit.dev/docs/frameworks/angular/ has been updated, and this commit ensures our documentation reflects that change accurately.

PR Close #63800
2025-09-15 15:45:50 +00:00
SkyZeroZx b05552fc7a docs: add documentation for NG02802 warning about HttpTransferCache headers (#63802)
add documentation for NG02802 warning about HttpTransferCache headers

PR Close #63802
2025-09-15 15:38:24 +00:00
SkyZeroZx 653089d213 test(platform-server): add test for transfer state data in nested defer blocks (#63801)
Add test for transfer state data in nested defer blocks

PR Close #63801
2025-09-15 15:35:00 +00:00
Damian Sire 134c31bd1b docs: clarify usage of docs-infra scope in commit messages (#63799)
The contribution guide is updated to provide clearer instructions on when to use the `docs-infra` scope versus the `docs` type.

This change helps contributors understand that `docs-infra` should only be used for infrastructure-related changes (application code, tooling, configuration) within the `/adev` directory. For simple content modifications, such as editing a `.md` file, `docs` without a scope is the correct choice.

PR Close #63799
2025-09-15 15:33:15 +00:00
Angular Robot 03bf4df6e0 build: lock file maintenance (#63807)
See associated pull request for more information.

PR Close #63807
2025-09-15 15:30:33 +00:00
Oleg Ivanitski 13e4255f9e fix(docs-infra): fix guide content width (#63798)
This commit fixes the width of the content section, specifically the
reactive forms and template-driven forms section

Closes #63798

PR Close #63798
2025-09-15 15:25:41 +00:00
Shuaib Hasan Akib 6178d36a7d docs(docs-infra): add missing type="button" for accessibility and to remove dev tools warning (#63784)
PR Close #63784
2025-09-15 15:25:09 +00:00
Damian Sire c536035cbc docs: correct typos in AI design patterns guide (#63788)
PR Close #63788
2025-09-15 15:03:00 +00:00
Shuaib Hasan Akib 6a616f81f3 docs(docs-infra): code style improvement and component update (#63557)
- Improved code style consistency in docs-infra
- Updated app.component.ts for enhancements

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #63557
2025-09-15 15:02:24 +00:00
Angular Robot d1919262f3 build: update pnpm to v10.16.1 (#63794)
See associated pull request for more information.

PR Close #63794
2025-09-15 14:43:32 +00:00
Angular Robot c8cde0f153 build: update cross-repo angular dependencies (#63786)
See associated pull request for more information.

PR Close #63786
2025-09-15 14:41:23 +00:00
Joey Perrott 2ebdd57eae build: update branches and versioning information (#63772)
Update the branches and versioning guide to include information about the `target: feature` and `target: automation` labels.

PR Close #63772
2025-09-12 21:45:49 +00:00
Jessica Janiuk c8d3439814 refactor(core): Reorganize and cleanup animations code (#63775)
This is a pure re-organization of the animations code. No functionality changes, but it should be easier to navigate now. Utility classes have been moved to a `utils.ts` file. The related functions in the instructions have been grouped closer together.

PR Close #63775
2025-09-12 21:41:52 +00:00
Angular Robot 9def49211a build: update pnpm to v10.16.0 (#63770)
See associated pull request for more information.

PR Close #63770
2025-09-12 17:45:15 +00:00
Angular Robot 15b6e1a8ab build: update cross-repo angular dependencies (#63768)
See associated pull request for more information.

PR Close #63768
2025-09-12 17:22:04 +00:00
martincampagnoli 8449001f8c docs: update signal-queries.md (#63726)
PR Close #63726
2025-09-12 16:48:54 +00:00
Angular Robot f2051e7f72 build: update cross-repo angular dependencies (#63765)
See associated pull request for more information.

PR Close #63765
2025-09-12 16:47:25 +00:00
Alan Agius fc850a5db5 ci: add automation label to update cdk apis and cli help workflow (#63753)
Adds the 'target: automation' label to the 'update-cdk-apis' and 'update-cli-help' jobs in the 'update-cdk-apis-and-cli-help.yml' workflow. This will help to better track and manage automation tasks.

PR Close #63753
2025-09-12 16:45:23 +00:00
Matthieu Riegler 9de50b1e7d docs(docs-infra): move the navigation related files (#63729)
* separate directory
* dedicated file for redirections

PR Close #63729
2025-09-12 16:05:04 +00:00
Shuaib Hasan Akib 895f0fb814 docs: update Creating service with CLI (#63714)
Update adev/src/content/guide/di/creating-injectable-service.md

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #63714
2025-09-12 15:51:18 +00:00
Jessica Janiuk 3ec8a5c753 fix(core): Prevent leave animations on a move operation (#63745)
When a user has `animate.leave` on a list of items in a `@for`, but are only showing a subset using a computed, removing the second to last item results in a move operation on the last item. There's no native atomic move API in the browser. So this results in the element being detached and attached at its new index. The detaching of the node resulted in leave animations firing.
This fix addresses this by adding a flag in the `LView[ANIMATIONS]` `AnimationLViewData` interface to allow for skipping animations. During list reconciliation, we set this flag so that the animations are skipped over. The flag is flipped back after the move operation is complete.

There is one complication that results from this. The index adjustment of elements in the list happens synchronously while the leave animation is asynchronous. This results in the leaving item getting shifted to the end of the list. This is not ideal but likely can be addressed in a future refactor.

fixes: #63544

PR Close #63745
2025-09-12 15:21:25 +00:00
Angular Robot 4ee399388e build: update cross-repo angular dependencies (#63751)
See associated pull request for more information.

PR Close #63751
2025-09-12 15:07:34 +00:00
Shuaib Hasan Akib 8e84429203 docs(docs-infra): replace deprecated big tag (#63738)
Update adev/src/content/introduction/what-is-angular.md

Co-authored-by: Joey Perrott <josephperrott@gmail.com>

PR Close #63738
2025-09-12 15:04:57 +00:00
Jens Kuehlers 185ac24ab6 docs: fix links and remove second banner (#63755)
PR Close #63755
2025-09-12 09:51:16 +02:00
Angular Robot e5de4109e6 build: update cross-repo angular dependencies to v20.2.3 (#63741)
See associated pull request for more information.

PR Close #63741
2025-09-11 21:36:02 +00:00
Joey Perrott 00b87a7c26 build: automatically select a random available port when running adev locally (#63740)
Previously we relied on the default port of 4200, but if it was already in use then we would run into issues where the cli provided a prompt which we were unable to respond to. Instead we now request port 0 which will automatically find an available port.

PR Close #63740
2025-09-11 21:17:59 +00:00
SkyZeroZx 50b3e9f4c4 docs: Adds guide for extending Angular service worker (#63629)
Documents how to create custom service worker scripts to handle push notifications, background sync, and other events by importing and extending Angular's default behavior

PR Close #63629
2025-09-11 17:40:48 +00:00
Jens Kuehlers b62cadbe5d docs: add banner for Angular AI developer event (#63734)
PR Close #63734
2025-09-11 16:50:31 +00:00
Angular Robot a686e34da1 docs: update Angular CLI help (#63736)
Updated Angular CLI help contents.

PR Close #63736
2025-09-11 16:44:54 +00:00
Angular Robot 4c3fda7dc3 docs: update Angular CDK apis (#63735)
Updated Angular CDK api files.

PR Close #63735
2025-09-11 16:44:21 +00:00
Angular Robot b7bc11098d build: update cross-repo angular dependencies (#63722)
See associated pull request for more information.

PR Close #63722
2025-09-11 16:32:28 +00:00
Alan Agius 58ddd8bff6 ci: fallback to last known branch when branch does not exist downstream (#63733)
When a new branch is created for a feature, it may not exist in the downstream repo. For example, during an exceptional minor release. In such scenarios, we fallback to the last known branch. This was previously handled in a catch block, but this change makes the fallback more explicit.

PR Close #63733
2025-09-11 16:31:58 +00:00
Rocky Meza 219462fe0f refactor(core): Split consumerBefore/AfterComputation (#62549)
This makes it possible to batch effects, where we can "reopen" consumers
during initial render and then finalize them after we are finally done
adding all the effects to a batch:

```
function createBatch() {
  const effect = // ... create effect node
  resetConsumerBeforeComputation(effect);
  return effect;
}

// pseudo-code
function appendEffect(effectBatch, updater) {
  if (value is a signal) {
    const prevConsumer = setActiveConsumer(effectBatch.node);
    const output = value();
    setActiveConsumer(prevConsumer);
    effectBatch.push({ signal, updater });
    return output;
  }
}

function finalizeBatch(effectBatch) {
  if (effectBatch.length > 0) {
    finalizeConsumerAfterComputation(effectBatch.node);
  }
}

const effectBatch = createBatchEffectNode();
appendEffect(signal1, (newValue) => /* something */);
appendEffect(signal2, (newValue) => /* something different */);
finalizeBatch(effectBatch);
```

PR Close #62549
2025-09-11 15:47:34 +00:00
Alan Agius c36cd73b78 ci: correctly set branchName for the CDK (#63718)
This was incorrect which is causing the Github Action to fail

PR Close #63718
2025-09-11 15:40:28 +00:00
Alan Agius 32ff9eb566 build: mark pnpapi as external for esbuild (#63723)
In the `deploy-docs-site` GitHub action, esbuild fails to resolve `pnpapi` during the bundling process. This is because `pnpapi` is a dependency that is available in the Node.js environment at runtime and should not be bundled.

This commit marks `pnpapi` as an external dependency for esbuild to prevent it from being bundled and resolve the build failure.

```
✘ [ERROR] Could not resolve "pnpapi" [plugin bazel-sandbox]
```

See: https://github.com/angular/angular/pull/63722#issuecomment-3278922553

PR Close #63723
2025-09-11 15:36:34 +00:00
Alan Agius e539e44c85 build: remove manual release note for Firefox addon (#63731)
The reviewer note for Firefox addons included a message that was intended for manual releases. This is no longer necessary with the automated release process.

PR Close #63731
2025-09-11 15:36:03 +00:00
Alan Agius 1c0cc27e6a build: create release branch from FETCH_HEAD (#63731)
When creating the release branch, it should be based on the latest upstream changes to avoid building a release on a stale commit.

PR Close #63731
2025-09-11 15:36:03 +00:00
Devin Chasanoff c7fd7f9a02 docs: update mcp guide (#63664)
PR Close #63664
2025-09-10 23:07:50 +00:00
Jessica Janiuk 5f5828f60d refactor(core): dispatch enter and leave animations at the right times (#63710)
This updates the enter and leave logic to use the stored LView data to dispatch the enter and leave animations at the right points in the lifecycle. This should fix issues with signals not being available yet, parallel animations, and also eliminate the need for the element registry.

fixes: #63391
fixes: #63388
fixes: #63369

PR Close #63710
2025-09-10 22:24:31 +00:00
Jessica Janiuk e00c5c5b3f refactor(core): track enter and leave animations in LView (#63710)
This tracks the enter and leave functions in the LView to be executed at a safe time for change detection.

PR Close #63710
2025-09-10 22:24:31 +00:00
Matthieu Riegler 10827a41ea refactor(core): Error logs links point to the archived version of the docs (#63512)
In order to point the right context, links in error messages will target the archived version of the online doc site (v*.angular.io).

See #44650

PR Close #63512
2025-09-10 22:21:10 +00:00
Alan Agius e4594ef2d8 ci: add fallback logic for downstream branch resolution in the CLI and CDK update action (#63678)
In some cases, such as when a new exceptional minor branch is created. The branch may not exist in the downstream repo. For example, during an exceptional minor release (e.g. FW 20.3.x and Components: 20.2.x).

This commit introduces a fallback mechanism to handle such scenarios. If the current branch is not found in the downstream repository, the script will now fall back to the last known branch from the build information. This ensures that the files can be updated properly.

PR Close #63678
2025-09-10 22:19:31 +00:00
Angular Robot aaacb15bf1 build: update cross-repo angular dependencies (#63669)
See associated pull request for more information.

PR Close #63669
2025-09-10 22:18:15 +00:00
Matthieu Riegler 1b7f53021f build: add a noDuplicateEnumValue rule (#63483)
It caught several legitimate issues.
In the cases I wasn't sure, I just disabled the rule.

fixes #45843

PR Close #63483
2025-09-10 22:16:11 +00:00
Shuaib Hasan Akib ff6038d72d docs(docs-infra): remove deprecated module and add test cases (#63497)
PR Close #63497
2025-09-10 22:15:39 +00:00
Matthieu Riegler 0495254143 docs: fix hostbinding. (#63509)
HostBindings only work on properties and getters. Not methods.

fixes #57909

PR Close #63509
2025-09-10 22:13:46 +00:00
Alan Agius 7dde1951d0 build: introduce and document pnpm run devtools:release command (#63599)
This commit introduces a new `pnpm run devtools:release` command to streamline the Angular DevTools release process.

The command automates the entire release workflow, including checking for new commits, updating version numbers, creating a release commit, and guiding the user through the publishing steps for both Chrome and Firefox extensions.

The `devtools/docs/release.md` documentation has been updated to reflect the use of this new command, providing a single entry point for the release process.

A new script `devtools/tools/release.mts` has been added to implement the release logic, and `package.json` has been updated to include the new script.

PR Close #63599
2025-09-10 22:11:44 +00:00
Angular Robot 8dc34965e3 build: update github/codeql-action action to v3.30.3 (#63675)
See associated pull request for more information.

PR Close #63675
2025-09-10 22:01:26 +00:00
Alan Agius e027406026 docs: update supported Angular versions to include 20.3.x (#63679)
The versions now include the exceptional minor release.

PR Close #63679
2025-09-10 21:59:52 +00:00
Ashna Wiar 7157099669 docs: typo in signals-interop (#63683)
- typo in reference to @angular/core/rxjs-interop
PR Close #63683
2025-09-10 21:59:22 +00:00
Andrew Scott 69b61cbc24 build: update symbol goldens (#63711)
updates symbol goldens after cross repo updates

PR Close #63711
2025-09-10 14:15:36 -07:00
Alan Agius 8266790fb8 build: update cross-repo angular dependencies (#63707)
See associated pull request for more information.

Closes #63669 as a pr takeover

PR Close #63707
2025-09-10 12:07:55 -07:00
Jessica Janiuk 802dbcc2a0 fix(core): prevent animation events from being cleaned up on destroy (#63414)
This will allow manually subscribed animation events to still fire when using `animate.leave`. Otherwise they were being cleaned up before the animations happened.

fixes: #63391

PR Close #63414
2025-09-10 10:07:20 -07:00
Andrew Scott 9096d45377 release: cut the v20.3.0 release 2025-09-10 08:02:27 -07:00
Andrew Scott 34c5a039d1 release: cut the v20.3.0-rc.0 release 2025-09-10 07:57:03 -07:00
Andrew Scott 7a7725ee4c refactor(core): Update tests for zoneless by default (#63672)
Cherrypick #63668 into patch branch to avoid issues with tests when
merging to patch
2025-09-09 15:07:24 -07:00
Miles Malerba 650cd6b903 docs: add missing component harness docs (#63620)
Add some documentation that's mentioned in the material.angular.dev version of the component hanress docs, but was missing from the adev version.

PR Close #63620
2025-09-09 14:29:28 -07:00
Ben Hong d0f0c0824f docs: add signals tutorial (#62750)
PR Close #62750
2025-09-09 12:57:16 -07:00
Ben Hong b1aa2d016a docs: add dedicated signals tutorial (#62750)
PR Close #62750
2025-09-09 12:57:16 -07:00
Christian Sarnataro 68e69670be docs: fixed typo in output page (#63646)
Change `initiaize` to `initialize`

PR Close #63646
2025-09-09 12:56:01 -07:00
Alan Agius 749a71c7e5 ci: update runs-on to ubuntu-latest (#63656)
This commit updates the `runs-on` configuration in the CI workflows
(`ci.yml`, `manual.yml`, `pr.yml`) from specific `ubuntu-latest-Xcore`
labels to the more general `ubuntu-latest`. This change reduces
resource consumption. This change should not be needed for RBE and remote cache.

PR Close #63656
2025-09-09 12:34:23 -07:00
Miles Malerba 3fb7a12078 docs: add missing drag & drop docs (#63619)
Add some documentation that's mentioned in the material.angular.dev
version of the drag & drop docs, but was missing from the adev version.

PR Close #63619
2025-09-09 12:09:53 -07:00
Alan Agius 6117ccee2e feat(core): introduce BootstrapContext for improved server bootstrapping (#63636)
This commit introduces a number of changes to the server bootstrapping process to make it more robust and less error-prone, especially for concurrent requests.

Previously, the server rendering process relied on a module-level global platform injector. This could lead to issues in server-side rendering environments where multiple requests are processed concurrently, as they could inadvertently share or overwrite the global injector state.

The new approach introduces a `BootstrapContext` that is passed to the `bootstrapApplication` function. This context provides a platform reference that is scoped to the individual request, ensuring that each server-side render has an isolated platform injector. This prevents state leakage between concurrent requests and makes the overall process more reliable.

BREAKING CHANGE:
The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

Before:
```ts
const bootstrap = () => bootstrapApplication(AppComponent, config);
```

After:
```ts
const bootstrap = (context: BootstrapContext) =>
  bootstrapApplication(AppComponent, config, context);
```

A schematic is provided to automatically update `main.server.ts` files to pass the `BootstrapContext` to the `bootstrapApplication` call.

In addition, `getPlatform()` and `destroyPlatform()` will now return `null` and be a no-op respectively when running in a server environment.

(cherry picked from commit 8bf80c9d2314b4f2bcf3df83ae01552a6fc49834)

PR Close #63636
2025-09-09 10:45:02 -07:00
Andrew Scott 90e798b675 build: prepare exceptional minor branch: 20.3.x 2025-09-09 10:32:55 -07:00
Shuaib Hasan Akib c7b84f5a22 docs: Update Language Service IDE list (#63647)
PR Close #63647
2025-09-08 16:31:23 -07:00
Shuaib Hasan Akib a857f72c81 docs: should not conditionally include <ng-content> in IMPORTANT block (#63580)
PR Close #63580
2025-09-08 14:53:12 -07:00
Angular Robot 067a3a5a76 build: update github/codeql-action action to v3.30.1 (#63622)
See associated pull request for more information.

PR Close #63622
2025-09-08 14:52:29 -07:00
Shuaib Hasan Akib ad1f106f6d docs(docs-infra): prevent empty h3 tags when title is empty (#63573)
Conditionally render h3 element only when title attribute has content

PR Close #63573
2025-09-08 14:50:47 -07:00
Matthieu Riegler 9943230f91 docs: remove installation (#63508)
We don't have that section in other parts of the docs, package name is already mentionned.

fixes #62691

PR Close #63508
2025-09-08 14:22:52 -07:00
Matthieu Riegler 35a1d5d7bf refactor(compiler-cli): add support for if/switch to the non-invoked signal diagnostic (#63502)
This commit adds the support to the existing "interpolated_signal_not_invoked" diagnostic (even though it's not really a interpolation)

PR Close #63502
2025-09-08 13:17:05 -07:00
Shuaib Hasan Akib b3d102b475 docs: update template examples to use signal-based viewChild instead of decorator-based @ViewChild (#63630)
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #63630
2025-09-08 12:52:28 -07:00
Joey Perrott a6ed784508 build: properly override the repo for rules_angular (#63584)
Override the repo "rules_angular_configurable_deps" correctly so that the actual compiler and compiler-cli from the local repo is used

PR Close #63584
2025-09-08 12:34:53 -07:00
Shuaib Hasan Akib cf690982de docs: update package link (#63579)
PR Close #63579
2025-09-08 12:33:55 -07:00
Jessica Janiuk f21c7565d7 docs: add CSS transitions note on animate.enter (#63618)
PR Close #63618
2025-09-08 12:32:03 -07:00
Joey Perrott a52f4a1987 build: separate zone.js dependencies into their own directory (#63612)
Separate out zone.js dependencies

PR Close #63612
2025-09-08 12:30:40 -07:00
Matthieu Riegler d124fba6ff docs: improve headings of docs (#63604)
This is an attemp to improve the indexation of those pages by making SSR and i18N important

PR Close #63604
2025-09-08 12:10:26 -07:00
Joey Perrott a6640e3cc5 build: add additional comments explaining deep imports in adev (#63644)
Add additional comment to explain why deep imports are required for building adev using the angular cli

PR Close #63644
2025-09-08 11:15:07 -07:00
Shuaib Hasan Akib f2ec6fbfa7 docs(docs-infra): quote title attributes in links (#63578)
Prevent broken HTML when link titles contain spaces by properly quoting the title attribute

PR Close #63578
2025-09-08 10:14:48 -07:00
Matthieu Riegler f18980c18d docs(docs-infra): fix mini share icon URL. (#63586)
fixes #63569

PR Close #63586
2025-09-05 13:08:16 -07:00
Alan Agius c3303a5f75 test: increase mermaid spec timeout to reduce flakes (#63610)
The mermaid spec test can be flaky due to timeouts. This commit increases the timeout to 25 seconds to make the test more reliable.

PR Close #63610
2025-09-05 12:53:50 -07:00
Cheng-Hsuan Tsai f697995c26 docs(docs-infra): allow collapse code example (#63559)
PR Close #63559
2025-09-04 15:25:24 -07:00
Shuaib Hasan Akib e1dd3b10dd docs: uses signal, implement TODOs, and fix typos (#63603)
PR Close #63603
2025-09-04 15:21:01 -07:00
Avcharov Hryhorii a3f808d7c8 fix: remove refresh button from transfer state tab (#63592)
TransferState is only written into the DOM once during SSR and is not kept in sync with the runtime state on the client. Pressing the refresh button always re-reads the initial serialized script tag, which never changes after bootstrap.

PR Close #63592
2025-09-04 09:23:24 -07:00
Angular Robot 951701dabb build: update cross-repo angular dependencies (#63581)
See associated pull request for more information.

PR Close #63581
2025-09-03 20:56:00 -07:00
Miles Malerba 08d363e2cc release: cut the v20.2.4 release 2025-09-03 12:36:46 -07:00
Angular Robot 320f1d6537 build: update @angular/ng-dev digest to 435c59b (#63571)
See associated pull request for more information.

PR Close #63571
2025-09-03 09:51:59 -07:00
Joey Perrott 991785fc18 build: use common jasmine rule from dev-infra (#63568)
Use the new common jasmine rule from dev-infra which include sourcemap rewriting support and esm file loading

PR Close #63568
2025-09-03 16:34:09 +00:00
Joey Perrott fc80684fa3 build: add zone.js/test/typings to bazelignore (#63568)
Add the zone.js/test/typings node_modules directory to the bazelignore list

PR Close #63568
2025-09-03 16:34:09 +00:00
Angular Robot 452abfc33c build: update cross-repo angular dependencies (#63566)
See associated pull request for more information.

PR Close #63566
2025-09-03 16:33:33 +00:00
Shuaib Hasan Akib 869312ef71 docs: discourage use of ng as a component or directive selector prefix (#63567)
PR Close #63567
2025-09-03 09:31:17 -07:00
Alan Agius 0c2255bde8 refactor(platform-server): simplify transfer state serialization tracking (#63525)
The logic to track if the transfer state has been serialized is simplified by removing the need for `APP_ID`. Instead of maintaining a `Set` of application IDs, a simple boolean flag is used.

PR Close #63525
2025-09-03 09:15:53 -07:00
Alan Agius d1d32db972 fix(platform-server): prevent false warning for duplicate state serialization (#63525)
The `TRANSFER_STATE_SERIALIZED_FOR_APPID` provider was previously configured at the platform level, causing its state to be shared across all concurrent server-side rendering requests. This created a race condition where one request could see the `appId` from a different, concurrent request, leading to false warnings about duplicate state serialization.

This commit changes the provider's scope to ensure that each application instance gets its own unique state. This correctly isolates the serialization check to each individual request, resolving the issue of false warnings in concurrent environments.

Closes #63524

PR Close #63525
2025-09-03 09:15:53 -07:00
Shuaib Hasan Akib f4a2d0abc5 docs: fix #63555 (#63560)
PR Close #63560
2025-09-03 09:01:37 -07:00
Angular Robot 7bbcb54241 build: lock file maintenance (#63523)
See associated pull request for more information.

PR Close #63523
2025-09-02 12:40:04 -07:00
Angular Robot 1e47a87fc6 build: update cross-repo angular dependencies (#63553)
See associated pull request for more information.

PR Close #63553
2025-09-02 11:54:45 -07:00
aparziale dc64f3e478 fix(core): Fixed inject migration schematics for migrate destructured properties (#62832)
Fixes #62626 - Properties used with the destructor are also managed during migration.

PR Close #62832
2025-09-02 10:59:47 -07:00
Angular Robot 957b36798f build: update github/codeql-action action to v3.30.0 (#63540)
See associated pull request for more information.

PR Close #63540
2025-09-02 17:10:21 +00:00
Angular Robot bf74c56fe1 build: update pnpm to v10.15.1 (#63527)
See associated pull request for more information.

PR Close #63527
2025-09-02 17:09:04 +00:00
Matthieu Riegler c664af8dec docs(docs-infra): highlight & parse api descriptions. (#63536)
The prevent future regression of this, this commit introduces additional tests.

PR Close #63536
2025-09-02 16:49:11 +00:00
Shuaib Hasan Akib d6f7f68012 docs(docs-infra): signal property should be readonly (#63166)
PR Close #63166
2025-09-02 16:44:13 +00:00
Shuaib hasan akib 043017871c docs: fix wrong file reference and update Tailwind CSS guide link (#63533)
PR Close #63533
2025-09-02 16:42:07 +00:00
Shuaib hasan akib 3b42314bb5 docs(docs-infra): export class (#63506)
PR Close #63506
2025-09-02 16:36:48 +00:00
Shuaib Hasan Akib 15fa2ce1c4 docs(docs-infra): apply migration script changes (#63514)
PR Close #63514
2025-09-02 09:32:01 -07:00
Shuaib Hasan Akib f204b54f9a docs(docs-infra): marks properties protected used in template (#63513)
PR Close #63513
2025-09-02 09:31:29 -07:00
Duncan Faulkner 3bd3c902ad docs: add full example for multiple content projections with card-title and card-body components (#63515)
PR Close #63515
2025-09-02 09:28:47 -07:00
Miles Malerba dddce8311f ci: add more team members as approvers (#63495)
adds amishne, leonsenft, mattrbeck to approve but not receive review
requests

PR Close #63495
2025-08-29 15:12:13 -07:00
Shuaib Hasan Akib e9096b9aab docs(docs-infra): properties should be readonly (#63492)
PR Close #63492
2025-08-29 14:06:34 -07:00
Sean Bright 6e5647f028 docs: fix up some clunky wording (#63491)
PR Close #63491
2025-08-29 14:06:02 -07:00
Jan Melcher 5bb4b75488 docs: fix rxResource example (#63484)
PR Close #63484
2025-08-29 19:00:16 +00:00
Angular Robot 8dbeac1341 build: update cross-repo angular dependencies (#63478)
See associated pull request for more information.

PR Close #63478
2025-08-29 08:53:44 -07:00
Matthieu Riegler ed50120d4c refactor(animations): remove dependency on @angular/common (#63248)
`DOCUMENT` was move to `@angular/core`, so we don't need to depend on common anymore.

PR Close #63248
2025-08-29 08:51:32 -07:00
Angular Robot 1abf6d5abd build: update cross-repo angular dependencies to 06d3af5 (#63476)
See associated pull request for more information.

PR Close #63476
2025-08-29 13:45:58 +00:00
Shuaib hasan akib c357a03bc6 docs(docs-infra): makes signal readonly (#63449)
PR Close #63449
2025-08-29 13:01:54 +00:00
Maryannah 6a5d12a186 docs: update documentation for Vitest use (#62798)
PR Close #62798
2025-08-29 13:00:53 +00:00
Emiliano González 7f5c1310f3 docs: Correct description of lesson outcome (#62710)
PR Close #62710
2025-08-29 13:00:21 +00:00
Angular Robot 22214593ab build: update cross-repo angular dependencies (#63468)
See associated pull request for more information.

PR Close #63468
2025-08-29 12:59:02 +00:00
Angular Robot 5a989f26f3 build: update dependency node to v22.19.0 (#63464)
See associated pull request for more information.

PR Close #63464
2025-08-29 12:57:34 +00:00
Angular Robot ae2a1faaad build: update google-github-actions/auth digest to c200f36 (#63462)
See associated pull request for more information.

PR Close #63462
2025-08-29 12:55:53 +00:00
Jessica Janiuk 64ddde21af release: cut the v20.2.3 release 2025-08-29 14:33:36 +02:00
Jessica Janiuk 479a919f42 fix(compiler): fixes regression with event parsing and animate prefix (#63470)
The new animations was not correctly looking for the `.` when parsing bindings. This resulted in arbitrary event bindings creating animate.leave instruction calls.

fixes: #63466

PR Close #63470
2025-08-29 11:53:30 +00:00
Angular Robot 98468c0d7a build: update cross-repo angular dependencies (#63444)
See associated pull request for more information.

PR Close #63444
2025-08-28 09:21:54 -07:00
Hongxu Xu b549cd28ae refactor(bazel): reduce build deps (#63348)
clean up deps in bazel build scripts

PR Close #63348
2025-08-28 09:16:10 -07:00
Angular Robot cef1449ac7 docs: update Angular CLI help (#63446)
Updated Angular CLI help contents.

PR Close #63446
2025-08-28 09:11:46 -07:00
Alan Agius 05a9322c75 build: remove rulesJsInteropMode (#63448)
This is no longer needed.

PR Close #63448
2025-08-28 08:49:25 -07:00
Matthieu Riegler df89611bf2 docs(docs-infra): remove unused example (#63426)
PR Close #63426
2025-08-28 08:47:54 -07:00
Milo 35dea23580 build: simplify pnpm scripts in package.json (#63310)
remove unnecessary pnpm prefix for bin scripts from node_modules

PR Close #63310
2025-08-28 08:46:23 -07:00
Vincent 596b545130 fix(core): Prevent an error on cleanup when an rxResource stream threw before returning an Observable (#63342)
Before this commit, it was wrongly assumed that the stream subscription could not be `undefined`.

Fixes #63341

PR Close #63342
2025-08-28 08:44:52 -07:00
arturovt 1e3999ec36 refactor(core): replace Optional/SkipSelf deps with inject() flags (#63386)
This commit updates provider definitions that relied on the `deps` array
with `new Optional()` and `new SkipSelf()` to instead use the modern
`inject(..., { optional: true, skipSelf: true })` API.

Previously:
  deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]

Now:
  const parent = inject(KeyValueDiffers, { optional: true, skipSelf: true });

**Bundle size reduction**: `Optional` and `SkipSelf` are runtime values
created by `makeParamDecorator()`. Even in production builds, esbuild
and other bundlers must keep their factory code because they are
referenced with `new Optional()` / `new SkipSelf()`. With `inject()`,
those classes are no longer referenced, allowing them and the
`makeParamDecorator` scaffolding to be tree-shaken when unused.

As a result, production bundles can drop both `Optional`, `SkipSelf`, and
their supporting factory code when not used elsewhere, reducing code size
while keeping the same behavior.

PR Close #63386
2025-08-28 08:43:17 -07:00
Jessica Janiuk 114906d2d6 fix(core): Fix cancellation of animation enter classes (#63442)
When toggling visibility on an element over and over, the enter animations were supposed to be cancelled and then the classes removed. There was a race condition happening that resulted in the cancelled animation being the leave animation. Rather than using the animation.cancel functionality, it's safer to just remove the enter classes.

fixes: #63439

PR Close #63442
2025-08-28 14:11:06 +00:00
Alan Agius 2e05deaffb ci: remove old options from workflows (#63441)
The `cache-node-modules` option has been removed as pnpm store cache is enabled by default.

PR Close #63441
2025-08-28 14:05:45 +00:00
Alan Agius 2fb029de04 ci: fix and improve devtools step (#63441)
This commit updates the devtools step by disabling the package manager cache. This change is necessary because Cypress downloads its binary to a cache directory during installation, which requires a post-install script. However, when the cache is hit this is skipped.

This update also disables `pnpm install` in the Cypress action to avoid a redundant installation step. And adds a seperate cache for the downloaded Cypress binary.

See: https://docs.cypress.io/app/get-started/install-cypress#pnpm-configuration

PR Close #63441
2025-08-28 14:05:45 +00:00
SkyZeroZx 690405b253 docs: Add docs service worker to new options (#63436)
Add docs service worker to new options

PR Close #63436
2025-08-28 10:20:52 +00:00
Angular Robot fe533cd244 docs: update Angular CLI help (#63420)
Updated Angular CLI help contents.

PR Close #63420
2025-08-28 10:09:09 +00:00
Matthieu Riegler 421edfe04b build: update @bazel/ibazel to 0.26.10 (#63435)
To fix failing devtools tests

PR Close #63435
2025-08-28 10:02:02 +00:00
Joey Perrott 87bfe164e3 build: define typescript version via string in module.bazel file (#63434)
Within our module.bazel file when describing the version of typescript to use for rules_ts, we use ts_version instead of ts_version_from to prevent our package.json file from being
part of the set of files used to calculate the sha for the lock file.  Any unrelated change to the version of the typescript file would end up causing our lockfile to be out of date.
This amount of churn has proven to be too much for our current setup. We instead now test to validate the versions defined in the package.json and MODULE.bazel files match.

PR Close #63434
2025-08-28 09:55:37 +00:00
Shuaib Hasan Akib a6a46e9839 docs(docs-infra): tooltip on hover and message after copied (#63167)
PR Close #63167
2025-08-27 16:56:45 -07:00
Ben Hong 9de2f078d5 docs: add customizing route behavior guide for router (#63398)
PR Close #63398
2025-08-27 16:18:39 -07:00
Shuaib Hasan Akib 40844876ea docs(docs-infra): mark properties as readonly if they shouldn't change (#63200)
PR Close #63200
2025-08-27 16:16:25 -07:00
Angular Robot ca61366218 build: update cross-repo angular dependencies (#63396)
See associated pull request for more information.

PR Close #63396
2025-08-27 16:14:31 -07:00
Matthieu Riegler cd748aad47 docs: remove the ng-class migration entry (#63430)
That migration is only available in v21 / on the main branch for now.

fixes #63428

PR Close #63430
2025-08-27 16:10:18 -07:00
arturovt fce5602b53 refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400)
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to
optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively
retain the `VERSION` instantiation even when unused. With the annotation,
the constant can be tree-shaken away in production builds if not referenced,
reducing bundle size.

PR Close #63400
2025-08-27 11:39:07 -07:00
arturovt f87fad3fff fix(core): avoid injecting internal error handler from a destroyed injector (#62275)
This commit prevents lazy injection of the internal `ErrorHandler` from a destroyed injector, which would otherwise result in a secondary "destroyed injector" error.

The `handleUncaughtError` function is used in a wrapped event listener that invokes the `ErrorHandler` if the listener throws. A simple case in a micro-frontend application:

```ts
onNavigationToAnotherApp() {
  this.appRef.destroy();
  do_some_stuff_ie_loggin_that_may_throw();
}
```

If the function throws an error, Angular attempts to inject the `ErrorHandler` from a destroyed injector.

PR Close #62275
2025-08-27 11:35:55 -07:00
Alexander Melde 06c53679ba docs: update to new standalone default behavior (#63329)
When declaring directives, the standalone flag is set to true by default in current Angular versions.

The docs for the directive decorator should correctly explain the default behavior, while still mentioning when to set it to false.

PR Close #63329
2025-08-27 11:26:13 -07:00
Matthieu Riegler e8d9bc5119 refactor(http): rework the HttpEvent union to improve narrowing. (#63267)
Prior to this change, `HttpProgressEvent` could not be narrowed to `HttpDownloadProgressEvent` or `HttpUploadProgressEvent`

PR Close #63267
2025-08-27 11:25:02 -07:00
Joey Perrott 26072bba9c build: move macros/build set up for zone.js into zone.js directories (#63421)
Move the zone_bundle and configurations into zone.js's tool directory

PR Close #63421
2025-08-27 11:23:58 -07:00
Joey Perrott 00bfff52c2 build: remove unused macros (#63421)
Remove unused macro files

PR Close #63421
2025-08-27 11:23:57 -07:00
Joey Perrott 0bc7f154c8 build: remove ts_project_interop file (#63421)
Remove the ts_project_interop.bzl file that no longer does interop work

PR Close #63421
2025-08-27 11:23:57 -07:00
Joey Perrott 705b94bd21 refactor: remove TODOs which have been corrected (#63421)
Remove TODOs which were addressed but the comment was not removed

PR Close #63421
2025-08-27 11:23:57 -07:00
Jessica Janiuk ed6a347109 refactor(core): prevent timeout from applying to non-event animation bindings (#63393)
The 4 second removal timeout was applying in all cases, but it should only actually apply to the situation where the event binding syntax is used for animate.leave. This ensures that's the only case in which it'll apply.

PR Close #63393
2025-08-27 11:17:40 -07:00
Andrew Scott 6d6b0278a8 refactor(core): Reorder resolve/reject in relation to navigate[error/success] (#63377)
Order was changed in https://github.com/whatwg/html/pull/11512 (see that
PR for details as to why).

https://whatpr.org/html/10919/nav-history-apis.html#abort-a-navigateevent

PR Close #63377
2025-08-27 11:16:53 -07:00
Andrew Kushnir 6e0b66d702 release: cut the v20.2.2 release 2025-08-27 10:53:04 -07:00
Matthieu Riegler 47caed9ada ci: pin create-pull-request version to sha (#63409)
This is a new security requirement to prevent dependency compromission.

PR Close #63409
2025-08-27 07:36:12 -07:00
Taygan Caldwell 23d1ace339 refactor(core): Create a base effect interface and prototype to be used by both angular and wiz. (#62931)
Add a common effect interface and prototype to be used to create the wiz and angular effects.

PR Close #62931
2025-08-26 14:48:33 -07:00
Matthieu Riegler e220a615d1 docs(docs-infra): patch port changes from main (#63394)
This sync some of the changes we have on the main branch will allow more upcomming changes to land via a single PR.

PR Close #63394
2025-08-26 09:48:03 -07:00
Jessica Janiuk d7b6045d61 fix(compiler): fixes animations on elements with structural directives (#63390)
The animate instructions were getting applied to the container comment nodes as well as the element nodes. This prevents that on the compiler level.

fixes: #63371

PR Close #63390
2025-08-26 09:47:08 -07:00
Avcharov Hryhorii c9b0f45690 fix(devtools): prevent profiler bars flickering after change detection (#63350)
Without trackBy cdkVirtualFor rerenders full list after in each update

PR Close #63350
2025-08-26 09:41:09 -07:00
Angular Robot 15395a576f build: update cross-repo angular dependencies (#63380)
See associated pull request for more information.

PR Close #63380
2025-08-25 16:29:57 -07:00
Joey Perrott 9a27c5befb build: rename defaults2.bzl to defaults.bzl (#63384)
Use defaults.bzl for the common macros

PR Close #63384
2025-08-25 15:45:46 -07:00
Joey Perrott a26d94d979 build: enable strict deps enforcement for ts_project (#63376)
Enable strict_deps testings for all ts_project and ng_project targets in the repo

PR Close #63376
2025-08-25 15:38:12 -07:00
Angular Robot 328e588bcd build: lock file maintenance (#63360)
See associated pull request for more information.

PR Close #63360
2025-08-25 15:37:25 -07:00
Angular Robot 454a269254 build: update cross-repo angular dependencies (#63339)
See associated pull request for more information.

PR Close #63339
2025-08-25 10:50:36 -07:00
Angular Robot f881082e80 build: update bazel dependencies (#63345)
See associated pull request for more information.

PR Close #63345
2025-08-25 08:36:53 -07:00
Jessica Janiuk c8f07daf8f fix(core): Fixes animate.leave binding to a string with spaces (#63366)
This fixes the rare case that someone uses binding syntax with `animate.leave` providing a value with a string that has spaces in it. For example:

```
<example `[animate.leave]="'class-a class-b"` />
```

fixes: #63365

PR Close #63366
2025-08-25 08:33:31 -07:00
AleksanderBodurri 3f247f1256 fix(devtools): correct path to load fonts for devtools devserver (#63358)
This broke in c35c0c7f2f. This commit changes the path to load the external stylesheet to reflect the new directory path.

PR Close #63358
2025-08-25 08:31:56 -07:00
Jessica Janiuk aabe146c30 docs: update paths and references to animations guides (#63370)
This updates the adev navigation to consider the new enter-and-leave path to be the definitive animations guide.
It also prefixes all the prior animations package docs with legacy and updates all links.

PR Close #63370
2025-08-25 08:22:32 -07:00
Jessica Janiuk 650ad1f7fb docs: add important service worker note (#63364)
This adds an important note about the service worker to indicate we are not accepting new features.

PR Close #63364
2025-08-25 08:18:32 -07:00
Jessica Janiuk 269f344d45 docs: update animations guide important note (#63363)
PR Close #63363
2025-08-25 08:17:44 -07:00
Matthieu Riegler a649d85de1 refactor(docs-infra): ensure we're not creating nested anchor elements. (#63352)
With #63162, we added automatic link creation on API symbols. The side effect was that we created HTML in some specific cases. For example with the docs-card we could have nested anchor elements which is invalid.

This commit prevent creating nested links inside docs-cards.
fixes #63351

PR Close #63352
2025-08-25 08:16:21 -07:00
Matthieu Riegler 020e0f0424 refactor(docs-infra): rename testing into test. (#63352)
We usually name `test` our test directories and `testing` for the testing helpers.

PR Close #63352
2025-08-25 08:16:21 -07:00
Joey Perrott 10b0927e15 refactor: various build and import specificer fixes for strict deps (#63324)
Change direct deps in bazel targets and import specifiers within files to maintain strict deps requirements ahead of enabling strict deps tests in the repo

PR Close #63324
2025-08-22 14:45:34 -07:00
Shuaib Hasan Akib 28c28a0aa4 docs(docs-infra): Replace page enums by constants (#63335)
PR Close #63335
2025-08-22 14:42:52 -07:00
Matthieu Riegler eef93f5a7b docs(docs-infra): auto-links to API entries (#63283)
This is a first step to create links to API entries automatically.
It adds support for
- code spans (`` `symbol` ``)
- code blocks (`` ```some code here``` ``)

Links are generated from on a K/V map of API entries (symbol => package name).
The map is generated from the API manifest that we're already generating for the API docs.

For the moment, entries with identical names are skipped.

This is a backport of #63162

PR Close #63283
2025-08-22 14:42:17 -07:00
Matthieu Riegler e1481d89dc ci: add myself to review fw-general (#63337)
Also adding myself to be assigned some adev PRs

PR Close #63337
2025-08-22 12:27:37 -07:00
Shuaib Hasan Akib e8aa7d3ce3 docs(docs-infra): fix spelling (#63334)
PR Close #63334
2025-08-22 12:01:49 -07:00
Angular Robot b02042301a build: update cross-repo angular dependencies (#63332)
See associated pull request for more information.

PR Close #63332
2025-08-22 11:29:11 -07:00
Angular Robot 551c99fd5f build: update github/codeql-action action to v3.29.11 (#63326)
See associated pull request for more information.

PR Close #63326
2025-08-22 11:28:31 -07:00
Jessica Janiuk 6c421ed65d fix(core): Ensures @for loop animations never get cancelled (#63328)
There's special logic in place to prevent duplicate nodes from showing up in the case when an `@if` toggles a view quickly. This had the unfortunate side effect of causing `@for` leave animations to get cancelled when an add and remove happened simultaneously, even if it was a different index. This fix prevents that from happening in the `@for` loop case.

fixes: #63307

PR Close #63328
2025-08-22 11:23:16 -07:00
Jessica Janiuk 9093e0e132 fix(core): fix memory leak with leaving nodes tracking (#63328)
This ensures the nodes are properly cleaned up from the leaving nodes map.

PR Close #63328
2025-08-22 11:23:16 -07:00
Angular Robot 040cba0b09 build: update cross-repo angular dependencies (#63319)
See associated pull request for more information.

PR Close #63319
2025-08-21 14:12:40 -07:00
Angular Robot 6213c7d998 build: update cross-repo angular dependencies (#63316)
See associated pull request for more information.

PR Close #63316
2025-08-21 11:45:18 -07:00
Matthieu Riegler 49e00b306a docs(docs-infra): fix mermaid rendering (#63311)
A recent update of mermaid change the html output. `rect` became `path`.

fixes #63308

PR Close #63311
2025-08-21 10:06:32 -07:00
Kristiyan Kostadinov 1c27fa982c release: cut the v20.2.1 release 2025-08-21 12:52:59 +02:00
Matthieu Riegler a28672fb70 fix(compiler): Keep paraenthesis in Nullish + Boolean expression. (#63292)
Ts 5.9 introduced a regression coming from 5.8 when parenthesis aren't generated for expressions like (`(a ?? b) && c`).
This fix works around this explicitly specifying that we want to keep those parenthesis that we're aware of in this specific case;

This change can be reverted if the root issue (https://github.com/microsoft/TypeScript/issues/61369) is fixed. (but let's keep the tests in any case for the coverage)

fixes #63287

PR Close #63292
2025-08-21 12:15:52 +02:00
Angular Robot 65c5a734e2 build: update @angular/ng-dev digest to c93dfc8 (#63290)
See associated pull request for more information.

PR Close #63290
2025-08-20 16:16:17 +00:00
Joey Perrott 9bdb4fe8cc build: reenable firefox tests for devtools (#63288)
Reenable firefox tests for devtools as the spaces issues with path names is addressed post v7 of bazel

PR Close #63288
2025-08-20 16:08:22 +00:00
Alan Agius 11c638557b build: enforce frozen lockfile mode (#63260)
This commit adds `lockfile_mode=error` to the `.bazelrc` file. This change ensures that any future builds will fail if the lock file is not up-to-date with the `BUILD.bazel` file, preventing inconsistencies and encouraging developers to commit updated lock files.

PR Close #63260
2025-08-20 16:00:06 +00:00
Angular Robot a6130e076a build: update cross-repo angular dependencies (#63286)
See associated pull request for more information.

PR Close #63286
2025-08-20 15:47:25 +00:00
Devin Chasanoff 906bce0877 docs: add ai design patterns to adev/ai (#63095)
PR Close #63095
2025-08-20 15:43:36 +00:00
Angular Robot a827f02746 build: update cross-repo angular dependencies (#63285)
See associated pull request for more information.

PR Close #63285
2025-08-20 15:16:58 +00:00
Matthieu Riegler eb0183009b docs: remove IsolatedShadowDom from the 20.2 release (#63281)
The change has been reverted by #63142

PR Close #63281
2025-08-20 13:05:12 +00:00
Jessica Janiuk 9e172e0280 release: cut the v20.2.0 release 2025-08-20 14:29:27 +02:00
Kristiyan Kostadinov 878b99a1c6 fix(compiler-cli): account for expression with type arguments during HMR extraction (#63261)
Fixes that the HMR extraction logic didn't accoubnt for expressions with type arguments (e.g. `viewChild('foo', {read: TemplateRef<unknown>})`).

Fixes #63240.

PR Close #63261
2025-08-20 11:31:45 +00:00
Angular Robot 9655ea7f5c build: update dependency playwright-core to v1.55.0 (#63273)
See associated pull request for more information.

PR Close #63273
2025-08-20 11:14:53 +00:00
Angular Robot d76a911669 build: update all non-major dependencies (#63266)
See associated pull request for more information.

PR Close #63266
2025-08-20 10:06:50 +00:00
ivanwonder 591c7e2ec8 fix(language-service): Support to resolve the re-export component. (#62585)
In the context of TypeScript (TS), a re-exported symbol is considered a distinct symbol.
This means that a developer can choose to import either the re-exported symbol or
the original symbol. However, in the context of Angular, the re-exported symbol
is treated as the same component because it uses the same selector.

This pull request will utilize the most recent re-export component file to
resolve the module specifier.

PR Close #62585
2025-08-20 09:39:56 +00:00
Matthieu Riegler 81dc006772 docs: update NG_VALIDATORS examples to use forwardRef (#63247)
PR Close #63247
2025-08-20 09:27:21 +00:00
Matthieu Riegler c0eb0cb7a5 docs(docs-infra): remove temporary shiki dts (#63253)
The tooling now supports reading `d.mts` typing files

PR Close #63253
2025-08-20 09:26:18 +00:00
Angular Robot 416878bb7c build: update cross-repo angular dependencies (#63265)
See associated pull request for more information.

PR Close #63265
2025-08-20 09:06:56 +00:00
Matthieu Riegler fceb19128d docs: rewording heading for define option (#63009)
This is an attemp to improve search results

PR Close #63009
2025-08-20 09:04:59 +00:00
Jessica Janiuk f9d73cc687 fix(core): handle cases where classes added have no animations (#63242)
In the case that someone wants to disable animations via selector specificity, for example by adding an `.animate-disabled` class to a parent node, we need to make sure the animate instructions don't misbehave. Now we detect if animations exist in the provided classes and react accordingly.

fixes: #63161

PR Close #63242
2025-08-20 08:59:03 +00:00
tjshiu 5ceb1167fb docs: remove redundant Angular docs link in tailwind guide (#63205)
The Tailwind CSS guide already resides within the Angular documentation, making a link to the Angular documentation redundant. This commit removes the unnecessary link.

PR Close #63205
2025-08-20 08:30:36 +00:00
tjshiu 6b475eb86c docs: update tailwind guide and navigation (#63205)
PR Close #63205
2025-08-20 08:30:36 +00:00
tjshiu 9eac011bd0 docs: add guide for using Tailwind CSS (#63205)
Adds a new guide that explains how to set up and use Tailwind CSS in an Angular project. This guide covers installation, configuration, and provides a basic usage example.

PR Close #63205
2025-08-20 08:30:35 +00:00
Angular Robot 0ba671d4a0 build: update pnpm to v10.15.0 (#63259)
See associated pull request for more information.

PR Close #63259
2025-08-20 08:29:24 +00:00
Joey Perrott 38b9b79c29 build: move from using WORKSPACE to MODULE.bazel (#63249)
Update to use MODULE.bazel

PR Close #63249
2025-08-20 08:27:00 +00:00
cexbrayat 1edb83c019 docs: animationsEnabled defaults to false (#63262)
PR Close #63262
2025-08-20 08:25:26 +00:00
Angular Robot be0e8457b7 build: update all non-major dependencies (#63258)
See associated pull request for more information.

PR Close #63258
2025-08-20 08:23:17 +00:00
Angular Robot aff482913b build: update cross-repo angular dependencies (#63244)
See associated pull request for more information.

PR Close #63244
2025-08-19 15:59:55 +00:00
Matthieu Riegler 9374d57330 build: remove patch-package dependency (#63233)
This a patch backport of #63126

PR Close #63233
2025-08-19 12:34:06 +00:00
Julien Zapata Duque 52106fb71b docs: use correct closing quote in input and model import usage notes (#63237)
PR Close #63237
2025-08-19 12:33:24 +00:00
Angular Robot 58765137ab build: update all non-major dependencies (#63236)
See associated pull request for more information.

PR Close #63236
2025-08-19 11:14:57 +00:00
Shuaib Hasan Akib 8164b2298e refactor(core): update NG0303 error message (#63222)
Ensure consistency in error message wording by aligning the NG0303
error with other Angular error strings. This improves clarity and
maintains a uniform developer experience

PR Close #63222
2025-08-19 08:25:50 +00:00
Angular Robot 966d95df20 docs: update Angular CLI help (#63226)
Updated Angular CLI help contents.

PR Close #63226
2025-08-19 08:16:32 +00:00
Angular Robot fe27810a24 build: update github/codeql-action action to v3.29.10 (#63232)
See associated pull request for more information.

PR Close #63232
2025-08-19 08:06:26 +00:00
Angular Robot 4dfd38e127 build: update dependency preact to v10.27.1 (#63231)
See associated pull request for more information.

PR Close #63231
2025-08-19 08:05:37 +00:00
Avetik Harutyunyan a8c5bafd18 docs: fix typo in SSR section (#63224)
PR Close #63224
2025-08-19 08:01:28 +00:00
Matthieu Riegler d8254d95e9 docs: update version compatiblity. (#63223)
TS 5.9 support landed with #62939

PR Close #63223
2025-08-19 08:00:55 +00:00
Paweł Kawula 0c61fc6d43 docs: fixed mismatch between supported node versions (#63218)
node versions listed here https://angular.dev/reference/versions
and minimal listed in installation.md are different

PR Close #63218
2025-08-19 07:59:22 +00:00
Matthieu Riegler 0da66e6d43 docs(docs-infra): lift circular imports (#63186)
This commit also adds adev on the cyclic import check.

PR Close #63186
2025-08-19 07:58:47 +00:00
Jessica Janiuk 7b51728813 fix(compiler): fixes animation event host bindings not firing (#63217)
Host bindings for `(animate.enter)` and `(animate.leave)` were not firing properly. This fixes the compiler ingest to make sure they do fire.

fixes: #63199

PR Close #63217
2025-08-18 15:56:49 +00:00
AleksanderBodurri 5be80d33a3 fix(devtools): DOM traversal bug (#62719)
Previously, Angular devtools would mistakenly traverse the same DOM elements multiple times while doing traversal for the component tree explorer. This error case would occur when more than 1 Angular application root component was present on the same page and in distinct DOM branches.

Some example cases that did work previously:

```html
<app-root>
...
</app-root>
```

```html
<app-root>
...
<app-root-2></app-root-2>
...
</app-root>
```

An example of where it would enter the irregular behaviour

```html
<app-root>
...
</app-root>
<app-root-2>
...
</app-root-2>
```

Now, we properly ignore duplicate DOM paths when looking for application and non-application root component to begin the Angular DevTools component discovery logic.

PR Close #62719
2025-08-18 15:43:09 +00:00
Angular Robot 1e3748b893 build: update cross-repo angular dependencies (#63221)
See associated pull request for more information.

PR Close #63221
2025-08-18 15:21:53 +00:00
Joey Perrott 87523e90bc build: update the failure message with the correct command (#63219)
Update the failure message for compliance tests to use the correct command for updating the goldens

PR Close #63219
2025-08-18 15:08:57 +00:00
Jessica Janiuk bdc31675b7 fix(core): ensure animate events do not have duplicate elements (#63216)
This applies the same fix that fixed the class version to the event binding version. It prevents duplicate elements from being on screen when animations have been toggled too fast.

fixes: #63127

PR Close #63216
2025-08-18 12:42:17 +00:00
Paul Gschwendtner 726d6026b1 ci: mark myself as unavailable during OOO (#63214)
Marks myself as unavailable during OOO to not block reviews :)

PR Close #63214
2025-08-18 12:53:20 +02:00
Alan Agius 0eb550e297 fix(docs-infra): allow wrapping of types-and-default CLI options (#63211)
This change fixes an issue where long lists of enum values would display on a single line, running off the screen, especially on mobile devices.

PR Close #63211
2025-08-18 12:52:05 +02:00
Alan Agius 67cfe686b1 fix(docs-infra): add spacing between Alias and Value (#63211)
Prior to this change there was noi spacing between the Alias and Value

PR Close #63211
2025-08-18 12:52:05 +02:00
Alan Agius c7440dddef fix(docs-infra): display value type in CLI pages (#63211)
The value type was not being displayed when a value had an enum, which was misleading. This change ensures the value type is always shown, so users know whether to expect a single value or an array of values.

PR Close #63211
2025-08-18 12:52:04 +02:00
Angular Robot c714426963 build: lock file maintenance (#63210)
See associated pull request for more information.

PR Close #63210
2025-08-18 12:51:22 +02:00
Walter Breakell a1fe7091f9 docs: fix grammatical mistake in installation guide (#63202)
PR Close #63202
2025-08-18 12:50:02 +02:00
cexbrayat af63b800ec refactor(core): improve animation instruction robustness and maintainability (#63163)
This commit extracts helper functions to reduce code duplication across animation instructions and adds early return when animations are disabled.

PR Close #63163
2025-08-18 12:49:18 +02:00
Matthieu Riegler 9e828d5e54 docs(docs-infra): remove @adev/constant path (#63213)
PR Close #63213
2025-08-18 10:06:25 +02:00
Alan Agius 7a4bc79720 build: remove extra comma in JSON (#63212)
This fixes CI which is currently broken.

PR Close #63212
2025-08-18 09:44:02 +02:00
Matthieu Riegler 1d5ea07bca docs: revert remove of build-and-link (#63187)
This works again since angular/dev-infra#2922 landed

PR Close #63187
2025-08-18 09:14:37 +02:00
Angular Robot 2031359069 build: update cross-repo angular dependencies (#63191)
See associated pull request for more information.

PR Close #63191
2025-08-18 09:13:08 +02:00
Angular Robot 0838df97bf docs: update Angular CLI help (#63193)
Updated Angular CLI help contents.

PR Close #63193
2025-08-18 09:11:08 +02:00
Gerome Grignon dbd403031a docs(): remove double parenthesis (#63196)
PR Close #63196
2025-08-18 09:09:52 +02:00
Shuaib Hasan Akib 287d6c8fdd docs(docs-infra): add paths for constants and missing link (#63197)
PR Close #63197
2025-08-18 09:09:00 +02:00
Angular Robot 732aadf082 build: update all non-major dependencies (#63204)
See associated pull request for more information.

PR Close #63204
2025-08-18 09:07:28 +02:00
Shuaib Hasan Akib 2d8ac7d9ef docs(docs-infra): replace deprecated router method (#63183)
PR Close #63183
2025-08-15 13:50:58 +02:00
Angular Robot 28b8782266 build: update dependency @codemirror/language to v6.11.3 (#63185)
See associated pull request for more information.

PR Close #63185
2025-08-15 13:49:29 +02:00
Shuaib Hasan Akib d8ac27f94a docs(docs-infra): replace Input by signal one (#63169)
PR Close #63169
2025-08-15 13:42:41 +02:00
Cheng-Hsuan Tsai 81751465b4 docs(docs-infra): add dark mode to example preview (#63171)
PR Close #63171
2025-08-15 13:41:09 +02:00
cexbrayat de6b6413e4 docs: add --yes option to mcp commands (#63173)
This makes it consistent with the message output by the CLI in v20.2 (see https://github.com/angular/angular-cli/commit/8b4de57af1)

PR Close #63173
2025-08-15 12:32:29 +02:00
Angular Robot d4a380d7bd build: update all non-major dependencies (#63182)
See associated pull request for more information.

PR Close #63182
2025-08-15 12:31:55 +02:00
Angular Robot 124d44f130 build: update cross-repo angular dependencies (#63179)
See associated pull request for more information.

PR Close #63179
2025-08-15 11:41:02 +02:00
Kristiyan Kostadinov 19ed12c81e fix(compiler): error when ng-content fallback has translated children (#63156)
Fixes that the pipeline wasn't processing the fallback content of `ng-content` for i18n which resulted in a compiler error further down the line.

Fixes #63065.

PR Close #63156
2025-08-15 09:47:18 +02:00
Kristiyan Kostadinov 557e6fe6eb fix(compiler): incorrect source span for expression AST inside template attribute (#63175)
Similar fix as #63082, but for template attributes. The root cause is the same where we should be using `fullStart` instead of `start` in order to account for whitespaces being skipped.

Fixes #63157.

PR Close #63175
2025-08-15 09:44:36 +02:00
Alan Agius b7cefe0370 Revert "ci: redirect adev to index.csr.html (#63168)" (#63177)
This reverts commit 5129daed1b.

PR Close #63177
2025-08-15 09:43:15 +02:00
Matthieu Riegler 8b02aa0333 ci: redirect adev to index.csr.html (#63168)
The build doesn't produce an `index.html`

PR Close #63168
2025-08-14 21:15:48 +00:00
Angular Robot c68a099ded build: update all non-major dependencies (#63129)
See associated pull request for more information.

PR Close #63129
2025-08-14 22:08:30 +02:00
Charles Lyding dc36fa5200 docs: update MCP server documentation for 20.2 (#63141)
This commit updates the MCP server documentation with the following changes:

- Updates the description of the `ng mcp` command behavior.
- Adds a configuration example for the Gemini CLI.
- Adds a new section for command options, including `--read-only` and `--local-only`.
- Alphabetizes the IDE configuration sections for better readability.
- Alphabetizes the "Available Tools" table.

PR Close #63141
2025-08-14 22:07:56 +02:00
Angular Robot e607d4db2b build: update cross-repo angular dependencies (#63151)
See associated pull request for more information.

PR Close #63151
2025-08-14 22:05:17 +02:00
Angular Robot e159ab1ee3 docs: update Angular CLI help (#63160)
Updated Angular CLI help contents.

PR Close #63160
2025-08-14 22:04:05 +02:00
Shuaib Hasan Akib 24e7238c54 docs(docs-infra): enhance method name following the guideline (#63164)
PR Close #63164
2025-08-14 22:03:17 +02:00
Joey Perrott f863792923 build: run integration tests using remote execution (#63118)
With the change to size tracking integration test can now be executed on our RBE platform

PR Close #63118
2025-08-14 22:02:33 +02:00
Ben Hong 65cca30361 docs: add rendering strategies guide for router (#62859)
PR Close #62859
2025-08-14 22:01:58 +02:00
Matthieu Riegler 8747f9ad55 docs: fix edit links for block/element api entries (#62766)
PR Close #62766
2025-08-14 13:03:01 +02:00
Matthieu Riegler 3ecf8c7114 docs: update testing scenarios and remove imports. (#63076)
With standalone, `imports` are not necessary anymore when configuring the Testing module.

Also
fixes #58073

PR Close #63076
2025-08-14 13:02:18 +02:00
Joey Perrott a6a2e38e5c build: update to bazel 7.6.0 (#63096)
Update to later version of bazel

PR Close #63096
2025-08-14 13:01:32 +02:00
Angular Robot 2faed63fed build: update actions/checkout action to v5 (#63116)
See associated pull request for more information.

PR Close #63116
2025-08-14 13:00:27 +02:00
Andrew Scott 1cf4d34c37 release: cut the v20.2.0-rc.1 release 2025-08-13 13:27:08 -07:00
Angular Robot ced0357bf8 build: update cross-repo angular dependencies (#63137)
See associated pull request for more information.

PR Close #63137
2025-08-13 12:52:28 -07:00
Andrew Scott d9f0e6b27c Revert "feat(platform-browser): Add IsolatedShadowDom encapsulation method (#62723)" (#63142)
This reverts commit d24d5742db. A
legitimate issue was raised in the original commit
(see https://github.com/angular/angular/commit/d24d5742db694604b09d57a3503e8c32751c4836#commitcomment-163853393)

PR Close #63142
2025-08-13 11:12:59 -07:00
Jeremy Elbourn 767a280562 docs: add rxjs-interop section for rxResource (#63125)
This commit adds brief documentation for `rxResource` to the "Using
Angular with RxJS" guide. The only available documentation for
`rxResource` today is the API reference, which lacks any code examples.

PR Close #63125
2025-08-13 09:29:34 -07:00
cexbrayat 254b560138 docs: update best-practices (#63132)
This removes the common pitfall for if blocks in the best practices, as this is no longer true in Angular v20.2, see angular/angular@a409534

PR Close #63132
2025-08-13 09:20:32 -07:00
Angular Robot b0900ccee5 build: update github/codeql-action action to v3.29.9 (#63128)
See associated pull request for more information.

PR Close #63128
2025-08-13 09:19:57 -07:00
Alan Agius 0065ebb115 docs: add link to ai-config command (#63139)
This adds a link to the new command.

PR Close #63139
2025-08-13 09:14:18 -07:00
Jeremy Elbourn 0211668d20 docs: add topic for takeUntilDestroyed (#63122)
This was missing from the RxJS interop guide. I came across it while
cleaning up some Google-internal docs and realized I had nothing on adev
to which I could link.

PR Close #63122
2025-08-12 18:41:19 -07:00
Paul Gschwendtner ada3c37338 refactor(compiler-cli): ensure JIT transforms with queries work with closure property renaming (#63123)
This map for the JIT transforms accidentally is property-renamed,
breaking the lookups below. This commit fixes this.

PR Close #63123
2025-08-12 13:24:10 -07:00
Jeremy Elbourn 4635095c01 fix(docs-infra): put content in <main> element (#63121)
This fix updates the adev `DocViewer` component to support rendering with the `main[docsViewer` selector so that the primary content for the page is inside of a `<main>` element (without introducing an extra DOM element).

PR Close #63121
2025-08-12 11:05:16 -07:00
Angular Robot b13c3fc2eb build: update actions/checkout action to v5 (#63115)
See associated pull request for more information.

PR Close #63115
2025-08-12 11:00:49 -07:00
ivanwonder c81e345e72 feat(language-service): support auto-import for attribute completions (#62797)
Add logic to provide code actions for auto-importing directives that
are out of scope.

PR Close #62797
2025-08-12 10:57:09 -07:00
Angular Robot 31df4d2fd1 build: update cross-repo angular dependencies (#63088)
See associated pull request for more information.

PR Close #63088
2025-08-12 09:53:15 -07:00
Matthieu Riegler 0e3465dfd9 docs: add missing supported != operator (#63108)
fixes 63103

PR Close #63108
2025-08-12 09:39:08 -07:00
Alan Agius 6fb2b71489 build: use link: instead of file: (#63111)
When using `file:` renovate updates fails due to ` ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND ` this is due to a different behaviour between `link:` amd `file:`. `link:` however will not fail when the directory does not exist.

PR Close #63111
2025-08-12 09:37:54 -07:00
Angular Robot 5105477490 build: update pnpm to v10 (#63117)
See associated pull request for more information.

PR Close #63117
2025-08-12 09:36:28 -07:00
Alan Agius 856dd50e64 ci: correctly configure ignored filenames (#63105)
Previously, the path did not match a file.

PR Close #63105
2025-08-12 10:02:00 +02:00
Alan Agius 1a16fb7aa2 build: resolve pnpm workspace dependency on compiler-cli (#63105)
The `pnpm install` command was failing for the `packages/core/test/bundling` project with the error:
`ERR_PNPM_NO_MATCHING_VERSION No matching version found for @angular/compiler-cli@0.0.0-PLACEHOLDER`

This happenes only in renovate updates.

PR Close #63105
2025-08-12 10:02:00 +02:00
Alan Agius 0e1bd1b404 build: fix ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND for typings tests (#63105)
During `pnpm install` in a monorepo setup, the `packages/zone.js/test/typings` project would fail with the error: `ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND: Could not install from "/.../node_modules/typescript" as it does not exist.`

PR Close #63105
2025-08-12 10:02:00 +02:00
Alan Agius 4ab709460a build: remove redundant yarn.lock files (#63105)
These are now managed by pnpm.

PR Close #63105
2025-08-12 10:02:00 +02:00
Matthieu Riegler b38c43bacc refactor(zone.js): remove unused jasmine globalerror monkey patching. (#63077)
This is for testing purposes for now. See discussion on the related issue.

fixes #63072

PR Close #63077
2025-08-11 16:41:12 -07:00
Angular Robot 88d48de46e build: update scorecard action dependencies (#63089)
See associated pull request for more information.

PR Close #63089
2025-08-11 16:38:13 -07:00
Matthieu Riegler af247cacb6 refactor(core): remove temporary resource setter function. (#63097)
Now that G3 has been fully migrated to the new throwing behavior, we don't need that setter anymore.

PR Close #63097
2025-08-11 15:43:48 -07:00
Matthieu Riegler 499fa8fa88 docs: remove router testing from the testing scenarios guide (#63078)
This commit also adds the router testing guide to the testing section

PR Close #63078
2025-08-11 12:15:41 -07:00
Kristiyan Kostadinov 79b91593c9 fix(compiler): incorrect spans for AST inside input value with leading space (#63082)
When parsing expressions inside a bound attribute, we offset all of its spans by an `absoluteOffset` in order to get the right spans in the source file. The offset was incorrect when parsing an attribute with leading spaces during the construction of the Ivy AST, because of the combination of:
1. We were setting the offset by looking at `valueSpan.start`.
2. The Ivy parser sets `leadingTriviaChars: [' ', '\n']` which means that spaces and new lines will be ignored in the `sourceSpan.start`.

These changes resolve the issue by using `valueSpan.fullStart` which includes the leading spaces.

Fixes #63069.

PR Close #63082
2025-08-11 11:57:08 -07:00
Alan Agius 51801612c3 ci: several fixes for renovate (#63083)
This commit contains several fixes for renovate to work properly with `pnpm`

PR Close #63083
2025-08-11 11:03:31 -07:00
Joey Perrott a92dea5b99 build: update to the latest version of devinfra and rename npm2 workspace (#63093)
Rename the npm2 workspace to npm and use the latest version of devinfra which drops rules_nodejs

PR Close #63093
2025-08-11 10:35:34 -07:00
Kristiyan Kostadinov 1156d7d786 release: cut the v20.2.0-rc.0 release 2025-08-11 10:41:09 +02:00
2113 changed files with 209383 additions and 291787 deletions
+6 -2
View File
@@ -35,10 +35,11 @@ integration/standalone-bootstrap/node_modules
integration/terser/node_modules
integration/trusted-types/node_modules
integration/typings_test_rxjs7/node_modules
integration/typings_test_ts58/node_modules
integration/legacy-animations/node_modules
integration/legacy-animations-async/node_modules
integration/typings_test_ts59/node_modules
modules/ssr-benchmarks/node_modules
# For rules_js
adev/node_modules
adev/shared-docs/node_modules
@@ -61,7 +62,10 @@ packages/platform-server/node_modules
packages/platform-browser-dynamic/node_modules
packages/router/node_modules
packages/zone.js/node_modules
packages/zone.js/test/typings/node_modules
packages/upgrade/node_modules
packages/benchpress/node_modules
packages/service-worker/node_modules
packages/zone.js/test/typings/node_modules
packages/zone.js/node_modules
tools/bazel/rules_angular_store/node_modules
+3 -2
View File
@@ -12,6 +12,9 @@ common --@aspect_rules_ts//ts:default_to_tsc_transpiler
# Needed as otherwise `env` of TS actions would be ignored.
common --incompatible_merge_fixed_and_default_shell_env
# Frozen lockfile
common --lockfile_mode=error
###############################
# Filesystem interactions #
###############################
@@ -166,8 +169,6 @@ test:saucelabs --flaky_test_attempts=1
# --ng_perf will ask the Ivy compiler to produce performance results for each build.
build --flag_alias=ng_perf=//packages/compiler-cli:ng_perf
# --full_build_adev will run adev build/serve in a full mode, performing prerendering and DCE.
build --flag_alias=full_build_adev=//adev:full_build_adev
####################################################
# User bazel configuration
+1 -1
View File
@@ -1 +1 @@
6.5.0
7.6.2
+2 -1
View File
@@ -1,4 +1,4 @@
load("//tools:defaults2.bzl", "esbuild_checked_in", "ts_config", "ts_project")
load("//tools:defaults.bzl", "esbuild_checked_in", "ts_config", "ts_project")
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
@@ -12,6 +12,7 @@ esbuild_checked_in(
entry_point = ":lib/main.mts",
external = [
"undici",
"pnpapi",
],
metafile = False,
platform = "node",
+14 -14
View File
@@ -1,4 +1,4 @@
import {cp, mkdtemp, readFile, rm, writeFile} from 'node:fs/promises';
import {mkdtemp, readFile, rm, writeFile} from 'node:fs/promises';
import {Deployment} from './deployments.mjs';
import {join} from 'node:path';
@@ -9,7 +9,7 @@ import {getCredentialFilePath} from './credential.mjs';
export async function deployToFirebase(
deployment: Deployment,
configPath: string,
distDirPath: string,
stagingDir: string,
) {
if (deployment.destination == undefined) {
console.log(`No deployment necessary for docs created from: ${deployment.branch}`);
@@ -18,37 +18,33 @@ export async function deployToFirebase(
console.log('Preparing for deployment to firebase...');
const tmpDeployDir = await mkdtemp(join(tmpdir(), 'deploy-directory'));
const deployConfigPath = join(tmpDeployDir, 'firebase.json');
const deployConfigPath = join(stagingDir, 'firebase.json');
const config = JSON.parse(await readFile(configPath, {encoding: 'utf-8'})) as {
hosting: {public: string};
};
config['hosting']['public'] = './dist';
config['hosting']['public'] = './browser';
await writeFile(deployConfigPath, JSON.stringify(config, null, 2));
await cp(distDirPath, join(tmpDeployDir, 'dist'), {recursive: true});
spawnSync(`chmod 777 -R ${tmpDeployDir}`, {encoding: 'utf-8', shell: true});
firebase(
`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`,
tmpDeployDir,
stagingDir,
);
firebase(
`target:apply --config ${deployConfigPath} --project angular-dev-site hosting angular-docs ${deployment.destination}`,
tmpDeployDir,
stagingDir,
);
firebase(
`deploy --config ${deployConfigPath} --project angular-dev-site --only hosting --non-interactive`,
tmpDeployDir,
stagingDir,
);
firebase(
`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`,
tmpDeployDir,
stagingDir,
);
await rm(tmpDeployDir, {recursive: true});
await rm(stagingDir, {recursive: true});
}
export async function setupRedirect(deployment: Deployment) {
@@ -103,7 +99,7 @@ export async function setupRedirect(deployment: Deployment) {
}
function firebase(cmd: string, cwd?: string) {
spawnSync('npx', `-y firebase-tools@13.15.1 ${cmd}`.split(' '), {
const {status} = spawnSync('npx', `-y firebase-tools@13.15.1 ${cmd}`.split(' '), {
cwd,
encoding: 'utf-8',
shell: true,
@@ -113,4 +109,8 @@ function firebase(cmd: string, cwd?: string) {
GOOGLE_APPLICATION_CREDENTIALS: getCredentialFilePath(),
},
});
if (status !== 0) {
console.error('Firebase command failed, see log above for details.');
process.exit(status ?? undefined);
}
}
@@ -9,6 +9,7 @@ export interface Deployment {
to: string;
};
destination?: string;
servingUrl: string;
}
export type Deployments = Map<string, Deployment>;
@@ -31,6 +32,7 @@ export async function getDeployments(): Promise<Deployments> {
docSites.set(branch.name, {
branch: branch.name,
destination: `v${branch.version.major}-angular-dev`,
servingUrl: `https://v${branch.version.major}.angular.dev/`,
});
});
@@ -40,12 +42,14 @@ export async function getDeployments(): Promise<Deployments> {
from: `v${releaseTrains.latest.version.major}-angular-dev`,
to: 'https://angular.dev',
},
servingUrl: 'https://angular.dev/',
destination: 'angular-dev-site',
});
if (releaseTrains.releaseCandidate) {
docSites.set(releaseTrains.next.branchName, {
branch: releaseTrains.next.branchName,
servingUrl: 'https://next.angular.dev/',
});
docSites.set(releaseTrains.releaseCandidate.branchName, {
@@ -55,11 +59,13 @@ export async function getDeployments(): Promise<Deployments> {
from: `v${releaseTrains.releaseCandidate.version.major}-angular-dev`,
to: 'https://next.angular.dev',
},
servingUrl: 'https://next.angular.dev/',
});
} else {
docSites.set(releaseTrains.next.branchName, {
branch: releaseTrains.next.branchName,
destination: 'next-angular-dev',
servingUrl: 'https://next.angular.dev/',
});
}
+12 -2
View File
@@ -2,8 +2,13 @@ import {getInput, setFailed} from '@actions/core';
import {context} from '@actions/github';
import {deployToFirebase, setupRedirect} from './deploy.mjs';
import {getDeployments} from './deployments.mjs';
import {generateSitemap} from './sitemap.mjs';
import {AuthenticatedGitClient, GithubConfig, setConfig} from '@angular/ng-dev';
import {githubReleaseTrainReadToken} from './credential.mjs';
import {spawnSync} from 'child_process';
import {cp, mkdtemp} from 'fs/promises';
import {tmpdir} from 'os';
import {join} from 'path';
const refMatcher = /refs\/heads\/(.*)/;
@@ -28,7 +33,11 @@ async function deployDocs() {
const currentBranch = matchedRef[1];
const configPath = getInput('configPath');
const distDir = getInput('distDir');
const stagingDir = await mkdtemp(join(tmpdir(), 'deploy-directory'));
// Copy all files from the distDir into stagingDir and modify the permissions for editing
await cp(getInput('distDir'), stagingDir, {recursive: true});
spawnSync(`chmod 777 -R ${stagingDir}`, {encoding: 'utf-8', shell: true});
const deployment = (await getDeployments()).get(currentBranch);
if (deployment === undefined) {
@@ -57,7 +66,8 @@ async function deployDocs() {
console.log(` To: ${deployment.redirect.to}`);
}
await deployToFirebase(deployment, configPath, distDir);
await generateSitemap(deployment, stagingDir);
await deployToFirebase(deployment, configPath, stagingDir);
await setupRedirect(deployment);
}
@@ -0,0 +1,33 @@
import {Deployment} from './deployments.mjs';
import {join} from 'path';
import {readFileSync, writeFileSync} from 'fs';
export async function generateSitemap(deployment: Deployment, distDir: string) {
const servingUrlWithoutEndingSlash = deployment.servingUrl.endsWith('/')
? deployment.servingUrl.slice(0, -1)
: deployment.servingUrl;
/** Timestamp string used to of the last file update. */
const lastModifiedTimestamp = new Date().toISOString();
/** An object containing all of the routes available within the application. */
const routes = JSON.parse(readFileSync(join(distDir, 'prerendered-routes.json'), 'utf-8'));
/** The generated sitemap string. */
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${Object.keys(routes.routes)
.map((route) => {
const routeWithoutLeadingSlash = route.startsWith('/') ? route.slice(1) : route;
return `
<url>
<loc>${servingUrlWithoutEndingSlash}/${routeWithoutLeadingSlash}</loc>
<lastmod>${lastModifiedTimestamp}</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
`;
})
.join('')}
</urlset>`;
writeFileSync(join(distDir, 'browser', 'sitemap.xml'), sitemap, 'utf-8');
console.log(`Generated sitemap with ${Object.keys(routes.routes).length} entries.`);
}
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@
"compilerOptions": {
"module": "NodeNext",
"target": "ES2021",
"types": ["node"],
"lib": ["es2021"],
"experimentalDecorators": true,
"strict": true,
@@ -11,6 +12,5 @@
"noImplicitReturns": true,
"declaration": true,
"sourceMap": true
}
}
+2 -2
View File
@@ -5,9 +5,9 @@ runs:
using: 'composite'
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/saucelabs@4425eed914bab0e311066d4b930c35576b7d200e
- name: Starting Saucelabs tunnel service
shell: bash
run: ./tools/saucelabs/sauce-service.sh run &
+7 -7
View File
@@ -15,22 +15,22 @@ permissions: read-all
jobs:
adev-build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8core
if: |
(github.event.action == 'labeled' && github.event.label.name == 'adev: preview') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: pnpm bazel build //adev:build --full_build_adev --config=release
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- name: Build adev
run: pnpm bazel build //adev:build.production
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@4425eed914bab0e311066d4b930c35576b7d200e
with:
workflow-artifact-name: 'adev-preview'
pull-number: '${{github.event.pull_request.number}}'
+2 -2
View File
@@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
token: '${{secrets.GITHUB_TOKEN}}'
@@ -40,7 +40,7 @@ jobs:
npx -y firebase-tools@latest target:clear --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs
npx -y firebase-tools@latest target:apply --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs ${{env.PREVIEW_SITE}}
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@4425eed914bab0e311066d4b930c35576b7d200e
with:
github-token: '${{secrets.GITHUB_TOKEN}}'
workflow-artifact-name: 'adev-preview'
@@ -13,9 +13,9 @@ jobs:
assistant_to_the_branch_manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: angular/dev-infra/github-actions/branch-manager@4425eed914bab0e311066d4b930c35576b7d200e
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+2 -2
View File
@@ -28,7 +28,7 @@ jobs:
- uses: alessbell/pull-request-comment-branch@aad01d65d6982b8eacabed5e9a684cd8ceb98da6 # v1.1
id: comment-branch
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Specify repository as the PR branch might be from a fork.
repository: ${{steps.comment-branch.outputs.head_owner}}/${{steps.comment-branch.outputs.head_repo}}
@@ -38,7 +38,7 @@ jobs:
- run: pnpm install --frozen-lockfile
- uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
bazelrc: ./.bazelrc.user
+39 -49
View File
@@ -21,9 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Check code lint
@@ -41,15 +39,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
with:
cache-node-modules: true
disable-package-manager-cache: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Cache downloaded Cypress binary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: '~/.cache/Cypress'
key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run unit tests
@@ -63,18 +66,17 @@ jobs:
start: pnpm bazel run //devtools/src:devserver
wait-on: 'http://localhost:4200'
wait-on-timeout: 300
install: false
test:
runs-on: ubuntu-latest-4core
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -83,16 +85,14 @@ jobs:
run: pnpm test:ci
integration-tests:
runs-on: ubuntu-latest-4core
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -102,14 +102,14 @@ jobs:
adev:
runs-on:
labels: ubuntu-latest-4core
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -117,20 +117,18 @@ jobs:
- name: Run tests
run: pnpm bazel test //adev/...
- name: Build adev in fast mode to ensure it continues to work
run: pnpm bazel build //adev:build --config=release
run: pnpm bazel build //adev:build
publish-snapshots:
runs-on:
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
@@ -139,20 +137,14 @@ jobs:
zone-js:
runs-on:
labels: ubuntu-latest-4core
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
node-module-directories: |
./node_modules
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -186,14 +178,12 @@ jobs:
- run: pnpm -C packages/zone.js/test/typings test
# saucelabs:
# runs-on: ubuntu-latest-4core
# runs-on: ubuntu-latest
# env:
# SAUCE_TUNNEL_IDENTIFIER: angular-framework-${{ github.run_number }}
# steps:
# - name: Initialize environment
# uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b5a3609f89c06eb4037dce22a93641213a5d1508
# with:
# cache-node-modules: true
# - name: Install node modules
# run: pnpm install --frozen-lockfile
# - uses: ./.github/actions/saucelabs-legacy
@@ -201,22 +191,22 @@ jobs:
adev-deploy:
needs: [adev]
if: needs.adev.result == 'success'
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: pnpm bazel build //adev:build --full_build_adev --config=release
- name: Build adev
run: pnpm bazel build //adev:build.production --config=release
- name: Deploy to firebase
uses: ./.github/actions/deploy-docs-site
with:
serviceKey: ${{ secrets.ANGULAR_DEV_SITE_DEPLOY }}
githubReleaseTrainReadToken: ${{ secrets.DOCS_DEPLOY_GITHUB_RELEASE_TRAIN_TOKEN }}
configPath: 'adev/firebase.json'
distDir: 'dist/bin/adev/dist/browser'
distDir: 'dist/bin/adev/dist'
+4 -4
View File
@@ -12,14 +12,14 @@ jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/pull-request-labeling@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/pull-request-labeling@4425eed914bab0e311066d4b930c35576b7d200e
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/post-approval-changes@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/post-approval-changes@4425eed914bab0e311066d4b930c35576b7d200e
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+2 -2
View File
@@ -13,8 +13,8 @@ jobs:
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/google-internal-tests@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/google-internal-tests@4425eed914bab0e311066d4b930c35576b7d200e
with:
run-tests-guide-url: http://go/angular-g3sync-start
github-token: ${{ secrets.GITHUB_TOKEN }}
+5 -7
View File
@@ -8,22 +8,20 @@ jobs:
# Bazel saucelabs job resides in `manual.yml` because it's currently unstable, but
# kept as "runnable" for debugging/stabilization effort purposes.
bazel-saucelabs:
runs-on: ubuntu-latest-4core
runs-on: ubuntu-latest
env:
JOBS: 2
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/saucelabs@4425eed914bab0e311066d4b930c35576b7d200e
- name: Set up Sauce Tunnel Daemon
run: pnpm bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
env:
+1 -1
View File
@@ -9,6 +9,6 @@ jobs:
status:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/unified-status-check@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
- uses: angular/dev-infra/github-actions/unified-status-check@4425eed914bab0e311066d4b930c35576b7d200e
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+4 -4
View File
@@ -21,7 +21,7 @@ jobs:
workflows: ${{ steps.workflows.outputs.workflows }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- id: workflows
@@ -36,16 +36,16 @@ jobs:
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
# identity federation. This allows us to request short lived credentials on demand, rather than storing
# credentials in secrets long term. More information can be found at:
# https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform
- uses: 'google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f' # v2
- uses: 'google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed' # v2
with:
project_id: 'internal-200822'
workload_identity_provider: 'projects/823469418460/locations/global/workloadIdentityPools/measurables-tracking/providers/angular'
+30 -40
View File
@@ -19,9 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Check code lint
@@ -39,7 +37,7 @@ jobs:
- name: Check code format
run: pnpm ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
- name: Check Package Licenses
uses: angular/dev-infra/github-actions/linting/licenses@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/linting/licenses@4425eed914bab0e311066d4b930c35576b7d200e
with:
allow-dependencies-licenses: 'pkg:npm/google-protobuf@'
@@ -47,13 +45,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
with:
cache-node-modules: true
disable-package-manager-cache: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Cache downloaded Cypress binary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: '~/.cache/Cypress'
key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run unit tests
@@ -67,18 +70,17 @@ jobs:
start: pnpm bazel run //devtools/src:devserver
wait-on: 'http://localhost:4200'
wait-on-timeout: 300
install: false
test:
runs-on: ubuntu-latest-8core
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run CI tests for framework
@@ -95,16 +97,14 @@ jobs:
retention-days: 1
integration-tests:
runs-on: ubuntu-latest-4core
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run integration CI tests for framework
@@ -112,37 +112,31 @@ jobs:
adev:
runs-on:
labels: ubuntu-latest-8core
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm bazel test //adev/...
- name: Build adev in fast mode to ensure it continues to work
run: pnpm bazel build //adev:build --config=release
run: pnpm bazel build //adev:build
zone-js:
runs-on:
labels: ubuntu-latest-4core
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
with:
cache-node-modules: true
node-module-directories: |
./node_modules
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/setup@4425eed914bab0e311066d4b930c35576b7d200e
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30
uses: angular/dev-infra/github-actions/bazel/configure-remote@4425eed914bab0e311066d4b930c35576b7d200e
- name: Install node modules
run: pnpm install --frozen-lockfile
- run: |
@@ -163,8 +157,6 @@ jobs:
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
# Install
- run: pnpm -C packages/zone.js install --frozen-lockfile
# Run zone.js tools tests
- run: pnpm -C packages/zone.js promisefinallytest
- run: pnpm -C packages/zone.js jest:test
@@ -174,14 +166,12 @@ jobs:
- run: pnpm -C packages/zone.js/test/typings test
# saucelabs:
# runs-on: ubuntu-latest-4core
# runs-on: ubuntu-latest
# env:
# SAUCE_TUNNEL_IDENTIFIER: angular-framework-${{ github.run_number }}
# steps:
# - name: Initialize environment
# uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@b5a3609f89c06eb4037dce22a93641213a5d1508
# with:
# cache-node-modules: true
# - name: Install node modules
# run: pnpm install --frozen-lockfile
# - uses: ./.github/actions/saucelabs-legacy
+3 -3
View File
@@ -25,12 +25,12 @@ jobs:
steps:
- name: 'Checkout code'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: 'Run analysis'
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
@@ -47,6 +47,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
uses: github/codeql-action/upload-sarif@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3.30.9
with:
sarif_file: results.sarif
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Setting `persist-credentials: false` prevents the github-action account from being the
# account that is attempted to be used for authentication, instead the remote is set to
@@ -37,7 +37,7 @@ jobs:
env:
ANGULAR_CDK_BUILDS_READONLY_GITHUB_TOKEN: ${{ secrets.ANGULAR_CDK_BUILDS_READONLY_GITHUB_TOKEN }}
- name: Create a PR CDK apis (if necessary)
uses: peter-evans/create-pull-request@v7.0.8 # v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.ANGULAR_ROBOT_ACCESS_TOKEN }}
push-to-fork: 'angular-robot/angular'
@@ -52,6 +52,7 @@ jobs:
labels: |
action: merge
area: docs
target: automation
commit-message: |
docs: update Angular CDK apis
@@ -66,7 +67,7 @@ jobs:
env:
ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN: ${{ secrets.ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN }}
- name: Create a PR CLI help (if necessary)
uses: peter-evans/create-pull-request@v7.0.8 # v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.ANGULAR_ROBOT_ACCESS_TOKEN }}
push-to-fork: 'angular-robot/angular'
@@ -81,6 +82,7 @@ jobs:
labels: |
action: merge
area: docs
target: automation
commit-message: |
docs: update Angular CLI help
+4 -1
View File
@@ -6,6 +6,7 @@ import {FormatConfig} from '@angular/ng-dev';
export const format: FormatConfig = {
'prettier': {
'matchers': [
'**/*.md',
'**/*.{yaml,yml}',
'**/*.{js,ts,mjs,mts,cjs,cts,tsx}',
'devtools/**/*.{js,ts,mjs,mts,cjs,cts,html,scss}',
@@ -15,7 +16,6 @@ export const format: FormatConfig = {
// Both third_party and .yarn are directories containing copied code which should
// not be modified.
'!third_party/**',
'!.yarn/**',
// Do not format the locale files which are checked-in for Google3, but generated using
// the `generate-locales-tool` from `packages/common/locales`.
'!packages/core/src/i18n/locale_en.ts',
@@ -26,6 +26,9 @@ export const format: FormatConfig = {
// Ignore generated javascript file(s)
'!.github/actions/deploy-docs-site/main.js',
// Ignore goldens MD files
'!/goldens/**/*.api.md',
],
},
'buildifier': true,
-1
View File
@@ -2,7 +2,6 @@ import {ReleaseConfig} from '@angular/ng-dev';
/** Configuration for the `ng-dev release` command. */
export const release: ReleaseConfig = {
rulesJsInteropMode: true,
publishRegistry: 'https://wombat-dressing-room.appspot.com',
representativeNpmPackage: '@angular/core',
npmPackages: [
+1 -1
View File
@@ -1 +1 @@
22.18.0
22.21.0
+26 -8
View File
@@ -56,8 +56,8 @@
version: 3
# availability:
# users_unavailable: ['atscott']
#availability:
# users_unavailable: []
# Meta field that goes unused by PullApprove to allow for defining aliases to be
# used throughout the config.
@@ -135,6 +135,9 @@ groups:
- kirjs
- JoostK
- mmalerba
- ~amishne
- ~leonsenft
- ~mattrbeck
# =========================================================
# Framework: General (most code in our packages)
@@ -177,6 +180,10 @@ groups:
- thePunderWoman
- ~pkozlowski-opensource
- mmalerba
- JeanMeche
- ~amishne
- ~leonsenft
- ~mattrbeck
# =========================================================
# Framework: Security-sensitive files which require extra review
@@ -230,6 +237,9 @@ groups:
- thePunderWoman
- ~pkozlowski-opensource
- mmalerba
- ~amishne
- ~leonsenft
- ~mattrbeck
# =========================================================
# Tooling: Compiler API shared with Angular CLI
@@ -273,7 +283,7 @@ groups:
- bencodezen
- crisbeto
- kirjs
- ~JeanMeche
- JeanMeche
- jelbourn
- thePunderWoman
- devversion
@@ -283,6 +293,9 @@ groups:
- MarkTechson
- mmalerba
- ~hawkgs
- ~amishne
- ~leonsenft
- ~mattrbeck
# =========================================================
# Angular DevTools
@@ -300,7 +313,7 @@ groups:
- ~devversion
- dgp1130
- hawkgs
- jkrems
- hybrist
- ~josephperrott
- JeanMeche
- milomg
@@ -320,7 +333,6 @@ groups:
'.gemini/**/{*,.*}',
'.ng-dev/**/{*,.*}',
'.vscode/**/{*,.*}',
'.yarn/**/{*,.*}',
'contributing-docs/*.md',
'contributing-docs/images/**/{*,.*}',
'goldens/{*,.*}',
@@ -393,13 +405,16 @@ groups:
- crisbeto
- devversion
- JeanMeche
- ~jkrems
- ~hybrist
- ~iteriani
- ~tbondwilkinson
- ~rahatarmanahmed
- ~amishne
- ~leonsenft
- ~mattrbeck
reviews:
request: 3 # Request reviews from 3 people
required: 2 # Require that 2 people approve
request: 2
required: 1
reviewed_for: required
# ================================================
@@ -424,6 +439,9 @@ groups:
- thePunderWoman
- ~pkozlowski-opensource
- mmalerba
- ~amishne
- ~leonsenft
- ~mattrbeck
reviews:
request: 2 # Request reviews from 2 people
required: 1 # Require that 1 person approve
-13
View File
@@ -1,13 +0,0 @@
# Yarn Vendoring
We utilize Yarn's `yarn-path` configuration in a shared `.yarnrc` file to enforce
everyone using the same version of Yarn. Yarn checks the `.yarnrc` file to
determine if yarn should delegate the command to a vendored version at the
provided path.
## How to update
To update to the latest version of Yarn as our vendored version:
- Run this command
```sh
yarn policies set-version latest
```
- Remove the previous version
-148049
View File
File diff suppressed because one or more lines are too long
-5
View File
@@ -1,5 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
yarn-path ".yarn/releases/yarn-1.22.22.cjs"
+8 -15
View File
@@ -1,7 +1,7 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//:yarn.bzl", "YARN_PATH")
load("//tools:defaults2.bzl", "copy_to_bin", "js_binary")
load("@devinfra//bazel/validation:defs.bzl", "validate_ts_version_matching")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defaults.bzl", "copy_to_bin")
package(default_visibility = ["//visibility:public"])
@@ -9,9 +9,7 @@ exports_files([
"LICENSE",
"karma-js.conf.js",
"browser-providers.conf.js",
YARN_PATH,
"package.json",
"angular.json",
])
npm_link_all_packages(
@@ -25,6 +23,11 @@ filegroup(
srcs = ["package.json"],
)
validate_ts_version_matching(
module_lock_file = "MODULE.bazel.lock",
package_json = "package.json",
)
alias(
name = "tsconfig.json",
actual = "//packages:tsconfig-build.json",
@@ -60,16 +63,6 @@ config_setting(
values = {"stamp": "true"},
)
js_binary(
name = "yarn_vendored",
data = [".yarn/releases/yarn-1.22.22.cjs"],
entry_point = ".yarn/releases/yarn-1.22.22.cjs",
visibility = [
"//integration:__subpackages__",
"//modules/ssr-benchmarks:__subpackages__",
],
)
alias(
name = "sauce_connect",
actual = select({
+5046 -3097
View File
File diff suppressed because it is too large Load Diff
+5519 -5035
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -14,20 +14,20 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:
* Use welcoming and inclusive language
* Respect each other
* Provide and gracefully accept constructive criticism
* Show empathy towards other community members
- Use welcoming and inclusive language
- Respect each other
- Provide and gracefully accept constructive criticism
- Show empathy towards other community members
Examples of unacceptable behavior by participants include:
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* The use of sexualized language or imagery
* Unwelcome sexual attention or advances
* Other conduct which could reasonably be considered inappropriate in a
- The use of sexualized language or imagery
- Unwelcome sexual attention or advances
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
@@ -69,9 +69,9 @@ members of the project's leadership.
If you are banned you may contest the decision. To do so email conduct@angular.io with the subject line "Repeal Ban for {{your name here}}" and body with the responses to the following:
* Why do you believe you did not violate the Code of Conduct?
* Were other factors involved in this situation the leadership team may have been unaware of?
* Why do you wish to be a part of the Angular community?
- Why do you believe you did not violate the Code of Conduct?
- Were other factors involved in this situation the leadership team may have been unaware of?
- Why do you wish to be a part of the Angular community?
## Attribution
+63 -73
View File
@@ -3,22 +3,20 @@
We would love for you to contribute to Angular and help make it even better than it is today!
As a contributor, here are the guidelines we would like you to follow:
- [Code of Conduct](#coc)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
- [Code of Conduct](#coc)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
## <a name="coc"></a> Code of Conduct
Help us keep Angular open and inclusive.
Please read and follow our [Code of Conduct][coc].
## <a name="question"></a> Got a Question or Problem?
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests.
@@ -34,28 +32,25 @@ To save your and our time, we will systematically close all issues that are requ
If you would like to chat about the question in real-time, you can reach out via [the Angular community Discord server][discord].
## <a name="issue"></a> Found a Bug?
If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github].
Even better, you can [submit a Pull Request](#submit-pr) with a fix.
## <a name="feature"></a> Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository.
If you would like to *implement* a new feature, please consider the size of the change in order to determine the right steps to proceed:
* For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed.
You can _request_ a new feature by [submitting an issue](#submit-issue) to our GitHub Repository.
If you would like to _implement_ a new feature, please consider the size of the change in order to determine the right steps to proceed:
- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed.
This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
**Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
## <a name="submit"></a> Submission Guidelines
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, please search the issue tracker. An issue for your problem might already exist and the discussion might inform you of workarounds readily available.
@@ -74,7 +69,6 @@ Unfortunately, we are not able to investigate / fix bugs without a minimal repro
You can file new issues by selecting from our [new issue templates](https://github.com/angular/angular/issues/new/choose) and filling out the issue template.
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:
@@ -93,9 +87,9 @@ Before you submit your Pull Request (PR) consider the following guidelines:
5. In your forked repository, make your changes in a new git branch:
```shell
git checkout -b my-fix-branch main
```
```shell
git checkout -b my-fix-branch main
```
6. Create your patch, **including appropriate test cases**.
@@ -106,10 +100,11 @@ Before you submit your Pull Request (PR) consider the following guidelines:
9. Commit your changes using a descriptive commit message that follows our [commit message conventions][commit-message-guidelines].
Adherence to these conventions is necessary because release notes are automatically generated from these messages.
```shell
git commit --all
```
Note: the optional commit `--all` command line option will automatically "add" and "rm" edited files.
```shell
git commit --all
```
Note: the optional commit `--all` command line option will automatically "add" and "rm" edited files.
10. Push your branch to GitHub:
@@ -133,16 +128,15 @@ If we ask for changes via code reviews then:
3. Create a fixup commit and push to your GitHub repository (this will update your Pull Request):
```shell
git commit --all --fixup HEAD
git push
```
```shell
git commit --all --fixup HEAD
git push
```
For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md).
For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md).
That's it! Thank you for your contribution!
##### Updating the commit message
A reviewer might often suggest changes to a commit message (for example, to add more context for a change or adhere to our [commit message guidelines][commit-message-guidelines]).
@@ -150,69 +144,68 @@ In order to update the commit message of the last commit on your branch:
1. Check out your branch:
```shell
git checkout my-fix-branch
```
```shell
git checkout my-fix-branch
```
2. Amend the last commit and modify the commit message:
```shell
git commit --amend
```
```shell
git commit --amend
```
3. Push to your GitHub repository:
```shell
git push --force-with-lease
```
```shell
git push --force-with-lease
```
> NOTE:<br />
> If you need to update the commit message of an earlier commit, you can use `git rebase` in interactive mode.
> See the [git docs](https://git-scm.com/docs/git-rebase#_interactive_mode) for more details.
#### After your pull request is merged
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
```shell
git push origin --delete my-fix-branch
```
```shell
git push origin --delete my-fix-branch
```
* Check out the main branch:
- Check out the main branch:
```shell
git checkout main -f
```
```shell
git checkout main -f
```
* Delete the local branch:
- Delete the local branch:
```shell
git branch -D my-fix-branch
```
```shell
git branch -D my-fix-branch
```
* Update your local `main` with the latest upstream version:
```shell
git pull --ff upstream main
```
- Update your local `main` with the latest upstream version:
```shell
git pull --ff upstream main
```
## <a name="rules"></a> Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**.
* We follow [Google's TypeScript Style Guide][ts-style-guide], but wrap all code at **100 characters**.
An automated formatter is available, see [building-and-testing-angular.md](./contributing-docs/building-and-testing-angular.md#formatting-your-source-code).
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
- All public API methods **must be documented**.
- We follow [Google's TypeScript Style Guide][ts-style-guide], but wrap all code at **100 characters**.
An automated formatter is available, see [building-and-testing-angular.md](./contributing-docs/building-and-testing-angular.md#formatting-your-source-code).
## <a name="commit"></a> Commit Message Guidelines
We have very precise rules over how our Git commit messages must be formatted:
```
<type>(<scope>): <short summary>
```
@@ -224,21 +217,18 @@ See [Commit Message Guidelines][commit-message-guidelines] for details.
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
* For individuals, we have a [simple click-through form][individual-cla].
* For corporations, we'll need you to
- For individuals, we have a [simple click-through form][individual-cla].
- For corporations, we'll need you to
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
If you have more than one GitHub accounts, or multiple email addresses associated with a single GitHub account, you must sign the CLA using the primary email address of the GitHub account used to author Git commits and send pull requests.
The following documents can help you sort out issues with GitHub accounts and multiple email addresses:
* https://help.github.com/articles/setting-your-commit-email-address-in-git/
* https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean
* https://help.github.com/articles/about-commit-email-addresses/
* https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
- https://help.github.com/articles/setting-your-commit-email-address-in-git/
- https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean
- https://help.github.com/articles/about-commit-email-addresses/
- https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
[coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md
[corporate-cla]: https://cla.developers.google.com/about/google-corporate
+170
View File
@@ -0,0 +1,170 @@
"""Rules/toolchains for angular with Bazel."""
module(
name = "angular",
)
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_nodejs", version = "6.6.0")
bazel_dep(name = "aspect_rules_ts", version = "3.7.0")
bazel_dep(name = "aspect_rules_js", version = "2.6.2")
bazel_dep(name = "aspect_rules_esbuild", version = "0.23.0")
bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0")
bazel_dep(name = "aspect_rules_rollup", version = "2.0.1")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "aspect_bazel_lib", version = "2.21.2")
bazel_dep(name = "tar.bzl", version = "0.6.0")
bazel_dep(name = "yq.bzl", version = "0.3.1")
bazel_dep(name = "rules_angular")
git_override(
module_name = "rules_angular",
commit = "4010ef96de0c46db7764adc2f262258c9de3d718",
remote = "https://github.com/devversion/rules_angular.git",
)
bazel_dep(name = "devinfra")
git_override(
module_name = "devinfra",
commit = "4425eed914bab0e311066d4b930c35576b7d200e",
remote = "https://github.com/angular/dev-infra.git",
)
bazel_dep(name = "rules_sass")
git_override(
module_name = "rules_sass",
commit = "1184a80751a21af8348f308abc5b38a41f26850e",
remote = "https://github.com/devversion/rules_sass.git",
)
bazel_dep(name = "rules_browsers")
git_override(
module_name = "rules_browsers",
commit = "6a699bf3e896690e2923cf3ade29fbd4e492e366",
remote = "https://github.com/devversion/rules_browsers.git",
)
yq = use_extension("@yq.bzl//yq:extensions.bzl", "yq")
use_repo(yq, "yq_toolchains")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "20.19.0")
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
use_repo(node, "nodejs_darwin_arm64")
use_repo(node, "nodejs_linux_amd64")
use_repo(node, "nodejs_linux_arm64")
use_repo(node, "nodejs_linux_ppc64le")
use_repo(node, "nodejs_linux_s390x")
use_repo(node, "nodejs_windows_amd64")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
name = "pnpm",
pnpm_version = "10.16.1",
)
use_repo(pnpm, "pnpm")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
data = [
"//:.pnpmfile.cjs",
"//:package.json",
"//:pnpm-workspace.yaml",
"//:tools/pnpm-patches/dagre-d3-es+7.0.11.patch",
"//adev:package.json",
"//adev/shared-docs:package.json",
"//adev/shared-docs/pipeline/api-gen:package.json",
"//integration:package.json",
"//modules:package.json",
"//packages/animations:package.json",
"//packages/benchpress:package.json",
"//packages/common:package.json",
"//packages/compiler:package.json",
"//packages/compiler-cli:package.json",
"//packages/compiler-cli/linker/babel/test:package.json",
"//packages/core:package.json",
"//packages/core/test/bundling:package.json",
"//packages/elements:package.json",
"//packages/forms:package.json",
"//packages/language-service:package.json",
"//packages/localize:package.json",
"//packages/platform-browser:package.json",
"//packages/platform-browser-dynamic:package.json",
"//packages/platform-server:package.json",
"//packages/router:package.json",
"//packages/service-worker:package.json",
"//packages/upgrade:package.json",
"//tools/bazel/rules_angular_store:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps(
name = "angular_npm_typescript",
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
ts_version = "5.9.2",
)
use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"})
# TODO: Figure out how to make ng_project update whenever the packages/core::pkg target changes.
rules_angular = use_extension("@rules_angular//setup:extensions.bzl", "rules_angular")
use_repo_rule("@rules_angular//setup:repositories.bzl", "configurable_deps_repo")(
name = "rules_angular_configurable_deps",
angular_compiler_cli = "@angular//:node_modules/@angular/compiler-cli",
typescript = "@angular//:node_modules/typescript",
)
override_repo(rules_angular, "rules_angular_configurable_deps")
register_toolchains(
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
)
CLDR_VERSION = "41"
cldr_json_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository")
cldr_json_data(
name = "cldr_json_data",
urls = {
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (CLDR_VERSION, CLDR_VERSION): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
},
)
cldr_xml_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_xml_data_repository")
cldr_xml_data(
name = "cldr_xml_data",
urls = {
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (CLDR_VERSION, CLDR_VERSION): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
},
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
http_archive(
name = "sauce_connect_linux_amd64",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
strip_prefix = "sc-4.8.2-linux",
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
)
http_archive(
name = "sauce_connect_mac",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
strip_prefix = "sc-4.8.2-osx",
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
)
+4258
View File
File diff suppressed because it is too large Load Diff
-257
View File
@@ -1,257 +0,0 @@
workspace(
name = "angular",
)
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# The PKG rules are needed to build tar packages for integration tests. The builtin
# rule in `@bazel_tools` is not Windows compatible and outdated.
# NOTE: We cannot move past version 0.6.0 as pkg_tar no longer works on directories, which rules_nodejs
# relies on for node_modules setup.
http_archive(
name = "rules_pkg",
sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
],
)
http_archive(
name = "aspect_rules_js",
sha256 = "304c51726b727d53277dd28fcda1b8e43b7e46818530b8d6265e7be98d5e2b25",
strip_prefix = "rules_js-2.3.8",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.3.8/rules_js-v2.3.8.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")
rules_js_register_toolchains(
node_repositories = {
"20.19.0-darwin_arm64": ("node-v20.19.0-darwin-arm64.tar.gz", "node-v20.19.0-darwin-arm64", "c016cd1975a264a29dc1b07c6fbe60d5df0a0c2beb4113c0450e3d998d1a0d9c"),
"20.19.0-darwin_amd64": ("node-v20.19.0-darwin-x64.tar.gz", "node-v20.19.0-darwin-x64", "a8554af97d6491fdbdabe63d3a1cfb9571228d25a3ad9aed2df856facb131b20"),
"20.19.0-linux_arm64": ("node-v20.19.0-linux-arm64.tar.xz", "node-v20.19.0-linux-arm64", "dbe339e55eb393955a213e6b872066880bb9feceaa494f4d44c7aac205ec2ab9"),
"20.19.0-linux_ppc64le": ("node-v20.19.0-linux-ppc64le.tar.xz", "node-v20.19.0-linux-ppc64le", "84937108f005679e60b486ed8e801cebfe923f02b76d8e710463d32f82181f65"),
"20.19.0-linux_s390x": ("node-v20.19.0-linux-s390x.tar.xz", "node-v20.19.0-linux-s390x", "11f8ee99d792a83bba7b29911e0229dd6cd5e88987d7416346067db1cc76d89a"),
"20.19.0-linux_amd64": ("node-v20.19.0-linux-x64.tar.xz", "node-v20.19.0-linux-x64", "b4e336584d62abefad31baecff7af167268be9bb7dd11f1297112e6eed3ca0d5"),
"20.19.0-windows_amd64": ("node-v20.19.0-win-x64.zip", "node-v20.19.0-win-x64", "be72284c7bc62de07d5a9fd0ae196879842c085f11f7f2b60bf8864c0c9d6a4f"),
},
node_version = "20.19.0",
)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
npm_translate_lock(
name = "npm2",
data = [
"//:.pnpmfile.cjs",
"//:package.json",
"//:pnpm-workspace.yaml",
"//:tools/pnpm-patches/dagre-d3-es+7.0.11.patch",
"//adev:package.json",
"//adev/shared-docs:package.json",
"//adev/shared-docs/pipeline/api-gen:package.json",
"//integration:package.json",
"//modules:package.json",
"//packages/animations:package.json",
"//packages/benchpress:package.json",
"//packages/common:package.json",
"//packages/compiler:package.json",
"//packages/compiler-cli:package.json",
"//packages/compiler-cli/linker/babel/test:package.json",
"//packages/core:package.json",
"//packages/core/test/bundling:package.json",
"//packages/elements:package.json",
"//packages/forms:package.json",
"//packages/language-service:package.json",
"//packages/localize:package.json",
"//packages/platform-browser:package.json",
"//packages/platform-browser-dynamic:package.json",
"//packages/platform-server:package.json",
"//packages/router:package.json",
"//packages/service-worker:package.json",
"//packages/upgrade:package.json",
"//tools/bazel/rules_angular_store:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
pnpm_version = "9.15.9",
verify_node_modules_ignored = "//:.bazelignore",
)
load("@npm2//:repositories.bzl", "npm_repositories")
npm_repositories()
http_archive(
name = "aspect_rules_ts",
sha256 = "09af62a0d46918d815b5f48b5ed0f5349b62c15fc42fcc3fef5c246504ff8d99",
strip_prefix = "rules_ts-3.6.3",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.3/rules_ts-v3.6.3.tar.gz",
)
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
ts_version_from = "//:package.json",
)
http_archive(
name = "aspect_rules_rollup",
sha256 = "0b8ac7d97cd660eb9a275600227e9c4268f5904cba962939d1a6ce9a0a059d2e",
strip_prefix = "rules_rollup-2.0.1",
url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.1/rules_rollup-v2.0.1.tar.gz",
)
http_archive(
name = "aspect_rules_jasmine",
sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
strip_prefix = "rules_jasmine-2.0.0",
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
)
load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")
rules_jasmine_dependencies()
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
load("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository", "cldr_xml_data_repository")
cldr_major_version = "41"
cldr_json_data_repository(
name = "cldr_json_data",
urls = {
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (cldr_major_version, cldr_major_version): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
},
)
cldr_xml_data_repository(
name = "cldr_xml_data",
urls = {
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (cldr_major_version, cldr_major_version): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
},
)
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
http_archive(
name = "sauce_connect_linux_amd64",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
strip_prefix = "sc-4.8.2-linux",
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
)
http_archive(
name = "sauce_connect_mac",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
strip_prefix = "sc-4.8.2-osx",
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
)
git_repository(
name = "devinfra",
commit = "17282887a46c27e9f297a3292f1fde5b35dfafc1",
remote = "https://github.com/angular/dev-infra.git",
)
load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1")
setup_dependencies_1()
load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
setup_dependencies_2()
git_repository(
name = "rules_angular",
commit = "a1b4985620e2b66b45c590ed5ddda1b346b3f098",
remote = "https://github.com/devversion/rules_angular.git",
)
load("@rules_angular//setup:step_1.bzl", "rules_angular_step1")
rules_angular_step1()
load("@rules_angular//setup:step_2.bzl", "rules_angular_step2")
rules_angular_step2()
load("@rules_angular//setup:step_3.bzl", "rules_angular_step3")
rules_angular_step3(
angular_compiler_cli = "@angular//tools/bazel/rules_angular_store:node_modules/@angular/compiler-cli",
typescript = "@angular//:node_modules/typescript",
)
git_repository(
name = "rules_browsers",
commit = "56ef8007ea07cd1916429bca8bb523433b0e9cdc",
remote = "https://github.com/devversion/rules_browsers.git",
)
load("@rules_browsers//setup:step_1.bzl", "rules_browsers_setup_1")
rules_browsers_setup_1()
load("@rules_browsers//setup:step_2.bzl", "rules_browsers_setup_2")
rules_browsers_setup_2()
http_archive(
name = "aspect_rules_esbuild",
sha256 = "530adfeae30bbbd097e8af845a44a04b641b680c5703b3bf885cbd384ffec779",
strip_prefix = "rules_esbuild-0.22.1",
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.22.1/rules_esbuild-v0.22.1.tar.gz",
)
load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependencies")
rules_esbuild_dependencies()
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains")
esbuild_register_toolchains(
name = "esbuild",
esbuild_version = LATEST_ESBUILD_VERSION,
)
# Register git toolchains
register_toolchains(
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
)
git_repository(
name = "rules_sass",
commit = "cc1e845339fc45d3c8390445014d5824b85a0948",
remote = "https://github.com/devversion/rules_sass.git",
)
load("@rules_sass//src/toolchain:repositories.bzl", "setup_rules_sass")
setup_rules_sass()
http_archive(
name = "jq.bzl",
sha256 = "7b63435aa19cc6a0cfd1a82fbdf2c7a2f0a94db1a79ff7a4469ffa94286261ab",
strip_prefix = "jq.bzl-0.1.0",
url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.1.0/jq.bzl-v0.1.0.tar.gz",
)
+55 -48
View File
@@ -1,5 +1,4 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_angular//src/architect:ng_application.bzl", "ng_application")
load("@rules_angular//src/architect:ng_config.bzl", "ng_config")
load("@rules_angular//src/architect:ng_test.bzl", "ng_test")
@@ -63,7 +62,12 @@ APPLICATION_DEPS = [
"//adev:node_modules/@types/node",
"//adev:node_modules/@types/dom-navigation",
# Deep imports
# The imports below are packages that our code does not directly import, but our upstream deps import from
# these locations directly. By design, rather than hoisting these packages into the "root" node_modules the
# dependency is found in (i.e. ./adev/node_modules), rules_js places all of each package's dependencies in
# a "hoisted" location within the `.aspect_rules_js/` directories in the node_modules directory. This prevents
# the bundler from being able to find it as expected. We instead specifically provide it as a dep within bazel
# as a mechanism of "hoisting" the package for our usage by this target.
"//adev:node_modules/@algolia/client-common",
"//adev:node_modules/@algolia/requester-browser-xhr",
"//adev:node_modules/@algolia/requester-node-http",
@@ -87,60 +91,63 @@ TEST_DEPS = [
for dep in APPLICATION_DEPS
if dep != "//adev:node_modules/@types/node"
] + [
"@rules_browsers//src/browsers/chromium",
"@rules_browsers//src/browsers/firefox",
"@rules_browsers//browsers/chromium",
"@rules_browsers//browsers/firefox",
"//adev/tools:windows-chromium-path",
]
ng_config(name = "ng_config")
bool_flag(
name = "full_build_adev",
build_setting_default = False,
)
config_setting(
name = "prod_build",
flag_values = {
":full_build_adev": "true",
},
)
config_setting(
name = "dev_build",
flag_values = {
":full_build_adev": "false",
},
)
config_based_architect_env = select({
":dev_build": {
"NG_BUILD_PARTIAL_SSR": "1",
},
":prod_build": {
"NG_BUILD_OPTIMIZE_CHUNKS": "1",
},
})
config_based_architect_flags = select({
":dev_build": [
"--configuration",
"development",
],
":prod_build": [
"--configuration",
"production",
],
})
ng_application(
name = "build",
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = config_based_architect_flags,
env = config_based_architect_env,
args = [
"--configuration",
"development",
],
env = {
"NG_BUILD_PARTIAL_SSR": "1",
},
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
serve_args = [
"--port",
"4201",
],
tags = [
# Tagged as manual as both build and build.production use the same output directory.
"manual",
# RBE significantly slows down the build because the CLI executes multiple CPU-intensive instances of esbuild.
# Furthermore, the current RBE machine pool lacks high-spec machines.
"no-remote-exec",
],
)
ng_application(
name = "build.production",
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = [
"--configuration",
"production",
],
env = {
"NG_BUILD_OPTIMIZE_CHUNKS": "1",
},
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
serve_args = [
"--port",
"4201",
],
tags = [
# Tagged as manual as both build and build.production use the same output directory.
"manual",
# RBE significantly slows down the build because the CLI executes multiple CPU-intensive instances of esbuild.
# Furthermore, the current RBE machine pool lacks high-spec machines.
"no-remote-exec",
],
)
ng_test(
@@ -155,7 +162,7 @@ ng_test(
node_modules = "//adev:node_modules",
project_name = "angular-dev",
toolchains = [
"@rules_browsers//src/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/firefox:toolchain_alias",
"@rules_browsers//browsers/chromium:toolchain_alias",
"@rules_browsers//browsers/firefox:toolchain_alias",
],
)
+10
View File
@@ -51,3 +51,13 @@ pnpm bazel clean
# If that doesn't work, try it with the expunge flag
pnpm bazel clean --expunge
```
## High level architecture
The angular.dev website is a modern Angular application that utilizes Static Site Generation (SSG) to deliver pre-rendered, high-performance content to users.
The architecture is designed for efficiency and maintainability:
Content Sources: The documentation is sourced from two main places within the monorepo. The guides and tutorials are written in Markdown files, while the API reference pages are automatically generated by extracting documentation directly from the TypeScript source code of the Angular framework packages.
Build Process: During the build process, the Markdown files are converted into HTML. Simultaneously, the API documentation is extracted from the code comments. This content is then integrated into the Angular application.
+13
View File
@@ -18,6 +18,19 @@
}
]
},
{
"source": "assets/others/versions.json",
"headers": [
{
"key": "Cross-Origin-Resource-Policy",
"value": "cross-origin"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "/**/*-[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z].*",
"headers": [
+15 -15
View File
@@ -1,21 +1,21 @@
{
"dependencies": {
"@angular-devkit/build-angular": "20.2.0-next.2",
"@angular-devkit/build-angular": "20.3.6",
"@angular/animations": "workspace:*",
"@angular/build": "20.2.0-next.2",
"@angular/cdk": "20.2.0-next.2",
"@angular/cli": "20.2.0-next.2",
"@angular/build": "20.3.6",
"@angular/cdk": "20.2.10",
"@angular/cli": "20.3.6",
"@angular/common": "workspace:*",
"@angular/compiler-cli": "workspace:*",
"@angular/compiler": "workspace:*",
"@angular/core": "workspace:*",
"@angular/docs": "workspace:*",
"@angular/forms": "workspace:*",
"@angular/material": "20.2.0-next.2",
"@angular/material": "20.2.10",
"@angular/platform-browser": "workspace:*",
"@angular/platform-server": "workspace:*",
"@angular/router": "workspace:*",
"@angular/ssr": "20.2.0-next.2",
"@angular/ssr": "20.3.6",
"@codemirror/autocomplete": "6.18.6",
"@codemirror/commands": "6.8.1",
"@codemirror/lang-angular": "0.1.4",
@@ -23,7 +23,7 @@
"@codemirror/lang-html": "6.4.9",
"@codemirror/lang-javascript": "6.2.4",
"@codemirror/lang-sass": "6.0.2",
"@codemirror/language": "6.11.2",
"@codemirror/language": "6.11.3",
"@codemirror/lint": "6.8.5",
"@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.2",
@@ -33,9 +33,9 @@
"@lezer/javascript": "1.5.1",
"@stackblitz/sdk": "1.11.0",
"@types/dom-navigation": "1.0.6",
"@types/jasmine": "5.1.8",
"@types/jasmine": "5.1.9",
"@types/jsdom": "21.1.7",
"@types/node": "24.1.0",
"@types/node": "24.3.0",
"@typescript/vfs": "1.6.1",
"@webcontainer/api": "1.6.1",
"@xterm/addon-fit": "0.10.0",
@@ -52,16 +52,16 @@
"karma-coverage": "2.2.1",
"karma-jasmine-html-reporter": "2.1.0",
"karma-jasmine": "5.1.0",
"marked": "16.1.1",
"mermaid": "11.9.0",
"marked": "16.2.0",
"mermaid": "11.10.0",
"ngx-progressbar": "14.0.0",
"open-in-idx": "0.1.1",
"playwright-core": "1.54.1",
"preact-render-to-string": "6.5.13",
"preact": "10.27.0",
"playwright-core": "1.55.0",
"preact-render-to-string": "6.6.1",
"preact": "10.27.1",
"prettier": "3.6.2",
"rxjs": "7.8.2",
"shiki": "3.9.0",
"shiki": "3.11.0",
"tinyglobby": "0.2.14",
"tslib": "2.8.1",
"typescript": "5.9.2",
+68 -46
View File
@@ -7,6 +7,7 @@
*/
//tslint:disable:no-console
import assert from 'node:assert';
import {execSync} from 'node:child_process';
import {existsSync, constants as fsConstants} from 'node:fs';
import {copyFile, mkdtemp, readdir, readFile, realpath, unlink, writeFile} from 'node:fs/promises';
@@ -19,72 +20,93 @@ export async function copyJsonAssets({repo, githubApi, assetsPath, destPath}) {
throw new Error(`${buildInfoPath} does not exist.`);
}
const branch = process.env.GITHUB_REF;
const {sha: currentSha} = JSON.parse(await readFile(buildInfoPath, 'utf-8'));
const latestSha = await githubApi.getShaForBranch(branch);
assert(process.env.GITHUB_REF);
const currentBranch = process.env.GITHUB_REF;
console.log(`Comparing ${currentSha}...${latestSha}.`);
const affectedFiles = await githubApi.getAffectedFiles(currentSha, latestSha);
const changedFiles = affectedFiles.filter((file) => file.startsWith(`${assetsPath}/`));
if (changedFiles.length === 0) {
console.log(`No '${assetsPath}/**' files changed between ${currentSha} and ${latestSha}.`);
return;
}
console.log(
`The below files changed between ${currentSha} and ${latestSha}:\n` +
changedFiles.map((f) => '* ' + f).join('\n'),
const {sha: storedSha, branchName: storedBranch} = JSON.parse(
await readFile(buildInfoPath, 'utf-8'),
);
const temporaryDir = await realpath(await mkdtemp(join(tmpdir(), 'copy-json-assets-')));
const execOptions = {cwd: temporaryDir, stdio: 'inherit'};
execSync('git init', execOptions);
execSync(`git remote add origin https://github.com/${repo}.git`, execOptions);
// fetch a commit
execSync(`git fetch origin ${latestSha}`, execOptions);
// reset this repository's main branch to the commit of interest
execSync('git reset --hard FETCH_HEAD', execOptions);
// get sha when files where changed
const shaWhenFilesChanged = execSync(`git rev-list -1 ${latestSha} "${assetsPath}/"`, {
encoding: 'utf8',
cwd: temporaryDir,
stdio: ['ignore', 'pipe', 'ignore'],
}).trim();
let downstreamBranch = currentBranch;
let latestSha = await githubApi.getShaForBranch(currentBranch);
if (
latestSha.includes('No commit') &&
currentBranch !== 'refs/heads/main' &&
currentBranch !== storedBranch
) {
// In some cases, such as when a new branch is created for a feature,
// the branch may not exist in the downstream repo. For example, during an
// exceptional minor release (e.g. FW 20.3.x and Components: 20.2.x).
// In such scenarios, we fallback to the last known branch.
latestSha = await githubApi.getShaForBranch(storedBranch);
downstreamBranch = storedBranch;
}
// Delete existing asset files.
const apiFilesUnlink = (await readdir(destPath))
.filter((f) => f.endsWith('.json'))
.map((f) => unlink(join(destPath, f)));
console.log(`Comparing ${storedSha}...${latestSha}.`);
const affectedFiles = await githubApi.getAffectedFiles(storedSha, latestSha);
const changedFiles = affectedFiles.filter((file) => file.startsWith(`${assetsPath}/`));
await Promise.allSettled(apiFilesUnlink);
let shaWhenFilesChanged;
if (changedFiles.length > 0) {
console.log(
`The below files changed between ${storedSha} and ${latestSha}:\n` +
changedFiles.map((f) => '* ' + f).join('\n'),
);
// Copy new asset files
const tempAssetsDir = join(temporaryDir, assetsPath);
const assetFilesCopy = (await readdir(tempAssetsDir)).map((f) => {
const src = join(tempAssetsDir, f);
const dest = join(destPath, f);
const temporaryDir = await realpath(await mkdtemp(join(tmpdir(), 'copy-json-assets-')));
const execOptions = {cwd: temporaryDir, stdio: 'inherit'};
execSync('git init', execOptions);
execSync(`git remote add origin https://github.com/${repo}.git`, execOptions);
// fetch a commit
execSync(`git fetch origin ${latestSha}`, execOptions);
// reset this repository's main branch to the commit of interest
execSync('git reset --hard FETCH_HEAD', execOptions);
// get sha when files where changed
shaWhenFilesChanged = execSync(`git rev-list -1 ${latestSha} "${assetsPath}/"`, {
encoding: 'utf8',
cwd: temporaryDir,
stdio: ['ignore', 'pipe', 'ignore'],
}).trim();
return copyFile(src, dest, fsConstants.COPYFILE_FICLONE);
});
// Delete existing asset files.
const apiFilesUnlink = (await readdir(destPath))
.filter((f) => f.endsWith('.json'))
.map((f) => unlink(join(destPath, f)));
await Promise.allSettled(assetFilesCopy);
await Promise.allSettled(apiFilesUnlink);
// Copy new asset files
const tempAssetsDir = join(temporaryDir, assetsPath);
const assetFilesCopy = (await readdir(tempAssetsDir)).map((f) => {
const src = join(tempAssetsDir, f);
const dest = join(destPath, f);
return copyFile(src, dest, fsConstants.COPYFILE_FICLONE);
});
await Promise.allSettled(assetFilesCopy);
console.log(`Successfully updated asset files in '${destPath}'.\n`);
} else {
console.log(`No '${assetsPath}/**' files changed between ${storedSha} and ${latestSha}.`);
}
// Write SHA to file.
await writeFile(
buildInfoPath,
JSON.stringify(
{
branchName: branch,
sha: shaWhenFilesChanged,
branchName: downstreamBranch,
sha: shaWhenFilesChanged ?? storedSha,
},
undefined,
2,
),
);
// The below command will show uncommitted changes.
// This is expected because the framework repo and component/cli might have different minors
// (e.g. during exceptional minor releases), leading to changes that need to be committed.
console.log('\nChanges: ');
execSync(`git status --porcelain`, {stdio: 'inherit'});
console.log(`Successfully updated asset files in '${destPath}'.\n`);
}
@@ -21,7 +21,7 @@ import {RouterLink} from '@angular/router';
export class Breadcrumb {
private readonly navigationState = inject(NavigationState);
breadcrumbItems = computed(() => {
readonly breadcrumbItems = computed(() => {
const breadcrumbs: NavigationItem[] = [];
let activeItem = this.navigationState.activeNavigationItem()?.parent;
@@ -4,7 +4,7 @@
<div>
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">
<button class="docs-primary-btn" [attr.text]="'Learn more'" aria-label="Learn More">
<button type="button" class="docs-primary-btn" [attr.text]="'Learn more'" aria-label="Learn More">
Learn more
</button>
</a>
@@ -11,7 +11,7 @@ import {LOCAL_STORAGE} from '../../providers/index';
import {setCookieConsent} from '../../utils';
/**
* Decelare gtag as part of the window in this file as gtag is expected to already be loaded.
* Declare gtag as part of the window in this file as gtag is expected to already be loaded.
*/
declare const window: Window & typeof globalThis & {gtag?: Function};
@@ -27,7 +27,7 @@ export class CookiePopup {
private readonly localStorage = inject(LOCAL_STORAGE);
/** Whether the user has accepted the cookie disclaimer. */
hasAccepted = signal<boolean>(false);
readonly hasAccepted = signal(false);
constructor() {
// Needs to be in a try/catch, because some browsers will
@@ -15,7 +15,6 @@ import {
inject,
signal,
} from '@angular/core';
import {CommonModule} from '@angular/common';
import {Clipboard} from '@angular/cdk/clipboard';
import {IconComponent} from '../icon/icon.component';
@@ -24,7 +23,7 @@ export const CONFIRMATION_DISPLAY_TIME_MS = 2000;
@Component({
selector: 'button[docs-copy-source-code]',
imports: [CommonModule, IconComponent],
imports: [IconComponent],
templateUrl: './copy-source-code-button.component.html',
host: {
'type': 'button',
@@ -20,6 +20,7 @@ ng_project(
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/slide-toggle",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/pipes",
"//adev/shared-docs/services",
@@ -3,106 +3,118 @@
class="docs-navigation-list docs-faceted-list"
[class.docs-navigation-list-dropdown]="isDropdownView()"
>
@for (item of navigationItems; track $index) {
<li class="docs-faceted-list-item">
@if (item.path) {
@if (item.isExternal) {
<a
[href]="item.path"
target="_blank"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span
[class.docs-external-link]="item.isExternal"
class="docs-faceted-list-item-text"
@for (itemGroup of groupItems(navigationItems); track $index) {
@let groupLabel = itemGroup[0];
@let items = itemGroup[1];
@if (groupLabel) {
<li class="docs-navigation-group">{{groupLabel | titlecase}}</li>
}
@for (item of items; track $index) {
<li class="docs-faceted-list-item">
@let itemLabel = item.label!;
@if (item.path) {
@if (item.isExternal) {
<a
[href]="item.path"
target="_blank"
[matTooltip]="item.label"
[matTooltipDisabled]="itemLabel.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
<span
[class.docs-external-link]="item.isExternal"
class="docs-faceted-list-item-text"
>
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
@if (item.children && item.level! > 1 && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
</a>
@if (item.children && item.level! > 1 && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
</a>
} @else {
<a
[routerLink]="'/' + item.path"
routerLinkActive="docs-faceted-list-item-active"
[routerLinkActiveOptions]="{ paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
(click)="emitClickOnLink()"
[matTooltip]="item.label"
[matTooltipDisabled]="itemLabel.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
@if (item.children && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
</a>
}
} @else {
<a
[routerLink]="'/' + item.path"
routerLinkActive="docs-faceted-list-item-active"
[routerLinkActiveOptions]="{ exact: true }"
(click)="emitClickOnLink()"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
<!-- Nav Section Header -->
@if (item.level !== collapsableLevel() && item.level !== expandableLevel()) {
<div
class="docs-secondary-nav-header"
[matTooltip]="item.label"
[matTooltipDisabled]="itemLabel.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</div>
}
@if (item.children && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
</a>
}
} @else {
<!-- Nav Section Header -->
@if (item.level !== collapsableLevel() && item.level !== expandableLevel()) {
<div
class="docs-secondary-nav-header"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</div>
}
<!-- Nav Button Expand/Collapse -->
@if (
(item.children && item.level === expandableLevel()) || item.level === collapsableLevel()
) {
<button
type="button"
(click)="toggle(item)"
[attr.aria-label]="(item.isExpanded ? 'Collapse' : 'Expand') + ' ' + item.label"
[attr.aria-expanded]="item.isExpanded"
class="docs-secondary-nav-button"
[class.docs-faceted-list-item-active]="item | isActiveNavigationItem: activeItem()"
[class.docs-expanded-button]="item.children && item.level == collapsableLevel()"
[class.docs-not-expanded-button]="item.children && item.level === expandableLevel()"
[class.docs-nav-item-has-icon]="
<!-- Nav Button Expand/Collapse -->
@if (
(item.children && item.level === expandableLevel()) || item.level === collapsableLevel()
) {
<button
type="button"
(click)="toggle(item)"
[attr.aria-label]="(item.isExpanded ? 'Collapse' : 'Expand') + ' ' + item.label"
[attr.aria-expanded]="item.isExpanded"
class="docs-secondary-nav-button"
[class.docs-faceted-list-item-active]="item | isActiveNavigationItem: activeItem()"
[class.docs-expanded-button]="item.children && item.level == collapsableLevel()"
[class.docs-not-expanded-button]="item.children && item.level === expandableLevel()"
[class.docs-nav-item-has-icon]="
item.children && item.level === expandableLevel() && !item.isExpanded"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
@if (item.children && item.level === collapsableLevel()) {
<docs-icon>arrow_back</docs-icon>
}
<span class="docs-faceted-list-item-text">
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</button>
[matTooltip]="item.label"
[matTooltipDisabled]="itemLabel.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
@if (item.children && item.level === collapsableLevel()) {
<docs-icon>arrow_back</docs-icon>
}
<span class="docs-faceted-list-item-text">
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</button>
}
}
}
@if (displayItemsToLevel() > item.level && item.children?.length > 0) {
<ng-container *ngTemplateOutlet="navigationList; context: {$implicit: item.children}" />
}
</li>
@if (
item.level && displayItemsToLevel() > item.level && item.children && item.children.length > 0
) {
<ng-container
*ngTemplateOutlet="navigationList; context: {$implicit: item.children, level: item.level}"
/>
}
</li>
}
}
</ul>
</ng-template>
@@ -49,6 +49,7 @@
max-width: calc(100% - 1rem);
overflow: hidden;
text-overflow: ellipsis;
text-wrap: balance;
}
.docs-nav-item-has-icon {
@@ -185,3 +186,11 @@ a,
white-space: pre;
}
}
.docs-navigation-group {
padding: 0.5rem 0.5rem 0.5rem 1rem;
background: var(--septenary-contrast);
&:not(:first-child) {
margin-top: 2rem;
}
}
@@ -11,9 +11,10 @@ import {NavigationItem} from '../../interfaces/index';
import {NavigationState} from '../../services/index';
import {RouterLink, RouterLinkActive} from '@angular/router';
import {IconComponent} from '../icon/icon.component';
import {IsActiveNavigationItem} from '../../pipes/is-active-navigation-item.pipe';
import {NgTemplateOutlet} from '@angular/common';
import {IsActiveNavigationItem} from '../../pipes';
import {NgTemplateOutlet, TitleCasePipe} from '@angular/common';
import {MatTooltipModule} from '@angular/material/tooltip';
import {ReactiveFormsModule} from '@angular/forms';
@Component({
selector: 'docs-navigation-list',
@@ -24,6 +25,8 @@ import {MatTooltipModule} from '@angular/material/tooltip';
IsActiveNavigationItem,
NgTemplateOutlet,
MatTooltipModule,
ReactiveFormsModule,
TitleCasePipe,
],
templateUrl: './navigation-list.component.html',
styleUrls: ['./navigation-list.component.scss'],
@@ -31,10 +34,10 @@ import {MatTooltipModule} from '@angular/material/tooltip';
})
export class NavigationList {
readonly navigationItems = input.required<NavigationItem[]>();
readonly displayItemsToLevel = input<number>(2);
readonly displayItemsToLevel = input(2);
readonly collapsableLevel = input<number | undefined>();
readonly expandableLevel = input<number>(2);
readonly isDropdownView = input<boolean>(false);
readonly expandableLevel = input(2);
readonly isDropdownView = input(false);
readonly linkClicked = output<void>();
@@ -56,4 +59,33 @@ export class NavigationList {
emitClickOnLink(): void {
this.linkClicked.emit();
}
private hasCategories(items: NavigationItem[]): boolean {
return items.some((item) => !!item.category);
}
protected groupItems(items: NavigationItem[]): Map<string, NavigationItem[]> {
const hasCategories = this.hasCategories(items);
if (hasCategories) {
const others: NavigationItem[] = [];
const categorizedItems = new Map<string, NavigationItem[]>();
for (const item of items) {
const category = item.category || 'Other';
if (category === 'Other') {
others.push(item);
continue;
}
if (!categorizedItems.has(category)) {
categorizedItems.set(category, []);
}
categorizedItems.get(category)!.push(item);
}
if (others.length) {
categorizedItems.set('Other', others);
}
return categorizedItems;
} else {
return new Map([['', items]]);
}
}
}
@@ -27,6 +27,7 @@ ng_project(
"//adev/shared-docs/directives",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/pipes",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
],
)
@@ -12,35 +12,49 @@
@if (searchResults().length) {
<ul class="docs-search-results docs-mini-scroll-track">
@for (result of searchResults(); track result.id) {
<li docsSearchItem [item]="result">
<li docsSearchItem [item]="result" class="docs-search-result">
<a
[routerLink]="'/' + result.url | relativeLink: 'pathname'"
[fragment]="result.url | relativeLink: 'hash'"
(click)="history.addItem(result)"
>
<div>
<div class="docs-result-icon-and-type">
<p class="docs-search-result__label">
<!-- Icon -->
<span class="docs-search-result-icon" aria-hidden="true">
<i role="presentation" class="material-symbols-outlined docs-icon-small">
{{ result.type === 'code' ? 'code' : 'description'}}
</i>
</span>
<!-- Results type -->
<span class="docs-search-results__type" [innerHtml]="result.labelHtml"></span>
</div>
<!-- Page title -->
<span [innerHtml]="result.labelHtml"></span>
@if (result.package) {
<span
[innerHTML]="result.package"
class="docs-search-result__label__package"
></span>
}
</p>
@if (result.subLabelHtml) {
<span
class="docs-search-results__type docs-search-results__lvl2"
[innerHtml]="result.subLabelHtml"
>
</span>
<p class="docs-search-result__sub-label">
<span class="docs-search-result-icon" aria-hidden="true">
<i role="presentation" class="material-symbols-outlined docs-icon-small">
grid_3x3
</i>
</span>
<span [innerHtml]="result.subLabelHtml"></span>
</p>
}
@if (result.contentHtml) {
<p class="docs-search-result__content" [innerHtml]="result.contentHtml"></p>
}
</div>
<!-- Page title -->
<span class="docs-result-page-title">{{ result.category }}</span>
<p class="docs-search-result__category">
{{ result.category }}
</p>
</a>
</li>
}
@@ -38,11 +38,21 @@ dialog {
margin: 0;
border-block-end: 1px solid var(--senary-contrast);
li {
.docs-search-result {
border-inline-start: 2px solid var(--senary-contrast);
margin-inline-start: 1rem;
padding-inline-end: 1rem;
padding-block: 0.25rem;
display: block;
font-size: 0.875rem;
.docs-search-result-icon {
display: inline-block;
i {
display: flex;
align-items: center;
font-size: 1.2rem;
}
}
/**
* This rule needs ng-deep to be applied to elements that are created via a [innerHTML] binding
@@ -61,17 +71,50 @@ dialog {
color: var(--secondary-contrast);
display: flex;
justify-content: space-between;
padding: 1rem;
gap: 0.5rem;
}
.docs-search-result-icon {
i {
display: flex;
align-items: center;
font-size: 1.2rem;
}
&__label,
&__sub-label,
&__content {
transition: color 0.3s ease;
}
&__label,
&__sub-label {
display: flex;
align-items: center;
gap: 0.75rem;
margin: 0;
}
&__label {
font-weight: 600;
flex-wrap: wrap;
&__package {
font-size: 0.75rem;
}
}
&__content,
&__category {
margin: 0;
}
&__sub-label,
&__content {
margin-block-start: 0.375rem;
margin-inline-start: 2rem;
color: var(--quaternary-contrast);
}
&__category {
font-weight: 400;
color: var(--quaternary-contrast);
}
&.active {
background-color: var(--septenary-contrast); // stylelint-disable-line
}
@@ -80,44 +123,14 @@ dialog {
&.active {
background-color: var(--octonary-contrast); // stylelint-disable-line
border-inline-start: 2px solid var(--primary-contrast);
a {
span:not(.docs-result-page-title),
.docs-search-results__type {
color: var(--primary-contrast);
i {
color: var(--primary-contrast);
}
}
.docs-search-result__label,
.docs-search-result__sub-label,
.docs-search-result__content {
color: var(--primary-contrast);
}
}
}
.docs-search-result-icon,
.docs-search-results__type,
.docs-result-page-title {
color: var(--quaternary-contrast);
display: inline-block;
font-size: 0.875rem;
transition: color 0.3s ease;
padding: 0.75rem;
padding-inline-end: 0;
}
.docs-search-results__lvl2 {
display: inline-block;
margin-inline-start: 2rem;
padding-block-start: 0;
}
.docs-search-results__lvl3 {
margin-inline-start: 2rem;
padding-block-start: 0;
}
}
.docs-result-page-title {
font-size: 0.875rem;
font-weight: 400;
}
}
@@ -127,14 +140,6 @@ dialog {
color: var(--gray-400);
}
.docs-result-icon-and-type {
display: flex;
.docs-search-results__type {
padding-inline-start: 0;
}
}
.docs-search-footer {
display: flex;
align-items: center;
@@ -20,19 +20,18 @@ import {
viewChildren,
} from '@angular/core';
import {WINDOW} from '../../providers/index';
import {ClickOutside} from '../../directives/index';
import {Search, SearchHistory} from '../../services/index';
import {WINDOW} from '../../providers';
import {ClickOutside, SearchItem} from '../../directives';
import {Search, SearchHistory} from '../../services';
import {TextField} from '../text-field/text-field.component';
import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
import {SearchItem} from '../../directives/search-item/search-item.directive';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {Router, RouterLink} from '@angular/router';
import {fromEvent} from 'rxjs';
import {AlgoliaIcon} from '../algolia-icon/algolia-icon.component';
import {RelativeLink} from '../../pipes/relative-link.pipe';
import {RelativeLink} from '../../pipes';
import {SearchHistoryComponent} from '../search-history/search-history.component';
@Component({
@@ -52,10 +51,10 @@ import {SearchHistoryComponent} from '../search-history/search-history.component
styleUrls: ['./search-dialog.component.scss'],
})
export class SearchDialog {
onClose = output();
dialog = viewChild.required<ElementRef<HTMLDialogElement>>('searchDialog');
items = viewChildren(SearchItem);
textField = viewChild(TextField);
readonly onClose = output();
readonly dialog = viewChild.required<ElementRef<HTMLDialogElement>>('searchDialog');
readonly items = viewChildren(SearchItem);
readonly textField = viewChild(TextField);
readonly history = inject(SearchHistory);
private readonly search = inject(Search);
@@ -68,9 +67,9 @@ export class SearchDialog {
this.injector,
).withWrap();
searchQuery = this.search.searchQuery;
resultsResource = this.search.resultsResource;
searchResults = this.search.searchResults;
readonly searchQuery = this.search.searchQuery;
readonly resultsResource = this.search.resultsResource;
readonly searchResults = this.search.searchResults;
// We use a FormControl instead of relying on NgModel+signal to avoid
// the issue https://github.com/angular/angular/issues/13568
@@ -22,6 +22,7 @@ ng_project(
],
deps = [
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/directives",
@@ -38,6 +39,8 @@ ts_project(
":search-history",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/testing",
],
@@ -1,17 +1,31 @@
<ng-template #searchItem let-item="item" let-type="type">
<i role="presentation" class="material-symbols-outlined type-icon" aria-hidden="true">
{{ type === 'recent' ? 'history' : 'star' }}
</i>
<span [innerHTML]="item.labelHtml" class="label"></span>
@if (item.subLabelHtml) {
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> arrow_right </i>
<span [innerHTML]="item.subLabelHtml" class="sub-label"></span>
}
</ng-template>
@let items = history.items();
@if (items.recent.length) {
<p class="title">Recent</p>
<ul class="history-results recent">
@for (item of items.recent; track item.id; let idx = $index) {
<li docsSearchItem [item]="item" (mouseenter)="onMouseEnter($event, idx)">
<li docsSearchItem (mouseenter)="onMouseEnter($event, idx)">
<a
[routerLink]="'/' + item.url | relativeLink: 'pathname'"
[fragment]="item.url | relativeLink: 'hash'"
(click)="history.addItem(item)"
>
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> history </i>
<span [innerHTML]="item.labelHtml"></span>
<ng-container
[ngTemplateOutlet]="searchItem"
[ngTemplateOutletContext]="{item, type: 'recent'}"
/>
</a>
<button
@@ -20,7 +34,9 @@
(click)="history.makeFavorite(item)"
title="Make favorite"
>
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> star </i>
<i role="presentation" class="material-symbols-outlined type-icon" aria-hidden="true">
star
</i>
</button>
<button
type="button"
@@ -39,17 +55,15 @@
<p class="title">Favorite</p>
<ul class="history-results favorite">
@for (item of items.favorite; track item.id; let idx = $index) {
<li
docsSearchItem
[item]="item"
(mouseenter)="onMouseEnter($event, items.recent.length + idx)"
>
<li docsSearchItem (mouseenter)="onMouseEnter($event, items.recent.length + idx)">
<a
[routerLink]="'/' + item.url | relativeLink: 'pathname'"
[fragment]="item.url | relativeLink: 'hash'"
>
<i role="presentation" class="material-symbols-outlined" aria-hidden="true"> star </i>
<span [innerHTML]="item.labelHtml"></span>
<ng-container
[ngTemplateOutlet]="searchItem"
[ngTemplateOutletContext]="{item, type: 'favorite'}"
/>
</a>
<button
@@ -41,9 +41,23 @@
flex: 1;
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--secondary-contrast);
transition: color 0.3s ease;
white-space: nowrap;
overflow: hidden;
.type-icon {
margin-inline-end: 0.75rem;
}
span {
text-overflow: ellipsis;
overflow: hidden;
&.sub-label {
flex: 1;
}
}
&:hover {
color: var(--primary-contrast);
@@ -8,6 +8,7 @@
import {
afterNextRender,
ChangeDetectionStrategy,
Component,
DestroyRef,
effect,
@@ -18,20 +19,22 @@ import {
import {Router, RouterLink} from '@angular/router';
import {toSignal} from '@angular/core/rxjs-interop';
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
import {NgTemplateOutlet} from '@angular/common';
import {SearchHistory} from '../../services';
import {RelativeLink} from '../../pipes';
import {SearchItem} from '../../directives/search-item/search-item.directive';
import {SearchItem} from '../../directives';
@Component({
selector: 'docs-search-history',
imports: [RelativeLink, RouterLink, SearchItem],
imports: [NgTemplateOutlet, RelativeLink, RouterLink, SearchItem],
templateUrl: './search-history.component.html',
styleUrl: './search-history.component.scss',
host: {
'(document:keydown)': 'onKeydown($event)',
'(document:mousemove)': 'onMouseMove($event)',
},
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SearchHistoryComponent {
protected readonly items = viewChildren(SearchItem);
@@ -8,7 +8,6 @@
import {ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule} from '@angular/forms';
import {ChangeDetectionStrategy, Component, model, forwardRef, input, signal} from '@angular/core';
import {CommonModule} from '@angular/common';
type SelectOptionValue = string | number | boolean;
@@ -20,7 +19,7 @@ export interface SelectOption {
@Component({
selector: 'docs-select',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, FormsModule],
imports: [FormsModule],
templateUrl: './select.component.html',
styleUrls: ['./select.component.scss'],
providers: [
@@ -38,7 +37,7 @@ export class Select implements ControlValueAccessor {
readonly id = input.required<string>({alias: 'selectId'});
readonly name = input.required<string>();
readonly options = input.required<SelectOption[]>();
readonly disabled = model<boolean>(false);
readonly disabled = model(false);
// Implemented as part of ControlValueAccessor.
private onChange: (value: SelectOptionValue) => void = (_: SelectOptionValue) => {};
@@ -13,6 +13,7 @@ ng_project(
],
visibility = [
"//adev/shared-docs/components:__pkg__",
"//adev/shared-docs/components/navigation-list:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
@@ -7,12 +7,10 @@
*/
import {ChangeDetectionStrategy, Component, forwardRef, model, input, signal} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
@Component({
selector: 'docs-slide-toggle',
imports: [CommonModule],
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './slide-toggle.component.html',
styleUrls: ['./slide-toggle.component.scss'],
@@ -27,7 +25,7 @@ import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
export class SlideToggle implements ControlValueAccessor {
readonly buttonId = input.required<string>();
readonly label = input.required<string>();
readonly disabled = model<boolean>(false);
readonly disabled = model(false);
// Implemented as part of ControlValueAccessor.
private onChange: (value: boolean) => void = (_: boolean) => {};
@@ -17,7 +17,7 @@ import {
} from '@angular/core';
import {Location, ViewportScroller} from '@angular/common';
import {TableOfContentsLevel} from '../../interfaces/index';
import {TableOfContentsLoader} from '../../services/table-of-contents-loader.service';
import {TableOfContentsLoader} from '../../services';
import {IconComponent} from '../icon/icon.component';
@Component({
@@ -38,7 +38,7 @@ export class TableOfContents {
tableOfContentItems = this.tableOfContentsLoader.tableOfContentItems;
activeItemId = signal<string | null>(null);
readonly activeItemId = signal<string | null>(null);
TableOfContentsLevel = TableOfContentsLevel;
constructor() {
@@ -17,14 +17,13 @@ import {
model,
viewChild,
} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR} from '@angular/forms';
import {IconComponent} from '../icon/icon.component';
@Component({
selector: 'docs-text-field',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, FormsModule, IconComponent],
imports: [FormsModule, IconComponent],
templateUrl: './text-field.component.html',
styleUrls: ['./text-field.component.scss'],
providers: [
@@ -26,6 +26,9 @@ ng_project(
sass_binary(
name = "style",
src = "top-level-banner.component.scss",
deps = [
"//adev/shared-docs/styles",
],
)
ts_project(
@@ -1,19 +1,24 @@
@if (!hasClosed()) {
@if (link()) {
<a [href]="link()" class="docs-top-level-banner">
<h1 tabindex="-1" class="docs-top-level-banner-cta shimmer">{{ text() }}</h1>
<h1 tabindex="0" class="docs-top-level-banner-cta background"><span class="docs-top-level-banner-cta__text">{{ text()
}}</span></h1>
</a>
} @else {
<div class="docs-top-level-banner">
<h1 tabindex="-1" class="docs-top-level-banner-cta shimmer">{{ text() }}</h1>
<h1 tabindex="0" class="docs-top-level-banner-cta background"><span class="docs-top-level-banner-cta__text">{{ text()
}}</span></h1>
</div>
<span class="spacer"></span>
@if (link()) {
<a [href]="link()" class="docs-top-level-banner">
<h1 tabindex="-1" class="docs-top-level-banner-cta shimmer">{{ text() }}</h1>
<h1 tabindex="0" class="docs-top-level-banner-cta background">
<span class="docs-top-level-banner-cta__text">{{ text()
}}</span>
</h1>
</a>
} @else {
<div class="docs-top-level-banner">
<h1 tabindex="-1" class="docs-top-level-banner-cta shimmer">{{ text() }}</h1>
<h1 tabindex="0" class="docs-top-level-banner-cta background">
<span class="docs-top-level-banner-cta__text">{{ text()
}}</span>
</h1>
</div>
}
<span class="spacer"></span>
<button class="docs-top-level-banner-close" type="button" (click)="close()">
<docs-icon class="docs-icon_high-contrast">close</docs-icon>
</button>
}
<button class="docs-top-level-banner-close" type="button" (click)="close()">
<docs-icon class="docs-icon_high-contrast">close</docs-icon>
</button>
}
@@ -1,3 +1,5 @@
@use '../../styles/media-queries' as mq;
:host {
&:not(:empty) {
z-index: var(--z-index-top-level-banner);
@@ -7,25 +9,33 @@
justify-content: center;
height: auto;
width: 100vw;
padding: .5rem;
border-bottom: 1px solid var(--septenary-contrast);
text-align: center;
align-content: center;
backdrop-filter: blur(16px);
background-color: color-mix(in srgb, var(--page-background) 70%, transparent);
@include mq.for-tablet-landscape-down {
position: initial;
}
}
.spacer {
flex: 1;
}
a.docs-top-level-banner {
display: grid;
width: auto;
margin: 0rem 2.5rem;
margin: 0.5rem 2.5rem;
&:hover{
h1.docs-top-level-banner-cta.background{
span.docs-top-level-banner-cta__text::after{
&:hover {
h1.docs-top-level-banner-cta.background {
span.docs-top-level-banner-cta__text::after {
transform: scaleX(1);
transform-origin: bottom left;
}}
}
}
}
}
@@ -39,9 +49,9 @@
&.background {
color: var(--tertiary-contrast);
& .docs-top-level-banner-cta__text{
position:relative;
& .docs-top-level-banner-cta__text {
position: relative;
&::after {
content: '';
@@ -57,9 +67,7 @@
transition: transform 0.3s ease;
}
}
}
}
&:not(.background) {
@@ -68,11 +76,8 @@
}
.docs-top-level-banner-close {
position: absolute;
top: 0.25rem;
right: 1.4rem;
margin: 0 1rem;
color: var(--tertiary-contrast);
padding-left: 0rem;
}
}
@@ -29,16 +29,16 @@ export class TopLevelBannerComponent {
* separately for different events or instances. Without a unique ID,
* closing one banner could inadvertently hide other banners for different events.
*/
id = input.required<string>();
readonly id = input.required<string>();
// Optional URL link that the banner should navigate to when clicked.
link = input<string>();
readonly link = input<string>();
// Text content to be displayed in the banner.
text = input.required<string>();
readonly text = input.required<string>();
// Optional expiry date. Setting the default expiry as a future date so we
// don't have to deal with undefined signal values.
expiry = input(new Date('3000-01-01'), {transform: parseDate});
readonly expiry = input(new Date('3000-01-01'), {transform: parseDate});
// Whether the user has closed the banner or the survey has expired.
hasClosed = linkedSignal(() => {
readonly hasClosed = linkedSignal(() => {
const expired = Date.now() > this.expiry().getTime();
// Needs to be in a try/catch, because some browsers will
@@ -21,13 +21,17 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/breadcrumb",
"//adev/shared-docs/components/copy-source-code-button",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/table-of-contents",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/utils",
],
)
@@ -21,8 +21,7 @@
max-width: var(--page-width);
}
//applying styles when TOC position got translated to the top right
// applying styles when TOC position got translated to the top right
@include mq.for-large-desktop-up {
// take the available space except a reserved area for TOC
margin-left: -16rem;
@@ -32,8 +31,13 @@
// restrict the content to be fluid until it reaches that width
// $screen-xl is the breakpoint where Main content stop being fluid and made fixed
>*:not(docs-table-of-contents) {
max-width: calc(mq.$screen-xxl - var(--secondary-nav-width) - var(--primary-nav-width) - var(--layout-padding)*2)
> *:not(docs-table-of-contents) {
max-width: calc(
mq.$screen-xl - var(--secondary-nav-width) - var(--primary-nav-width) - var(
--layout-padding
) *
2
);
}
pre {
@@ -50,8 +54,15 @@
margin-block-start: 0.75rem;
display: inline-block;
color: inherit;
max-width: 100%;
@include anchor.docs-anchor();
code {
// This can be useful on mobile if the heading contains a long code block
overflow: hidden;
text-overflow: ellipsis;
}
}
}
@@ -90,7 +101,6 @@
}
a:not(.docs-github-links):not(.docs-card):not(.docs-pill):not(.docs-example-github-link) {
&[href^='http:'],
&[href^='https:'] {
@include links.external-link-with-icon();
@@ -98,7 +108,6 @@
}
&-scroll-margin-large {
h2,
h3 {
scroll-margin: 5em;
@@ -109,7 +118,7 @@
.docs-header {
margin-block-end: 1rem;
&>p:first-child {
& > p:first-child {
color: var(--quaternary-contrast);
font-weight: 500;
margin: 0;
@@ -140,4 +149,4 @@
}
}
}
}
}
@@ -109,7 +109,10 @@ describe('DocViewer', () => {
expect(exampleViewer).not.toBeNull();
expect(exampleViewer.componentInstance.view()).toBe(CodeExampleViewMode.SNIPPET);
const checkIcon = fixture.debugElement.query(By.directive(IconComponent));
const copySourceCodeButton = fixture.debugElement.query(By.directive(CopySourceCodeButton));
expect(copySourceCodeButton).not.toBeNull();
const checkIcon = copySourceCodeButton.query(By.directive(IconComponent));
expect((checkIcon.nativeElement as HTMLElement).classList).toContain(
`material-symbols-outlined`,
);
@@ -28,21 +28,22 @@ import {
effect,
} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services/index';
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services';
import {TableOfContents} from '../../table-of-contents/table-of-contents.component';
import {IconComponent} from '../../icon/icon.component';
import {handleHrefClickEventWithRouter} from '../../../utils/index';
import {Snippet} from '../../../interfaces/index';
import {handleHrefClickEventWithRouter} from '../../../utils';
import {Snippet} from '../../../interfaces';
import {Router} from '@angular/router';
import {fromEvent} from 'rxjs';
import {Breadcrumb} from '../../breadcrumb/breadcrumb.component';
import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-code-button.component';
import {ExampleViewer} from '../example-viewer/example-viewer.component';
import {DomSanitizer} from '@angular/platform-browser';
const TOC_HOST_ELEMENT_NAME = 'docs-table-of-contents';
export const ASSETS_EXAMPLES_PATH = 'assets/content/examples';
export const DOCS_VIEWER_SELECTOR = 'docs-viewer';
export const DOCS_VIEWER_SELECTOR = 'docs-viewer, main[docsViewer]';
export const DOCS_CODE_SELECTOR = '.docs-code';
export const DOCS_CODE_MUTLIFILE_SELECTOR = '.docs-code-multifile';
// TODO: Update the branch/sha
@@ -60,8 +61,8 @@ export const GITHUB_CONTENT_URL = 'https://github.com/angular/angular/blob/main/
},
})
export class DocViewer {
docContent = input<string | undefined>();
hasToc = input(false);
readonly docContent = input<string | undefined>();
readonly hasToc = input(false);
readonly contentLoaded = output<void>();
private readonly destroyRef = inject(DestroyRef);
@@ -74,6 +75,7 @@ export class DocViewer {
private readonly environmentInjector = inject(EnvironmentInjector);
private readonly injector = inject(Injector);
private readonly appRef = inject(ApplicationRef);
private readonly sanitizer = inject(DomSanitizer);
protected animateContent = false;
private readonly pendingTasks = inject(PendingTasks);
@@ -186,6 +188,7 @@ export class DocViewer {
path: string,
): Promise<void> {
const preview = Boolean(placeholder.getAttribute('preview'));
const hideCode = Boolean(placeholder.getAttribute('hideCode'));
const title = placeholder.getAttribute('header') ?? undefined;
const firstCodeSnippetTitle =
snippets.length > 0 ? (snippets[0].title ?? snippets[0].name) : undefined;
@@ -197,13 +200,14 @@ export class DocViewer {
path,
files: snippets,
preview,
hideCode,
id: this.countOfExamples,
});
exampleRef.instance.githubUrl = `${GITHUB_CONTENT_URL}/${snippets[0].name}`;
exampleRef.setInput('githubUrl', `${GITHUB_CONTENT_URL}/${snippets[0].name}`);
// TODO: Re-add support for opening examples on StackBlitz
exampleRef.instance.stackblitzUrl = null; // `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
exampleRef.setInput('stackblitzUrl', null); // `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
placeholder.parentElement!.replaceChild(exampleRef.location.nativeElement, placeholder);
@@ -215,8 +219,10 @@ export class DocViewer {
return tabs.map((tab) => ({
name: tab.getAttribute('path') ?? tab.getAttribute('header') ?? '',
content: tab.innerHTML,
sanitizedContent: this.sanitizer.bypassSecurityTrustHtml(tab.innerHTML),
visibleLinesRange: tab.getAttribute('visibleLines') ?? undefined,
shell: tab.classList.contains('shell'),
title: tab.getAttribute('header') ?? undefined,
}));
}
@@ -235,8 +241,11 @@ export class DocViewer {
return {
title,
name: path,
content: content?.outerHTML,
sanitizedContent: content?.outerHTML
? this.sanitizer.bypassSecurityTrustHtml(content.outerHTML)
: '',
visibleLinesRange: visibleLines,
shell: element.classList.contains('shell'),
};
}
@@ -5,23 +5,33 @@
}
@if (view() === CodeExampleViewMode.MULTI_FILE) {
<mat-tab-group
#codeTabs
animationDuration="0ms"
mat-stretch-tabs="false"
>
<mat-tab-group #codeTabs animationDuration="0ms" mat-stretch-tabs="false">
@for (tab of tabs(); track tab) {
<mat-tab [label]="tab.name"></mat-tab>
<mat-tab [label]="tab.name" />
}
</mat-tab-group>
}
<div class="docs-example-viewer-icons">
<button
type="button"
role="switch"
class="docs-example-code-toggle"
[attr.aria-checked]="showCode()"
[attr.aria-label]="showCode() ? 'Hide code' : 'Show code'"
(click)="showCode.set(!showCode())"
[matTooltip]="showCode() ? 'Hide code' : 'Show code'"
matTooltipPosition="above"
>
<docs-icon>{{showCode() ? 'code_off' : 'code'}}</docs-icon>
</button>
<button
type="button"
class="docs-example-copy-link"
[attr.aria-label]="'Copy link to ' + exampleMetadata()?.title + ' example to the clipboard'"
(click)="copyLink()"
matTooltip="Copy link to example"
matTooltipPosition="above"
>
<i aria-hidden="true">
<svg
@@ -45,8 +55,9 @@
<button
type="button"
(click)="toggleExampleVisibility()"
[attr.title]="(expanded() ? 'Collapse' : 'Expand') + ' example'"
[attr.aria-label]="(expanded() ? 'Collapse' : 'Expand') + ' code example'"
matTooltip="{{ expanded() ? 'Collapse' : 'Expand' }} example"
matTooltipPosition="above"
>
<i aria-hidden="true">
@if (!expanded()) {
@@ -81,14 +92,19 @@
</div>
</header>
<div
class="docs-example-viewer-code-wrapper"
[class.docs-example-viewer-snippet]="view() === CodeExampleViewMode.SNIPPET"
[class.docs-example-viewer-multi-file]="view() === CodeExampleViewMode.MULTI_FILE"
>
<button docs-copy-source-code></button>
<docs-viewer [docContent]="snippetCode()?.content" />
</div>
@if (showCode()) {
<div
class="docs-example-viewer-code-wrapper"
[class.docs-example-viewer-snippet]="view() === CodeExampleViewMode.SNIPPET"
[class.docs-example-viewer-multi-file]="view() === CodeExampleViewMode.MULTI_FILE"
[class.shell]="snippetCode()?.shell"
>
<button docs-copy-source-code></button>
@if (snippetCode()?.sanitizedContent; as content) {
<div [innerHTML]="content"></div>
}
</div>
}
@if (exampleComponent) {
<div class="docs-example-viewer-preview">
@@ -98,13 +114,14 @@
<ng-template #openCodeInExternalProvider>
@if (exampleComponent) {
@if (githubUrl) {
@if (githubUrl()) {
<a
[href]="githubUrl"
[href]="githubUrl()"
target="_blank"
title="Open example on GitHub"
class="docs-example-github-link"
aria-label="Open example on GitHub"
matTooltip="Open example on GitHub"
matTooltipPosition="above"
>
<i aria-hidden="true">
<svg
@@ -125,13 +142,14 @@
</i>
</a>
}
@if (stackblitzUrl) {
@if (stackblitzUrl()) {
<a
[href]="stackblitzUrl"
[href]="stackblitzUrl()"
target="_blank"
class="docs-example-stackblitz-link"
title="Edit this example in StackBlitz"
aria-label="Edit this example in StackBlitz"
aria-label="Edit example in StackBlitz"
matTooltip="Edit example in StackBlitz"
matTooltipPosition="above"
>
<i aria-hidden="true">
<svg
@@ -1,10 +1,12 @@
:host {
.docs-example-viewer-preview {
.docs-dark-mode & {
background: var(--gray-100);
color: var(--primary-contrast);
background: var(--gray-900);
}
@media screen and (prefers-color-scheme: dark) {
background: var(--gray-100);
color: var(--primary-contrast);
background: var(--gray-900);
}
.docs-light-mode & {
background: var(--page-background);
@@ -55,25 +57,25 @@
display: flex;
gap: 0.75rem;
svg {
fill: var(--gray-400);
}
}
a,
button {
padding: 0;
margin: 0;
cursor: pointer;
height: 24px;
width: 24px;
color: var(--gray-400);
a,
button {
padding: 0;
margin: 0;
cursor: pointer;
height: 24px;
width: 24px;
path {
transition: fill 0.3s ease;
}
path {
transition: fill 0.3s ease;
}
&:hover {
svg {
fill: var(--tertiary-contrast);
fill: currentColor;
}
&:hover {
color: var(--tertiary-contrast);
}
}
}
@@ -10,7 +10,7 @@ import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ExampleViewer} from './example-viewer.component';
import {ExampleMetadata, ExampleViewerContentLoader} from '../../../interfaces';
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers';
import {Component, provideZonelessChangeDetection, ComponentRef} from '@angular/core';
import {Component, provideZonelessChangeDetection, ComponentRef, signal} from '@angular/core';
import {HarnessLoader} from '@angular/cdk/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Clipboard} from '@angular/cdk/clipboard';
@@ -35,7 +35,6 @@ describe('ExampleViewer', () => {
await TestBed.configureTestingModule({
imports: [ExampleViewer],
providers: [
// TODO: Find why tests warn that zone.js is still loaded
provideZonelessChangeDetection(),
{provide: EXAMPLE_VIEWER_CONTENT_LOADER, useValue: exampleContentSpy},
{provide: ActivatedRoute, useValue: {snapshot: {fragment: 'fragment'}}},
@@ -53,9 +52,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'file.ts', content: ''},
{name: 'file.html', content: ''},
{name: 'file.css', content: ''},
{name: 'file.ts', sanitizedContent: ''},
{name: 'file.html', sanitizedContent: ''},
{name: 'file.css', sanitizedContent: ''},
],
}),
);
@@ -73,9 +72,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'file.ts', content: 'typescript file'},
{name: 'file.html', content: 'html file'},
{name: 'file.css', content: 'css file'},
{name: 'file.ts', sanitizedContent: 'typescript file'},
{name: 'file.html', sanitizedContent: 'html file'},
{name: 'file.css', sanitizedContent: 'css file'},
],
}),
);
@@ -93,9 +92,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'example.ts', content: 'typescript file'},
{name: 'example.html', content: 'html file'},
{name: 'another-example.ts', content: 'css file'},
{name: 'example.ts', sanitizedContent: 'typescript file'},
{name: 'example.html', sanitizedContent: 'html file'},
{name: 'another-example.ts', sanitizedContent: 'css file'},
],
}),
);
@@ -124,7 +123,7 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
visibleLinesRange: '[1]',
},
],
@@ -148,7 +147,7 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
visibleLinesRange: '[1]',
},
],
@@ -198,7 +197,7 @@ describe('ExampleViewer', () => {
By.css('a[aria-label="Open example on GitHub"]'),
);
expect(githubButton).toBeTruthy();
expect(githubButton.nativeElement.href).toBe(component.githubUrl);
expect(githubButton.nativeElement.href).toBe(component.githubUrl());
});
it('should display StackBlitz button when stackblitzUrl is provided and there is preview', async () => {
@@ -210,15 +209,16 @@ describe('ExampleViewer', () => {
preview: true,
}),
);
component.stackblitzUrl = 'https://stackblitz.com/';
componentRef.setInput('stackblitzUrl', 'https://stackblitz.com/');
await component.renderExample();
fixture.detectChanges();
const stackblitzButton = fixture.debugElement.query(
By.css('a[aria-label="Edit this example in StackBlitz"]'),
By.css('a[aria-label="Edit example in StackBlitz"]'),
);
expect(stackblitzButton).toBeTruthy();
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl);
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl());
});
it('should set expanded flag in metadata after toggleExampleVisibility', async () => {
@@ -242,9 +242,9 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
},
{name: 'example.css', content: ''},
{name: 'example.css', sanitizedContent: ''},
],
}),
);
@@ -272,21 +272,86 @@ describe('ExampleViewer', () => {
button.click();
expect(spy.calls.argsFor(0)[0].trim()).toBe(`${window.location.href}#example-1`);
});
it('should hide code content when `hideCode` is true', async () => {
componentRef.setInput(
'metadata',
getMetadata({
hideCode: true,
}),
);
await component.renderExample();
fixture.detectChanges();
// Initially, the code should be hidden.
expect(component.showCode()).toBeFalse();
let codeContainer = fixture.debugElement.query(By.css('.docs-example-viewer-code-wrapper'));
expect(codeContainer).toBeNull();
});
it('should expand/collapse code content with toggle button.', async () => {
componentRef.setInput('metadata', getMetadata());
await component.renderExample();
fixture.detectChanges();
// Initially, the code should be visible.
expect(component.showCode()).toBeTrue();
let codeContainer = fixture.debugElement.query(By.css('.docs-example-viewer-code-wrapper'));
expect(codeContainer).not.toBeNull();
const codeToggleButton = fixture.debugElement.query(By.css('.docs-example-code-toggle'));
codeToggleButton.nativeElement.click();
fixture.detectChanges();
expect(component.showCode()).toBeFalse();
codeContainer = fixture.debugElement.query(By.css('.docs-example-viewer-code-wrapper'));
expect(codeContainer).toBeNull();
codeToggleButton.nativeElement.click();
fixture.detectChanges();
expect(component.showCode()).toBeTrue();
codeContainer = fixture.debugElement.query(By.css('.docs-example-viewer-code-wrapper'));
expect(codeContainer).not.toBeNull();
});
it('should render example', async () => {
exampleContentSpy.loadPreview.and.resolveTo(ExampleComponent);
componentRef.setInput(
'metadata',
getMetadata({
path: 'example.ts',
preview: true,
}),
);
await component.renderExample();
fixture.detectChanges();
expect(component.exampleComponent).toBeDefined();
const previewContainer = fixture.debugElement.query(By.css('.docs-example-viewer-preview'));
expect(previewContainer.nativeElement.innerHTML).toContain('ng-component');
expect(previewContainer.nativeElement.textContent).toContain('foobar');
});
});
const getMetadata = (value: Partial<ExampleMetadata> = {}): ExampleMetadata => {
return {
id: 1,
files: [
{name: 'example.ts', content: ''},
{name: 'example.css', content: ''},
{name: 'example.ts', sanitizedContent: ''},
{name: 'example.css', sanitizedContent: ''},
],
preview: false,
hideCode: false,
...value,
};
};
@Component({
template: '',
template: '{{foobar}}',
})
class ExampleComponent {}
class ExampleComponent {
foobar = signal('foobar');
}
@@ -14,23 +14,22 @@ import {
computed,
DestroyRef,
ElementRef,
forwardRef,
inject,
Injector,
input,
Input,
signal,
Type,
viewChild,
} from '@angular/core';
import {CommonModule, DOCUMENT} from '@angular/common';
import {DOCUMENT, NgComponentOutlet, NgTemplateOutlet} from '@angular/common';
import {MatTabGroup, MatTabsModule} from '@angular/material/tabs';
import {Clipboard} from '@angular/cdk/clipboard';
import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-code-button.component';
import {IconComponent} from '../../icon/icon.component';
import {ExampleMetadata, Snippet} from '../../../interfaces/index';
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers/index';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {DocViewer} from '../docs-viewer/docs-viewer.component';
import {MatTooltipModule} from '@angular/material/tooltip';
export enum CodeExampleViewMode {
SNIPPET = 'snippet',
@@ -44,16 +43,22 @@ export const HIDDEN_CLASS_NAME = 'hidden';
@Component({
selector: 'docs-example-viewer',
imports: [CommonModule, forwardRef(() => DocViewer), CopySourceCodeButton, MatTabsModule],
imports: [
CopySourceCodeButton,
MatTabsModule,
MatTooltipModule,
IconComponent,
NgTemplateOutlet,
NgComponentOutlet,
],
templateUrl: './example-viewer.component.html',
styleUrls: ['./example-viewer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ExampleViewer {
exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
@Input() githubUrl: string | null = null;
@Input() stackblitzUrl: string | null = null;
readonly exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
readonly githubUrl = input<string | null>(null);
readonly stackblitzUrl = input<string | null>(null);
readonly matTabGroup = viewChild<MatTabGroup>('codeTabs');
private readonly changeDetector = inject(ChangeDetectorRef);
@@ -75,17 +80,18 @@ export class ExampleViewer {
CodeExampleViewMode = CodeExampleViewMode;
exampleComponent?: Type<unknown>;
expandable = signal<boolean>(false);
expanded = signal<boolean>(false);
snippetCode = signal<Snippet | undefined>(undefined);
tabs = computed(() =>
readonly expandable = signal<boolean>(false);
readonly expanded = signal<boolean>(false);
readonly snippetCode = signal<Snippet | undefined>(undefined);
readonly showCode = signal<boolean>(true);
readonly tabs = computed(() =>
this.exampleMetadata()?.files.map((file) => ({
name:
file.title ?? (this.shouldDisplayFullName() ? file.name : this.getFileExtension(file.name)),
code: file.content,
code: file.sanitizedContent,
})),
);
view = computed(() =>
readonly view = computed(() =>
this.exampleMetadata()?.files.length === 1
? CodeExampleViewMode.SNIPPET
: CodeExampleViewMode.MULTI_FILE,
@@ -93,14 +99,17 @@ export class ExampleViewer {
async renderExample(): Promise<void> {
// Lazy load live example component
if (this.exampleMetadata()?.path && this.exampleMetadata()?.preview) {
this.exampleComponent = await this.exampleViewerContentLoader.loadPreview(
this.exampleMetadata()?.path!,
);
const path = this.exampleMetadata()?.path;
if (path && this.exampleMetadata()?.preview) {
this.exampleComponent = await this.exampleViewerContentLoader.loadPreview(path);
}
this.snippetCode.set(this.exampleMetadata()?.files[0]);
if (this.exampleMetadata()?.hideCode) {
this.showCode.set(false);
}
afterNextRender(
() => {
// Several function below query the DOM directly, we need to wait until the DOM is rendered.
+1 -1
View File
@@ -3,7 +3,7 @@ load("@aspect_bazel_lib//lib:copy_to_directory.bzl", _copy_to_directory = "copy_
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild")
load("@devinfra//bazel/private:path_relative_to_label.bzl", _path_relative_to_label = "path_relative_to_label")
load(
"//tools:defaults2.bzl",
"//tools:defaults.bzl",
_jasmine_test = "jasmine_test",
_js_binary = "js_binary",
_js_library = "js_library",
@@ -7,7 +7,7 @@
*/
import {DOCUMENT} from '@angular/common';
import {Directive, ElementRef, Input, inject, output} from '@angular/core';
import {Directive, ElementRef, inject, input, output} from '@angular/core';
@Directive({
selector: '[docsClickOutside]',
@@ -16,8 +16,7 @@ import {Directive, ElementRef, Input, inject, output} from '@angular/core';
},
})
export class ClickOutside {
// TODO: Understand why replacing this @Input with a signal input breaks the tests
@Input('docsClickOutsideIgnore') public ignoredElementsIds: string[] = [];
readonly ignoredElementsIds = input<string[]>([], {alias: 'docsClickOutsideIgnore'});
public readonly clickOutside = output<void>({alias: 'docsClickOutside'});
private readonly document = inject(DOCUMENT);
@@ -33,11 +32,11 @@ export class ClickOutside {
}
private wasClickedOnIgnoredElement(event: MouseEvent): boolean {
if (this.ignoredElementsIds.length === 0) {
if (this.ignoredElementsIds().length === 0) {
return false;
}
return this.ignoredElementsIds.some((elementId) => {
return this.ignoredElementsIds().some((elementId) => {
const element = this.document.getElementById(elementId);
const target = event.target as Node;
const contains = element?.contains(target);
@@ -41,11 +41,13 @@ describe('ExternalLink', () => {
By.css('a[href="https://stackoverflow.com/questions/tagged/angular"]'),
);
expect(externalLink.attributes['target']).toEqual('_blank');
expect(externalLink.attributes['rel']).toEqual('noopener');
});
it('should not internal link have target=_blank attribute', () => {
const internalLink = fixture.debugElement.query(By.css('a[href="/roadmap"]'));
expect(internalLink.attributes['target']).toBeFalsy();
expect(internalLink.attributes['rel']).toBeFalsy();
});
it('should not set target=_blank attribute external link when anchor has got noBlankForExternalLink attribute', () => {
@@ -53,23 +55,28 @@ describe('ExternalLink', () => {
By.css('a[href="https://github.com/angular/angular/issues"]'),
);
expect(externalLink.attributes['target']).toBeFalsy();
expect(externalLink.attributes['rel']).toBeFalsy();
});
});
@Component({
template: `
<a
class="external"
href="https://stackoverflow.com/questions/tagged/angular"
title="Stack Overflow: where the community answers your technical Angular questions."
>
Stack Overflow
</a>
<a routerLink="/roadmap" title="Roadmap">Roadmap</a>
<a class="internal" routerLink="/roadmap" title="Roadmap">Roadmap</a>
<a
class="optout"
href="https://github.com/angular/angular/issues"
title="Post issues and suggestions on github"
noBlankForExternalLink
></a>
>
GitHub Issues
</a>
`,
imports: [ExternalLink, RouterLink],
})
@@ -18,6 +18,7 @@ import {isExternalLink} from '../../utils/index';
selector: 'a[href]:not([noBlankForExternalLink])',
host: {
'[attr.target]': 'target',
'[attr.rel]': 'rel',
},
})
export class ExternalLink {
@@ -25,6 +26,7 @@ export class ExternalLink {
private readonly platformId = inject(PLATFORM_ID);
target?: '_blank' | '_self' | '_parent' | '_top' | '';
rel?: string;
constructor() {
this.setAnchorTarget();
@@ -37,6 +39,7 @@ export class ExternalLink {
if (isExternalLink(this.anchor.nativeElement.href)) {
this.target = '_blank';
this.rel = 'noopener';
}
}
}
+1
View File
@@ -8,3 +8,4 @@
export * from './click-outside/click-outside.directive';
export * from './external-link/external-link.directive';
export * from './search-item/search-item.directive';
@@ -21,7 +21,7 @@ export class SearchItem implements Highlightable {
// We can't migrate them to signals yet
@Input() disabled = false;
item = input<SearchResultItem | undefined>();
readonly item = input<SearchResultItem | undefined>();
private readonly elementRef = inject(ElementRef<HTMLLIElement>);
+1
View File
@@ -26,6 +26,7 @@ ts_project(
),
deps = [
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev:node_modules/@types/node",
"//adev:node_modules/@webcontainer/api",
+6 -1
View File
@@ -7,6 +7,7 @@
*/
import {Type} from '@angular/core';
import {SafeHtml} from '@angular/platform-browser';
/**
* Map of the examples, values are functions which returns the promise of the component type, which will be displayed as preview in the ExampleViewer component
@@ -21,9 +22,11 @@ export interface Snippet {
/** Name of the file. */
name: string;
/** Content of code snippet */
content: string;
sanitizedContent: SafeHtml;
/** Text in following format `start-end`. Start and end are numbers, based on them provided range of lines will be displayed in collapsed mode */
visibleLinesRange?: string;
shell?: boolean;
}
export interface ExampleMetadata {
@@ -37,4 +40,6 @@ export interface ExampleMetadata {
files: Snippet[];
/** True when ExampleViewer should have preview */
preview: boolean;
/** Whether to hide code example by default. */
hideCode: boolean;
}
@@ -16,4 +16,5 @@ export interface NavigationItem {
parent?: NavigationItem;
contentPath?: string;
status?: 'new' | 'updated';
category?: string;
}
@@ -60,6 +60,8 @@ export interface SearchResultItem {
type: 'doc' | 'code';
labelHtml: string | null;
subLabelHtml: string | null;
contentHtml: string | null;
package: string | null;
url: string;
id: string;
+1 -1
View File
@@ -151,7 +151,7 @@ export type PlaygroundRouteData = {
starterTemplate?: PlaygroundTemplate;
};
export type PlaygroundTemplate = Required<Pick<NavigationItem, 'path' | 'label'>>;
export type PlaygroundTemplate = Required<Pick<NavigationItem, 'path' | 'label'>> & {id: string};
// Note: only the fields being used are defined in this type
export interface PackageJson {
+1 -1
View File
@@ -20,7 +20,7 @@
"fflate": "^0.8.2",
"html-entities": "~2.6.0",
"jsdom": "~26.1.0",
"marked": "~16.1.0",
"marked": "~16.2.0",
"mermaid": "^11.0.0",
"shiki": "^3.0.0",
"tinyglobby": "^0.2.12"
+2 -2
View File
@@ -47,13 +47,13 @@ js_binary(
"//adev:node_modules/jsdom",
"//adev:node_modules/mermaid",
"//adev:node_modules/playwright-core",
"@rules_browsers//src/browsers/chromium",
"@rules_browsers//browsers/chromium",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides.mjs",
env = {
"CHROME_HEADLESS_BIN": "$(CHROME-HEADLESS-SHELL)",
},
toolchains = ["@rules_browsers//src/browsers/chromium:toolchain_alias"],
toolchains = ["@rules_browsers//browsers/chromium:toolchain_alias"],
visibility = ["//visibility:public"],
)
+16 -2
View File
@@ -16,6 +16,12 @@ def _generate_guides(ctx):
# Pass the the output directory path (which is the bazel-bin directory).
args.add(ctx.bin_dir.path)
# Add the api_manifest file if provided
if ctx.attr.api_manifest:
args.add(ctx.file.api_manifest.path)
else:
args.add("")
# Determine the set of html output files. For each input markdown file, produce an html
# file with the same name (replacing the markdown extension with `.html`).
html_outputs = []
@@ -30,9 +36,13 @@ def _generate_guides(ctx):
html_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)]
# Define an action that runs the executable.
inputs = ctx.files.srcs + ctx.files.data
if ctx.attr.api_manifest:
inputs.append(ctx.file.api_manifest)
if (ctx.attr.mermaid_blocks):
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
inputs = depset(inputs),
executable = ctx.executable._generate_guides,
outputs = html_outputs,
arguments = [args],
@@ -42,7 +52,7 @@ def _generate_guides(ctx):
)
else:
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
inputs = depset(inputs),
executable = ctx.executable._generate_guides_no_mermaid,
outputs = html_outputs,
arguments = [args],
@@ -71,6 +81,10 @@ generate_guides = rule(
doc = """Source referenced from within the markdown.""",
allow_files = True,
),
"api_manifest": attr.label(
doc = """A file containing API entries to be used in the markdown.""",
allow_single_file = True,
),
"mermaid_blocks": attr.bool(
doc = """Whether to transform mermaid blocks.""",
default = False,
@@ -1,4 +1,4 @@
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@npm//:defs.bzl", "npm_link_all_packages")
package(default_visibility = ["//visibility:public"])
@@ -111,7 +111,7 @@ function main() {
...getEntriesFromMembers(entry).map((member) => [member, moduleName]),
]),
],
} as EntryCollection);
} satisfies EntryCollection);
writeFileSync(outputFilenameExecRootRelativePath, output, {encoding: 'utf8'});
}
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {DocEntry} from '@angular/compiler-cli';
import {DocEntry, ClassEntry, MethodEntry} from '@angular/compiler-cli';
import {basename, dirname, resolve} from 'path';
import fs from 'fs';
@@ -48,6 +48,27 @@ export function interpolateCodeExamples(entries: DocEntry[]): void {
for (const jsdocTag of entry.jsdocTags) {
jsdocTag.comment = replaceExample(jsdocTag.comment);
}
if ('members' in entry) {
const members = (entry as ClassEntry).members ?? [];
for (const member of members) {
member.description = replaceExample(member.description);
for (const jsdocTag of member.jsdocTags) {
jsdocTag.comment = replaceExample(jsdocTag.comment);
}
const method = member as MethodEntry;
if (method.implementation) {
for (const functionSignature of [method.implementation, ...(method.signatures ?? [])]) {
functionSignature.description = replaceExample(functionSignature.description);
functionSignature.jsdocTags.forEach((jsdocTag) => {
jsdocTag.comment = replaceExample(jsdocTag.comment);
});
}
}
}
}
}
}
@@ -8,7 +8,14 @@
import fs from 'fs';
import {interpolateCodeExamples} from '../interpolate_code_examples.mjs';
import {DocEntry} from '@angular/compiler-cli';
import {
ClassEntry,
DocEntry,
EntryType,
FunctionSignatureMetadata,
MemberType,
MethodEntry,
} from '@angular/compiler-cli';
import {mockReadFileSync} from './fake-examples.mjs';
const tsMdBlock = (code: string) => '```angular-ts\n' + code + '\n```';
@@ -156,4 +163,51 @@ class Baz {
expect(getComment(entries)).toMatch(/^\`\`\`/m);
});
it('should interpolate an example on a method', () => {
const entries: ClassEntry[] = [
{
description: '',
rawComment: '',
entryType: EntryType.UndecoratedClass,
name: 'Test',
jsdocTags: [],
isAbstract: false,
generics: [],
implements: [],
extends: undefined,
members: [
{
name: 'test',
jsdocTags: [],
description: '',
memberTags: [],
memberType: MemberType.Method,
signatures: [],
entryType: EntryType.Function,
rawComment: '',
implementation: {
name: 'test',
entryType: EntryType.Function,
rawComment: '',
params: [],
returnType: 'void',
generics: [],
isNewType: false,
jsdocTags: [{name: '', comment: "{@example dummy/single.ts region='foo'}"}],
description: `Example: {@example dummy/single.ts region='foo'}`,
} as FunctionSignatureMetadata,
} as MethodEntry,
],
},
];
interpolateCodeExamples(entries as DocEntry[]);
const method = entries[0].members![0] as MethodEntry;
expect(method.implementation!.description).toContain(tsMdBlock("foo('Hello world!');"));
const jsdocTag = method.implementation!.jsdocTags[0];
expect(jsdocTag.comment).toEqual(tsMdBlock("foo('Hello world!');"));
});
});
@@ -12,6 +12,7 @@ import type {DocEntry, EntryCollection, FunctionEntry, JsDocTagEntry} from '@ang
export interface ManifestEntry {
name: string;
type: string;
category: string | undefined;
deprecated: {version: string | undefined} | undefined;
developerPreview: {version: string | undefined} | undefined;
experimental: {version: string | undefined} | undefined;
@@ -85,6 +86,7 @@ export function generateManifest(apiCollections: EntryCollection[]): Manifest {
developerPreview: getTagSinceVersion(entry, 'developerPreview'),
experimental: getTagSinceVersion(entry, 'experimental'),
stable: getTagSinceVersion(entry, 'publicApi'),
category: getTag(entry, 'category')?.comment.trim(),
}));
const existingEntry = manifest.find((entry) => entry.moduleName === collection.moduleName);
@@ -14,18 +14,21 @@ describe('api manifest generation', () => {
it('should generate a manifest from multiple collections', () => {
const manifest: Manifest = generateManifest([
{
repo: 'angular/router',
moduleName: '@angular/router',
entries: [entry({name: 'Router', entryType: EntryType.UndecoratedClass})],
normalizedModuleName: 'angular_router',
moduleLabel: 'router',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'foo', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
@@ -47,6 +50,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
{
name: 'PI',
@@ -55,6 +59,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -70,6 +75,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -79,12 +85,14 @@ describe('api manifest generation', () => {
it('should generate a manifest when collections share a symbol with the same name', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/router',
moduleName: '@angular/router',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_router',
@@ -105,6 +113,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -120,6 +129,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -129,12 +139,14 @@ describe('api manifest generation', () => {
it('should union collections for the same module into one manifest', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'TAO', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
@@ -155,6 +167,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
{
name: 'TAO',
@@ -163,6 +176,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -172,6 +186,7 @@ describe('api manifest generation', () => {
it('should mark a manifest entry as deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({name: 'PI', entryType: EntryType.Constant, jsdocTags: jsdocTags('deprecated')}),
@@ -195,6 +210,7 @@ describe('api manifest generation', () => {
deprecated: {version: undefined},
experimental: undefined,
stable: undefined,
category: undefined,
},
{
name: 'XI',
@@ -203,6 +219,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: {version: undefined},
stable: undefined,
category: undefined,
},
],
},
@@ -212,6 +229,7 @@ describe('api manifest generation', () => {
it('should not mark a function as deprecated if only one overload is deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
functionEntry({
@@ -262,6 +280,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -271,6 +290,7 @@ describe('api manifest generation', () => {
it('should mark a function as deprecated if all overloads are deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
functionEntry({
@@ -321,6 +341,7 @@ describe('api manifest generation', () => {
deprecated: {version: undefined},
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -330,6 +351,7 @@ describe('api manifest generation', () => {
it("should mark a fn as deprecated if there's one w/ the same name in another collection", () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({name: 'save', entryType: EntryType.Function, jsdocTags: jsdocTags('deprecated')}),
@@ -338,6 +360,7 @@ describe('api manifest generation', () => {
moduleLabel: 'core',
},
{
repo: 'angular/more',
moduleName: '@angular/more',
entries: [entry({name: 'save', entryType: EntryType.Function})],
normalizedModuleName: 'angular_more',
@@ -358,6 +381,7 @@ describe('api manifest generation', () => {
deprecated: {version: undefined},
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -373,6 +397,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
],
},
@@ -382,6 +407,7 @@ describe('api manifest generation', () => {
it('should mark a manifest entry as developerPreview', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({
@@ -409,6 +435,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: undefined,
stable: undefined,
category: undefined,
},
{
name: 'XI',
@@ -417,6 +444,7 @@ describe('api manifest generation', () => {
deprecated: undefined,
experimental: {version: undefined},
stable: undefined,
category: undefined,
},
],
},
@@ -5,6 +5,10 @@ package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages
esbuild(
name = "bin",
entry_point = ":index.mts",
external = [
"jsdom",
"playwright-core",
],
format = "esm",
output = "bin.mjs",
platform = "node",
@@ -20,7 +24,6 @@ ts_project(
[
"**/*.mts",
"**/*.tsx",
"shiki.d.ts",
],
exclude = [
"entities.mts",
@@ -28,13 +31,15 @@ ts_project(
),
deps = [
":entities",
"//adev:node_modules/@types/node",
"//adev:node_modules/html-entities",
"//adev:node_modules/marked",
"//adev:node_modules/preact",
"//adev:node_modules/preact-render-to-string",
"//adev:node_modules/prettier",
"//adev:node_modules/shiki",
"//adev/shared-docs/pipeline/shared:linking",
"//adev/shared-docs/pipeline/shared:shiki",
"//adev/shared-docs/pipeline/shared/marked",
"//adev/shared-docs/pipeline/shared/regions",
],
)
@@ -107,10 +107,13 @@ export interface ClassEntry extends DocEntry {
implements: string[];
}
// From an API doc perspective, class and interfaces are identical.
/** Documentation entity for a TypeScript interface. */
export type InterfaceEntry = ClassEntry;
export interface InterfaceEntry extends DocEntry {
members: MemberEntry[];
generics: GenericEntry[];
extends: string[];
implements: string[];
}
/** Documentation entity for a TypeScript enum. */
export interface EnumEntry extends DocEntry {
@@ -15,6 +15,7 @@ import {
FunctionEntry,
FunctionSignatureMetadata,
InitializerApiFunctionEntry,
InterfaceEntry,
JsDocTagEntry,
MemberEntry,
ParameterEntry,
@@ -80,7 +81,11 @@ export type EnumEntryRenderable = EnumEntry &
};
/** Documentation entity for a TypeScript interface augmented transformed content for rendering. */
export type InterfaceEntryRenderable = ClassEntryRenderable;
export type InterfaceEntryRenderable = InterfaceEntry &
DocEntryRenderable &
HasRenderableToc & {
members: MemberEntryRenderable[];
};
export type FunctionEntryRenderable = FunctionEntry &
DocEntryRenderable &

Some files were not shown because too many files have changed in this diff Show More