Commit graph

26172 commits

Author SHA1 Message Date
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
Angular Robot
2edb82241e build: update io_bazel_rules_sass digest to 901d22c (#48897)
See associated pull request for more information.

PR Close #48897
2023-02-02 09:31:42 -08:00
Kristiyan Kostadinov
584976e6c8 fix(migrations): support --defaults in standalone migration (#48921)
Fixes that running the standalone migration with `--defaults` was throwing an error, because all the properties were specified as required. We don't need to set them as required, because they have default values.

Fixes #48845.

PR Close #48921
2023-02-02 09:31:09 -08:00
Kristiyan Kostadinov
a40cd47aa7 fix(migrations): avoid modifying testing modules without declarations (#48921)
Fixes that we were changing the testing modules that have no `declarations` unnecessarily, resulting in more formatting changes that users would have to clean up.

PR Close #48921
2023-02-02 09:31:09 -08:00
Matthieu Riegler
8a9907c23a refactor(common): Remove currency pipe depreciation notice about the default currency (#48872)
Currency pipe won't be using the LOCALE_ID to determine the default currency.

fixes #47612

PR Close #48872
2023-02-02 09:30:04 -08:00
Besim Gürbüz
5c5d36547b docs: fix indentation error in content/guide/build.md (#48893)
PR Close #48893
2023-02-02 09:29:16 -08:00
Matthieu Riegler
33b9cb8693 refactor: remove todos on forms tests (#48894)
Removing the todos implied using fakeAsync and passing an async validator as async (3rd parameter).

PR Close #48894
2023-02-02 09:28:39 -08:00
Matthieu Riegler
6edf35c8d6 refactor(forms): remove deprecated uses from the unit tests (#48894)
Jasmine has deprecated the `expectationFailOutput` argument and replaced it by the `withContext()` method

Also removing all references to #24571 from the forms unit tests as the non null assertions are fine in the context.

PR Close #48894
2023-02-02 09:28:39 -08:00
Alan Agius
2fc5b70fce fix(platform-server): insert transfer state script before other script tags (#48868)
Previously, the state `script` was always appended as the last item in the `body` tag. This can result in the state not being available when the Angular application is bootstrap.
A workaround for this was to delay the bootstrapping of the application until by using the `DOMContentLoaded` event listener.

```ts
const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);

document.addEventListener('DOMContentLoaded', bootstrap);
```

With this change the above workaround is no longer necessary as the state `script` tag is now added prior of any other `script` which guarantees that the state is present prior of the Angular application is bootstrapped.

PR Close #48868
2023-01-30 16:54:07 -08:00
Kristiyan Kostadinov
03f47ac901 fix(migrations): use consistent quotes in generated imports (#48876)
Adds some logic so that the imports generated by the `ImportManager` use the same styles as the other imports.

PR Close #48876
2023-01-30 16:52:23 -08:00
Brecht Billiet
d3a14d94a1 docs(docs-infra): update strongbrew resource to new website (#48340)
StrongBrew has stopped a few years back.
We are taking over at https://simplified.courses where we have an Angular blog, do on-site training and create content.

PR Close #48340
2023-01-27 17:07:19 +00:00
Kristiyan Kostadinov
f82bdc4b01 fix(migrations): don't delete classes that may provide dependencies transitively (#48866)
Fixes that we would incorrectly remove a module that imports another module which has providers. This is a follow-up from the following discussion: https://github.com/angular/angular/pull/48832#discussion_r1086623514

PR Close #48866
2023-01-27 16:55:20 +00:00
Kristiyan Kostadinov
c865b8b59c docs(migrations): follow-up readme fixes (#48866)
Addresses a couple of notes from #48848 that came in after the PR was merged.

PR Close #48866
2023-01-27 16:55:20 +00:00
Santosh Yadav
869c9ac1a9 docs: add angular getting started course (#48619)
PR Close #48619
2023-01-27 16:51:06 +00:00
Santosh Yadav
c2dc51af45 docs: add this is angular to Community Curations (#48618)
PR Close #48618
2023-01-27 16:23:53 +00:00
Walid Bouguima
8d3e246dda docs: update Reactive Forms' FormControl usage description (#48858)
It seems that the description of the `FormControl` usage is  incorrect or at least the copy is not very helpful for beginners and can be very confusing as we do not have a command to generate a `FormControl`, as far as I know  😄.  Additionally, the link for component generation points to the CLI page instead of the component generation section on the CLI page. It would be DX/UX for readers and users to get where the link's text is supposed to take them.
PR Close #48858
2023-01-27 16:22:11 +00:00
Onkar Ruikar
2352f8dca3 docs(docs-infra): in navigation put prerequisites page 'guide/property-binding' before 'guide/attribute-binding' (#48766)
Pages 'https://angular.io/guide/attribute-binding' and 'https://angular.io/guide/class-binding' have prerequisite of 'https://angular.io/guide/property-binding' but in navigation the property binding page comes much later.
The change puts the binding pages in prerequisite order.
PR Close #48766
2023-01-27 16:21:28 +00:00
Dario Piotrowicz
b4187548ca fix(animations): fix non-animatable warnings for easing (#48583)
the easing "prop" used to specify the easing function to
apply to animations isn't a valid css property, it is thus
considered not animatable but different values for such
property shouldn't cause non-animatable warnings

resolves #48571

PR Close #48583
2023-01-26 22:03:07 +00:00
Matthieu Riegler
33a636aaaf docs: fix crisis-center / crisis-list route parameter (#48853)
The params is in the child component, let's reflect that in the code.

fixes #36970

PR Close #48853
2023-01-26 22:01:42 +00:00
Angular Robot
e7a4fd3426 build: update cross-repo angular dependencies (#48843)
See associated pull request for more information.

PR Close #48843
2023-01-26 22:00:41 +00:00
Kristiyan Kostadinov
ed8f70125e docs(core): add readme for standalone migration (#48848)
Updates the readme for the standalone migration to describe the process and the different transformations that are happening.

PR Close #48848
2023-01-26 17:02:50 +00:00
Kristiyan Kostadinov
345e737daa feat(core): add ng generate schematic to convert to standalone bootstrapping APIs (#48848)
Adds a new mode to the `@angular/core:standalone` schematic that allows users to switch from `bootstrapModule` to `bootstrapApplication`, as well as `provideRouter`, `provideAnimations` and `provideNoopAnimations`.

PR Close #48848
2023-01-26 17:02:50 +00:00
Kristiyan Kostadinov
04e0ac3d7c fix(migrations): migration host incorrectly reading empty files (#48849)
Fixes that the migration host was doing a basic falsy check if the content was read correctly which meant that a component with an empty template would be considered as having a missing template file.

Fixes #48846.

PR Close #48849
2023-01-26 15:54:14 +00:00
Alan Agius
65c74ed93e fix(migrations): normalize paths to posix (#48850)
Both TypeScript and Angular Schematic rely on posix system paths which can cause issues on Windows if paths are not normalized correctly.

Such as `sourceFile.fileName.startsWith(pathToMigrate)` on Windows will always return falsey.

PR Close #48850
2023-01-26 15:53:48 +00:00
Alan Agius
2796230e95 fix(migrations): add enum in mode option in standalone schema (#48851)
Currently the `mode` is validated during schematic execution. While this cover a case of incorrect value this caused other parts were the correct values cannot be determined.

Options in schemas are used for a number of reasons during runtime.

- These are used to build auto complete
- Validation of inputs prior of the schematic is built with meaningful errors such as suggested inputs.
- Generation of help output.

Eventually these should also be used to generate DTS. This is already done in the CLI to avoid having to write Types manually.

PR Close #48851
2023-01-26 15:52:48 +00:00
Andrew Scott
dedac8d3f7 feat(router): Add test helper for trigger navigations in tests (#48552)
In order to test components and services which depend on router navigations, such as `ActivatedRoute` instances, tests currently need to provide a fair bit of boilerplate _or_ they can set up a stub for `ActivatedRoute` and list it in the `providers` to override it in `TestBed`. This approach of stubbing the `ActivatedRoute` creates a situation that can easily cause the test to break. The stub often only mocks out the dependencies that the component/service _currently_ needs. This dependencies might change over time and break the test in an unexpected way. In addition, it is difficult to get the structure of `ActivatedRoute` exactly correct.

This change will allow unit tests to quickly set up routes, trigger real navigations in the Router, and get instances of component's to test along with real instances of `ActivatedRoute`. This all comes without needing to know that the component depends on `ActivatedRoute` at all. This becomes more important when considering that a component may be refactored in the future to use `@Input` rather than access data on the `ActivatedRoute` instance (see #18967). Tests which mock out `ActivatedRoute` would all break, but those which use `navigateForTest` would continue to work without needing any updates.

resolves #15779
resolves #48608

PR Close #48552
2023-01-25 19:31:38 +00:00
Andrew Scott
930020c578 refactor(router): Move afterNextNavigation helper function to a reusable location (#48552)
There may be use-cases in the future where `afterNextNavigation` is used
in other locations. For example, a test helper function which navigates
should likely wait for all redirects to complete rather than simply
waiting for the promise returned from `navigate` to resolve.

PR Close #48552
2023-01-25 19:31:38 +00:00
Iván Navarro
a055196c55 fix(common): warn if using ngSrcset without a configured image loader (#48804)
Warn the user in the console in case the `ngSrcset` is present and no
loader is configured. In this case, the default loader is used and
it ignores this attribute.

PR Close #48804
2023-01-25 19:27:00 +00:00
Matthieu Riegler
5915c7236e refactor(upgrade): rewrite the downgrade component adapter (#48715)
To remove the non-null assertions linked to #24571, DowngradeComponentAdapter has been refactored and the public methods have been simplifed.

PR Close #48715
2023-01-25 18:32:05 +00:00
Matthieu Riegler
67c9d5250c refactor(upgrade): code cleaning on upgrade module (#48715)
This commit removes unused code, non-null assertions linked to #24571 and improves readability

PR Close #48715
2023-01-25 18:32:05 +00:00
Matthieu Riegler
223912028e refactor(upgrade): code cleaning on tests (#48715)
This commit removes the null assertions linked to #24571

PR Close #48715
2023-01-25 18:32:05 +00:00
Kristiyan Kostadinov
06e161f2dd fix(compiler): incorrect code when non-null assertion is used after a safe access (#48801)
Fixes that the expression converter was producing code that throws a runtime error if a non-null assertion is used as a part of a safe read, write or call.

Fixes #48742.

PR Close #48801
2023-01-25 18:31:37 +00:00
Matthieu Riegler
fd539a298e docs: fix the documentation for BootstrapOptions (#48834)
Inline code was being rendered on aio, this commit fixes this.

PR Close #48834
2023-01-25 18:31:08 +00:00
Virginia Dooley
14aefa1b03 docs: add new files for HTTP content (#47684)
PR Close #47684
2023-01-25 18:29:47 +00:00