Commit Graph

38338 Commits

Author SHA1 Message Date
Matthew Beck 124bf44809 release: cut the zone.js-0.16.3 release zone.js-0.16.3 2026-09-02 14:19:15 -07:00
Matthieu Riegler f44bf0fe22 ci: move packages/private under fw-general
This doesn't need dev-infra approval as its mostly testing utils.
2026-09-01 14:42:04 -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
aparziale 1d9e445d1a fix(vscode-extension): handle escaped delimiters in inline template and styles highlighting
The TextMate grammars for inline templates and inline styles ended the
string at the first occurrence of the delimiter, so an escaped delimiter
(e.g. \`) terminated the highlighting prematurely and the rest of the
template was no longer highlighted as HTML.

Escape sequences are now consumed before delegating to the HTML/CSS
grammars, so escaped delimiters no longer end the string. Also removes
the stray pipes from the string delimiter character class, which
unintentionally matched a literal '|'.

Fixes #65493
2026-09-01 14:40:44 -07:00
Kristiyan Kostadinov 05c4d5a835 feat(core): add utility for testing directives
Adds `TestBed.createDirective` to make testing directives easier.

Fixes #54164.
2026-09-01 14:40:05 -07:00
Matthieu Riegler 9f440907e8 refactor(core): remove old deferredImports structure
This finishes the migration to the keyed object structure
2026-09-01 09:41:10 -07:00
Doug Parker 6e299da8cf feat(forms): hard-code readOnlyHint and untrustedContentHint for WebMCP implicit signal forms
Signal forms can safely assume `{readOnlyHint: false, untrustedContentHint: false}` given their context. A form _must_ alter page DOM (or else how would a user interact with it) and is therefore definitionally side-effectful. We also assume returned content is trusted, given it is currently hard-coded or derived from application errors.

In the future, we might want to consider cases where application errors are explicitly untrusted or where application developers choose to customize the response text with something which might be untrusted. For now, that's out of scope and we'll worry about it when a compelling use case arises.
2026-09-01 09:39:20 -07:00
Doug Parker 91a2bf8425 feat(core): support annotations in WebMCP tool declarations
This updates `declareExperimentalWebMcpTool` to allow annotations to be provided to opt-in the tool explicitly into being read only or returning untrusted content.
2026-09-01 09:39:20 -07:00
Matthieu Riegler faafd18a4c fix(compiler-cli): check uninvoked signal aliases in extended diagnostic
Extended template diagnostic interpolated_signal_not_invoked previously
only checked symbols with kind === SymbolKind.Expression. When a signal
is aliased via @let (or a template variable), getSymbolOfNode returns
a LetDeclarationSymbol (or VariableSymbol), causing the diagnostic to
skip checking uninvoked usages of signal aliases in interpolations and
bindings.

This commit updates interpolated_signal_not_invoked to also check
LetDeclarationSymbol and VariableSymbol, using the usage site's AST
name span for reporting the diagnostic.

Closes #70476
2026-09-01 09:38:21 -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
hawkgs 00ec65546b refactor(devtools): fix signal details UI
Fix different action buttons and value preview container size.
2026-09-01 09:33:35 -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
Shuaib Hasan Akib b5ce15c659 refactor(core): use native Promise.withResolvers() in tests
Replaces the temporary `promiseWithResolvers` polyfill with the
native `Promise.withResolvers()` API in test files and Updates the TypeScript configuration to include the `es2024.promise`.
2026-09-01 09:31:48 -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
lazerg f72600eadd fix(migrations): skip tsconfig files of non-Angular projects
Only touch tsconfig files for targets that use an Angular builder, including community ones like Nx, so non-Angular projects in mixed workspaces are left alone.

Fixes #69837
2026-08-31 20:31:31 -07:00
Angular Robot 87d38ec3ff build: lock file maintenance
See associated pull request for more information.
2026-08-31 15:37:10 -07:00
Stefan 4c4a705ce3 fix(zone.js): preserve accessor and non-enumerable event listener options
`copyEventListenerOptions` copied the caller's options with `{...options}`
before forwarding to the native `addEventListener`. Object spread only
copies own enumerable data properties, whereas the native call reads
each dictionary member via WebIDL — a plain `[[Get]]` per member, which
invokes accessors and ignores enumerability. The copy was therefore
lossy in a way the native call is not:

- `Object.defineProperty(opts, 'passive', { get })` (the shape used by
  MDN's passive-listener feature test) — the getter was never invoked,
  so libraries that use the feature test fall back to the legacy boolean
  and register every listener as non-passive.
- `Object.defineProperty(opts, 'capture', { get: () => true })` — the
  listener was silently registered on the bubbling phase.
- `Object.defineProperty(opts, 'once', { get: () => true })` — the
  listener fired on every dispatch.

`signal` was already special-cased for `AbortController.prototype.signal`
after #54142; that patch generalises the workaround to every recognised
member.

The copy itself was the correct fix for #54142 (frozen/readonly options)
and is preserved. The fix reads each recognised member from the source
via `[[Get]]` when the spread did not, which recovers accessors and
non-enumerable properties without double-invoking any getter. The list
of recognised members is hoisted to module scope so it isn't allocated
on every `patchEventTarget` invocation.

The call site is reordered to `buildEventListenerOptions(
copyEventListenerOptions(...))` so the passive-events code path also
spreads a normalised data object rather than the caller's raw input.

Fixes #70431

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
2026-08-31 15:21:37 -07:00
Roman 0904f90b13 fix(core): cancel stale debounce timers to prevent timer leaks
The debounce() utility scheduled a setTimeout when using a numeric wait value, but the scheduled timer was never cleared when a new value arrived, the observable threw, or the injector was destroyed. This caused pending timers to fire after invalidation and leak beyond the owner's lifecycle.

Refactor timer cancellation into a dedicated helper and track the pending timer id so any stale timer is cleared on new values or teardown. Adds tests covering cancellation on new values, errors, and injector destruction.
2026-08-31 15:07:31 -07:00
Jessica Janiuk f3ed75eb6b ci: remove shared primitives pullapprove group
This group is no longer necessary as responsibilities for that are now spread amongst teams more equally.
2026-08-31 15:03:05 -07:00
Alan Agius b3bb36ad87 fix(platform-server): resolve HTTP(S) URLs without authority as relative during SSR
Under the WHATWG URL standard, HTTP and HTTPS URLs lacking an authority
(e.g., `http:/path` or `http:path`) resolve as relative paths when resolved
against an origin of the same scheme. Previously, `relativeUrlsTransformerInterceptorFn`
treated any URL with a scheme as an absolute URL, bypassing base resolution in SSR
and allowing Node fetch to parse the path as a cross-origin host.

This commit updates SSR URL resolution and the HTTP interceptor to ensure
HTTP(S) URLs without an authority are resolved against the current origin,
preventing unexpected origin changes and aligning SSR with browser behavior.

Fixes #70447
2026-08-31 13:22:53 -07:00
Kristiyan Kostadinov 38861ac41b fix(forms): avoid writing to name input on ControlValueAccessor
Fixes that signal forms were overridding the `name` input of the CVA with an auto-generated one. This can break directives like `mat-radio` that assign their own `name`.

Fixes #69677.
2026-08-31 13:21:15 -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
Kam 731c838dbb docs(zone.js): point the Bluebird link at the project repo
bluebirdjs.com no longer resolves. npm lists the GitHub repo as the package's
homepage, so the link now goes there.
2026-08-31 11:21:42 -07:00
Kam 519c52eea0 docs: update dead links in the contributing docs
The fork guide link 404s since GitHub retired help.github.com, and the
rules_nodejs debugging docs moved to the bazel-contrib org. Also points the
git setup link straight at its current home rather than through a redirect.
2026-08-31 11:17:37 -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
Angular Robot 444b4652a9 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-08-28 18:01:05 -07:00
Kam 2a4903fec1 docs(core): repoint or drop dead jsperf links in the render3 notes
jsperf.com now returns 410 for every benchmark. Two of them still exist on the
successor site and are repointed at jsperf.app; the other five are gone, so the
links are removed and the performance claims they backed are kept.
2026-08-28 18:00:36 -07:00
Angular Robot 2877c3b995 build: update dependency node to v24.20.0
See associated pull request for more information.
2026-08-28 17:59:46 -07:00
Shuaib Hasan Akib 54f67e1318 docs: correct highlight index for pipe examples in README 2026-08-28 17:58:55 -07:00
Kam 1e8dd80458 build: point the integration .gitignore comments at live GitHub docs
help.github.com/ignore-files/ 404s since GitHub retired that domain. Five of the
files still linked to it over plain http as well.
2026-08-28 17:57:15 -07:00
Michael Small 0017b87b52 docs: update link/file for JetBrains AGENTS.md 2026-08-28 17:56:37 -07:00
leonsenft 34817da735 refactor(core): defer foreign component rendering to post-update pass
Foreign components imported via foreignImports and created by the
ɵɵforeignComponent instruction were previously rendered eagerly in the
creation phase (rf & 1) of the template. This restricted which
properties could be passed to foreign component props, as parent-bound
inputs (@Input(), input(), input.required()), properties initialized in
ngOnInit(), and pull-based view queries (viewChild()) were not yet
initialized at creation time.

This change defers foreign component rendering to run as a view effect
during the update pass:
- Update ɵɵforeignComponent in core to schedule component rendering via
  createViewEffect (executed in runEffectsInView during refreshView),
  executed with setActiveConsumer(null) to prevent reactive context
  leakage and destroyed immediately upon first execution.
- Update ɵɵforeignComponent to strictly accept props as a factory function
  (() => props) or null.
- Update the compiler template pipeline to wrap foreign component props
  in an arrow function closure (() => ({ ... })).
- Hoist creation-time foreign content projection instructions
  (ɵɵforeignContent, ɵɵforeignContentFn) into creation-phase variable
  declarations before ɵɵforeignComponent so creation-time context is
  captured safely.
2026-08-27 21:05:33 -07:00
Matthieu Riegler 4c55a36a87 refactor(compiler): deduplicate explicitly deferred types to prevent syntax errors
When `@Component.deferredImports` maps blocks to arrays of dependencies, an explicitly
deferred dependency might be defined in multiple blocks (e.g. `block1: [CmpA], block2: [CmpA]`).
Previously, these were appended to the `explicitlyDeferredTypes` array without deduplication.
When generating the `setClassMetadataAsync` wrapper for development mode, the compiler
used this array to generate callback parameters for dynamic imports. This resulted in
duplicate parameter names in the callback signature `(CmpA, CmpA) => { ... }`, which
causes an `Uncaught SyntaxError` when V8 parses the module in strict mode.
This commit deduplicates `explicitlyDeferredTypes` in the `ngtsc` component handler, and
adds a secondary deduplication check in the `r3_class_metadata_compiler` generator to
ensure duplicate parameter names are never emitted.
2026-08-27 21:04:07 -07:00
Kam ad22e89d4d refactor(devtools): point the .gitignore comment at live GitHub docs
help.github.com/ignore-files/ 404s since GitHub retired that domain.
2026-08-27 13:44:43 -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
Andrew Scott 4fc45a9b38 refactor(compiler-cli): index bound directive inputs and outputs in templates
Update the template indexer to discover and record bound directive inputs (property bindings, static text attributes) and outputs (event bindings).

This associates template binding identifiers with their target directive or component class declarations, enabling indexers and language tooling to properly resolve and cross-reference bound directive inputs and outputs.
2026-08-27 10:23:32 -07:00
Angular Robot 6f91982c0d build: update dependency vscode-languageserver-textdocument to v1.0.14
See associated pull request for more information.
2026-08-27 10:22:46 -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 bcc0e9206f build: update cypress-io/github-action action to v7.4.3
See associated pull request for more information.
2026-08-27 07:55:41 -07:00