Commit graph

30971 commits

Author SHA1 Message Date
Georgy Serga
aea747ab3b fix(compiler): preserve attributes attached to :host selector (#57796)
keep attributes used to scope :host selectors

PR Close #57796
2024-10-10 08:13:23 +00:00
Georgy Serga
11692c8dab fix(compiler): add multiple :host and nested selectors support (#57796)
add support for nested and deeply nested (up to three levels) selectors,
parse multiple :host selectors, scope selectors within pseudo functions

PR Close #57796
2024-10-10 08:13:23 +00:00
Georgy Serga
48a1437e77 fix(compiler): fix comment typo (#57796)
fix spelling in the comment

PR Close #57796
2024-10-10 08:13:23 +00:00
Georgy Serga
66dcc691f5 fix(compiler): allow combinators inside pseudo selectors (#57796)
allow css combinators within pseudo selector functions, parsing those
correctly. Similarly to previous version, don't break selectors
into part if combinators are within parenthesis, for example
`:where(.one > .two)`

PR Close #57796
2024-10-10 08:13:23 +00:00
Georgy Serga
7a6fd427d5 fix(compiler): transform pseudo selectors correctly for the encapsulated view (#57796)
fix scoping and transforming logic of the `shimCssText` for the
components with encapsulated view:
- add support for pseudo selector functions
- apply content scoping for inner selectors of `:is()` and `:where()`
- allow multiple comma separated selectors inside pseudo selectors

Fixes #45686

PR Close #57796
2024-10-10 08:13:22 +00:00
cexbrayat
31fb9d0d52 docs: mention autoDetectChanges parameter default value (#58092)
It was unclear whether the parameter was necessary, as its default value was not mentioned in the jdsoc.

PR Close #58092
2024-10-09 13:50:32 +00:00
Krzysztof Platis
b40875a2cc fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135)
The `bootstrap()` phase might fail e.g. due to an rejected promise in some `APP_INIIALIZER`.
If `PlatformRef` is not destroyed, then the main app's injector is not destroyed and therefore `ngOnDestroy` hooks of singleton services is not called on the end (failure) of SSR.

This could lead to possible memory leaks in custom SSR apps, if their singleton services' `ngOnDestroy` hooks contained an important teardown logic (e.g. unsubscribing from RxJS observable).

Note: I needed to fix by the way another thing too: now we destroy `moduleRef` when `platformInjector` is destroyed - by setting a `PLATFORM_DESTROY_LISTENER`

Patch port of #58112

PR Close #58135
2024-10-09 13:50:02 +00:00
Angular Robot
59394ee830 build: update actions/cache digest to 3624ceb (#58125)
See associated pull request for more information.

PR Close #58125
2024-10-08 13:27:59 -07:00
Kristiyan Kostadinov
46bafb0b0a fix(core): clean up afterRender after it is executed (#58119)
We stop tracking `afterRender` hooks as soon as they execute, but their on destroy callbacks stay registered until either the injector is destroyed or the user calls `destroy` manually. This was leading to memory leaks in the `@defer` triggers based on top of `afterRender` when placed inside long-lived views, because the callback would execute, but its destroy logic was waiting for the view to be destroyed.

These changes resolve the issue by destroying the `AfterRenderRef` once it is executed.

PR Close #58119
2024-10-08 13:27:07 -07:00
Matthieu Riegler
9ca9db4f74 refactor(core): drop ViewRefTracker in favor of ApplicationRef. (#58096)
We can leverage an `import type` to prevent the circular import.

PR Close #58096
2024-10-08 13:25:24 -07:00
ColinJolivet
9f2726bb43 refactor(docs-infra): add tooltip to the download button in playground (#58065)
Add a material tooltip to the download button in the playground in order to clarify what this button does

PR Close #58065
2024-10-08 09:28:37 -07:00
Lang
490786af10 docs: complete the example in use InjectionToken section (#57839)
PR Close #57839
2024-10-08 09:27:23 -07:00
Angular Robot
7b13d34a24 build: update scorecard action dependencies (#58116)
See associated pull request for more information.

PR Close #58116
2024-10-08 06:18:16 +00:00
Angular Robot
99b5417d28 build: update actions/cache digest to 2cdf405 (#58107)
See associated pull request for more information.

PR Close #58107
2024-10-08 06:17:36 +00:00
Angular Robot
bf83801b8c build: update actions/checkout digest to eef6144 (#58108)
See associated pull request for more information.

PR Close #58108
2024-10-07 13:26:53 -07:00
arturovt
02de7fc731 fix(zone.js): remove abort listener once fetch is settled (#57882)
This commit updates the `fetch` patch for zone.js. Currently, we're attaching an
`abort` event listener on the signal (when it's provided) and never removing it.
We should be good citizens and remove event listeners whenever objects need to be
properly collected. In Firefox, when saving a heap snapshot and running it through
`fxsnapshot`, querying `AbortSignal` will print a so-called "CaptureMap" with a list
of "lambdas," indicating that the signal is not garbage collected because of the event
listener lambda function.

PR Close #57882
2024-10-07 08:27:54 -07:00
Kristiyan Kostadinov
f187c3abf8 fix(compiler-cli): defer symbols only used in types (#58104)
Currently we don't defer any symbols that have references outside of the `import` statement and the `imports` array. This is a bit too aggressive, because it's possible that the symbol is only used for types (e.g. `viewChild<SomeCmp>('ref')`) which will be stripped when emitting to JS.

These changes expand the logic so that references inside type nodes aren't considered.

**Note:** one special case is when the symbol used in constructor-based DI (e.g. `constructor(someCmp: SomeCmp)`, because these constructors will be compiled to `directiveInject` calls. We don't need to worry about them, because the compiler introduces an addition `import * as i1 from './some-cmp';` import that it uses to refer to the symbol.

Fixes #55991.

PR Close #58104
2024-10-07 08:26:07 -07:00
Luan Gong
7eb264a017 docs: use correct heading in templates guide (#58101)
PR Close #58101
2024-10-07 08:22:46 -07:00
Matthieu Riegler
b35e7f8bb3 docs: add info on AbstractControl.source type. (#58094)
The source can be of any type and can't be inferred from `T`

fixes #58076

PR Close #58094
2024-10-07 08:21:56 -07:00
vladboisa
10081a9d7a docs: move JSDoc before functions (#58087)
Move the JSDoc before functions for correct view of params

PR Close #58087
2024-10-04 14:47:53 -07:00
Matthieu Riegler
0e225ce16b docs(docs-infra): Add NgModule exports for directives. (#58071)
This information is extracted from the @NgModule Jsdoc tag.

fixes #57906

PR Close #58071
2024-10-04 14:46:17 -07:00
Adrien Crivelli
ccf2c7f40e docs(common): Minor typo in code example (#58085)
PR Close #58085
2024-10-04 14:38:41 -07:00
JoostK
39a851fa55 refactor: change security issue redirect to angular.dev (#58070)
Ensure the security issue template points to the correct location.

PR Close #58070
2024-10-04 10:57:43 -07:00
Stanka Kopalova
91874a7c41 docs: add better title name (#58060)
PR Close #58060
2024-10-04 10:57:08 -07:00
Stanka Kopalova
3b06a09df2 docs: fix wrong title of section (#58060)
PR Close #58060
2024-10-04 10:57:08 -07:00
Angular Robot
3fb696df96 refactor(compiler): update dependency chokidar to v4 (#57945)
This commit bump chokidar to the latest major and adjusts to the breaking changes.

PR Close #57945
2024-10-04 10:56:03 -07:00
arturovt
69702b17cc docs(zone.js): update docs to enable beforeunload (#57881)
In this commit, we update the documentation to reflect the property that allows
enabling the default browser `beforeunload` handling, which was added in a
previous commit.

Additionally, some cosmetic grammar changes have been made in this documentation,
as the previous text had some issues.

Closes #52256

PR Close #57881
2024-10-04 10:55:01 -07:00
Matthieu Riegler
de03e93262 build: update ts target to ES2022 and module to ES2022 (#58022)
Our integration tests are based on the CLI. CLI build force the target to ES2022 else it logs a warning

PR Close #58022
2024-10-04 13:33:48 +00:00
Jeevan Mahesha
44cb2f8131 docs: add documentation for lazy loading a standalone component (#57620)
Added a new section in the documentation explaining how to lazy load a standalone component using `loadComponent`. This includes a code example demonstrating the setup in Angular routes.

PR Close #57620
2024-10-04 13:31:52 +00:00
Matthieu Riegler
1db1b3d6b8 refactor(compiler-cli): exclude private computed properties from class member extractions (#57596)
This will exclude properties like `[ɵWRITABLE_SIGNAL]` from the `WritableSignal` interface.

PR Close #57596
2024-10-04 13:29:52 +00:00
Matthieu Riegler
c18ec3dd26 ci: disable updates for @bazel (#58050)
This is to prevent the bot to update #51047

PR Close #58050
2024-10-04 13:28:16 +00:00
vladboisa
694fe3faab fix(docs-infra): fix calculation of height editor (#54128)
Apply the min() function for set the smallest height

fix(docs-infra): move height into editor-wrapper

Move the calculation rule of height edit into editor-wrapper selector

fix(docs-infra): change has selector

Change the has selector

fix(docs-infra): change selector's for child

Changing the selector for test this solution

Fix

PR Close #54128
2024-10-03 16:43:03 +00:00
vladboisa
ca5bc0c5bd feat(docs-infra): add transition on editor wrapper (#54128)
Add the smooth animation when height of the container is changing

PR Close #54128
2024-10-03 16:43:03 +00:00
vladboisa
3d1fd3442e fix(docs-infra): max-height IDE error panel visibility (#54128)
Remove max-height: 200px in ul child inline-errors-box, add the overflow & max-height in percentages to the parent for correct visualization

Fixes #52760

refactor(docs-infra): correct typo
Correct typo in comment

feat(docs-infra): modify the height of the editor
If error box are displayed, modify the height of the editor

PR Close #54128
2024-10-03 16:43:03 +00:00
Andrew Seguin
8f6560857c docs: reword when to use model inputs (#57648)
PR Close #57648
2024-10-03 16:42:18 +00:00
arturovt
dc911c635a refactor(docs-infra): cleanup AfterRenderSequence for reference list (#58030)
In this commit, we're replacing the provided injector in `afterNextRender` with a node injector
because it was previously mistakenly passing an `EnvironmentInjector`. The `EnvironmentInjector`
resolves `DestroyRef` to itself, meaning that `AfterRenderSequence` is essentially never destroyed
(since the environment injector is not destroyed either).

PR Close #58030
2024-10-02 18:01:31 +00:00
Jeevan Mahesha
42eb096b77 docs: update comments to use consistent code formatting for boolean values (#57619)
PR Close #57619
2024-10-02 18:00:52 +00:00
Paul Gschwendtner
46b088a245 release: cut the v18.2.7 release 2024-10-02 14:31:40 +02:00
arturovt
46a2ad39f5 fix(common): prevent warning about oversize image twice (#58021)
I’ve noticed that there was a loop inside a loop. Since we’re already iterating through
`images` using `forEach`, it was running a `for` loop through `images` again. This was
probably a mistake made when the functionality was initially added. The test actually
verified that `logs.length` is `1`, but in the real environment, it logs twice
(which is quite obvious due to the code).

I’ve also added the missing file to the Bazel target.

PR Close #58021
2024-10-02 11:46:18 +00:00
Suat Oğulcan Özcan
c48816e123 docs: remove whitespace (#58042)
PR Close #58042
2024-10-02 11:26:28 +00:00
Matthieu Riegler
7c16e70b20 build: Add LICENSE file to the generated packages (#58033)
This commit adds a parameter to `ng_package` to specify a license file that will be bundled with the generated packages.

fixes #58029

PR Close #58033
2024-10-01 16:34:27 +00:00
Sam Verschueren
70591e7de0 docs: use proper workdir for tutorial and playground (#56063)
PR Close #56063
2024-10-01 16:09:54 +00:00
arturovt
a21867df6a fix(docs-infra): allow tutorial component to be GCed (#58028)
This commit updates the tutorial component's functionality to unsubscribe from the route
data observable and stop monitoring the resizer element when the component is destroyed.
This is necessary because `monitor` adds event listeners that prevent the element and
component from being garbage collected.

PR Close #58028
2024-10-01 13:51:06 +00:00
ilir.beqiri
8d8fb44ec1 docs: update the name of the sub-navigation item at error encyclopedia menu (#57997)
PR Close #57997
2024-10-01 08:32:09 +00:00
Angular Robot
6b67cb5976 build: update scorecard action dependencies (#58024)
See associated pull request for more information.

PR Close #58024
2024-10-01 08:25:10 +00:00
Andrew Scott
0e62b30989 docs(router): Document missing input for route binding (#57697)
This commit clearly documents the approach used by router input binding
when an input is not present in the route data.

resolves #52946

PR Close #57697
2024-10-01 08:09:33 +00:00
arturovt
ca637fe6a9 fix(http): cleanup JSONP script listeners once loading completed (#57877)
This commit removes event listeners from the `script` element once loading is
complete. If the element is not garbage collected properly, in Firefox, the script
element still appears in the memory tree view, captured by
`__zone_symbol__loadfalse -> HTMLScriptElement -> GC Roots`. We should always be good
citizens and clean up event listeners when we no longer need them, as browser's garbage
collectors work differently. Calling `remove()` on the node doesn't guarantee that the
node can be collected.

PR Close #57877
2024-10-01 08:08:40 +00:00
Thanh Truong
b84e2d3338 docs: add deferrable views tutorial (#57934)
Add a new tutorial "Deferrable Views" to the tutorials page.

PR Close #57934
2024-10-01 07:07:21 +00:00
Kristiyan Kostadinov
b9d846dad7 fix(migrations): delete constructor if it only has super call (#58013)
Adds some logic to the `inject` migration that will remove constructors that are made up of only a `super` call after the migration.

PR Close #58013
2024-09-30 13:39:43 -07:00
Santosh Yadav
8bb21de452 docs: correct line number for localize example (#57999)
PR Close #57999
2024-09-30 13:39:01 -07:00