Commit graph

29561 commits

Author SHA1 Message Date
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
Jessica Janiuk
c91606b67e release: cut the v15.2.0-next.2 release 2023-01-25 09:09:50 -08:00
Jessica Janiuk
d7b4b42f0c docs: release notes for the v15.1.2 release 2023-01-25 08:54:26 -08:00
Kristiyan Kostadinov
e7318fc758 feat(core): add ng generate schematic to remove unnecessary modules (#48832)
Adds a new mode to the `@angular/core:standalone` schematic that automatically deletes modules that may not be necessary after the previous step of converting them to standalone.

PR Close #48832
2023-01-25 16:20:27 +00:00
Angular Robot
10634048ea docs: update Angular CLI help [main] (#48827)
Updated Angular CLI help contents.

PR Close #48827
2023-01-24 21:27:02 +00:00
dario-piotrowicz
87fe3161d4 refactor: remove unnecessary test support check utilities (#47543)
remove the following utilities used in unit tests which check for features
that are supported by all supported browsers:
 - supportsCustomElements
 - supportsWebAnimation
 - supportsRegExUnicodeFlag
 - supportsTemplateElement

also remove the following utilities which check for features that are
not supported (and aren't going to be) by any of the supported browsers:
 - supportsDeprecatedCustomCustomElementsV0
 - supportsDeprecatedShadowDomV0

PR Close #47543
2023-01-24 21:06:09 +00:00
Charles Lyding
402fcc57bb refactor(localize): bundle message digest algorithm directly in npm package (#48799)
The main entry point for the `@angular/localize` package no longer imports
the `@angular/compiler` package and now has no external dependencies. This
allows the main functionality of the package to be used without requiring
any other Angular packages. Only the message digest algorithm implementation
from the `@angular/compiler` package was being used and this code is now
bundled directly into the final npm package for `@angular/localize`.
The `tooling` secondary entry point still leverages and requires Angular
related packages (`@angular/compiler`/`@angular/compiler-cli`). However,
the tooling functionality is not intended to be used and/or bundled in
a web application.

Closes #48163

PR Close #48799
2023-01-24 18:31:25 +00:00
Angular Robot
3440778671 build: update cross-repo angular dependencies (#48437)
See associated pull request for more information.

PR Close #48437
2023-01-24 18:30:43 +00:00
Matthieu Riegler
c2cd0c548d fix(docs-infra): consistent table width with min-width:100% (#48815)
Let's have a consistent min-width of the tables across AIO to improve the look of the docs.

fixes #43840

PR Close #48815
2023-01-24 18:30:04 +00:00
Matthieu Riegler
bc8cfa2552 fix(compiler): handle css selectors with space after an escaped character. (#48558)
In Css, selectors with escaped characters require a space after if the following character is a hex character. ie: .\fc ber which matches class="über"
These escaped selectors happen for example when esbuild run with `optimization.minify`

fixes #48524

PR Close #48558
2023-01-24 17:46:33 +00:00
Kristiyan Kostadinov
a154db8a81 feat(core): add ng generate schematic to convert declarations to standalone (#48790)
Implements a new `ng generate @angular/core:standalone` schematic that allows the user to convert all the declarations in a set of NgModules to standalone.

PR Close #48790
2023-01-24 16:48:19 +00:00
Kristiyan Kostadinov
b37a624985 build: set up ng generate schematics for core (#48790)
Adds the necessary boilerplate to allow for `ng generate` schematics to be included with `@angular/core`.

PR Close #48790
2023-01-24 16:48:19 +00:00