Commit Graph

20643 Commits

Author SHA1 Message Date
Alex Rickabaugh 48fec08c95 perf(compiler-cli): refactor the performance tracing infrastructure (#41125)
ngtsc has an internal performance tracing package, which previously has not
really seen much use. It used to track performance statistics on a very
granular basis (microseconds per actual class analysis, for example). This
had two problems:

* it produced voluminous amounts of data, complicating the analysis of such
  results and providing dubious value.
* it added nontrivial overhead to compilation when used (which also affected
  the very performance of the operations being measured).

This commit replaces the old system with a streamlined performance tracing
setup which is lightweight and designed to be always-on. The new system
tracks 3 metrics:

* time taken by various phases and operations within the compiler
* events (counters) which measure the shape and size of the compilation
* memory usage measured at various points of the compilation process

If the compiler option `tracePerformance` is set, the compiler will
serialize these metrics to a JSON file at that location after compilation is
complete.

PR Close #41125
2021-03-24 13:42:24 -07:00
Zach Arend dd82c8e9f4 docs(docs-infra): add Zach Arend to contributors.json (#41325)
Add an entry for Zach Arend to the contributors.json file.

PR Close #41325
2021-03-24 13:34:51 -07:00
Joey Perrott 9da7ea9836
release: cut the v12.0.0-next.6 release (#41337) 2021-03-24 09:27:09 -07:00
Joey Perrott 3177d6375e docs: update changelog for the v11.2.7 release 2021-03-24 09:24:08 -07:00
George Kalpakas 81a0e7145b ci: fix `elements` test on older browsers (#41324)
Some `elements` tests rely on `window.customElements` being available.
On browsers where this was not present, the tests were skipped.

This commit includes the `@webcomponents/custom-elements` polyfill in
order to be able to run all `elements` tests on older browsers, which do
not natively support Custom Elements.

This, also, fixes the [saucelabs_ivy][1] and [saucelabs_view_engine][2]
CI jobs (part of the `monitoring` workflow), which have been failing
recently on IE 11 (probably due to the update to TS 4.2.3).

[1]: https://circleci.com/gh/angular/angular/944291
[2]: https://circleci.com/gh/angular/angular/944289

PR Close #41324
2021-03-24 08:28:46 -07:00
Marios Radis a92a89b0eb docs: spelling changes in app.e2e-spec and validate-spec files (#41326)
PR Close #41326
2021-03-23 14:37:12 -07:00
Joey Perrott 0516fbb180 refactor(dev-infra): use conventional-commits-parser for commit parsing (#41286)
Use conventional-commits-parser for parsing commits for validation, this is being done
in anticipation of relying on this parser for release note creation.  Unifying how commits
are parsed will provide the most consistency in our tooling.

PR Close #41286
2021-03-23 13:10:47 -07:00
Leandro Diniz eba1289ec9 docs: format browser-support tables for GitHub markdown (#41122)
Format the HTML used in browser-support.md such that the tables
render correctly under GitHub markdown.

PR Close #41122
2021-03-23 13:08:35 -07:00
JoostK 274dc15452 fix(core): detect synthesized constructors that have been downleveled using TS 4.2 (#41305)
TypeScript 4.2 has changed its emitted syntax for synthetic constructors
when using `downlevelIteration`, which affects ES5 bundles that have
been downleveled from ES2015 bundles. This is typically the case for UMD
bundles in the APF spec, as they are generated by downleveling the
ESM2015 bundle into ES5. The reflection capabilities in the runtime need
to recognize this new form to correctly deal with synthesized
constructors, as otherwise JIT compilation could generate invalid
factory functions.

Fixes #41298

PR Close #41305
2021-03-23 11:23:04 -07:00
JoostK 8d3da56eda fix(ngcc): detect synthesized constructors that have been downleveled using TS 4.2 (#41305)
TypeScript 4.2 has changed its emitted syntax for synthetic constructors
when using `downlevelIteration`, which affects ES5 bundles that have
been downleveled from ES2015 bundles. This is typically the case for UMD
bundles in the APF spec, as they are generated by downleveling the
ESM2015 bundle into ES5. ngcc needs to detect the new syntax in order to
correctly identify synthesized constructor functions in ES5 bundles.

Fixes #41298

PR Close #41305
2021-03-23 11:23:04 -07:00
Yvonne Allen 65f7d5380d docs: add link to fork repo how-to (#41266)
add a link from github doc on how to fork a repo. 

this will enhance user experience for users new to github by putting the information on how to fork a repo at their finger tips without them having to do additional work to search for it.
PR Close #41266
2021-03-23 11:22:31 -07:00
waterplea 6a6d332c06 docs: add Alexander Inkin to GDE list (#41310)
PR Close #41310
2021-03-23 11:18:26 -07:00
Kristiyan Kostadinov 190fa07b9a feat(router): add migration for ActivatedRouteSnapshot.fragment (#41092)
Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable.

Also moves some code from the `AbstractControl.parent` migration so that it can be reused.

Relates to #37336.

PR Close #41092
2021-03-23 11:18:00 -07:00
Alex Rickabaugh 1eba57eb00 fix(language-service): show suggestion when type inference is suboptimal (#41072)
The Ivy Language Service uses the compiler's template type-checking engine,
which honors the configuration in the user's tsconfig.json. We recommend
that users upgrade to `strictTemplates` mode in their projects to take
advantage of the best possible type inference, and thus to have the best
experience in Language Service.

If a project is not using `strictTemplates`, then the compiler will not
leverage certain type inference options it has. One case where this is very
noticeable is the inference of let- variables for structural directives that
provide a template context guard (such as NgFor). Without `strictTemplates`,
these guards will not be applied and such variables will be inferred as
'any', degrading the user experience within Language Service.

This is working as designed, since the Language Service _should_ reflect
types exactly as the compiler sees them. However, the View Engine Language
Service used its own type system that _would_ infer these types even when
the compiler did not. As a result, it's confusing to some users why the
Ivy Language Service has "worse" type inference.

To address this confusion, this commit implements a suggestion diagnostic
which is shown in the Language Service for variables which could have been
narrowed via a context guard, but the type checking configuration didn't
allow it. This should make the reason why variables receive the 'any' type
as well as the action needed to improve the typings much more obvious,
improving the Language Service experience.

Fixes angular/vscode-ng-language-service#1155
Closes #41042

PR Close #41072
2021-03-23 09:39:19 -07:00
George Kalpakas 80f11a9b86 ci: check that there are no unused contributor images (#41290)
When a contributor was removed from `contributors.json`, the
corresponding image should also be removed from
`aio/content/images/bios/`. However, this was often overlooked,
resulting in unused images remaining in `aio/content/images/bios/`.

This commit adds a check to ensure that all images in
`aio/content/images/bios/` are referenced in `contributors.json`.

PR Close #41290
2021-03-23 09:38:43 -07:00
George Kalpakas ac66b0199e build(docs-infra): remove unused contributor images (#41290)
This commit removes some contributor images that are no longer
referenced in `contributors.json` (i.e. they belong to contributors that
have since been removed).

BTW, removing these unused images saves ~720KB off the total size of the
assets that are deployed along with the app.

PR Close #41290
2021-03-23 09:38:43 -07:00
Kapunahele Wong e340d190bd docs: add some boilerplate button, h3, and hr styles (#41052)
PR Close #41052
2021-03-23 09:37:59 -07:00
Alisa Duncan 31dc483206 docs: add alisa duncan to GDE resources (#41295)
PR Close #41295
2021-03-23 09:37:11 -07:00
arturovt c49b28013a fix(animations): cleanup DOM elements when the root view is removed (#41059)
Currently, when importing `BrowserAnimationsModule`, Angular uses `AnimationRenderer`
as the renderer. When the root view is removed, the `AnimationRenderer` defers the actual
work to the `TransitionAnimationEngine` to do this, and the `TransitionAnimationEngine`
doesn't actually remove the DOM node, but just calls `markElementAsRemoved()`.

The actual DOM node is not removed until `TransitionAnimationEngine` "flushes".

Unfortunately, though, that "flush" will never happen, since the root view is being
destroyed and there will be no more flushes.

This commit adds `flush()` call when the root view is being destroyed.

BREAKING CHANGE:
DOM elements are now correctly removed when the root view is removed.
If you are using SSR and use the app's HTML for rendering, you will need
to ensure that you save the HTML to a variable before destorying the
app.
It is also possible that tests could be accidentally relying on the old behavior by
trying to find an element that was not removed in a previous test. If
this is the case, the failing tests should be updated to ensure they
have proper setup code which initializes elements they rely on.

PR Close #41059
2021-03-22 12:58:11 -07:00
Matthias Kunnen b5551609fe fix(router): fragment can be null (#37336)
ActivatedRoute.fragment was typed as Observable<string> but could emit
both null and undefined due to incorrect non-null assertion. These
non-null assertions have been removed and fragment has been retyped to
string | null.

BREAKING CHANGE:
Strict null checks will report on fragment potentially being null.
Migration path: add null check.

Fixes #23894, fixes #34197.

PR Close #37336
2021-03-22 10:02:39 -07:00
Pete Bacon Darwin e7b1d434c8 refactor(compiler): use `ɵɵInjectorDeclaration` rather than `ɵɵInjectorDef` in compiled output (#41119)
The `ɵɵInjectorDef` interface is internal and should not be published publicly
as part of libraries. This commit updates the compiler to render an opaque
type, `ɵɵInjectorDeclaration`, for this instead, which appears in the typings
for compiled libraries.

PR Close #41119
2021-03-22 08:57:18 -07:00
Pete Bacon Darwin 4dc27a7eaa refactor(core): rename `ɵɵFactoryDef` to `ɵɵFactoryDeclaration` (#41119)
Th `ɵɵFactoryDef` type will appear in published libraries, via their typings
files, to describe what type dependencies a DI factory has. The parameters
on this type are used by tooling such as the Language Service to understand
the DI dependencies of the class being created by the factory.

This commit moves the type to the `public_definitions.ts` file alongside
the other types that have a similar role, and it renames it to `ɵɵFactoryDeclaration`
to align it with the other declaration types such as `ɵɵDirectiveDeclaration`
and so on.

PR Close #41119
2021-03-22 08:57:18 -07:00
Pete Bacon Darwin 88683702e5 refactor(core): rename `...WithMeta` types to `...Declaration` and alias to `unknown` (#41119)
These types are only used in the generated typings files to provide
information to the Angular compiler in order that it can compile code
in downstream libraries and applications.

This commit aliases these types to `unknown` to avoid exposing the
previous alias types such as `ɵɵDirectiveDef`, which are internal to
the compiler.

PR Close #41119
2021-03-22 08:57:18 -07:00
Pete Bacon Darwin f2f0eaf37c docs(core): fix typos in interface docs (#41119)
The terminology use in the comments did not match the actual
types being referred to.

PR Close #41119
2021-03-22 08:57:18 -07:00
cindygk efe02d8b04 docs: update contributors.json (#41284)
PR Close #41284
2021-03-22 08:56:47 -07:00
Pete Bacon Darwin 5bc0a472bd refactor(docs-infra): remove image size exclusion list (#41292)
In #41253 the size of contributor images was limited, but
some images were already too large. So an exclusion list
was added. These images have now been reduced, so
the exclusion list is no longer needed.

The files were reduced by a combination of running them through the
https://tinyjpg.com/ online service and manually setting their size to
168px wide or tall using the MacOS Image Preview app.

PR Close #41292
2021-03-22 08:55:53 -07:00
Pete Bacon Darwin 2548921a19 docs: reduce the file size of contributor images (#41292)
Fixes #41287

PR Close #41292
2021-03-22 08:55:53 -07:00
MariosRadis ed5bfe8173 docs: simplify deleteHero method in tutorial (#41303)
Fixes #41233

PR Close #41303
2021-03-22 08:54:53 -07:00
Joey Perrott 5eb7f3491f fix(dev-infra): remove commit message wizard and builder (#41280)
Removing commit message builder and wizard as they are unused and
unneeded.

PR Close #41280
2021-03-19 12:41:09 -07:00
Alan Agius e8cae22d66 feat(dev-infra): validate breaking changes commit messages (#41274)
With this change we valid breaking changes descriptions as per our contribution guidelines

See: 88fbc06677/CONTRIBUTING.md (commit-message-footer)

PR Close #41274
2021-03-19 12:39:19 -07:00
Yvonne Allen b012a56615 docs: specify date format for reviewed tag (#41269)
Specify a date format for the reviewed tag and provided an example.

PR Close #41269
2021-03-19 12:38:50 -07:00
Pete Bacon Darwin aa039a13f0 fix(compiler): correctly process multiple rules containing `:host` selectors (#41261)
When there was more than one rule in a single style string, only the first
rule was having its `:host` selector processed correctly. Now subsequent
rules will also be processed accurately.

Fixes #41237

PR Close #41261
2021-03-19 12:38:15 -07:00
Andrew Kushnir 3a55698402 fix(core): remove obsolete check for [class] and [className] presence (#41254)
Previously presence of both [class] and [className] bindings on an element was treated as compiler error (implemented in 6f203c9575). Later, the situation was improved to actually allow both bindings to co-exist (see a153b61098), however the compiler check was not removed completely. The only situation where the error is thrown at this moment is when static (but with interpolation) and bound `class` attributes are present on an element, for ex.:

```
<div class="{{ one }}" [class]="'two'"></div>
```

In the current situation the error is acually misleading (as it refers to `[className]`).

This commit removes the mentioned compiler check as obsolete and makes the `class` and `style` attribute processing logically the same (the last occurrence is used to compute the value).

PR Close #41254
2021-03-19 12:37:45 -07:00
Andrew Kushnir 2ccb579e06 feat(docs-infra): add profile picture size check (#41253)
This commit updates the logic that validates contributors.json data and introduces a new check that verifies that profile images don't exceed specified limit.

PR Close #41253
2021-03-19 12:37:21 -07:00
Pete Bacon Darwin fbdb19c263 docs(localize): expose documentation for the `@angular/localize` package (#40317)
PR Close #40317
2021-03-19 12:36:10 -07:00
George Kalpakas 655507012b build(docs-infra): upgrade cli command docs sources to b6effecae (#41259)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](5f5448301...b6effecae):

**Modified**
- help/extract-i18n.json

PR Close #41259
2021-03-18 10:02:54 -07:00
Samuel R ac9a250fc4 docs: update link to schematics schema (#41258)
PREVIOUSLY:
The https://angular.io/guide/schematics#configuring-cli-schematics page has a link to "app" schematic specifically and to a version 7.

NOW:
The https://angular.io/guide/schematics#configuring-cli-schematics page links to the latest version of schematics (all of them, not just the "app" schematic) to let the reader snoop around a bit.
PR Close #41258
2021-03-18 10:02:25 -07:00
Manuele Dones ac9c4289e0 docs: replace deprecated karma-coverage-istanbul-reporter (#41246)
'karma-coverage-istanbul-reporter' usage has been deprecated since version 11.
Please install 'karma-coverage' and update 'karma.conf.js.' For more info, see https://github.com/karma-runner/karma-coverage/blob/master/README.md

PR Close #41246
2021-03-18 10:01:57 -07:00
George Kalpakas e23994191c docs: make `HeroService#gerHero()` in `toh-pt5` compatible with TS strict mode (#41234)
Fixes #41207

PR Close #41234
2021-03-18 10:00:52 -07:00
George Kalpakas 6d47b05b5b docs: align `toh-pt5` code with `toh-pt4` (#41234)
This commit aligns the code of `HeroService` `getHeroes()` and
`getHero()` methods in `toh-pt5` with that of `toh-pt4`. I.e. it applies
the changes from #40419 to `toh-pt5`.

PR Close #41234
2021-03-18 10:00:52 -07:00
Preston Lamb 81d2aabcbb docs: add preston lamb to GDE resources (#41204)
PR Close #41204
2021-03-18 09:58:07 -07:00
Zach Arend 09aefd2904 fix(compiler-cli): add `useInlining` option to type check config (#41043)
This commit fixes the behavior when creating a type constructor for a directive when the following
conditions are met.
1. The directive has bound generic parameters.
2. Inlining is not available. (This happens for language service compiles).

Previously, we would throw an error saying 'Inlining is not supported in this environment.' The
compiler would stop type checking, and the developer could lose out on getting errors after the
compiler gives up.

This commit adds a useInlineTypeConstructors to the type check config. When set to false, we use
`any` type for bound generic parameters to avoid crashing. When set to true, we inline the type
constructor when inlining is required.

Addresses #40963

PR Close #41043
2021-03-18 09:52:47 -07:00
Zach Arend c267c680d8 refactor(compiler-cli): don't use FakeEnvironment for tcb tests (#41043)
For the tests in //packages/compiler-cli/src/ngtsc/typecheck, this
commits uses a `TypeCheckFile` for the environment, rather than a
`FakeEnvironment`. Using a real environment gives us more flexibility
with testing.

PR Close #41043
2021-03-18 09:52:47 -07:00
Jessica Janiuk 02e8901d9e
release: cut the v12.0.0-next.5 release (#41249) 2021-03-17 11:41:56 -07:00
Jessica Janiuk 239dab6185
docs: update changelog for the v11.2.6 release (#41248) 2021-03-17 11:32:26 -07:00
Kristiyan Kostadinov fa048948be feat(core): drop support for TypeScript 4.0 and 4.1 (#41158)
Drops support for TypeScript 4.0 and 4.1 across the repo.
The typings check for 4.1 was kept in order to ensure that we don't break g3.

PR Close #41158
2021-03-17 09:10:25 -07:00
Kristiyan Kostadinov 59ef40988e feat(core): support TypeScript 4.2 (#41158)
Updates the repo to TypeScript 4.2 and tslib 2.1.0.

PR Close #41158
2021-03-17 09:10:25 -07:00
JoostK eb74a96935 refactor(compiler-cli): separate used components from used directives in partial declaration (#41104)
The partial declaration of a component includes the list of directives
that are used in its template, including some metadata of the directive
which can be used during actual compilation of the component. Used
components are currently part of this list, as components are also
directives. This commit splits the used components into a dedicate
property in the partial declaration, which allows for template
compilation to optimize the generated code for components.

PR Close #41104
2021-03-17 09:09:29 -07:00
Alan Agius 98de4cb1bf docs: add deprecation note next to IE 11 in browser-support page (#41147)
Add a deprecation note, that IE 11 will be deprecated in version 12.

See angular/angular-cli#20225 and https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666

PR Close #41147
2021-03-17 09:07:37 -07:00
George Kalpakas 6bc22a7557 build(docs-infra): upgrade cli command docs sources to 5f5448301 (#41239)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](46538eea1...5f5448301):

**Modified**
- help/build.json
- help/lint.json

PR Close #41239
2021-03-17 09:06:37 -07:00