Keep numeric URL keys in V8 dictionary storage while parsing URLs and
copying segment groups. This avoids oversized allocations for each
segment without changing route matching or component input binding.
Fixes#70716
(cherry picked from commit 37196053d5)
Add an important note to the @angular/upgrade package documentation
indicating that the package is in maintenance mode and only security
fixes will be accepted, similar to @angular/service-worker and zone.js.
(cherry picked from commit be7ee3a68b)
`Compiler` links to `{@link AbstractComponentFactory}`, a symbol that does not
exist, so the API page renders a dead link to an anchor on itself. The service
returns `NgModuleFactory`, which is public API.
`TypeProvider` has a stray quote in `` `Type' ``, which leaves the code span
unclosed and prints the backtick.
`ContentChildren` and `ViewChildren` write `** Note: ***`, which renders as
literal asterisks instead of a bold label.
(cherry picked from commit 95e8dec4e2)
Restructure the route resources guide into a clearer flow:
- Enabling the feature
- Defining route resources and ResourceContext
- Fine-grained signal reactivity
- Parallel execution
- Blocking and non-blocking resources
- In-place reloading without renavigation
- Transitional and rollback states
(cherry picked from commit 30ff1317a9)
The api-gen extractor only interpolates `{@example <path> region='<name>'}`,
so the three `<code-example>` tags on `SwPush` and the `header` on the
`SwRegistrationOptions` example are never substituted. Both ship to the API
pages as literal markup, and the snippets they point at are missing.
`push.ts` was the last file under `packages/*/src` still using the
`<code-example>` form.
(cherry picked from commit afcda88384)
`<docs-video>` reads only `src` and `title`, so the `alt` attribute on two
pages is dropped and the play link falls back to a generic "Play video"
label. On the typed forms guide that loses the video's name from the
accessible label entirely.
Pass `title` on both, and fix the kitchen sink prose that tells authors a
video "just needs a `src` and `alt`", which is where the attribute came
from. The extension's own test fixture used `alt` as well and the spec
never asserted on the label, so add that assertion.
(cherry picked from commit 95e7df429d)
The change detection cell used an unclosed `<p>` to break its label across
two lines. Browsers close it into a block paragraph, so "Detection" carries
14px of margin above and below and sits 50px below the top of the cell,
out of line with the method cell beside it. Use `<br>` instead.
The rest of the diff is `ng-dev format` on the file, which CI checks for
every file a pull request touches.
(cherry picked from commit 42da94c7fd)
The skill documents code block metadata as `header="Title"` and
`highlight="[1, 3-5]"`, but the tokenizer has only ever read the
`key: value` form. Since 7bbe2636dc that mismatch is fatal rather than
silent, so a guide written to the skill's own example now fails the
build with `Invalid code block metadata`. That change did not update
this file.
Correct the metadata syntax and document the `highlight` range
semantics and the `hideDollar` flag. Drop the `<docs-code>` `diff`
attribute, removed in 8ec0a4ee5c, and stop describing `preview` as a
StackBlitz link, which is disabled. Add the attributes `<docs-code>`
and `<docs-card>` accept, correct `<docs-video>` to `title` rather
than `alt`, which the extension has never read, and note that mermaid
works only in a fenced block.
(cherry picked from commit 249f55f2c6)
Resources managed by the Angular Router implement a `reload(): boolean` method, but `ResourceResult` typed resources on `ActivatedRoute.resources` and `ActivatedRouteSnapshot.resources` as `Record<string, Resource<unknown>>`. This caused TypeScript errors when attempting to call `.reload()` without a type assertion.
This commit updates `ResourceResult` to intersect each resource with `Pick<WritableResource<unknown>, 'reload'>` so that `.reload()` is properly typed.
Fixes#70698
Avoid String.prototype.trim() when classifying server request URLs because it
strips Unicode whitespace that WHATWG URL parsing preserves as path data.
This mismatch can cause xhr2 to send credentials to a different origin than
the application approved.
Classify the unmodified request URL so whitespace-prefixed input falls through
URL resolution, and cover NBSP- and BOM-prefixed HTTP URLs.
Fixes#70540
(cherry picked from commit 44355181e2)
Avoid asserting on chrome.devtools.inspectedWindow.eval directly via
Jasmine matchers, as TypeScript picks up the 3-argument overload
signature from @types/chrome, causing a TS2554 compilation error when
only 2 arguments are provided. Instead, assert directly on the
evalSpy instance.
(cherry picked from commit c0c5d452c3)
Inline templates written as template literals with `${...}` substitutions are `TemplateExpression` nodes, not string literals, so they were not recognized when building the virtual HTML document. The HTML language service received a blank document and produced no folding ranges, breaking element folding for the whole template.
Match template expressions in addition to string-literal-like nodes and blank out the `${...}` substitutions (preserving line breaks) so offsets
in the virtual document stay aligned and the expression contents are not parsed as HTML.
Fixes#65508
(cherry picked from commit 0ec19b571c)
Verify that a boundary around the receiving component catches errors from projected content and renders its fallback.
(cherry picked from commit fe75da1af5)
The parsed jsaction action map, the parser cache keyed by the raw jsaction attribute value, and the fallback in getDefaulted were all plain {} objects. Looking up a key that was never explicitly set but happens to match an inherited Object.prototype member (toString, constructor, hasOwnProperty, ...) resolves to that inherited value instead of undefined, and callers only check `!== undefined` to decide whether there's a real action or cache entry.
Use Object.create(null) instead, which has no prototype to accidentally collide with.
(cherry picked from commit 8d8859cb21)
Demonstrates that a plain {} used as the parsed jsaction action map resolves an inherited Object.prototype member (e.g. toString) for a key that was never explicitly parsed into the map, instead of undefined. Callers only check `!== undefined`, so this gets treated as a real action.
This commit adds the test only, without the fix, so the failure is visible on its own.
(cherry picked from commit 5cb3ed2958)
In local compilation mode the compiler can emit a reference to a symbol that it
was not able to prove has a value at runtime, because deciding that can require
information from other files. The generated factory already guards those
references with a `@ts-ignore`, but the `ctorParameters` callback passed to
`setClassMetadata` does not, so the same symbol ends up guarded in one place and
unguarded a few lines later in the same file. Type checking the generated code
then fails on the unguarded reference.
Constructor parameters are now handed to `@angular/compiler` in a structured
form rather than as an already-built callback, which lets the compiler attach a
suppression directly to the `type` property assignment of each parameter that
needs one. Only references that reflection could not verify are guarded: full
compilation resolves every reference, so its output is unchanged, and partial
declarations are published as JavaScript and never type checked, so they are
never guarded either.
Producers that build the callback themselves keep passing an expression, which
is emitted untouched.
(cherry picked from commit c92ed082ea)
Aligning section headers under the "File Layout" heading for better readability and consistent "On this page" hierarchy levels.
Grouping "Partial compilation" and "Optimizations" under a common section header, as these describe the compilation process from sources to final APF-compliant package.
(cherry picked from commit fc637788a0)
The downloadable AI context files had drifted from the canonical
`packages/core/resources/best-practices.md`. `GEMINI.md` was also
missing the accessibility requirements and several rules that were
only added to `AGENTS.md` and `guidelines.md`.
Bring all three files in line: OnPush is the default in v22, `model()`,
`linkedSignal()`, Signal Forms, `@Service`, and no `CommonModule`. Also
drop the unused `ChangeDetectionStrategy` import from the example.
(cherry picked from commit d5f409cfab)