Commit graph

26205 commits

Author SHA1 Message Date
cexbrayat
a28cf2438b docs(router): fix error handler deprecation (#49015)
The deprecation mentions `withErrorHandler` whereas the feature is called `withNavigationErrorHandler` since 15eccef4eb.

PR Close #49015
2023-02-10 08:41:55 +01:00
Paul Gschwendtner
865e67fcb4 build: remove unused webdriver-manager code (#49009)
We no longer need webdriver-manager as everything is tested
using Bazel with the Bazel-managed browsers and chrome/gecko drivers.

The drivers and browser binaries are managed as part of dev-infra's
shared browser/driver configuration in `bazel/browsers`.

PR Close #49009
2023-02-10 08:25:58 +01:00
Kristiyan Kostadinov
4ac25b2aff perf(migrations): avoid re-traversing nodes when resolving bootstrap call dependencies (#49010)
Fixes that the migration was unnecessarily traversing top-level nodes. This was a large performance bottle-neck, because it involves a lot of language service lookups.

PR Close #49010
2023-02-09 15:37:18 +01:00
Kristiyan Kostadinov
521ccfbe6c fix(migrations): avoid interrupting the migration if language service lookup fails (#49010)
In some internal migrations the language service was throwing for some file reads which was crashing the migration. These changes add a `try/catch` to avoid interrupting it.

PR Close #49010
2023-02-09 15:37:18 +01:00
Kristiyan Kostadinov
26cb7ab2e6 perf(migrations): speed up language service lookups (#49010)
For the module pruning and bootstrap API migration steps we depend heavily upon the TypeScript `LanguageService` which ends up being slow on a large project. E.g. in some large internal projects single-file lookups were taking around 30s.

These changes introduce a wrapper around the `LanguageService` that we can use to trick it into not traversing the entire project every time.

PR Close #49010
2023-02-09 15:37:18 +01:00
Pawel Kozlowski
642cc1c349 release: cut the v15.2.0-next.4 release 2023-02-08 19:26:45 +01:00
Pawel Kozlowski
47387d495e docs: release notes for the v15.1.4 release 2023-02-08 19:20:03 +01:00
Kristiyan Kostadinov
bdbf21d04b fix(migrations): avoid generating imports with forward slashes (#48993)
We're using Node's `path` utilities to remap existing imports and create new ones which can yield paths with forward slash separators.

These changes add some logic to ensure that we only generate forward slashes.

PR Close #48993
2023-02-08 15:19:59 +01:00
Kristiyan Kostadinov
c7926b5773 fix(migrations): move standalone migrations into imports (#48987)
Normally having a standalone declaration in the `imports` array is an error and something we handle in the conversion to standalone, but tests can end up in this situation, because apps may have separate tsconfigs for the main app and for tests.

These changes make it so that we move any incorrectly-defined standalone declarations, even if they aren't part of the current migration.

PR Close #48987
2023-02-08 15:18:06 +01:00
Kristiyan Kostadinov
ffad1b49d9 fix(migrations): reduce number of files that need to be checked (#48987)
Attempts to speed up the standalone migration by:
1. Not analyzing typechecker files.
2. Telling TS not to check libraries.

PR Close #48987
2023-02-08 15:18:05 +01:00
Kristiyan Kostadinov
e9e4449a43 fix(migrations): preserve tsconfig in standalone migration (#48987)
For the standalone migration we need to pass a couple of compiler flags which accidentally also overwrote the project's compiler options. These changes extend the options instead.

PR Close #48987
2023-02-08 15:18:05 +01:00
Kristiyan Kostadinov
1afa6ed322 fix(migrations): don't add ModuleWithProviders to standalone test components (#48987)
Fixes that we were copying all expressions in the `imports` array of the test to the `imports` of the component, including any potential `ModuleWithProviders`.

Fixes #48971.

PR Close #48987
2023-02-08 15:18:05 +01:00
Kristiyan Kostadinov
770191cf1f fix(migrations): migrate tests when switching to standalone bootstrap API (#48987)
The first step of the migration updates the tests of the component being migrated, however it also skips any bootstraped declarations. We get back to the these declarations when converting to the standalone bootstrapping APIs, but we weren't updating their tests.

These changes rework some of the logic so that we migrate any remaining tests as a part of the final step.

Relates to #48944.

PR Close #48987
2023-02-08 15:18:05 +01:00
Kristiyan Kostadinov
6377487b1a fix(migrations): only exclude bootstrapped declarations from initial standalone migration (#48987)
Currently the standalone migration is set up to skip any modules that have a `bootstrap` array with at least one element. This ends up being misleading for small apps who have everything in the root module.

These changes add some logic to only skip the root component.

Fixes #48944.

PR Close #48987
2023-02-08 15:18:05 +01:00
Angular Robot
845ef7102b build: update github/codeql-action action to v2.2.2 (#48889)
See associated pull request for more information.

PR Close #48889
2023-02-08 15:07:06 +01:00
Andrew Scott
5128ba036a refactor(router): Warn if a navigation will change in the upcoming v16 release (#48688)
v16 will have a breaking change to the way `UrlTree`s are constructed.
This change is actually a bug fix that makes `UrlTree` creation correct
in more scenarios (see #48508). However, this can affect applications that are
relying on the current incorrect behavior. This commit adds a dev mode
warning when the target of a navigation will change once #48508 is
submitted.

PR Close #48688
2023-02-07 12:25:59 -08:00
Angular Robot
4b8b5e3f3c build: update eslint dependencies to v5.51.0 (#48983)
See associated pull request for more information.

PR Close #48983
2023-02-07 11:49:02 -08:00
Kristiyan Kostadinov
0cf11167f1 fix(compiler-cli): incorrectly detecting forward refs when symbol already exists in file (#48988)
In #48898 the `isForwardRef` flag was added to indicate whether a reference should be wrapped in a `forwardRef`. This logic assumed that the node can't be referring to another node within the same file, however from testing it looks like that's not actually the case, because we hit the same code path when an external import to the same symbol exists already.

PR Close #48988
2023-02-07 09:00:46 -08:00
Kian Yang Lee
57d0c03e17 docs: Fixing typo error (#48891)
PR Close #48891
2023-02-06 12:38:26 -08:00
Matthieu Riegler
431ec6c8be refactor(forms): removing a workaround comment (#48904)
The code is clearer without the reduce, let's just remove the comment.

PR Close #48904
2023-02-06 12:37:48 -08:00
Matthieu Riegler
c4e5840725 refactor(docs-infra): Enable @typescript-eslint/quotes rule for aio content (#48952)
The commit enables the @typescript-eslint/quotes rule which mendates single quotes over doubles and allows template literals with backticks.

PR Close #48952
2023-02-06 12:33:23 -08:00
Walid Bouguima
73394126b6 docs(core): standalone-migration schematics typos fix and properties addition (#48961)
Fixed a typo and updated the hyphenation in a couple of words to keep consistency across schematics docs style. Assuming beginners reading docs, I also added the property called 

public showGreeting = true;

This is because it is available in the examples `.HTML` `*ngIf` directive snippets without being present in the `.ts` class properties declarations.  also this removes potential inference that this absence is a result of the standalone migration schematics work.
PR Close #48961
2023-02-06 12:32:57 -08:00
Jessica Janiuk
67422f5d71 fix(dev-infra): Fix code ownership for animations package (#48975)
An incorrect username was added to the reviewers list for animations.

PR Close #48975
2023-02-06 12:32:32 -08:00
Simona Cotin
5a886c0308 docs(extended-diagnostics): fix code example (#48963)
Update code examples to use < and &gt for html elements
PR Close #48963
2023-02-06 12:31:33 -08:00
Kristiyan Kostadinov
a47721c2f1 refactor(migrations): add API to remap generated import names (#48974)
Internally we'll need to remap some imports to generate better import statements. These changes add an API that we can use to do the remapping.

PR Close #48974
2023-02-06 12:28:38 -08:00
Kristiyan Kostadinov
4f6127aa34 refactor(migrations): account for internal module names in module reference check (#48974)
Fixes that the code which checks if something is a reference to a specific class didn't work internally.

PR Close #48974
2023-02-06 12:28:38 -08:00
Kristiyan Kostadinov
32cf4e5cb9 fix(migrations): avoid internal modules when generating imports (#48958)
Adds some logic to prefer non-Angular-internal modules when generating imports. This allows us to generate better code for some cases like the `ɵInternalFormsSharedModule` in Forms.

Also adds some logic to prefer symbols that are already in the same file.

Fixes #48942.

PR Close #48958
2023-02-06 12:27:52 -08:00
Kristiyan Kostadinov
49a7c9f94a fix(migrations): standalone migration incorrectly throwing path error for multi app projects (#48958)
Fixes that the standalone migration was throwing the "Could not find any paths to migrate..." error on a per-tsconfig-basis, preventing the migration from running on any configs that might occur further down in the project.

These changes move the error to after all the configs have been checked.

PR Close #48958
2023-02-06 12:27:52 -08:00
Alex Castle
54b24eb40f feat(common): Add loaderParams attribute to NgOptimizedImage (#48907)
Add a new loaderParams attribute, which can be used to send arbitrary data to a custom loader, allowing for greater control of image CDN features.

PR Close #48907
2023-02-06 10:10:44 -08:00
Kristiyan Kostadinov
759db12e0b fix(migrations): duplicated comments on migrated classes (#48966)
Fixes that the migration was duplicating the comments on class nodes that were being converted to standalone.

Fixes #48943.

PR Close #48966
2023-02-06 09:52:18 -08:00
Kristiyan Kostadinov
2de6dae16d fix(migrations): migrate RouterModule.forRoot with a config object to use features (#48935)
Previously if the standalone migration saw a `RouterModule.forRoot` with a config object, it wouldn't migrate it. These changes add some logic that convert the config object to a set of features from the new router API.

PR Close #48935
2023-02-03 11:40:45 -08:00
Matthieu Riegler
2ceff3f0c2 refactor(core): remove IE11 only sanitization code (#48438)
As IE11 support has been drop with v13, this specific code isn't needed anymore.

PR Close #48438
2023-02-03 09:45:03 -08:00
Kristiyan Kostadinov
ba38178d19 fix(migrations): generate forwardRef for same file imports (#48898)
Adds some logic that will generate a `forwardRef` if necessary when adding imports.

PR Close #48898
2023-02-02 13:40:17 -08:00
Kristiyan Kostadinov
d0145033bd fix(language-service): generate forwardRef for same file imports (#48898)
Adds some logic that will generate a `forwardRef` if necessary when automatically fixing an import.

PR Close #48898
2023-02-02 13:40:17 -08:00
Kristiyan Kostadinov
59c0106654 refactor(compiler): indicate whether potential import is forward reference (#48898)
In the `PotentialImport` we indicate if it's in the same file by not setting a `moduleSpecifier`, but if that's the case, the imported symbol might need to be wrapped in a `forwardRef` to avoid generating an error. These changes expose this information so the various tools can take advantage of it.

PR Close #48898
2023-02-02 13:40:17 -08:00
Redouane Bekkouche
3a9bbada5d docs: making footer copyright year dynamic (#48811)
PR Close #48811
2023-02-02 13:39:53 -08:00
Andrew Scott
f5a7e02529 docs(router): Update functional guard and resolver docs (#48873)
This commit updates the docs of the functional guards and resolvers to improve the migration
experience when moving away from class-based equivalents.

PR Close #48873
2023-02-02 13:39:32 -08:00
Matthieu Riegler
c2bcf0b475 refactor(compiler): Remove strictStyling option for ShadowCss (#48824)
`strictStyling` was an option provided by Polymer but it's not needed by Angular. This commit removes the dead code and updates related comments.

PR Close #48824
2023-02-02 13:38:38 -08:00
Dylan Hunn
617a01073d docs: release notes for the v15.1.3 release 2023-02-02 13:37:52 -08:00
Dylan Hunn
3cce18e434 release: cut the v15.2.0-next.3 release 2023-02-02 13:24:18 -08:00
Dylan Hunn
65329a93f4 Revert "build: pin dependency aspect_bazel_lib to de8d9ca (#48887)" (#48928)
This reverts commit b0a5b3873a.

PR Close #48928
2023-02-02 10:56:30 -08:00
Payam Valadkhan
9250afbffd refactor(compiler-cli): Export the interface PluginCompilerHost for 1p use. (#48874)
Some 1p module which uses the method TscPlugin.wrapHost requires to import this type to make its internal class definitions compatible with this type.

PR Close #48874
2023-02-02 09:44:18 -08:00
Matthieu Riegler
16ef770db8 fix(router): Handle routerLink directive on svg anchors. (#48857)
On svgs, the tagNames are lowercase even for non-svg related tags like `a`.

fixes #48854

PR Close #48857
2023-02-02 09:38:06 -08:00
Angular Robot
6e0e94def4 build: update cross-repo angular dependencies (#48875)
See associated pull request for more information.

PR Close #48875
2023-02-02 09:37:39 -08:00
Angular Robot
fc6d898867 build: update dependency madge to v6 (#48877)
See associated pull request for more information.

PR Close #48877
2023-02-02 09:37:13 -08:00
Matthieu Riegler
7030fb8531 docs: display the exact command to generate a browserslist config (#48879)
`ng generate config browserslist` is the command to generate the browerslist

fixes #48878
PR Close #48879
2023-02-02 09:36:47 -08:00
Kristiyan Kostadinov
8389557848 fix(migrations): don't copy unmigrated declarations into imports array (#48882)
Currently the migration is set up to assume that any elements that exist in a `declarations` array will be converted to standalone and copied into the `imports` array, however that might be incorrect for some special cases like the root component.

These changes rework the declaration merging logic so that they take all the declarations being migrated into account.

PR Close #48882
2023-02-02 09:35:57 -08:00
Angular Robot
827380033b build: update actions/cache digest to 627f0f4 (#48884)
See associated pull request for more information.

PR Close #48884
2023-02-02 09:33:20 -08:00
Angular Robot
b0a5b3873a build: pin dependency aspect_bazel_lib to de8d9ca (#48887)
See associated pull request for more information.

PR Close #48887
2023-02-02 09:32:50 -08:00
Angular Robot
7f8d1b5f1d build: update eslint dependencies to v5.50.0 (#48892)
See associated pull request for more information.

PR Close #48892
2023-02-02 09:32:22 -08:00