Commit graph

29423 commits

Author SHA1 Message Date
Andrew Kushnir
dcb9deb363 fix(core): collect providers from NgModules while rendering @defer block (#52881)
Currently, when a `@defer` block contains standalone components that import NgModules with providers, those providers are not available to components declared within the same NgModule. The problem is that the standalone injector is not created for the host component (that hosts this `@defer` block), since dependencies become defer-loaded, thus no information is available at host component creation time.

This commit updates the logic to collect all providers from all NgModules used as a dependency for standalone components used within a `@defer` block. When an instance of a defer block is created, a new environment injector instance with those providers is created.

Resolves #52876.

PR Close #52881
2024-02-23 12:30:05 -08:00
Pawel Kozlowski
0d95ae51fa refactor(core): use performance API for signals (#54521)
This commit adds a standard performance marker that can be viewed in Chrome dev tools and other tooling.
See more info at https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark

PR Close #54521
2024-02-23 12:18:30 -08:00
Kristiyan Kostadinov
4efcc74dd6 docs: add a guide for model inputs (#54514)
Adds a guide for `model()` inputs for angular.io. Will port this over to angular.dev once it's finalized.

PR Close #54514
2024-02-23 11:47:03 -08:00
Felix Geißler
a3d5f7a2b3 docs: syntax error in signal input transform example (#54567)
PR Close #54567
2024-02-23 11:46:10 -08:00
loka shafeek
835c3a1c27 docs: Update wildcard route component to PageNotFoundComponent (#54570)
This PR enhances the Angular documentation by replacing the placeholder `<component-name>` with the actual `PageNotFoundComponent` in the wildcard route configuration. This update ensures that the documentation accurately reflects the recommended practice for handling page-not-found scenarios. Additionally, it addresses the issue where HTML entities like `&lt;` were being displayed instead of the desired `<` symbol, resulting in clearer and more readable documentation for users.
PR Close #54570
2024-02-23 11:45:38 -08:00
Kristiyan Kostadinov
f04ecc0cda fix(compiler-cli): identify aliased initializer functions (#54480)
Fixes that initializer functions weren't being recognized if they are aliased (e.g. `import {model as alias} from '@angular/core';`).

To do this efficiently, I had to introduce the `ImportedSymbolsTracker` which scans the top-level imports of a file and allows them to be checked quickly, without having to go through the type checker. It will be useful in the future when verifying that that initializer APIs aren't used in unexpected places.

I've also introduced tests specifically for the `tryParseInitializerApiMember` function so that we can test it in isolation instead of going through the various functions that call into it.

PR Close #54480
2024-02-23 11:44:36 -08:00
Lukas Matta
52924c5317 docs: remove mutate function mention (#54569)
PR Close #54569
2024-02-23 11:43:24 -08:00
Matthieu Riegler
35e5ba0ba6 ci: adding Matthieu as approver for ADEV (#54575)
This is to help the team approve changes on the new doc site.

PR Close #54575
2024-02-23 11:42:44 -08:00
Kristiyan Kostadinov
c5a7661319 refactor(compiler-cli): changes to get signal diagnostic working internally (#54585)
The diagnostic for signals that haven't been invoked wasn't working internally, because the path to `@angular/core` is different. These changes resolve the issue and do some general cleanup.

PR Close #54585
2024-02-23 11:42:04 -08:00
Kristiyan Kostadinov
71e0c7df69 fix(migrations): resolve infinite loop for a single line element with a long tag name and angle bracket on a new line (#54588)
Fixes an edge case where a single-line elemnt with a long tag name a closing bracket on a new line was putting the control flow migration into an infinite loop.

Fixes #54587.

PR Close #54588
2024-02-23 11:40:27 -08:00
Dylan Hunn
1a6beae8a2 feat(compiler): Enable template pipeline by default. (#54571)
Template pipeline is now the default template compiler.

A pair of source map tests is failing, related to DI in JIT mode; I will fix and re-enable these during the preview period.

PR Close #54571
2024-02-23 11:15:36 -08:00
Matthieu Riegler
812a9729fa docs(docs-infra): revert font-inlining (#54573)
To fix the CI/Build for ADEV.

PR Close #54573
2024-02-23 18:30:04 +00:00
Andrew Scott
3f95829f6d refactor(core): Allow dirty views to be refreshed in a loop internally (#54572)
ApplicationRef.tick has a loop that will refresh views again that have
an updated signal. This change ensures views marked with the `Dirty`
flag are also considered in this loop, but only inside g3 for now
because this may be considered a breaking change and we need to wait for
v18 to land externally.

PR Close #54572
2024-02-23 09:59:11 -08:00
Andrew Scott
707bfc9b32 perf(common): AsyncPipe should not call markForCheck on subscription (#54554)
This commit prevents `AsyncPipe` from calling `markForCheck` when values
are synchronously emit during subscription to an observable. This
prevents subscriptions to `Replay` observables from needlessly walking
up to the root of the view tree during template execution for each
new replay observable in the template.

PR Close #54554
2024-02-23 09:20:02 -08:00
Alex Rickabaugh
8e65bdc848 release: cut the v17.3.0-next.0 release 2024-02-21 18:02:51 -08:00
Alex Rickabaugh
09710295bc docs: release notes for the v17.2.2 release 2024-02-21 17:57:34 -08:00
Matthieu Riegler
f5f73fd997 docs(docs-infra): enable webcontainers for Firefox (#54550)
PR Close #54550
2024-02-21 15:27:36 -08:00
Joey Perrott
e7b6be5abe build: perform build/serve of adev locally (#54549)
Use no-remote-exec to allow for building and serving to occur locally but still allow remote caching.  Because of the number of
files involved in being passed to and from the RBE server, it is actually a bit faster to perform these actions locally.

PR Close #54549
2024-02-21 15:27:02 -08:00
Jessica Janiuk
42d3ddd9ae fix(migrations): Fix cf migration regular expression to include underscores (#54533)
In rare cases people may use an underscore in their component names, which was not accounted for in the formatting portion of the migration.

fixes: #54532

PR Close #54533
2024-02-21 15:25:05 -08:00
Doug Parker
9ec22244ee docs(devtools): expand release docs (#54525)
This provides some more information on how to release and notably includes commands for zipping extension code and source code, which can otherwise be tricky to get exactly right.

PR Close #54525
2024-02-21 15:24:26 -08:00
Doug Parker
e9e5e255e9 release: bump Angular DevTools version to 1.0.10 (#54523)
PR Close #54523
2024-02-21 15:23:36 -08:00
Kristiyan Kostadinov
a9f563f043 refactor(compiler-cli): move defer block tests into separate file (#54499)
Splits the tests for `@defer` blocks out into a separate file since the `ngtsc_spec.ts` is getting quite large.

PR Close #54499
2024-02-21 15:22:36 -08:00
Kristiyan Kostadinov
badda0c389 fix(compiler-cli): correctly detect deferred dependencies across scoped nodes (#54499)
This is based on an internal issue report.

An earlier change introduced a diagnostic to report cases where a symbol is in the `deferredImports` array, but is used eagerly. The check worked by looking through the deferred blocks in a scope, resolving the scope for each and checking if the element is within the scope. The problem is that resolving the scope won't work across scoped node boundaries. For example, if there's a control flow statement around the block or within the block but around the deferred dependency, it won't be able to resolve the scope since it isn't a direct child, e.g.

```
@if (true) {
  @defer {
   <deferred-dep/>
  }
}
```

To fix this the case where the deferred block is inside a scoped node, I've changed the `R3BoundTarget.deferBlocks` to be a `Map` holding both the deferred block and its corresponding scope. Then to resolve the case where the dependency is within a scoped node inside the deferred block, I've added a depth-first traversal through the scopes within the deferred block.

PR Close #54499
2024-02-21 15:22:36 -08:00
Kristiyan Kostadinov
1d14e527d5 refactor(compiler-cli): add the ability to treat object literals as enums in docs (#54487)
We have a couple of cases now (#53753 and #54414) where we're forced to redefine enums as object literals. These literals aren't rendered in the best way in the docs so these changes introduce a new `object-literal-as-enum` tag that we can use to mark them so they're treated for documentation purposes.

PR Close #54487
2024-02-21 15:21:58 -08:00
Dean Davidson
5a13c18104 docs: add closing tags to code examples (#54485)
There were two minor issues in the code examples that this addresses.
PR Close #54485
2024-02-21 15:20:12 -08:00
Lukas Matta
27603996fa docs: fix typos (#54475)
PR Close #54475
2024-02-21 15:19:39 -08:00
vladboisa
024c14fb69 docs(docs-infra): fix tab shrinking (#54380)
Fix a behavior when block shrinks on Usage notes tab

Fixes #52818

PR Close #54380
2024-02-21 15:19:13 -08:00
cexbrayat
efdc50a403 docs: view child static query differences formatting (#54370)
The docs were broken as the first line is the only one to be displayed in the table.

PR Close #54370
2024-02-21 15:18:43 -08:00
Dmitry Ivanitskiy
dba3e0b5aa fix(compiler): adding the inert property to the "SCHEMA" array (#53148)
This change allows template binding "inert" attribute with the following syntax: [inert]="isInert"

Fixes #51879

fixup! fix(compiler): adding the inert property to the "SCHEMA" array

revert: "fixup! fix(compiler): adding the inert property to the "SCHEMA" array"

This reverts commit b637b7ce646e8bab2f585339028a84018e8ea982.

This commit is being reverted because the inert property is safe as a boolean attribute

PR Close #53148
2024-02-21 15:13:48 -08:00
Matthieu Riegler
23119c5397 refactor(platform-browser): use performance API for async animations (#53963)
This commit adds a standard performance marker

PR Close #53963
2024-02-21 15:12:04 -08:00
Andrew Scott
d3b273ac33 fix(router): Clear internal transition when navigation finalizes (#54261)
This commit fixes a small memory issue in the router where a destroyed
component instance would be retained.

fixes #54241

PR Close #54261
2024-02-21 14:09:52 -08:00
Joey Perrott
e9246f745a refactor(docs-infra): correct location of hosted images (#54547)
Properly include hosted images in the generated application

PR Close #54547
2024-02-21 16:52:01 +00:00
Matthieu Riegler
554628e190 docs(docs-infra): Add missing API entries to ADEV (#54530)
* `localize`: `MessageId` & `MessageId`
* `core/global`
*  `upgrade/static` : `downgradeComponent`, `downgradeInjectable`, `getAngularJSGlobal`, `getAngularLib`, `setAngularJSGlobal` & `setAngularLib`

PR Close #54530
2024-02-21 16:41:33 +00:00
Matthieu Riegler
d49558d18d docs: fix brokens links (#54507)
PR Close #54507
2024-02-21 16:05:30 +00:00
Matthieu Riegler
0644072354 docs: fix links in ngModule API guide (#54507)
fixes #54506

PR Close #54507
2024-02-21 16:05:30 +00:00
Joey Perrott
7220c89cef fix(docs-infra): enable font inlining for adev (#54524)
Enable font inlining for adev

PR Close #54524
2024-02-21 16:02:00 +00:00
Joey Perrott
6501d9bbe1 build: update to the latest @angular/docs version (#54528)
Update @angular/docs to latest

PR Close #54528
2024-02-21 16:00:35 +00:00
cexbrayat
36afd8902b docs: typos in signal queries guide (#54540)
PR Close #54540
2024-02-21 15:59:00 +00:00
Matthieu Riegler
dd413ebc3b docs(docs-infra): fix error page. (#54522)
Display the not found page on 404.

fixes #54506

PR Close #54522
2024-02-21 15:58:01 +00:00
Matthieu Riegler
55fd7b3c85 docs(docs-infra): Add missing api entries (#54517)
This commit adds `common/http/testing` and `platform-browser/animations/async`.

PR Close #54517
2024-02-20 09:50:36 -08:00
Kristiyan Kostadinov
219445cda4 fix(common): image placeholder not removed in OnPush component (#54515)
Fixes that the placeholder wasn't being removed when an optimized image is placed in an `OnPush` component.

Fixes #54478.

PR Close #54515
2024-02-20 09:49:58 -08:00
Pawel Kozlowski
69daa37b65 test(core): more tests for queries as signals (#54508)
A couple of tests that illustrate combination of signal
and decorator queries in once component.

PR Close #54508
2024-02-20 09:49:19 -08:00
JoostK
0c8744c73e fix(compiler-cli): use correct symbol name for default imported symbols in defer blocks (#54495)
This commit addresses a problem with PR #53695 that introduced support for default imports,
where the actual dynamic import used in the defer loading function continued to use the
symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the
testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function,
but not the generated dependency loader function.

Fixes #54491

PR Close #54495
2024-02-20 09:45:32 -08:00
Jamie Couperwhite
960fe156ee docs: fix developer preview link in signal queries (#54492)
PR Close #54492
2024-02-20 09:44:42 -08:00
Alex Castle
a14d139a24 docs(common): add new faq entry to NgOptimizedImage docs (#54469)
add new FAQ entry explaining that we're not adding new loaders to the angular repo

PR Close #54469
2024-02-20 09:43:46 -08:00
Andrew Scott
a9741e69d2 docs(router): deprecate RouterTestingModule (#54466)
Deprecate `RouterTestingModule` as it is no longer needed or useful and
is not actively maintained.

fixes #54461

PR Close #54466
2024-02-20 09:33:16 -08:00
Ahmed Hakeem
fcfef52cb2 docs: enhance Dependency injection description (#54464)
PR Close #54464
2024-02-20 09:29:53 -08:00
Matthieu Riegler
70345b1292 docs: override piscina dependency for webcontainers projects in adev (#54494)
PR Close #54494
2024-02-20 09:21:04 -08:00
Pawel Kozlowski
d9a1a7dd07 fix(core): properly execute content queries for root components (#54457)
Prior to this fix an incorrect view instance (a dynamically created component
one instead of the root view) was passed to the content query function. Having
incorrect view instance meant that a component instance could not be found.

This is a pre-existing bug, introduction of signal-based queries just surfaced it.

Fixes #54450

PR Close #54457
2024-02-15 12:21:29 -08:00
Joey Perrott
62be6802d3 build: no longer include the unnecessary --config=aio_local_deps flag (#54465)
With the correction of how local build linker interaction works the `aio_local_deps` flag is
no longer needed.

PR Close #54465
2024-02-15 12:20:40 -08:00