35674 Commits

Author SHA1 Message Date
Kristiyan Kostadinov 5a80a48e96 fix(compiler-cli): avoid allocating an object for signals in production mode
Currently when the signal debug name transform sees something like `const foo = signal(0);`, it transforms the signal into `signal(0, {...(ngDevMode ? { debugName: 'foo' } : {})})`. After minification this becomes `signal(0, {})` which will allocate memory for the empty object literal.

These changes rework the logic to produce `signal(0, ...(ngDevMode ? [{ debugName: 'foo' }] : []))` which will be fully tree shaken away to `signal(0)`.

(cherry picked from commit e30e61b789)
2025-12-02 15:06:55 +01:00
Jessica Janiuk 8c3304c766 fix(core): run animation queue in environment injector context
In the case that a component injector is destroyed before the animation
queue runs, the animation queue would fail to run because it was using a
destroyed injector. This commit changes the animation queue to run in the
context of the EnvironmentInjector, which is not destroyed until the app
is destroyed.

fixes: #65628
(cherry picked from commit d8ab83ca82)
2025-12-02 15:05:21 +01:00
Matthieu Riegler 017672f742 refactor(compiler): Generate the controlCreate instruction after the native element has been created
This is necessary to exclude a race condition where the MutationObserver initialized by the instruction fired before the inputs are binded.

fixes #65678

(cherry picked from commit f35b2ef47c)
2025-12-02 12:59:53 +01:00
Matthieu Riegler 8e0df4083d docs(docs-infra): Show examples on function overloads
(cherry picked from commit a784995a98)
2025-12-02 12:13:16 +01:00
Georgi Serev c0e0010bb9 fix(devtools): hide profiler node details when the frame is changed
Hide the details panel when the user selects a new frame.

(cherry picked from commit 2eaa4d54ad)
2025-12-02 12:05:58 +01:00
Joey Perrott 53e0aaba4e refactor(docs-infra): move header id tracking into RendererContext
Move the header id tracking into the renderer context rather than a global state.  Since the RendererContext is
initialized for each execution of the marked parser, we can store the context of which header ids have been seen within
a single page there which allows us to run these parse interactions in parallel.

(cherry picked from commit a16a70ca74)
2025-12-02 12:03:39 +01:00
Joey Perrott 5ec3bd9c55 refactor(docs-infra): transform all headings using the built in transformer
Rather than manually calling the transformer we use for headings from within a render function, we now properly call into the Renderer to do them
via the tokens they are require instead.  This is being done to allow us to have a per Renderer instance of state instead of a global state, which will
allow us to run marked async and hopefully speed up the pipeline

(cherry picked from commit 8b296543ae)
2025-12-02 12:03:38 +01:00
Tim Deschryver efe4b72abb docs: fix documentation link for currentNavigation method
(cherry picked from commit 680de24c3c)
2025-12-02 12:02:28 +01:00
SkyZeroZx ea45b4d54c docs: add platform-specific implementation and helpers
(cherry picked from commit 0c7508bf56)
2025-12-02 12:00:05 +01:00
Angular Robot 2935fef3af build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-02 10:47:29 +01:00
SkyZeroZx 35b39bd86f docs: improve formatting and fixed numeration issue in attribute directives guide
(cherry picked from commit 03c04d4c83)
2025-12-02 10:45:51 +01:00
SkyZeroZx 893fbdfb04 docs: update syntax highlighting in component documentation
(cherry picked from commit 7fd5890d48)
2025-12-02 10:38:20 +01:00
Gaston f368ab957c docs: add FormArrayDirective documentation to reactive forms guide
Update adev/src/content/guide/forms/reactive-forms.md

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
(cherry picked from commit da99b5d1d0)
2025-12-02 10:36:17 +01:00
Matthieu Riegler 7f289bdc3a docs: fix submit example
`async` keyword is required for the `submit` callback

(cherry picked from commit bc93b398af)
2025-12-02 10:35:10 +01:00
Angular Robot 706d7620e8 build: update cross-repo angular dependencies
See associated pull request for more information.
2025-12-01 19:36:18 +01:00
SkyZeroZx b4c8c939b0 docs: update notes to use consistent formatting in various guides
(cherry picked from commit aea2465a59)
2025-12-01 19:33:36 +01:00
Angular Robot 48008c2f6f docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2025-12-01 19:30:14 +01:00
Shuaib Hasan Akib 8ab759497c docs: format typescript examples and replace <docs-code> with fenced code blocks
Replaced <docs-code language="typescript"  to improved
readability and consistency across documentation.

(cherry picked from commit 3731f07579)
2025-12-01 19:20:23 +01:00
SkyZeroZx dad3d7900f feat(docs-infra): Adds copy link to anchor functionality
Enables copying a direct link to any section by clicking its anchor. Also updates the aria-label to remove the code tag

(cherry picked from commit 4e89bc6244)
2025-12-01 19:19:35 +01:00
Angular Robot c139b35d5d build: update rules_angular digest to 9409450
See associated pull request for more information.
2025-12-01 19:18:09 +01:00
til0r ed32e8c364 docs: fix npm link URL in creating-libraries guide
- Update `npm link` to the official docs URL.
- Keep `pnpm link` reference intact

(cherry picked from commit 721080aaa9)
2025-12-01 18:58:37 +01:00
Pratyush Swain fe863aad05 docs(docs-infra): update NG0910 documentation with new control flow
(cherry picked from commit 27d1ccb2df)
2025-12-01 18:54:02 +01:00
Shuaib Hasan Akib 7efcd9ad4c docs: link inject function to its API reference
Replaced plain code-form usage of `inject` with a link to the
API docs (`/api/core/inject`) to improve navigation and
help readers access detailed reference information more easily.

(cherry picked from commit 7b33554d24)
2025-12-01 18:53:08 +01:00
aparziale 4d036fcc41 docs(docs-infra): Fix Incorrect indentation
Fix Incorrect indentation in hierarchical dependency injection guide

Fix #65722

(cherry picked from commit a850987519)
2025-12-01 18:52:20 +01:00
Shuaib Hasan Akib 74cbe36fa6 docs: update examples to use self-closing tags for consistency with recommended practices
Updated various template examples to use self-closing component tags
(e.g., `<my-comp />`) instead of the expanded form (`<my-comp></my-comp>`),
improving consistency across the documentation and aligning with current
Angular style recommendations.

(cherry picked from commit a464406ebf)
2025-12-01 18:50:54 +01:00
aparziale ce961fe5c0 docs(docs-infra): Fix Drag handle SVG is not visible
Fix Drag handle SVG is not visible. The css style overrides the default behavior

Fixes #65545

(cherry picked from commit 7a39565916)
2025-12-01 18:49:10 +01:00
SkyZeroZx b7ccb308b8 docs(docs-infra): Improves symbol linking for Angular Aria selectors
Improves the symbol linking logic to handle Angular component selectors (e.g., ngCombobox). It attempts to convert Angular selector patterns to their corresponding class names, improving navigation to Angular API documentation.

(cherry picked from commit 2d854e01bc)
2025-12-01 18:47:23 +01:00
galmi bc6cb6830e docs(forms): fix links in signal forms guides and use docs-pill-row links for next steps
(cherry picked from commit 726dfad9db)
2025-12-01 18:46:22 +01:00
Shuaib Hasan Akib cb2847c8d9 fix(docs-infra): truncate long TOC items and add title tooltips
Long TOC entries now truncate with …, and a title attribute is added to display the full label on hover.

Fixes: #65727
(cherry picked from commit 313454bf17)
2025-12-01 18:43:50 +01:00
Ben Hong 8cfe9d8100 docs: update aria listbox selection mode section
(cherry picked from commit 7ea5b66a70)
2025-12-01 18:41:57 +01:00
Kristiyan Kostadinov c46f65df39 docs: fix up font in drag drop examples
Fixes that the CDK drag&drop examples were using a serif font.

(cherry picked from commit 649e2ec1d4)
2025-12-01 18:40:38 +01:00
aparziale 505e1a1f6b docs(docs-infra): fix content projection documentation
Fixed documentation issues in content projection examples.
- Component decorator without '@'
- Self-closing tag for ng-content

Fix #65675

(cherry picked from commit f18dd5e54c)
2025-12-01 18:38:20 +01:00
kirjs 9aab858871 feat(docs-infra): prevent browser save dialog in adev code editor
Add Cmd+S/Ctrl+S keyboard shortcut to the adev code editor that prevents
the annoying browser save dialog from appearing. The shortcut is a no-op
since the editor already has auto-save functionality that persists changes
after 500ms of inactivity.

(cherry picked from commit cb04cee7b2)
2025-12-01 18:36:06 +01:00
Kristiyan Kostadinov 8c4a1524da release: cut the v21.0.2 release 21.0.2 2025-12-01 12:51:18 +01:00
Alan Agius 78fd159b78 fix(compiler): prevent XSS via SVG animation attributeName and MathML/SVG URLs
This commit implements a security fix to prevent XSS vulnerabilities where SVG animation elements (`<animate>`, `<set>`, etc.) could be used to modify the `href` or `xlink:href` attributes of other elements to `javascript:` URLs.

(cherry picked from commit 1c6b0704fb)
2025-12-01 10:27:00 +01:00
SkyZeroZx fec1f1ae5f docs: update code snippets in reference doocumentation
(cherry picked from commit 8f3fdc3e80)
2025-11-26 16:01:17 -05:00
Matthieu Riegler a4084154f2 refactor(migrations): don't migration the server bootstrapApplicaiton on zoneless apps.
With the change we specifically analyse `boostrapApplication` with a config that uses `mergeApplicationConfig`.

fixes #65408

(cherry picked from commit c1dfd9cde6)
2025-11-26 15:58:57 -05:00
aparziale 99b6341ca5 docs(docs-infra): fix form custom control example uses syntax
Fixed form custom control example uses non-working syntax in template

Fix #65647

(cherry picked from commit a3fb41e797)
2025-11-26 15:48:20 -05:00
Matthieu Riegler 4207d89455 docs(docs-infra): fix visible lines/regions
fixes #65552

(cherry picked from commit 1c3868198e)
2025-11-26 13:43:40 -05:00
Matthieu Riegler 1260d1ac6d refactor(devtools): Use the same error message as the signal custom formatter for signal errors
When signals throw errors on read, the devtools will show the same error message as the signal custom formatter.
We also don't log errors anymore to the console as those might be surprising to see as errors and are buggy behavior of the devtools.

(cherry picked from commit a0930e166c)
2025-11-26 13:11:10 -05:00
Matthieu Riegler 151616dd7c refactor(core): show error message on signal error
When a signal throws an error on read. The formatter will show the error message.

(cherry picked from commit 5b720aa2eb)
2025-11-26 13:11:10 -05:00
Leon Senft 0ae14cb746 test(core): test bundling of dynamic component creation and bindings
Add test coverage for bundling dynamic component creation API like
`createComponent()` and `inputBinding()`. This will be used to test that
Signal Forms related features for #64632 can be tree-shaken when unused.

(cherry picked from commit add8c41e5b)
2025-11-26 11:57:18 -05:00
SkyZeroZx 10201b6873 docs(docs-infra): renders inline code snippets in docs pills
Improves the rendering of `DocsPillRow` to correctly display inline code snippets (using backticks) within the pill labels.

(cherry picked from commit ef034c15c1)
2025-11-25 18:30:09 -05:00
kirjs 47a739611a release: cut the v21.0.1 release 21.0.1 2025-11-25 15:04:58 -05:00
Alan Agius 3240d856d9 fix(http): prevent XSRF token leakage to protocol-relative URLs
The XSRF interceptor previously failed to detect protocol-relative URLs (starting with `//`) as absolute URLs. This allowed requests to such URLs to include the XSRF token, potentially leaking it to external domains.

This change updates the interceptor to correctly identify protocol-relative URLs as absolute and exclude them from receiving the XSRF token.

(cherry picked from commit 40790ef980)
2025-11-25 13:47:29 -05:00
Alan Agius 908b5a41a3 refactor: replace getDocument() with inject(DOCUMENT)
This replaces `getDocument()` with `inject(DOCUMENT)` across hydration and transfer state logic.

(cherry picked from commit 400fc82c43)
2025-11-25 13:05:01 -05:00
Kristiyan Kostadinov 6b20adff62 refactor: add mark for signal forms
Adds a mark for signal forms so we can track adoption. Also moves the call for `@let` into `declareLet` since we don't need it to fire as often as in `storeLet`.

(cherry picked from commit c994267f17)
2025-11-25 13:03:46 -05:00
Alan Agius 49ad7c6508 fix(core): use injected DOCUMENT for CSP_NONCE
This ensures that the right document is used and that `CSP_NONCE` can be used in `provideAppInitializer` and `provideEnvironmentInitializer`.

Closes #65624

(cherry picked from commit 3b1fa8235b)
2025-11-25 11:39:23 -05:00
AntonChesnokov 8d3a89a477 fix(compiler-cli): escape angular control flow in jsdoc
Escape @-prefixed template control flow constructs during doc extraction so JSDoc parsing keeps description text intact. Add regression coverage for @for snippets.

(cherry picked from commit 5bfa027d41)
2025-11-25 11:33:29 -05:00
Angelo Parziale 4634b467c2 docs(docs-infra): Fix anchor link DI
Fix anchor link for Dependency Injection Overview.

(cherry picked from commit 346caefa8d)
2025-11-25 11:05:45 -05:00