Commit graph

29561 commits

Author SHA1 Message Date
alefra
da8ea7dfaa docs: modify import (#45828)
Modify import after moving Component and Directives

PR Close #45828
2022-06-10 16:11:09 +00:00
alefra
eafe9886b8 docs: move ZippyToggleDirective (#45828)
Move ZippyToggleDirective from app.component.ts

PR Close #45828
2022-06-10 16:11:09 +00:00
alefra
57fa804bb2 docs: remove Component and Directives (#45828)
Move all content to example-zippy.component.ts

PR Close #45828
2022-06-10 16:11:09 +00:00
alefra
008111d2c2 docs: create file to improve docs (#45828)
Move ZippyComponent and ZippyContentDirective to example-zippy.component.ts file to improve readability of the docs

PR Close #45828
2022-06-10 16:11:09 +00:00
alefra
d6c370bc67 docs: modify header and path of code-example (#45828)
In the example, @ContentChild is used in app.component.ts but the component we want to project content into is example-zippy.component.ts.
PR Close #45828
2022-06-10 16:11:09 +00:00
dario-piotrowicz
974da3f802 fix(docs-infra): improve accessibility of aio-select component (#46013)
improve the accessibility of the aio-select component so that it is
clear for screen reader users its functionality (currently it is
presented as a simple button), following the WAI-ARIA authoring
practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox)

A first attempt in improving the accessibility of the component has been
tried in PR #45937 by replacing it with the material select component,
such implementation has however been scrapped since the increase of
payload sizes has proven prohibitively large

(also note that given native select elements haven't been used given the lack
of syling options for such elements)

PR Close #46013
2022-06-10 16:10:35 +00:00
Renovate Bot
4b3baf22c5 build: update dependency @types/chrome to ^0.0.190 (#46017)
PR Close #46017
2022-06-10 16:09:59 +00:00
dario-piotrowicz
5e20f60efa fix(docs-infra): add missing aria-labels to contributors page (#46324)
add proper aria-labels for the twitter and website link of contributors
(which being icons they have no text) so that they can be correctly read
by screenreaders

also add aria-labels to the view-bio buttons for a better user
experience

PR Close #46324
2022-06-10 16:09:25 +00:00
Andrew Scott
caa2f3560d refactor(router): clean up internal hooks (#46321)
* beforePreactivation hook is unused
* The only place that uses afterPreactivation does not use the arguments

Not to say we won't want to provide hooks similar to this in the future,
but the current state is over-engineered for what it's being used for.

PR Close #46321
2022-06-10 15:23:57 +00:00
mgechev
12a0cad02e build(devtools): update the extension version (#46289)
Update the version for the Firefox and Chrome extension to enable us
to publish the latest support of standalone components.

PR Close #46289
2022-06-10 15:23:12 +00:00
Kristiyan Kostadinov
04acc6b14d fix(compiler-cli): don't emit empty providers array (#46301)
Saves us some bytes by not emitting `providers` in `defineInjector`. While the amount of bytes isn't huge, I think that this change is worthwhile, because `ng generate` currently generates `providers: []` with every `NgModule` which users can forget to remove.

PR Close #46301
2022-06-10 14:27:22 +00:00
Renovate Bot
0410c0901e build: update all non-major dependencies (#46150)
PR Close #46150
2022-06-10 14:26:34 +00:00
dario-piotrowicz
51297e1493 docs: fix "for to learn more" typo (#46095)
PR Close #46095
2022-06-10 14:24:37 +00:00
dario-piotrowicz
521c7dd03e docs: add standalone info to aio glossary (#46095)
add information about standalone components, directives and pipes in the
guide glossary

PR Close #46095
2022-06-10 14:24:37 +00:00
Younes Jaaidi
3b304219c4 docs: use better wording (#46314)
Co-authored-by: Andrew Kushnir <43554145+AndrewKushnir@users.noreply.github.com>
PR Close #46314
2022-06-10 14:21:06 +00:00
Younes Jaaidi
78ae490e0a docs: clarify OnPush (#46314)
PR Close #46314
2022-06-10 14:21:06 +00:00
sten-bone
8a42f27d1e 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
2022-06-09 20:45:54 +00:00
Kristiyan Kostadinov
8b9c32d4dc fix(common): allow null in ngComponentOutlet (#46280)
`ngComponentOutlet` already handles null/undefined values, but the types don't reflect that. These changes update the types.

Fixes #45716.

PR Close #46280
2022-06-09 16:04:16 +00:00
Totati
81150313f6 docs(forms): fix FormRecord usage notes (#46299)
FormRecod usegaesNotes were like it accetps simple object like a FormBuilder.
PR Close #46299
2022-06-08 20:52:22 +00:00
Alex Rickabaugh
4fe52c03e0 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
2022-06-08 13:42:29 -07:00
Alex Rickabaugh
0e6dbcd9c3 release: cut the v14.1.0-next.0 release (#46311)
PR Close #46311
2022-06-08 13:31:53 -07:00
Alex Rickabaugh
58182e549d docs: release notes for the v14.0.1 release (#46309)
PR Close #46309
2022-06-08 13:20:38 -07:00
Adrien Crivelli
34890fb901 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
2022-06-08 12:40:56 -07:00
Alan Agius
7391143dd3 docs: remove azure builder reference (#46285)
This builder is not compatible with newer versions of the Angular CLI.

See https://github.com/angular/angular-cli/issues/23255 for more context

PR Close #46285
2022-06-08 12:40:23 -07:00
Paul Gschwendtner
960c7ed755 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
2022-06-07 10:43:38 -07:00
Renovate Bot
342836d784 build: update dependency magic-string to v0.26.2 (#46279)
PR Close #46279
2022-06-07 10:43:12 -07:00
George Kalpakas
5f339ef9f8 build(docs-infra): update dependencies in docs examples package.json files (#46248)
This is a follow-up to #46227 to update the dependency version ranges in
the docs examples `package.json` files.

PR Close #46248
2022-06-07 10:42:43 -07:00
Paul Gschwendtner
b280b97d5a 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:

- 0d538327d1
- 0d538327d1/common/main/zh_Hant.xml
- 6a4353cb40/packages/common/src/i18n/format_date.ts (L609-L639)
- https://cldr.unicode.org/translation/date-time/date-time-symbols
- 4be7cdce82/packages/angular_devkit/build_angular/src/utils/i18n-options.ts (L23)

PR Close #46167
2022-06-07 10:14:14 -07:00
Andrew Kushnir
627cdf31a3 test: add an internal helper to populate document.head before a test (#46250)
This commit reuses the logic of the `withBody` helper and implements the `withHead` based on it.The helper method is useful for tests that rely on a certain tags being present in document's `<head>` element.

PR Close #46250
2022-06-06 16:12:32 -07:00
Andrew Kushnir
8c15eea5a2 refactor(core): rename a file to avoid old terminology (to avoid mentioning render3) (#46250)
This commit renames the packages/private/testing/src/render3.ts -> packages/private/testing/src/utils.ts to avoid using the `render3` term as it used to differentiate VE and Ivy, which is no longer relevant.

PR Close #46250
2022-06-06 16:12:32 -07:00
Alan Agius
a9e8a212f8 docs: mark version 13 as LTS in releases guide (#46268)
Verson 13 is now in LTS.

PR Close #46268
2022-06-06 11:48:05 -07:00
mgechev
d67cf922c2 docs: add i18n video to the overview page (#46273)
PR Close #46273
2022-06-06 11:46:49 -07:00
Renovate Bot
c083f6dcb2 build: lock file maintenance (#46270)
PR Close #46270
2022-06-06 11:46:27 -07:00
Phalgun Vaddepalli
385b5ec92c docs: removed outdated migration documentation (#46257)
Fixes #46236

PR Close #46257
2022-06-06 11:42:51 -07:00
Andrew Kushnir
aa2e8acd0e 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
2022-06-06 11:37:55 -07:00
Andrew Kushnir
612b4088b9 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
2022-06-06 11:35:25 -07:00
wellWINeo
cac4d0527e docs: fix duplicate in CHANGELOG (#46267)
PR Close #46267
2022-06-06 10:18:32 -07:00
dario-piotrowicz
3ab9d48ef0 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
2022-06-06 10:17:53 -07:00
dario-piotrowicz
d4f11147f4 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
2022-06-06 10:17:01 -07:00
Kristiyan Kostadinov
ceb9abd9fd 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: https://github.com/angular/components/pull/25027

PR Close #46259
2022-06-06 10:16:04 -07:00
Fabrizio Fallico
6724e43bf6 docs: fix missing closing div in http page (#46258)
PR Close #46258
2022-06-06 10:15:37 -07:00
Jelle Bruisten
185cbc414c 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
2022-06-06 10:14:46 -07:00
Dylan Hunn
f18e1739b8 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
2022-06-06 10:14:19 -07:00
dario-piotrowicz
0d10fe52f1 refactor(core): add helpful info in the pipe not found error message (#46247)
Add info to the pipe not found error message so to give some help to the developer for
resolving the problem more efficiently

(Note: this change also distinguishes the case in which the hosting component is standalone)

PR Close #46247
2022-06-06 10:13:28 -07:00
dario-piotrowicz
cc183928e1 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
2022-06-06 10:12:06 -07:00
dario-piotrowicz
0b7ab075b7 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
2022-06-06 10:12:05 -07:00
Dylan Hunn
f12cf2b89b docs(forms): Amend the FormGroupDirective docs to indicate it also works with FormRecord. (#46235)
It is currently unclear which directive to use for FormRecord. This commit amends the docs to explicitly state that the group directives can and should be used with records.

PR Close #46235
2022-06-06 10:11:15 -07:00
dario-piotrowicz
d846bba678 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
2022-06-06 10:10:41 -07:00
Renovate Bot
5cfde8b23e build: lock file maintenance (#46104)
PR Close #46104
2022-06-03 10:23:36 -07:00
George Kalpakas
e9cb0454dc feat(upgrade): more closely align UpgradeModule#bootstrap() with angular.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
2022-06-03 10:16:05 -07:00