29384 Commits

Author SHA1 Message Date
AleksanderBodurri 6aef0f6fc8 fix(core): handle non-container environment injector cases (#52774)
Previously we had logic for a special case where a root injector in standalone apps would skip the import paths calculation step for the `getEnvironmentInjectorProviders` function.

This commit intends to fix this for two other cases, namely:
- When an injector is created by a route (via the `providers` field and lazy loading).
- When an injector is manually created and attached to the injector tree

It does this by assuming that any environment injector it cannot find a provider imports container for was created without one, and simply returns the raw provider records without the import paths calculation.

PR Close #52774
2023-11-13 16:21:03 +00:00
Sylvain DEDIEU f51ce68bf5 docs: update readme links to target angular.dev documentation (#52772)
Change the angular.io links to target the new angular.dev website
Changed the angular logo

PR Close #52772
2023-11-13 15:56:19 +00:00
Sam Edwards 181e4f31ea docs: correct component name on Managing Dynamic Data on angular.dev website (#52792)
PR Close #52792
2023-11-13 15:55:51 +00:00
Jessica Janiuk da97bbc762 fix(migrations): passed in paths will be respected in nx workspaces (#52796)
This fixes a bug where if you have multiple tsconfig files, the migration would not find anything to migrate at the passed in path.
fixes: #52787

PR Close #52796
2023-11-13 15:21:36 +00:00
Jessica Janiuk 17adf0f917 fix(migrations): Add support for removing imports post migration (#52763)
This update removes imports from component decorators and at the top of the files. It only removes standalone imports though. It does not remove CommonModule if that is the only import.

PR Close #52763
2023-11-13 15:21:06 +00:00
AleksanderBodurri 3cf18bb6f2 fix(devtools): check for all new DI debug APIs before trying to determine resolution path providers (#52791)
Previously, some versions of Angular 16.1.x that had 3/4 of the new DI debug APIs would enter a code path that required them to have access to the 4th.

Now DevTools checks for the existence of all 4 explicitly before going down this code path.

PR Close #52791
2023-11-10 18:37:05 +00:00
Miles Malerba 70fe5e60b3 refactor(compiler): Handle trailing spaces in ICU placeholders (#52698)
In some cases ICU expression placeholders may have trailing spaces that
need to be trimmed when matching the placeholder to its corresponding
text binding.

PR Close #52698
2023-11-10 17:01:07 +00:00
Miles Malerba 2c3b6c6e27 refactor(compiler): Fix some issues with i18n expressions in ICUs (#52698)
We were previously counting the i18n expression index and deciding when
to apply i18n expressions based on the i18n context. These should be
done based on the i18n block instead.

PR Close #52698
2023-11-10 17:01:07 +00:00
Miles Malerba 0864dbe571 refactor(compiler): Change how ICUs are ingested (#52698)
The previous commit added support for interpolated text in ICUs, but it
made the assumption that the interpolation would be a single variable
read expression.

To properly support all kinds of interpolation expressions, this commit
refactors how ICUs are ingested to allow us to re-use the same logic we
use for bound text outside of ICUs.

To accomplish this, the `IcuOp` creation op has been removed in favor of
a pair of ops: `IcuStartOp` and `IcuEndOp`, that mark the beginning and
end of the ICU. Now, instead of inserting an `IcuUpdateOp` in the update
IR, we call `ingestBoundText` and use the presence of the surrounding
`IcuStartOp` and `IcuEndOp` to match the interpolation with the ICU.

PR Close #52698
2023-11-10 17:01:07 +00:00
Miles Malerba 3a0ac32dcb refactor(compiler): Support expressions inside ICUs (#52698)
Previously ICUs were assumed to only generate a single i18n expression
per ICU. However, it is possible for ICUs to contain text interpolations
which requires additional expressions. This commit adds support for
multiple expressions per ICU.

PR Close #52698
2023-11-10 17:01:06 +00:00
Miles Malerba ef6999f2f6 refactor(compiler): Support element tags inside ICUs (#52698)
ICUs that contain element tags need extra parameters for the i18n
message. These are in addition to the element slot params that are
already added to the parent i18n block's params. In this commit we add a
new phase to fill in these placeholders.

PR Close #52698
2023-11-10 17:01:06 +00:00
Miles Malerba 50a06fa451 refactor(compiler): More consistent sorting of i18n params (#52698)
Previously the template pipeline sorted i18n message params before
adding the sub-message placeholders. Now its sorts after all
placeholders are added.

Both the template pipeline and TemplateDefinitionBuilder previously
failed to sort the post-processing params. They both now sort these as
well. This is safe to change in TemplateDefinitionBuilder, as it does
not change anything about the functionality, it simply ensures that
params map in the output has the keys ordered in a way that can be
easily reproduced in the template pipeline.

PR Close #52698
2023-11-10 17:01:06 +00:00
Doug Parker 5ee935e7fe release: bump DevTools version to 1.0.8 (#52759)
PR Close #52759
2023-11-10 17:00:20 +00:00
Kristiyan Kostadinov 94096c6ede feat(core): support TypeScript 5.3 (#52572)
Updates the repo to support TypeScript 5.3 and resolve any issues. Fixes include:
* Updating usages of TS compiler APIs to match their new signatures.
* In TS 5.3 negative numbers are represented as `PrefixUnaryExpression` instead of `NumericExpression`. These changes update all usages to account for it since passing a negative number into the old APIs results in a runtime error.

PR Close #52572
2023-11-09 22:56:41 +00:00
Jessica Janiuk beb18fb01c refactor(migrations): code clean up and add comments on exported functions (#52755)
This cleans up a bit of code to make maintenance easier. It also adds comments for all the exported methods so they are clear to anyone in the future.

PR Close #52755
2023-11-09 22:55:50 +00:00
Jessica Janiuk f84cce09df docs: release notes for the v17.0.2 release 2023-11-09 12:26:27 -08:00
Pawel Kozlowski 6c8776ff71 fix(core): limit rate of markers invocations (#52742)
This PR assures that the performance markers are invoked
only once for a given feature.

Closes #52524

PR Close #52742
2023-11-09 19:58:26 +00:00
Sasidharan SD 154f286d55 docs: add extended diagnostic NG8109 (#52721)
PR Close #52721
2023-11-09 19:39:24 +00:00
Mikita Himpel 71a4d6aaef docs: fix programmatic-rendering example component name (#52731)
PR Close #52731
2023-11-09 19:38:18 +00:00
Nelson Gutierrez c5e4424810 docs: add missing backtick on title (#52711)
PR Close #52711
2023-11-09 19:32:24 +00:00
Patrick Hyatt cb5c6fc530 docs: correct typescript type inference link (#52714)
PR Close #52714
2023-11-09 19:30:39 +00:00
Balaji 5935f91cf7 docs: updating incorrect link in Class Binding page (#52715)
PR Close #52715
2023-11-09 19:28:06 +00:00
Mikhail Filin 867161f204 docs: remove broken link pill in dynamic component page (#52744)
PR Close #52744
2023-11-09 19:18:29 +00:00
Jeevan Mahesha f2127368ba docs: removed the broken link (#52743)
PR Close #52743
2023-11-09 19:06:13 +00:00
Tom Wilkinson 029edea32a refactor(common): Update packages/common/src/navigation/platform_navigation.ts (#52363)
Co-authored-by: Andrew Scott <atscott01@gmail.com>

PR Close #52363
2023-11-09 18:01:33 +00:00
Thomas Wilkinson 27f5eed017 refactor(common): Add fake implementation of PlatformNavigation. (#52363)
This implementation does most, but not all, of the things the native
Navigation API does. Also adds a spec that tests all the currently
supported behaviors.

PR Close #52363
2023-11-09 18:01:33 +00:00
Thomas Wilkinson 77770c6d5b refactor(common): Add a new platform_navigation that provides the Navigation API. (#52363)
This allows using the Navigation API in Angular packages like Router.

PR Close #52363
2023-11-09 18:01:33 +00:00
Andrew Kushnir 55d2c427c2 refactor(core): delay applying component metadata until it's needed in tests (#52708)
When a component contains `@defer` blocks, Angular compiler generates the code to apply component metadata (from the `@Component` decorator) after resolving all dynamic dependencies. Currently, this function is invoked eagerly at runtime, which causes dynamic imports to be kicked off earlier than expected. With the change in this commit, Angular will start resolving async metadata when it becomes necessary during testing.

PR Close #52708
2023-11-09 16:58:06 +00:00
Vadim Makeev 8c8ff63376 docs: make homepade example accessible (#52578)
PR Close #52578
2023-11-09 15:58:10 +00:00
Kristiyan Kostadinov 645447daff fix(compiler-cli): incorrect inferred type of for loop implicit variables (#52732)
Fixes that all implicit variables in `@for` loops were inferred to be numbers, even though most are actually boolean.

Note that I also had to work around a weird TypeScript behavior in `tsDeclareVariable` where usually we declare variables in the following format:

```
var _t1: <type> = null!;
```

This works in most cases, but if the type is a `boolean`, TypeScript infers the variable as `never`, instead of `boolean`. I've worked around it by adding an `as boolean` to the initializer.

Fixes #52730.

PR Close #52732
2023-11-09 15:47:56 +00:00
cexbrayat 8a87e62e19 fix(compiler-cli): add interpolatedSignalNotInvoked to diagnostics (#52687)
This template diagnostic has been introduced in 8eef694def but was not enabled,
as it was not added to `ALL_DIAGNOSTIC_FACTORIES`.

PR Close #52687
2023-11-09 15:46:16 +00:00
Pawel Kozlowski ea8c9b61d2 fix(core): properly update collection with repeated keys in @for (#52697)
This change fixes a bug in the new list reconcilation algorithm
that could lead to an infinite loop in certain situations.

More specifically, it adjusts the internal MultiMap implementation
such that an entry returned from the .get call is the same entry
(for an identical key) removed by the .delete call.

The existing logic of the MultiMap was leading to a situation where
one view was requested and attached to LContainer, but a very different
view was removed from the MultiMap. This was leaving an attached LView
in a collection that was supposed to hold only detached views.

Closes #52524

PR Close #52697
2023-11-09 15:44:53 +00:00
cexbrayat cc68b0e9f5 fix(core): error code in image performance warning (#52727)
The warnings link to https://angular.io/errors/NG2965 which is a 404
The proper error page is https://angular.io/errors/NG0913

PR Close #52727
2023-11-09 15:44:24 +00:00
Sylvain DEDIEU b1cc0923a0 docs(docs-infra): improve decorator deprecated property display in documentation (#52041)
Add the deprecated-api-item class on decorator-overview option code if deprecated. Add deprecated label on decorator-overview short description if deprecated. Add Add deprecated label on decorator option table header if option is deprecated.

PR Close #52041
2023-11-09 15:36:32 +00:00
Andrew Scott 1d3d33ffd0 docs: fix broken http link (#52541)
fixes #52542

PR Close #52541
2023-11-09 15:35:59 +00:00
Andrew Scott ab99171de5 docs: fix broken DI link on roadmap (#52541)
fixes #52539

PR Close #52541
2023-11-09 15:35:59 +00:00
Sam Verschueren 56b96f6f19 docs: fix LCP element link (#52580)
PR Close #52580
2023-11-09 15:34:07 +00:00
Sasidharan SD 68f89b00a5 docs: fix angular compatability version (#52585)
PR Close #52585
2023-11-09 15:33:37 +00:00
Sasidharan SD 3d98a44db5 docs: fix incorrect tag reference (#52586)
PR Close #52586
2023-11-09 15:01:02 +00:00
Sasidharan SD 9dff1fe891 docs: fix repetetive text (#52587)
PR Close #52587
2023-11-09 15:00:27 +00:00
Sasidharan SD 2ee1b5cddf docs: fix cli command redirection (#52589)
PR Close #52589
2023-11-09 14:59:55 +00:00
Sasidharan SD 3153892342 docs: fix prefetching typo issue (#52590)
PR Close #52590
2023-11-09 14:58:59 +00:00
Sasidharan SD 0ffa228165 docs: add missing backtick (#52607)
PR Close #52607
2023-11-09 14:57:59 +00:00
Ryth-cs 01f9b57f6a docs: correct reactive-forms typo (#52608)
PR Close #52608
2023-11-09 14:57:28 +00:00
Raghav Kanwal b25153abb3 docs: update typo in Guide/Testing (#52619)
PR Close #52619
2023-11-09 14:56:36 +00:00
technbuzz fc8f521fc2 docs: fix typo in component output guide (#52673)
We should use @Output rathar than @Input decorator for output events.
This comments fixes the typo by replacing Input with Output

PR Close #52673
2023-11-09 14:56:02 +00:00
Marianna Maglio 8fee560ca7 docs: fix typos in tutorials/learn-angular (#52677)
PR Close #52677
2023-11-09 14:55:32 +00:00
Sasidharan SD 4526335157 docs: fix developer preview link (#52693)
PR Close #52693
2023-11-09 14:54:55 +00:00
Jessica Janiuk 9cac4eea5b docs: release notes for the v17.0.1 release 2023-11-08 12:42:48 -08:00
Matthieu Riegler 291ba38623 fix(http): Don't override the backend when using the InMemoryWebAPI (#52425)
When using `withFetch`,  the `PRIMARY_HTTP_BACKEND` token is set.

The InMemory Backend services will also set that token.

This means that providers order will matter and the latest on the list will be the one instantiated

PR Close #52425
2023-11-08 18:42:20 +00:00