main
Commits on Jun 9, 2022
-
docs: update example hero ID (#46304)
The hero ID "11" does not correspond to any hero from the example mock heroes list described at https://angular.io/tutorial/toh-pt2#create-mock-heroes. ID 12 seems to be the more fitting ID to get the hero with name "Dr. Nice". PR Close #46304
-
Commits on Jun 8, 2022
-
docs(forms): fix FormRecord usage notes (#46299)
FormRecod usegaesNotes were like it accetps simple object like a FormBuilder. PR Close #46299
-
build: exclude bazel commits from release notes (#46310)
@angular/bazel has been deprecated since v10, and is no longer supported. We don't need to mention fixes/features for Bazel in the release notes. PR Close #46310
-
docs(router): Complete
QueryParamsHandling
documentation (#46286)`QueryParamsHandling` has a third possibility which is the default behavior, and it was not documented until now. PR Close #46286
-
docs: remove azure builder reference (#46285)
This builder is not compatible with newer versions of the Angular CLI. See angular/angular-cli#23255 for more context PR Close #46285
Commits on Jun 7, 2022
-
build: update dev-infra shared code to latest revision (#46291)
Updates dev-infra to the latest revision. This revision supports for custom release prechecks and performs the release build before the staging, verifying integrity later. This has various benefits for stability and making the less less relucant to build issues that mess up a previously-merged staging PR. PR Close #46291
-
build(docs-infra): update dependencies in docs examples `package.json…
-
refactor(common): include locale extra data in closure locale file (#…
…46167) The recent update to CLDR 41 highlighted (internally) that some time formats have changed to rely on locale-specific day periods. In particular the `zh_TW` (or canonical: `zh_Hant`) has changed some time formats/patterns from the universal `AM/PM` symbols (`a`) to `B`. The `b`/`B` symbols rely on locale-specific day period rules. This data is only extracted from CLDR into the so-called extra locale data that Angular provides. To fix this, and to be able to reverse the internal workaround that doesn't allow us to use the actual CLDR 41 data here, we always provide the locale extra data when conditonally loading CLDR data based on `goog.LOCALE`. This will result in additional payload cost that locale-specific JS bundles have to pay, but the only alternative would be to break Angular's `b`/`B` symbol support in favor of falling back to `AM/PM` rules (similar to how Closure Libray itself does it). For our external users (something I want to note here), they will be able to load the extra data easily (like it was possible before). Angular has some good erroring if the extra data is required. Most of our users will always use the global locale files anyway (the Angular CLI always uses them). These come with the extra data by default. Resources: - unicode-org/cldr@0d53832 - https://github.com/unicode-org/cldr/blob/0d538327d1ea2a31d1614d8989007b97a3ee5021/common/main/zh_Hant.xml - https://github.com/angular/angular/blob/6a4353cb40227330be2a5685adca485a8b8e8a0b/packages/common/src/i18n/format_date.ts#L609-L639 - https://cldr.unicode.org/translation/date-time/date-time-symbols - https://cs.github.com/angular/angular-cli/blob/4be7cdce8283a177b92594bb7b34b4718d0a39c3/packages/angular_devkit/build_angular/src/utils/i18n-options.ts?q=%22locales%2Fglobal%22#L23 PR Close #46167
Commits on Jun 6, 2022
-
test: add an internal helper to populate document.head before a test (#…
-
refactor(core): rename a file to avoid old terminology (to avoid ment…
-
docs: mark version 13 as LTS in releases guide (#46268)
Verson 13 is now in LTS. PR Close #46268
-
-
docs: annotate more APIs with the
@developerPreview
tag (#46234)This commit updates a few more standalone-related APIs with the `@developerPreview` tag. PR Close #46234
-
refactor(core): export missing util function (#46274)
This commit exports the `isHostComponentStandalone` function and also changes a location where it's imported from. The function was moved recently in a different PR, which caused some conflicts after merging other PRs that relied on the old structure. PR Close #46274
-
docs: change wrong alters to callouts (#46262)
change the alerts present in the docs to callouts so that their header can be properly rendered (since alters don't support have headers) PR Close #46262
-
refactor(core): fix eaither typo in transitiveScopesFor comment (#46261)
fix the 'eaither' typo (instead of 'either') in the tsdoc comment for the transitiveScopesFor function PR Close #46261
-
fix(bazel): update API extractor version (#46259)
`@angular/bazel` currently uses an older version of `@microsoft/api-extractor` which is causing downstream issues in Components. These changes bump up to a version that has a fix. Context: angular/components#25027 PR Close #46259
-
docs: fix typo in the CHANGELOG (#46255)
Fixes a type made in the CHANGELOG.md under the 14.0.0 at router release notes PR Close #46255
-
fix(forms): allow FormBuilder.group(...) to accept optional fields. (#…
…46253) Consider the case in which `FormBuilder` is used to construct a group with an optional field: ``` const controls = { name: fb.control('') }; const foo: FormGroup<{ name: FormControl<string | null>; address?: FormControl<string | null>; }> = fb.group<{ name: FormControl<string | null>; address?: FormControl<string | null>; }>(controls); ``` Today, with fully strict TypeScript settings, the above will not compile: ``` Types of property 'controls' are incompatible. Type '{ name: FormControl<string | null>; address?: FormControl<FormGroup<SubFormControls> | null | undefined> | undefined; }' is not assignable to type '{ name: FormControl<string | null>; address?: FormGroup<SubFormControls> | undefined; }'. ``` Notice that the `fb.group(...)` is calculating the following type for address: `address?: FormControl<FormGroup<string|null>`. This is clearly wrong -- an extraneous `FormControl` has been added! This is coming from the calculation of the result type of `fb.group(...)`. In the type definition, if we cannot detect the outer control type, [we assume it's just an unwrapped value, and automatically wrap it in `FormControl`](https://github.com/angular/angular/blob/14.0.0/packages/forms/src/form_builder.ts#L66). Because the optional `{address?: FormControl<string|null>}` implicitly makes the RHS have type `FormControl<string|null>|undefined`, [the relevant condition is not satisfied](https://github.com/angular/angular/blob/14.0.0/packages/forms/src/form_builder.ts#L55). In particular, the condition expects just `FormGroup<T>`, not `FormGroup<T>|undefined`. So we assume `T` is a value type, and it gets wrapped with `FormControl`. The solution is to add the cases where `undefined` is included in the union type when detecting which control `T` is (if any). PR Close #46253
-
refactor(core): add helpful info in the pipe not found error message (#…
-
refactor(core): split RuntimeError unit test up (#46239)
split the single RuntimeError utils test testing about the correct formatting of errors in multiple separate unit tests (for better granularity and clearness) PR Close #46239
-
refactor(core): improve the runtime errors formatting (#46239)
the formatted error messages always include a period separator between the provided error message and the find-more suffix, this is not always desirable as it may add periods when they shoud not be, so improve the formatting by checking and applying the period only if the provided message doesn't end with a character which already represents a separator additionally also improve the formatting by trimming the provided error message note that such trimming needs to be performed before the separator check so that for example an error message like `"some error! "` doesn't produce `"some error! ."` but it successfully produces "some error!" PR Close #46239
-
docs(forms): Amend the FormGroupDirective docs to indicate it also wo…
-
refactor(core): improve code around element validation (#46175)
improve code regarding element validation by creating a new file exporting validation functions and not exporting utils previously globally available PR Close #46175
Commits on Jun 3, 2022
-
feat(upgrade): more closely align
UpgradeModule#bootstrap()
with `a……ngular.bootstrap()` (#46214) Previously, [UpgradeModule#bootstrap()][1], while being a replacement for and accepting the same arguments as [angular.bootstrap()][2], did not return the same value as `angular.bootstrap()` (i.e. the AngularJS injector in most cases). This made it less straight forward to migrate some usecases that relied on the return value of `.bootstrap()`. The work-around was to access the injector via [UpgradeModule#$injector][3] (after the app had been bootstrapped with `UpgradeModule#bootstrap()`). This commit addresses this by ensuring `UpgradeModule#bootstrap()` returns the same value as `angular.bootstrap()`, making it easier to replace the latter with the former. [1]: https://angular.io/api/upgrade/static/UpgradeModule#bootstrap [2]: https://docs.angularjs.org/api/ng/function/angular.bootstrap [3]: https://angular.io/api/upgrade/static/UpgradeModule#%24injector Fixes #46211 PR Close #46214
-
test(upgrade): add some tests for
UpgradeModule
(#46214)Add some tests for the `UpgradeModule` class and its members. PR Close #46214