Commit Graph

2998 Commits

Author SHA1 Message Date
Matthew Beck 502fa130aa fix(docs-infra): ignore external links when mapping navigation items to routes
When navigation items contain external URLs (e.g. https:// links for documentation or third-party resources), mapNavigationItemsToRoutes previously registered them as Angular Router route definitions. In recent versions of @angular/build, the static prerender worker asserts that discovered routes do not return empty content during SSG prerendering, causing production builds and CI adev-deploy to fail on these routes.

This change filters out external links in mapNavigationItemsToRoutes so only valid internal application paths are registered as Angular routes.
2026-09-02 19:07:15 -07:00
Andrew Scott 7137a41223 feat(router): stabilize auto cleanup injectors feature
Removes experimental tags and stabilizes withAutoCleanupInjectors, AutoCleanupInjectorsFeature,
and RouteReuseStrategy cleanup methods, while re-exporting withExperimentalAutoCleanupInjectors as deprecated.
2026-09-02 16:05:12 -07:00
Angular Robot a66fd64cd4 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-09-02 15:52:44 -07:00
Angular Robot de91d10b80 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-09-02 15:39:44 -07:00
Cheng-Hsuan Tsai d7af4b5aca docs: decouple selection from aria toolbar examples and guide 2026-09-02 15:14:21 -07:00
Kam 45148dae44 docs: correct openFiles entries that point at missing files
Two tutorial steps list a file in `openFiles` that does not exist, and a
missing entry is dropped without complaint. `first-app/05-inputs` asks for
`housinglocations.ts` when the file is `housinglocation.ts`; since
`hiddenFiles` is everything not in `openFiles`, the interface that step
teaches was marked hidden rather than opened.
`signals/5-component-communication-with-signals` asks for
`quantity-selector.ts`, which exists in neither `src` nor `answer`. Every
openFiles entry in the tutorials now resolves.
2026-09-02 14:32:45 -07:00
Kam 90b9e081f5 fix(docs-infra): keep the collapsed code state when a code block is reshown
The code block lives inside `@if (showCode())`, so hiding it destroys the DOM and
showing it builds a fresh copy with no hidden lines. Nothing reapplied
`setCodeLinesVisibility()`, so a collapsed block came back showing the whole file.

Reapply it once the block is rendered again. It already branches on `expanded()`,
so a block that was expanded stays expanded.
2026-09-02 14:32:17 -07:00
Kam 431b170fd5 build: narrow the preview exclusions for two example apps
`reactive-forms` and `form-validation` were excluded from `embeddable` in
full, with a TODO to fix them. The examples are fine; four partial snapshots
quoted by the guides are not, since each shares the final template of the
component it precedes, which references members it does not have yet.
Excluding those four files clears all 30 errors and puts 23 app files back in
the preview pool, so both guides' final components can be previewed for the
first time.
2026-09-02 14:30:50 -07:00
Kam c03e872ed9 docs: highlight the search tutorial @for block as Angular
The block quotes a `.ts` file but declares `language="html"`, and shiki's
HTML grammar does not know Angular control flow, so the whole `@for` line
renders unstyled. Use `angular-ts`, matching the other blocks in the
tutorial.
2026-09-01 14:41:31 -07:00
Kam b70edd2768 fix(docs-infra): parse docs-callout attributes correctly
Three ways a callout could be misparsed:

- A title quoted with `'` or a backtick was dropped, leaving an empty
  heading. Two callouts lose their title on angular.dev today, on
  guide/forms/template-driven-forms and guide/i18n/prepare. The first has
  to use single quotes because its title contains `"pristine"`.
- A title containing `>` was dropped, because the attribute capture
  stopped at the first `>` even inside a quoted value.
- The severity was matched anywhere in the tag, so a title such as
  "Why this is important" silently rendered an important callout.

Scan attributes with quoting in mind, accept all three quote characters
as #69268 did for docs-code-block, and match the severity flags against
the tag with attribute values removed. The i18n callout also spelled the
attribute `header`, which the extension has never read.
2026-09-01 09:36:47 -07:00
Kam a92f6057d3 refactor(docs-infra): remove two more unreferenced guide images
`input.svg` and `output.svg` are leftovers that #70335 missed. Their
last reference was deleted by #54829 when the AIO guides were removed,
and nothing in the repo mentions them or their directory. Removing both
empties `adev/src/assets/images/guide/inputs-outputs`.
2026-09-01 09:32:27 -07:00
arturovt 8975b4346d docs: add NG0991 error page and document rxResource's completion contract
RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE had no guide, no JSDoc on
RxResourceOptions.stream, and — since the code was positive rather
than negative — could never get an auto-linked docs page even if one
existed. Flip it to -991, add the NG0991 reference page, and document
the "stream must emit a value or an error before completing"
requirement on stream's JSDoc and in the RxJS interop guide.

Also documents and tests that an unguarded template read of an
errored resource's .value() propagates to the global ErrorHandler,
and recommends guarding with .hasValue() as defense in depth.

httpResource can throw the same error, but for a different reason:
its internal request Observable isn't something app code writes
directly, so an empty completion there is almost always an
HttpInterceptor swallowing the response (catchError(() => EMPTY))
rather than a stream authored in the resource() call itself. The page
covers both APIs with guidance matched to what's actually going on
for each.
2026-09-01 09:31:00 -07:00
arturovt ca38305976 docs: explain that errors during early app startup miss ErrorHandler
There's a short window where Angular can't send errors to ErrorHandler
yet: while it's still building the root module or root component. It
needs that root instance to look up the ErrorHandler you provided, so
an error thrown before it exists just becomes a normal uncaught error
instead.

This mostly bites people using Angular elements, where a custom element
tag already sitting in the page gets upgraded (and its component built)
the moment you call customElements.define, which can happen very early.

Added a short section to the error handling guide explaining why this
happens and the usual ways around it: setTimeout, APP_BOOTSTRAP_LISTENER,
or moving element registration to ngDoBootstrap.

Fixes #29211
2026-09-01 09:26:44 -07:00
oerol 9fd77852fb docs: fix global target event listener example 2026-09-01 09:26:07 -07:00
Santosh Yadav e1bf5393ad docs: Update request handler to use handle method
there is no request method the correct method is hanlde
2026-09-01 09:25:24 -07:00
Angular Robot 1b0d861fe5 build: lock file maintenance
See associated pull request for more information.
2026-09-01 09:22:54 -07:00
SkyZeroZx d8e74e7d39 docs(docs-infra): improve update checkbox accessibility
Associate each recommendation with its checkbox so assistive technology has a descriptive label and non-interactive text toggles the control. Keep embedded links independently operable.
2026-08-31 20:33:18 -07:00
Angular Robot 87d38ec3ff build: lock file maintenance
See associated pull request for more information.
2026-08-31 15:37:10 -07:00
Matthieu Riegler 9cf7b44f7c build: remove explicit strict options
Those options are enabled by default, they don't need to be explicit.
2026-08-31 13:17:00 -07:00
Kam acdac1cb89 fix(docs-infra): restore the edit link on decorative header pages
The 34 pages using `<docs-decorative-header>` render their title
through `getPageTitle()` without passing the markdown file path, so
the "Edit this page" link is silently dropped. Every other page keeps
it. Compare https://v19.angular.dev/guide/components, which still has
the pencil, against https://angular.dev/guide/components, which does
not.

`filePath` was required until #63536 made it optional, so API
descriptions with no editable source could render a title without a
link. That removed the compile error forcing the decorative header to
supply it, and the argument was lost with nothing to catch it.

Pass the path again and cover both header variants with tests, since
the edit link had no coverage at all.
2026-08-31 13:14:25 -07:00
Kam d9afca095b fix(docs-infra): reject unclosed paired docs elements
An unclosed `<docs-step>` or `<docs-card>` produces no error, just wrong
output, so the two cases fixed in the previous commit went unnoticed for
years.

Validate that the paired custom elements balance before parsing. A
mismatch now names the file and the counts instead of silently
swallowing a section.
2026-08-31 11:31:02 -07:00
Kam 0752282c8f docs: close the unclosed docs-step tags in two guides
`reactive-forms.md` and `app-shell.md` each open a `<docs-step>` that is
never closed. The tokenizers match up to the *next* closing tag instead
of failing, so the unclosed tag pulls in the content that follows and
leaves the block after it unparsed in the output.

On https://angular.dev/guide/forms/reactive-forms the "Creating nested
form groups" section shows raw source: "To create a nested group in
`profileForm`, add a nested `address` element", backticks and all. Its
heading is swallowed into the unclosed step instead of being an h3, and
the page renders 20 of its 21 steps. On
https://angular.dev/ecosystem/service-workers/app-shell the third step
is missing entirely.

`reactive-forms.md` has been broken since #52536, `app-shell.md` since
#55550.
2026-08-31 11:31:02 -07:00
Kam 46b02cc181 docs: correct stale visibleLines ranges in the first-app tutorial
The tutorial's example files shifted without the README line references
following, so several steps point at the wrong code. In two cases every
requested line is past the end of the file; on the inputs step this renders
as a code block with no lines visible at all.
2026-08-31 11:26:37 -07:00
Kam cd3c8cdd3a docs: correct out-of-range highlight indices in two code blocks
Both indices point past the end of their block, so the intended lines are
never highlighted. The reactive forms block renders with no highlight at all,
and the first example in output-interop.md highlights nothing while its
sibling block is unaffected.
2026-08-31 11:25:03 -07:00
Angular Robot 563850e860 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-08-28 18:05:00 -07:00
Shuaib Hasan Akib 54f67e1318 docs: correct highlight index for pipe examples in README 2026-08-28 17:58:55 -07:00
Michael Small 0017b87b52 docs: update link/file for JetBrains AGENTS.md 2026-08-28 17:56:37 -07:00
Andrew Scott 6f1dc268cc docs(router): Add router resource docs
Adds doc (but no navigation entry) for router resources. Feature not released yet
but getting documentation in place.
2026-08-27 12:45:27 -07:00
Kam 843a65cba0 fix(docs-infra): point the tutorial .gitignore at live GitHub docs
The common tutorial scaffold's .gitignore opens with a link to
help.github.com/ignore-files/, which 404s. That directory is copied into every
tutorial and playground, so the dead link ships to anyone who opens one.
2026-08-27 10:20:49 -07:00
Angular Robot c2d4070c36 build: update all non-major dependencies
See associated pull request for more information.
2026-08-27 07:59:47 -07:00
Angular Robot 2e6a05750e docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-08-26 15:50:33 -07:00
Angular Robot 8c26fc74e5 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-26 15:37:41 -07:00
Kam ddfd8a8e9b refactor(docs-infra): remove example configs for tooling that no longer exists
An example-config.json marked a directory as a doc example and told aio's
example tooling which boilerplate to use and what to run against it. #56496
removed that tooling in June 2024. Eight of these fifteen files are empty and no
code has read any of them since; the name survives only in the zip and
StackBlitz exclude lists, which skip it rather than open it.
2026-08-25 15:21:49 -07:00
Lazizbek Ergashev 3848b7f8bc docs: clarify onSameUrlNavigation reload behavior
fixes #70367
2026-08-25 11:27:10 -07:00
Kam 90fc9475f2 refactor(docs-infra): remove example code that nothing references
The `built-in-directives` and `structural-directives` example apps are no
longer referenced. Two guide rewrites moved their pages to inline code fences
and dropped the last references without removing the apps: #69134 for
structural directives, and #69822 for built-in directives, whose page is gone
entirely. Both apps sat inside the `embeddable` glob, so they were still
compiled as preview components on every build.

The example e2e suites are excluded from every consumer by design: previews
ignore `*.e2e-spec.ts` and `*.po.ts`, and the zip and StackBlitz pipelines
both list the suffix in `EXCLUDE_FILES`. They could not run in any case,
since every spec declares a `driver` and never assigns it before calling
`driver.get('')`, left over from an abandoned protractor to selenium
migration.

The eslint configuration in the same directory is also unused. Nothing in the
repository depends on eslint, and `tsconfig.eslint.json` extends a path that
no longer exists.
2026-08-25 10:11:19 -07:00
Kam 7da60d1920 fix(docs-infra): redirect three removed pages instead of 404ing
`guide/http/security` and `reference/concepts` both still exist as content but
neither is routed, so each falls through to the 404 shell.

`guide/http/security` was navigable from November 2023 until #54365 removed its
entry in February 2024. #55029 then copied its XSRF sections into the security
guide, which already covered XSSI, and #55060 repointed the remaining links, so
it now redirects to `/best-practices/security`.

`reference/concepts` was added by #54365 and removed by #58694 in November
2024, leaving it navigable for nine months without a redirect. The same commit
also removed `guide/ngmodules`, the route its only card linked to, so both now
redirect to `/guide/ngmodules/overview`, alongside the four `guide/ngmodules/*`
paths already redirected there.

Both pages are removed, along with the Bazel package that existed only to build
the concepts page, and the stale `llms-list.md` entry for the HttpClient page.
The security guide takes its place in that list, so `llms-full.txt` keeps its
XSSI coverage and picks up CSP, Trusted Types and sanitization with it.
2026-08-25 10:08:42 -07:00
Kam a67d4027e2 refactor(docs-infra): remove the Windows tile icons and other unused icons
The `msapplication` tile configuration serves no purpose now, so the
`browserconfig.xml` it points at, the five tile images and the two meta tags
in `index.html` are removed together.

`shared-docs/icons/twitter.svg` is also unused, left behind when the footer
moved to X and Bluesky. Its three siblings in that directory are all still
referenced.
2026-08-25 10:02:43 -07:00
Angular Robot 1426f5ecf5 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-24 15:53:22 -07:00
Angular Robot 671d8d395e build: update all non-major dependencies
See associated pull request for more information.
2026-08-24 10:49:59 -07:00
Kam 5e8a70a010 fix(docs-infra): fail the build on duplicate heading anchors
Two headings on the same page can generate the same anchor id, and every
link to it then resolves to whichever comes first. Nothing caught this
because the route manifest keeps anchors in a `Set`, so a repeat collapses
into one entry before any check runs, and the existing link validation only
asks whether an anchor exists, which a duplicate satisfies.

The generator now inspects each page's headings while they are still an
ordered list and fails with the offending pages and anchors. The scanning
and the duplicate check move to `heading.mts` so they are covered by tests
next to `getIdFromHeading`, which should keep this from coming back.
2026-08-24 10:36:16 -07:00
Kam 698a14d735 fix(docs-infra): give duplicated headings their own anchor ids
Eight guides have headings that generate the same anchor id twice or more.
Because an id resolves to the first element that claims it, the table of
contents lists two entries pointing at the same place, the second section
cannot be reached from the ToC at all, and the copy link button on the
later heading hands out a URL for the earlier one.

On `guide/forms/reactive-forms` the two "Display the component" steps sit
5176px apart and both ToC entries scroll to the first.

Give the later heading on each page an explicit id with the `{#custom-id}`
syntax the pipeline already supports. Only later duplicates are changed, so
every anchor that resolves today keeps pointing at the same heading.
2026-08-24 10:36:16 -07:00
Kam 355a9d83e3 refactor(docs-infra): remove images no longer referenced by any doc
Most of these came over from the angular.io docs and were orphaned as adev
rewrote or dropped the guides that used them. Two are newer: a devtools
screenshot that was added but never referenced, and the logo left behind
when the Firebase Studio launcher was removed. All of them are still
copied into the build and served from angular.dev.

No markdown, template, stylesheet, TypeScript file or build target
references any of them, by filename or through a path built at runtime,
and the images are globbed into the build rather than listed, so nothing
else needs updating. Removes 78 files, 5.15 MB in total, and empties
nineteen directories.
2026-08-24 10:35:41 -07:00
Kam 3074fdb3ab docs: repair the AST link in the AOT compiler guide
The link to the Wikipedia article on abstract syntax trees spelled the
underscores as asterisks, which 404s. The same link two paragraphs
earlier in this guide is correct.
2026-08-24 10:31:51 -07:00
Kam 39da06138b fix(docs-infra): repair redirects pointing at removed pages
Five redirects sent people to the home page instead of a guide, because
their target no longer exists: the four `guide/ngmodules/*` entries point
at `/guide/ngmodules`, which has no route, and
`guide/animations/transitions-and-triggers` had a plural in a target that
is registered as `transition-and-triggers`.

Two more resolved only after a second hop, redirecting to a path that is
itself a redirect.

The spec only checked that a `redirectTo` starts with a slash, which all
seven satisfied, so it now also checks that the target is a real page and
that it is not another redirect.
2026-08-24 10:31:14 -07:00
Kam c6a6ad0a44 refactor(docs-infra): drop exclude patterns for examples that no longer exist
The `embeddable` glob excludes nine example directories. Four of them,
`testing`, `ssr`, `resolution-modifiers` and `dependency-injection`, were
removed by #66753 and #61686 without updating this file, so those patterns
match nothing.

Three of the four sit under a TODO about examples that do not compile. Those
were deleted rather than fixed, which leaves `reactive-forms` and
`form-validation` as the only two the note still applies to.
2026-08-24 10:16:18 -07:00
Kam 51cb07e980 docs: point the LLM indexes at current pages, not redirects
`llms-list.md` feeds the generated `llms-full.txt`. Three of its DI
entries were left behind by a page rename: two named files that no longer
exist and one named a copy that had been superseded. The generator warns
on an unreadable file and carries on, so the build stayed green while
`llms-full.txt` quietly lost three DI guides and shipped a stale fourth.

`llms.txt` linked the same old URLs, which only reach their pages through
a redirect, plus `guide/hybrid-rendering`, which redirects to `/guide/ssr`
and duplicates the line above it.

Also removes `creating-injectable-service.md`, left behind by that rename
and reachable from nothing.
2026-08-21 12:36:50 -07:00
Kam eb6570b06d refactor(docs-infra): remove the orphaned home animation component
The new home page in #63662 stopped rendering `HomeAnimationComponent`
and its directory was left behind. The animation that runs today lives
in `features/home/animation`, which replaced it.

Nothing references the class, its `adev-home-animation` selector, or any
file in the directory, and no stylesheet or build target pulls it in.
2026-08-21 12:35:12 -07:00
Kam 4997521685 refactor(docs-infra): type the API manifest in the nav entries
`getApiNavigationItems` cast the manifest to `any` behind a TODO waiting
on #66252, which was closed without merging, so the three `any`s it
guarded were never going away on their own.

The real `ApiManifestPackage` cannot be imported here: navigation
entries are built as a standalone `ts_project` so the route generator
can consume them at build time, and it has no dependency on the app
tree. Declaring the handful of fields this file reads gets rid of the
`any`s without touching the build graph.
2026-08-21 12:29:38 -07:00
Kam 238d8bf98a refactor(docs-infra): hold editor diagnostics in a signal
`DiagnosticsState` carried a TODO to move off `BehaviorSubject` once
zoneless was turned on. adev has been zoneless for a while now, with no
zone.js dependency and an empty `polyfills` array, so the condition is
met and the TODO can go.

Both consumers now derive from the signal instead of subscribing. The
Console tab badge becomes a `computed`, and so does the code editor's
error list: the diagnostics are produced by a `linter()` configured with
a 400ms delay rather than arriving as a stream, so the rxjs chain was
only adding a further second before they were displayed. The errors box
stays dismissable through a `linkedSignal`, which reverts as soon as the
diagnostics change.
2026-08-21 11:50:42 -07:00
Kam 593f2d7e2e refactor(docs-infra): share the angular.dev origin constant
The angular.dev origin was declared twice as a local `ANGULAR_DEV`
const and hardcoded inline in two more places. It now lives once in
`core/constants/links.ts`, next to `ANGULAR_LINKS`.
2026-08-21 11:50:02 -07:00