Compare commits

...

569 Commits

Author SHA1 Message Date
Andrew Kushnir 03d2fc2834 release: cut the v11.2.11 release 2021-04-21 09:50:07 -07:00
Pete Bacon Darwin 8f3e5a5982 build(docs-infra): update docs examples to Angular v11.2.10 (#41689) (#41716)
This commit updates the docs examples to Angular v11.2.10. See the [diff between 11.0.1 and 11.2.10 (FW) and 11.2.9 (CLI)][1].

The changes are fairly trivial including:

- Removal of `emitDecoratorMetadata` from tsconfig.json files, where no JIT compilation is required.
- Setting `enableI18nLegacyMessageIdFormat` to `false` for CLI based applications - the i18n example was already migrated away from legacy message IDs.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.9..11.0.1

PR Close #41689

PR Close #41716
2021-04-20 13:13:09 -07:00
Pete Bacon Darwin 81260c4009 refactor(docs-infra): tidy up systemjs boilerplate for upgrade examples (#41689) (#41716)
The ngUpgrade examples mostly rely upon SystemJS configuration.
This commit tidies up how these examples are built and tested so that
it will be easier to migrate them to work with Angular 11.2.x

PR Close #41689

PR Close #41716
2021-04-20 13:13:09 -07:00
Kapunahele Wong 20e09177b7 docs: add margin to button boilerplate CSS for examples (#41413)
PR Close #41413
2021-04-20 11:37:29 -07:00
Daniel Díaz 7459f6d705 docs: rewrites animation query () method use (#41710)
PR Close #41710
2021-04-20 09:40:30 -07:00
unknown c6dde4cd8c docs: add Material Design for Bootstrap to UI Component resources (#41702)
PR Close #41702
2021-04-20 09:39:16 -07:00
Oluwole Majiyagbe 866b30972b docs: add API CMS capability to Angular App resources (#40924)
PR Close #40924
2021-04-20 09:37:52 -07:00
Ajit Singh a76f07bd13 docs: documentation of descendants property of @ContentChildren (#35927)
documentation of decendants property of @ContentChildren was not clear when decendants was set to false it did not pick up direct children when any directive was used on the elements. With Ivy the functionality follows the following pattern only query direct children (in the sense of elements in a template) when descendants: false is specified.

Fixes #20074

PR Close #35927
2021-04-19 15:57:18 -07:00
Joey Perrott f5248c6c23 build: remove entities dependency from root package.json (#41705)
Remove the dependency on `entities` in the root package.json as it is unused.  `entities` is
used in aio, however the package.json in aio manages these dependencies.

PR Close #41705
2021-04-19 14:17:20 -07:00
Bendik Skarpnes 2a136e2eda docs: fix styling issues in example CSS (#41222)
PR Close #41222
2021-04-19 14:15:46 -07:00
Pierre Portejoie 7a153f78aa docs: fix tutorial indicating the app is working when an error is actually displayed (#40732)
PR Close #40732
2021-04-19 14:14:59 -07:00
Andrew Kushnir 3631934f2d Revert "fix(zone.js): should continue to executue listeners when throw error (#41562)" (#41707)
This reverts commit 5c48cd30b5.

Reason: that change introduces race conditions on CI.

PR Close #41707
2021-04-19 13:33:12 -07:00
Andrew Kushnir 26a0285dea Revert "test(zone.js): should invoke XHR task even onload handler throw error. (#41562)" (#41707)
This reverts commit 6910118b0d.

Reason: this change introduces race conditions on CI.

PR Close #41707
2021-04-19 13:33:12 -07:00
JiaLiPassion 8c831a257c test(zone.js): should invoke XHR task even onload handler throw error. (#41562)
Close #41520.

This case related to the issue #41522.

```
Zone.root
  .fork({
    name: 'xhr',
    onHasTask(delegate, currentZone, zone, taskState) {
      console.log('hasMacrotask', taskState.macroTask);
      return delegate.hasTask(zone, taskState);
    },
  })
  .run(() => {
    const xhr = new XMLHttpRequest();
    xhr.open('GET', 'https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.11.4/zone.min.js');
    xhr.addEventListener('load', () => {
      throw new Error();
    });
    xhr.send();
  });
```

zone.js invoke all `onload` event handlers before change the XHR task's state from
`scheduled` to `notscheduled`, so if any `onload` listener throw error, the XHR task
wlll be hang to `scheduled`, and leave the macroTask status in the zone wrongly.

This has been fixed in the previous commit, this commit add test to verify the case.

PR Close #41562
2021-04-19 08:38:44 -07:00
JiaLiPassion c4a7f1ccc0 fix(zone.js): should continue to executue listeners when throw error (#41562)
Close #41522

`zone.js` patches event listeners and run all event listeners together, if
one event handler throws error, the listeners afterward may not be invoked.

Reproduction:

```
export class AppComponent implements AfterViewInit {
  @ViewChild('btn') btn: ElementRef;
  title = 'event-error';

  constructor(private ngZone: NgZone) {}

  ngAfterViewInit() {
    this.ngZone.runOutsideAngular(() => {
      this.btn.nativeElement.addEventListener('click', () => {
        throw new Error('test1');
      });
      this.btn.nativeElement.addEventListener('click', () => {
        console.log('add eventlistener click');
      });
    });
  }
}
```

Until now no Angular users report this issue becuase in the `ngZone`, all
error will be caught and will not rethrow, so the event listeners afterward
will still continue to execute, but if the event handlers are outside of `ngZone`,
the error will break the execution.

This commit catch all errors, and after all event listeners finished invocation,
rethrow the errors in seperate `microTasks`, the reason I am using `microTask` here
is to handle multiple errors case.

PR Close #41562
2021-04-19 08:38:44 -07:00
Amadou Sall 8f6c166aea docs: add missing preposition in the animations guide (#41697)
PR Close #41697
2021-04-19 08:35:12 -07:00
George Kalpakas 0538d5b747 fix(docs-infra): fix code inside anchor elements with external URLs (#41694)
Previously, due to the `inline-flex` display style of anchor elements
with external URLs, `<code>` elements nested inside such anchor elements
would cause extra spacing between lines. An occurrence of this can be
seen in the [Angular workspace configuration][1] guide.

This commit fixes the problem by removing the `inline-flex` display
style (allowing anchor elements to fall back to the default `inline`
style).

For reference, the `inline-flex` style was introduced in commit
7944ee2c30 in order to avoid underlining
link icons. This style seems to no longer be necessary (either it was
never necessary or the underlying browser bug that made it necessary was
fixed).

Before: ![code links before][2]
After: ![code links after][3]

[1]: https://next.angular.io/guide/workspace-config#generation-schematics
[2]: https://user-images.githubusercontent.com/8604205/115149753-34589780-a06e-11eb-8d4e-825b5e94282d.png
[3]: https://user-images.githubusercontent.com/8604205/115149755-3589c480-a06e-11eb-9b15-825d75c74878.png

PR Close #41694
2021-04-19 08:32:10 -07:00
George Kalpakas 8f58a1016f refactor(docs-infra): remove duplicate ol selector (#41694)
This commit removes a duplicate `ol` selector from `typography.scss`.

PR Close #41694
2021-04-19 08:32:10 -07:00
George Kalpakas 7ec60bec1b refactor(docs-infra): simplify regex in search WebWorker (#41693)
This commit simplifies a regex used in angular.io's search WebWorker. It
also updates some comments to add more context on what the code does.

PR Close #41693
2021-04-19 08:31:33 -07:00
George Kalpakas b84088aa3a docs: replace hair space with regular space in creating-libraries.md (#41690)
This commit replaces a [hair space][1] with a regular space in
`creating-libraries.md`.
(You can see the hair space "in action" in the "Schematics for
Libraries" link right above the [Publishing your library][2] section.

[1]: https://en.wikipedia.org/wiki/Template:Hair_space
[2]: https://v10.angular.io/guide/creating-libraries#publishing-your-library

PR Close #41690
2021-04-19 08:29:46 -07:00
George Kalpakas 710a336648 docs: add missing backticks in schematics-for-libraries.md (#41681)
PR Close #41681
2021-04-19 08:26:36 -07:00
George Kalpakas 335ec2ef80 test(docs-infra): change URL separator from \t to --> in URLS_TO_REDIRECT.txt (#41680)
Previously, the `URLS_TO_REDIRECT.txt` file was expected to separate
URLs by a `\t` character. This could easily been mistaken for a regular
space and would often result in test errors when updating the file.

This commit updates the `URLS_TO_REDIRECT.txt` file and the
corresponding test helpers to use `-->` (potentially surrounded by
whitespace) as a separator for the URLs. This also gives a hint about
the "from" --> "to" relationship of the redirect URL pair.

PR Close #41680
2021-04-19 08:26:02 -07:00
George Kalpakas e0bbada214 test(docs-infra): ignore empty lines in URLS_TO_REDIRECT.txt (#41680)
Previously, the `URLS_TO_REDIRECT.txt` file was expected to not contain
any empty lines. This could easily result in test errors when updating
the file, since it is common for IDEs/editors to automatically ensure
there is an empty line at the end of a saved file
([example failure][1]).

This commit updates the test helpers to be able to cope with empty or
whitespace-only lines in `URLS_TO_REDIRECT.txt` by ignoring such lines.

[1]: https://circleci.com/gh/angular/angular/965534

PR Close #41680
2021-04-19 08:26:02 -07:00
Kirk Larkin e174407829 docs: correct appUnless desc re true/false (#41656)
PR Close #41656
2021-04-19 08:23:12 -07:00
George Kalpakas 43f95b9e40 docs: fix broken links to CLI wiki in the "Component styles" guide (#41516)
Fixes #41362

PR Close #41516
2021-04-19 08:22:21 -07:00
va-stefanek 161f61116e docs: change link to the styles configuration guide (#41516)
PR Close #41516
2021-04-19 08:22:21 -07:00
Eduard Bondarenko 095bb520ff docs: move lazy loading section to the best practices section (#41378)
PR Close #41378
2021-04-16 17:27:01 -07:00
Gérôme Grignon be73f7b0fb docs: add mention to CSS styles for hero-detail (#41214)
PR Close #41214
2021-04-16 17:26:30 -07:00
sovtara 3c49671baf docs: fix the property name in the example (#41410)
AppHighlight directive from the example doesn't have myHighlight attribute.
It only has appHighlight property. So we should use appHighlight instead of myHighlight.

PR Close #41410
2021-04-16 17:25:40 -07:00
Dharmen Shah 69b25ad8f0 docs: separate steps for github actions (#41594)
PR Close #41594
2021-04-16 17:25:03 -07:00
Dharmen Shah c0d85f510e docs: add github actions in CI story (#41594)
PR Close #41594
2021-04-16 17:25:02 -07:00
Joey Perrott d99e8f1c85 feat(dev-infra): prevent pr merges of features or breaking changes on rc (#41660)
Prevent pull requests targeting `target: rc` from merging PRs with breaking
changes or features from being merged.

PR Close #41660
2021-04-16 13:09:48 -07:00
Zach Arend 296f887383 fix(compiler-cli): autocomplete literal types in templates
This adds string literals, number literals, `true`, `false`, `null` and
`undefined` to autocomplete results in templates.

For example, when completing an input of union type.

Component: `@Input('input') input!: 'a'|'b'|null;`
Template: `[input]="|"`

Provide `'a'`, `'b'`, and `null` as autocompletion entries.

Previously we did not include literal types because we only included
results from the component context (`ctx.`) and the template scope.

This is the second attempt at this. The first attmpet is in , then was
reverted in 75f881e078.
2021-04-16 08:56:35 -07:00
Teri Glover 21d3084512 docs: edits to remove jargon and abbreviations (#41530)
PR Close #41530
2021-04-15 16:00:54 -07:00
Teri Glover 6c43a949b8 docs: update copy in schematics.md (#41521)
PR Close #41521
2021-04-15 14:38:07 -07:00
Kristiyan Kostadinov 3aa92355ef fix(common): viewport scroller not finding elements inside the shadow DOM (#41644)
The `ViewportScroller` figures out which element to scroll into view using `document.getElementById`. The problem is that it won't find elements inside the shadow DOM.

These changes add some extra logic that goes through all the shadow roots to look for the element.

Fixes #41470.

PR Close #41644
2021-04-15 12:47:07 -07:00
Dmitrij Kuba f4376fc0d4 fix(router): Only retrieve stored route when reuse strategy indicates it should reattach (#30263)
When creating the router state, the `RouteReuseStrategy#retrieve` should
only be called when `RouteReuseStrategy#shouldAttach` returns `true`.
That is, we should only retrieve a stored route when the reuse strategy
indicates that there is one stored and that it should be reattached.

This now matches the behavior in the route activation:
https://github.com/angular/angular/blob/1d12c50f63f90c91636185b2287e31e9c0291121/packages/router/src/operators/activate_routes.ts#L170-L172

Fixes #23162

PR Close #30263
2021-04-15 11:33:01 -07:00
Martin Sikora c4b0753908 test(router): add Router regression test for hash location strategy (#40409)
This situation can probably happen only when using
`HashLocationStrategy` and by manually changing hash that triggers a route
guard that returns a new `UrlTree`. Then hash in the browser might not
match the current route because navigation was canceled, while hash in
the URL remained set by the user.

Related to #37048

PR Close #40409
2021-04-14 18:48:27 -07:00
Michael Hladky b616f731b2 docs: add rx-angular to resources.json (#39291)
PR Close #39291
2021-04-14 15:50:45 -07:00
Andrew Scott 8d6281311c fix(router): recursively merge empty path matches (#41584)
When recognizing routes, the router merges nodes which map to the same
empty path config. This is because auxiliary outlets under empty path
parents need to match the parent config. This would result in two
outlet matches for that parent which need to be combined into a single
node: The regular 'primary' match and the match for the auxiliary outlet.
In addition, the children of the merged nodes should also be merged to
account for multiple levels of empty path parents.

Fixes #41481

PR Close #41584
2021-04-14 15:47:09 -07:00
Joey Perrott 62c6fc20f0 feat(dev-infra): prevent attempting to merge draft, closed or merged pull requests (#41604)
During pull request validation, assert that the pull request is not in
draft mode, already merged or already closed.

PR Close #41604
2021-04-14 15:44:56 -07:00
Paul Gschwendtner 4d79c1d7db build: update to latest version of rules_nodejs v3.3.0 (#41607)
Updates to the latest version of `rules_nodejs` that supports
the most recent NodeJS lts version v14.16.1.

Additionally the latest version of `rules_nodejs` provides
[a package for runfile resolution](https://github.com/bazelbuild/rules_nodejs/pull/2568) w/ types that we can leverage.

PR Close #41607
2021-04-14 15:42:08 -07:00
Zach Arend 3a2b5906ae release: cut the v11.2.10 release 2021-04-14 12:34:31 -07:00
Joey Perrott b8c4da9ae8 Revert "fix(compiler-cli): autocomplete literal types in templates. (#41456)" (#41623)
This reverts commit 1d12c50f63.

PR Close #41623
2021-04-14 09:16:36 -07:00
Andrew Scott 3d549809c3 fix(language-service): resolve to the pre-compiled style when compiled css url is provided (#41538)
With this commit, the language service will first try to locate a
pre-compiled style file with the same name when a `css` is provided in
the `styleUrls`. This prevents a missing resource diagnostic for when the
compiled file is not available in the language service environment and also
allows "go to definition" to go to that pre-compiled file.

Fixes angular/vscode-ng-language-service#1263

PR Close #41538
2021-04-14 09:15:01 -07:00
Andrew Scott 3dbcc7f7a1 fix(language-service): bound attributes should not break directive matching (#41597)
The language service uses an elements attributes to determine if it
matches a directive in the component scope. We do this by accumulating
all attribute bindings and matching against the selectors for the
available directives. The compiler itself does a similar thing. In
addition, the compiler does not use the value of `BoundAttribute`s to
match directives (https://github.com/angular/angular/blob/cdf1ea1951fb7187b1f6c9bb8a847c859c41e0b8/packages/compiler/src/render3/view/util.ts#L174-L206). This commit changes the language
service to also ignore bound attribute values for directive matching.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1278

PR Close #41597
2021-04-13 18:23:50 -07:00
Zach Arend df04b9be7d fix(compiler-cli): autocomplete literal types in templates. (#41456)
This adds string literals, number literals, `true`, `false`, `null` and
`undefined` to autocomplete results in templates.

For example, when completing an input of union type.

Component: `@Input('input') input!: 'a'|'b'|null;`
Template: `[input]="|"`

Provide `'a'`, `'b'`, and `null` as autocompletion entries.

Previously we did not include literal types because we only included
results from the component context (`ctx.`) and the template scope.

PR Close #41456
2021-04-13 13:51:48 -07:00
pavlenko 04235fa079 docs: replace Codelyzer recommendation with Angular-ESLint in accessibility guide (#41294)
Replace Codelyzer recommendation with Angular-ESLint in accessibility guide since that tool is deprecated and was removed from the Angular CLI.

Closes #41573

PR Close #41294
2021-04-13 13:06:18 -07:00
Joey Perrott 4847c146dc fix(dev-infra): only create authenticated github instance once in yargs (#41603)
Fix github token option for yargs to only create an authenticated token one time.

PR Close #41603
2021-04-13 11:50:50 -07:00
JoostK cfd67c1c81 refactor(compiler-cli): track a dependency on a default import on WrappedNodeExpr (#41586)
Previously, the `DefaultImportRecorder` interface was used as follows:

1. During the analysis phase, the default import declaration of an
   identifier was recorded.

2. During the emit phase each emitted identifier would be recorded.
   The information from step 1 would then be used to determine the
   default import declaration of the identifier which would be
   registered as used.

3. A TypeScript transform would taint all default imports that were
   registered as used in step 2 such that the imports are not elided
   by TypeScript.

In incremental compilations, a file may have to be emitted even if its
analysis data has been reused from the prior compilation. This would
mean that step 1 is not executed, resulting in a mismatch in step 2 and
ultimately in incorrectly eliding the default. This was mitigated by
storing the mapping from identifier to import declaration on the
`ts.SourceFile` instead of a member of `DefaultImportTracker` such that
it would also be visible to the `DefaultImportRecorder` of subsequent
compiles even if step 1 had not been executed.

Ultimately however, the information that is being recorded into the
`DefaultImportRecorder` has a longer lifetime than a single
`DefaultImportRecorder` instance, as that is only valid during a single
compilation whereas the identifier to import declaration mapping
outlives a single compilation. This commit replaces the registration of
this mapping by attaching the default import declaration on the output
AST node that captures the identifier. This enables the removal of
all of the `DefaultImportRecorder` usages throughout the analysis phase
together with the `DefaultImportRecorder` interface itself.

PR Close #41586
2021-04-13 07:37:29 -07:00
JoostK 43050a16de fix(compiler-cli): prevent eliding default imports in incremental recompilations (#41586)
The Angular compiler has to actively keep default import statements
alive if they were only used in type-only positions, but have been
emitted as value expressions for DI purposes. A problem occurred in
incremental recompilations, where the relationship between an identifier
usage and its corresponding default import would not be considered. This
could result in the removal of the default import statement and caused
a `ReferenceError` at runtime.

This commit fixes the issue by storing the association from an
identifier to its default import declaration on the source file itself,
instead of within the `DefaultImportTracker` instance. The
`DefaultImportTracker` instance is only valid for a single compilation,
whereas the association from an identifier to a default import
declaration is valid as long as the `ts.SourceFile` is the same
instance.

A subsequent commit refactor the `DefaultImportTracker` to no longer
be responsible for registering the association, as its lifetime is
conceptually too short to do so.

Fixes #41377

PR Close #41586
2021-04-13 07:37:28 -07:00
JoostK 01b7e3973a test(compiler-cli): disable emitDecoratorMetadata in the compiler test environment (#41586)
The `emitDecoratorMetadata` compiler option does not have to be enabled
as Angular decorators are transformed by the AOT compiler. Having the
option enabled in our tests can hide issues around import preservation,
as with `emitDecoratorMetadata` enabled the TypeScript compiler itself
does not elide imports even if they are only used in type-positions.
This is unlike having `emitDecoratorMetadata` disabled, however; in that
case the Angular compiler has to actively trick TypeScript into
retaining default imports when an identifier in a type-only position has
been reified into a value position for DI purposes.

A subsequent commit addresses a bug in default import preservation
that relies on this flag being `false`.

PR Close #41586
2021-04-13 07:37:28 -07:00
JoostK 616145e1a7 perf(compiler-cli): allow incremental compilation in the presence of redirected source files (#41587)
When multiple occurrences of the same package exist within a single
TypeScript compilation unit, TypeScript deduplicates the source files
by introducing redirected source file proxies. Such proxies are
recreated during an incremental compilation even if the original
declaration file did not change, which caused the compiler not to reuse
any work from the prior compilation.

This commit changes the incremental driver to recognize a redirected
source file and treat them as their unredirected source file.

PR Close #41587
2021-04-13 07:35:33 -07:00
Alex Rickabaugh 09eb1257d8 fix(compiler-cli): show a more specific error for Ivy NgModules (#41534)
When an Ivy NgModule is imported into a View Engine build, it doesn't have
metadata.json files that describe it as an NgModule, so it appears to VE
builds as a plain, undecorated class. The error message shown in this
situation generic and confusing, since it recommends adding an @NgModule
annotation to a class from a library.

This commit adds special detection into the View Engine compiler to give a
more specific error message when an Ivy NgModule is imported.

PR Close #41534
2021-04-13 07:34:47 -07:00
aschaap 9cda866703 docs: change (+) operator to Number function to match code (#41570)
PR Close #41570
2021-04-12 21:08:22 -07:00
aschaap 4795c5e7d8 docs(docs-infra): fix (+) not accepting null error by using Number instead (#41570)
Fix unexpected error when following the tutorial (when going through it with stricter type checking enforced). While (+) converts a string to an integer, it does not account for the possibility that `this.route.snapshot.paramMap.get('id')` could return null (type: string | null). Since this null case is not a practical outcome, it is a matter of types; switching from (+) to the `Number` function eliminates this issue, making the tutorial more robust.
PR Close #41570
2021-04-12 21:08:22 -07:00
aschaap 332653d353 docs: replaced erroneous instances of HeroDetailsComponent with HeroDetailComponent (#41569)
PR Close #41569
2021-04-12 21:07:36 -07:00
Nishu Goel a0ce686ec4 docs: add Nishu Goel to GDE list (#41347)
PR Close #41347
2021-04-12 21:06:02 -07:00
Joey Perrott 4378bc3a1b refactor(dev-infra): use a singleton for GitClient (#41589)
Creates a singleton class for GitClient rather than relying on creating an instance to
require being passed around throughout its usages.

PR Close #41589
2021-04-12 21:05:30 -07:00
Alex Rickabaugh f76873e4d5 fix(language-service): use 'any' instead of failing for inline TCBs (#41513)
In environments such as the Language Service where inline type-checking code
is not supported, the compiler would previously produce a diagnostic when a
template would require inlining to check. This happened whenever its
component class had generic parameters with bounds that could not be safely
reproduced in an external TCB. However, this created a bad user experience
for the Language Service, as its features would then not function with such
templates.

Instead, this commit changes the compiler to use the same strategy for
inline TCBs as it does for inline type constructors - falling back to `any`
for generic types when inlining isn't available. This allows the LS to
support such templates with slightly weaker type-checking semantics, which
a test verifies. There is still a case where components that aren't
exported require an inline TCB, and the compiler will still generate a
diagnostic if so.

Fixes #41395

PR Close #41513
2021-04-12 21:02:21 -07:00
Alan Cohen db90ba40eb docs: change ActivatedRouteStub code sample to work with strictNullChecks on (#41559)
convertToParamMap() does not accept undefined.
Fix code sample so it can be used in strict mode without requiring changes.

PR Close #41559
2021-04-12 21:01:40 -07:00
Pete Bacon Darwin 99c9f7c709 ci: remove old compliance tests (#41556) (#41585)
Now that we can run the new compliance tests on Windows,
we can delete the old ones, simplifying and speeding up our CI.

PR Close #41556

PR Close #41585
2021-04-12 16:40:40 -07:00
Pete Bacon Darwin 6a943883c2 ci: enable compliance tests on Windows (#41556) (#41585)
Now that we have updated the Bazel node.js rules we can run all the
compliance tests in Windows on CI.

PR Close #41556

PR Close #41585
2021-04-12 16:40:40 -07:00
Kristiyan Kostadinov 419c189ad3 fix(core): error if DebugRenderer2.destroyNode is called twice in a row (#41565)
Fixes an error that will be thrown if  `DebugRenderer2.destroyNode` is called with a node that has already been destroyed. The error happened, because we had a non-null assertion, even though the value can be null.

Note that this fix applies only to ViewEngine, because Ivy doesn't provide the `DebugRenderer2`. I decided to resolve it, because it fix is straightforward and this error has been showing up in our logs for a long time now, making actual errors harder to find.

PR Close #41565
2021-04-12 10:30:13 -07:00
Joey Perrott f0633c0c9a build: add breakingChangesLabel to merge configuration (#41546)
Sets the breakingChangesLabel property to properly confirm breaking changes.

PR Close #41546
2021-04-12 10:11:19 -07:00
Joey Perrott b5bf0a7c0d feat(dev-infra): verify breaking changes are properly labeled before merging (#41546)
During merging with `ng-dev pr merge` tooling will ensure that pull requests are
properly labeled for breaking changes.  Pull requests with commits noting breaking
changes must also be labeled as such, additionally pull requests with breaking
change labels must contain commits noting breaking changes.

Fixes #38776

PR Close #41546
2021-04-12 10:11:18 -07:00
Sagar Pandita 04ef24d87b docs: remove 'ui-jar' from Resources (#41552)
This commit removes 'ui-jar' from Resources, since it is not
compatible with the latest versions of Angular.

Fixes #41030

PR Close #41552
2021-04-12 10:05:51 -07:00
Joey Perrott 7946f6385b feat(dev-infra): create ReleaseNotes class for generating release notes during publishing (#41476)
Generate release notes to be used for entries in both CHANGELOG.md files as well as
Github releases.

PR Close #41476
2021-04-09 07:49:50 -07:00
Joey Perrott 9f67bace6a test(dev-infra): extract commit message build function into testing util function (#41476)
Creates a testing utility function to build commit message strings.

PR Close #41476
2021-04-09 07:49:50 -07:00
Aristeidis Bampakos 9bfa94f264 docs: add entry for prod tsconfig in library files (#41512)
Add an entry for TypeScript configuration file used in production

PR Close #41512
2021-04-09 07:46:53 -07:00
Andrew Scott e34299af25 fix(router): handle new navigations from a NavigationEnd event (#41262) (#41511)
This commit removes the line to set `currentNavigation` to `null` in the
navigation transitions subscription of the router. This logic is
already handled in the `finalize` stage of the transition pipe and has
been found to cause issues if a new navigation is triggered from a
subscription to the `NavigationEnd` event.

fixes #37460

PR Close #41262

PR Close #41511
2021-04-08 16:52:04 -07:00
Joey Perrott 74d1769a48 fix(dev-infra): use base ref name rather than sha for the githubTargetBranch (#41523)
After updating to use the v4 graphql api in the merge tooling, the githubTargetBranch
was set to be the sha of the latest commit rather than the branch name of the target
branch.  This caused our tooling to mismatch which branches were actually being targeted
with the effect that if a PR targeted only the patch branch (i.e. labeled `target: patch`
and targeting `11.2.x` in github)it would still expect to merge into both `11.2.x` and
`master`.  This is now corrected to once again use the branch name, restoring to the
previous functionality.

PR Close #41523
2021-04-08 15:18:03 -07:00
Andrew Scott 646f4a1fe6 fix(router): Remove information about attached component when deactivating route (#41381)
When we deactivate a child route, we deactivate its outlet as well as
its children. We also need to clear the stored information about the
route and the associated component.
If we do not, the context will keep these references and can result in
reactivating an outlet that was deactivated by the previous navigation.

Fixes #41379

PR Close #41381
2021-04-07 13:55:33 -07:00
Pete Bacon Darwin f72e218f01 docs: fix typo in migration guide (#41447)
Also reformat the table to look nice :-)

PR Close #41447
2021-04-07 13:51:09 -07:00
Pete Bacon Darwin 8b11bb4c9e build(docs-infra): store search dictionary as a string (#41447)
Previously, the search index info file contained an array of strings that is
the dictionary of terms in the corpus.
Storing this as a space separated string reduces the size of the file.

PR Close #41447
2021-04-07 13:51:09 -07:00
Pete Bacon Darwin 9d52386ba2 build(docs-infra): tidy up the generateKeywords processor (#41447)
The recent PR #41368 contained some changes that could be improved.

PR Close #41447
2021-04-07 13:51:09 -07:00
Joey Perrott 41636e6f5c build: rely on engines to prevent using npm for dependency install (#41477)
Rather than relying on a preinstall script, set `engine-strict` to `true` in a
project `.npmrc` file, relying on the `engines` having `npm` set to note that
yarn should be used instead.

---

Output from `npm install` changes from:
```
$ npm install

> angular-srcs@12.0.0-next.7 preinstall /usr/local/account/js/angular
> node tools/yarn/check-yarn.js

/usr/local/account/js/angular/tools/yarn/check-yarn.js:12
  throw new Error(
  ^

Error: Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/
    at Object.<anonymous> (/usr/local/account/js/angular/tools/yarn/check-yarn.js:12:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-srcs@12.0.0-next.7 preinstall: `node tools/yarn/check-yarn.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-srcs@12.0.0-next.7 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_54_02_292Z-debug.log
```
to
```
$ npm install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for angular-srcs@12.0.0-next.7: wanted: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"} (current: {"node":"10.20.1","npm":"6.14.4"})
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Required: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"}
npm ERR! notsup Actual:   {"npm":"6.14.4","node":"10.20.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_53_23_912Z-debug.log
```

PR Close #41477
2021-04-07 12:05:02 -07:00
Kristiyan Kostadinov b0120407d6 refactor(core): remove deprecated rxjs signature usage in event emitter and make more minifier-friendly (#41450)
* We had a usage of `Observable.subscribe` that uses the deprecated signature with 3 arguments. These changes switch to the non-deprecated version that passes in an `Observer`.
* Avoids always creating a `complete` callback since it isn't required.
* We were repeating all of the internal callbacks twice: once for sync and once for async. These changes move them out into variables so that they're more minifier-friendly. The savings aren't huge (~100 bytes minified), but it doesn't add any maintenance effort on our end so I decided to add it.

PR Close #41450
2021-04-07 11:53:09 -07:00
Joey Perrott 775993b1ed build: add dev-infra and docs-infra as targetLabelExemptScopes (#41459)
Add these scopes to allow for use of features and breaking changes for the
scopes regardless of target labels.

PR Close #41459
2021-04-07 11:52:37 -07:00
Joey Perrott 2b999e81a1 feat(dev-infra): add support for targetLabelExemptScopes for merging (#41459)
Add a property, `targetLabelExemptScopes`, to the merge configuration allowing certain
scopes to be exempted from requirements for features and breaking changes only included
in PRs targetting certain labels.

PR Close #41459
2021-04-07 11:52:37 -07:00
Joey Perrott 76832633c5 feat(dev-infra): prevent merges for PRs with invalid breaking changes or commit types (#41459)
Check commits in pull requests to ensure the pr can be merged into the target branch. Confirms
that prs targeting minor do not contain breaking changes, and prs targeting patch or lts do not
contain breaking changes or `feat` commits.

PR Close #41459
2021-04-07 11:52:37 -07:00
Joey Perrott ef13bbff61 refactor(dev-infra): use graphql to query PRs in merge tooling (#41459)
Migrate to use graqhql to query for PR information during the validation and
preperation portions of the pr merge tooling.

PR Close #41459
2021-04-07 11:52:36 -07:00
Zack DeRose ee65ffefd4 docs: add Zack DeRose to GDE resources (#41464)
PR Close #41464
2021-04-07 11:52:00 -07:00
Paul Muriel Biya-Bi 46f1cf27c0 docs: use the right tag in the HeroesComponent's template snippet (#41473)
Based on the tutorial content of the Hero Editor, the tag to be used in
HeroesComponent's template snippet should be h2 and not h3.

PR Close #41473
2021-04-07 11:51:38 -07:00
Andrew Scott bafec59b33 release: cut the v11.2.9 release (#41492) 2021-04-07 11:27:06 -07:00
George Kalpakas 9408af6059 docs: fix link URL in NG0100 error page (#41484)
Fixes #41474

PR Close #41484
2021-04-07 10:36:50 -07:00
Andrew Scott 07131fa8ef fix(compiler-cli): Allow analysis to continue with invalid style url (#41403) (#41489)
Currently, we throw a FatalDiagnosticError when we fail to load a resource
(`templateUrl` or `styleUrl`) at various stages in the compiler. This prevents
analysis of the component from completing. This will result in in users not being
able to get any information in the component template when there is a missing
`styleUrl`, for example.

This commit simply tracks the diagnostic, marks the component as poisoned, and
continues merrily along. Environments configured to use poisoned data
(like the language service) will then be able to use other information from the analysis.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1241

PR Close #41403

PR Close #41489
2021-04-07 10:35:32 -07:00
Joey Perrott f8986e1a53 fix(dev-infra): make scopes for test and refactor commit types optional (#41486)
As the `test` and `refactor` commit types are not used in release notes and there
are solid use cases for having multiple scopes/scopeless uses of these types, they
are made to be optional instead of required on commits.

PR Close #41486
2021-04-07 09:40:31 -07:00
Alan Agius 8d005e5132 fix(bazel): add missing dependency on tslib (#41480)
`@angular/bazel` depends on `tslib` https://unpkg.com/browse/@angular/bazel@11.2.8/src/api-extractor/index.js#L20

Related failure https://github.com/angular/universal/pull/2040

PR Close #41480
2021-04-07 09:39:49 -07:00
JounQin e0165fd7f8 fix(compiler-cli): fix extending angularCompilerOptions from non relative extension less TypeScript configuration files (#41349)
support non rooted file of node package and relative path without json extension

close #41343

PR Close #41349
2021-04-07 09:37:45 -07:00
Joey Perrott 110a20eeeb release: bump angular-in-web-memory-api package to 0.12.0 (#41487)
PR Close #41487
2021-04-07 09:35:17 -07:00
Joey Perrott 3f12a0dbfa build: update package.json engines range for nodes in preparation for upgrade (#41472)
In preparation for upgrading to `node@14`, and dropping `node@10`, updating the engines
for local `package.json`s.

PR Close #41472
2021-04-06 12:46:32 -07:00
Alan Agius 4c2fdd39e8 ci: add cache for windows run (#41467)
Add CircleCI cache for windows runs

PR Close #41467
2021-04-06 12:44:48 -07:00
Alan Agius 5aeb1c4f11 ci: don't save node_modules directory (#41467)
Storing node_modules directory in cache causes a number of issues, such as increase in the laid out node_modules tree and also in some cases break module resolution. This is because modules are not hoisted correctly when running `yarn install`.

Example of related failures https://app.circleci.com/pipelines/github/angular/angular/30441/workflows/c1a16135-f5c9-478d-a298-d720c6657d52/jobs/952138

A better cache strategy would be to save yarn cache, more information can be found in https://circleci.com/docs/2.0/caching/#yarn-node.

PR Close #41467
2021-04-06 12:44:48 -07:00
George Kalpakas bc74735644 build: correctly publish angular-in-memory-web-api as CI build artifact (#41429) (#41471)
Previously, the `angular-in-memory-web-api` package was built in
`dist/packages-dist/misc/angular-in-memory-web-api/`. This was different
from other Angular packages, which were placed directly in
`dist/packages-dist/`. This caused the `create-package-archives.sh`
script to create an invalid `misc.tgz` archive (i.e. treating the
`misc/` subdirectory as a package).
See, for example, the artifacts [here][1].

This commit changes the build scripts to have the
`angular-in-memory-web-api` package built in
`dist/angular-in-memory-web-api-dist/`, similar to how the `zone.js`
package is handled. It also updates the CircleCI config to correctly
publish the `angular-in-memory-web-api` package to CI build artifacts.

[1]: https://circleci.com/gh/angular/angular/951491

PR Close #41429

PR Close #41471
2021-04-06 11:32:46 -07:00
George Kalpakas e48d6cd049 build: build angular-in-memory-web-api when building packages with Ivy (#41429) (#41471)
This commit updates the `build-ivy-npm-packages.js` script to also build
the `angular-in-memory-web-api` package. This could be used if someone
wanted to test the Ivy packages in docs examples or an integration test.

PR Close #41429

PR Close #41471
2021-04-06 11:32:46 -07:00
George Kalpakas 478336a2d7 build: make the build scripts for the various packages consistent (#41429) (#41471)
This commit makes the build scripts for the various packages (framework,
`@angular/dev-infra-private`, `angular-in-memory-web-api`, `zone.js`)
consistent. This makes it easier to maintain them (e.g. make similar
changes across all build scripts).

PR Close #41429

PR Close #41471
2021-04-06 11:32:46 -07:00
George Kalpakas a9065a78b2 build(docs-infra): enable linting for ng-packages-installer scripts (#41429) (#41471)
This commit enables linting for the scripts in
`aio/tools/ng-packages-installer/`. It also makes the necessary changes
to the files to make linting pass.

PR Close #41429

PR Close #41471
2021-04-06 11:32:46 -07:00
George Kalpakas 55da31d521 build(docs-infra): update eslint and eslint-plugin-jasmine to latest versions (#41429) (#41471)
This commit updates the `eslint` and `eslint-plugin-jasmine` packages to
latest versions to take advantage of latest fixes and improvements.

PR Close #41429

PR Close #41471
2021-04-06 11:32:46 -07:00
Alan Agius 63ec4616c2 build(docs-infra): support building the local angular-in-memory-web-api package in NgPackagesInstaller (#41313) (#41471)
In some cases, we want to test the AIO app or docs examples against the locally built `angular-in-memory-web-api` for example to ensure that the changes in a commit do not introduce a breaking changes.

PR Close #41313

PR Close #41471
2021-04-06 11:32:46 -07:00
josemontespg 0eecbed69f docs(router): make getCurrentNavigation() jsdoc more explicit (#41417)
Add additional clarification to the documentation for
`getCurrentNavigation`.

PR Close #41417
2021-04-06 10:05:18 -07:00
Joey Perrott 9d6163ed99 feat(dev-infra): update commit-message functions to properly type commits from git log (#41458)
For commits from git log entries additional fields are available such as the reference
hash and author name, update the utility functions in commit-message to include the
parsed fields.  Additionally define, per commit message type, whether to include the
commit in a release notes entry.

PR Close #41458
2021-04-06 10:04:54 -07:00
Joey Perrott 2d194238fa feat(dev-infra): add utility method to GitClient to get latest SemVer tag (#41455)
Create a utility method for the latest git tag, sorted by committerdate, which
matches SemVer, representing the latest version released on the branch.

PR Close #41455
2021-04-06 10:04:31 -07:00
Paul Gschwendtner e6da38a5e0 feat(bazel): allow setting compilationMode in ng_module rule (#41418)
Adds a new attribute to the `ng_module` rule that allows users to
set the Angular compiler `compilationMode` flag. An alternative
would have been to just enable the option in the user-specified
tsconfig. Though that is more inconvenient if a Bazel workspace
wants to change the compilation mode conditionally at anaylsis
phase through build settings.

Related to: https://github.com/angular/components/pull/22351t

PR Close #41418
2021-04-06 10:03:14 -07:00
Arthur Ming aa36121c36 build: install husky in prepare script instead of postinstall (#41405)
With typicode/husky#890, the recommended way to install husky is in the
`prepare` script instead of the `postinstall`. This commit moves
the husky installation to the `prepare` script to align with the new
recommendation.

PR Close #41405
2021-04-06 10:02:52 -07:00
Arthur Ming f39ae4b833 build: update to husky@6 (#41405)
Upgrade husky from 5.0.1 to 6.0.0

PR Close #41405
2021-04-06 10:02:51 -07:00
George Kalpakas 6eb3dc770d build: update the recommended Dockerfile for VSCode remote development (#41396)
This commit updates the recommended `Dockerfile` for VSCode remote
development to take into account recent changes in our dev workflow
(updated Node.js version, vendored yarn, modified CircleCI config).

It also adds a note in the CircleCI config to keep the recommended
`Dockerfile` up-to-date with the Node.js version used on CI.

PR Close #41396
2021-04-05 12:41:35 -07:00
Joey Perrott 754247fefd feat(dev-infra): prevent git push from being called in dryRun mode (#41387)
Update GitClient to prevent the `push` command from being run in dryMode.

PR Close #41387
2021-04-05 08:57:14 -07:00
Joey Perrott 16ebd6bcf3 feat(dev-infra): create dry-run environment variable flag utils (#41387)
Create utility functions for adding a dry-run flag and checking the environment
for a dry run mode.

PR Close #41387
2021-04-05 08:57:14 -07:00
George Kalpakas 2ff13d28f3 fix(docs-infra): avoid auto-linking generic word state (#41438)
Since `state` is a generic word, this commit adds it to the list of
ignored words for auto-linking to avoid incorrectly auto-linking to the
[state()][1] animation helper. For example, see `/ngsw/state` in the
[ServiceWorker in production][2] guide.

[1]: https://v10.angular.io/api/animations/state
[2]: https://v10.angular.io/guide/service-worker-devops#locating-and-analyzing-debugging-information

PR Close #41438
2021-04-05 08:56:44 -07:00
George Kalpakas 04406faabf test(core): fix Function#name shim used in IE11 (#41439)
Since IE11 does not support `Function#name`, we use a shim in tests that
parses the stringified function to extract the name. Previously, that
shim would cache the computed name on the function to speed up future
invocations. However, this resulted in incorrect values for functions
that "extended" other functions (such as the code generated by
TypeScript when downleveling ES2015 classes that extended other
classes).

To avoid issues such as #41416 (see also [internal discussion][1]), this
commit removes the caching of names. This is not expected to noticeably
affect performance, since (a) it is only used in tests, (b) it is only
used on browsers that do not natively support `Function#name` (i.e.
IE11) and (c) accessing function names is rare and inexpensive compared
to other operations that happen during testing.

[1]: https://angular-team.slack.com/archives/CB4UC1932/p1617285258058000

PR Close #41439
2021-04-05 08:56:17 -07:00
Philipp_Lypniakov 103f05ad54 docs: fix grammar mistake in glossary.md ("can exported" --> "can be exported") (#41440)
PR Close #41440
2021-04-05 08:17:26 -07:00
Zach Arend 7b0a800b69 perf(language-service): add perf tracing to LanguageService (#41401)
Adds perf tracing for the public methods in LanguageService. If the log level is verbose or higher,
trace performance results to the tsServer logger. This logger is implemented on the extension side
in angular/vscode-ng-language-service.

PR Close #41401
2021-04-02 12:06:30 -07:00
mgechev 94af9d95bb perf(core): add private hooks around user code executed by the runtime (#41421)
Introduces an **internal**, **experimental** `profiler` function, which
the runtime invokes around user code, including before and after:
- Running the template function of a component
- Executing a lifecycle hook
- Evaluating an output handler

The `profiler` function invokes a callback set with the global
`ng.ɵsetProfiler`. This API is **private** and **experimental** and
could be removed or changed at any time.

This implementation is cheap and available in production. It's cheap
because the `profiler` function is simple, which allows the JiT compiler
to inline it in the callsites. It also doesn't add up much to the
production bundle.

To listen for profiler events:

```ts
ng.ɵsetProfiler((event, ...args) => {
  // monitor user code execution
});
```

PR Close #41421
2021-04-02 12:05:10 -07:00
Gabrielle Crevecoeur d4f739fb70 docs: Including Visual Studio (#41414)
Uploading how to use the Angular Language Service in Visual Studio
PR Close #41414
2021-04-02 10:53:37 -07:00
Joey Perrott dc8a0818e7 fix(dev-infra): require npm login for all publishes via wombat proxy (#41422)
Due to an issue with wombat proxy returning the login state of the generated tokens,
we will need to require a login for all `ng-dev release publish` runs to ensure npm
login has occured.

PR Close #41422
2021-04-02 10:30:18 -07:00
GChuf f066a2f29e build: Bump minimum required node version to 10.19.0 (#41390)
Critical security vulnerability fixed in node v 10.19.0
Other performance and security updates since node 10.9.0

PR Close #41390
2021-04-02 10:29:24 -07:00
Alex Rickabaugh 154129b9de release: cut the v11.2.8 release (#41419)
PR Close #41419
2021-04-01 14:46:31 -07:00
Pete Bacon Darwin 4bac297aa0 build: update yargs dependency to 16.2.0. (#41392)
This avoids a vulnerability in the transitive y18n dependency.

Fixes #41215

PR Close #41392
2021-04-01 13:41:26 -07:00
Pete Bacon Darwin bef92f97d7 docs(forms): fix the short description for DefaultValueAccessor (#41409)
The position of the `{@searchKeywords}` inline tag was causing the short-description to be empty.

PR Close #41409
2021-04-01 12:07:04 -07:00
Zach Arend e717915a22 ci: add Zach Arend to pullapprove (#41386)
add Zach Arend to .pullapprove.yml

PR Close #41386
2021-04-01 12:06:18 -07:00
Pete Bacon Darwin d48b00dc26 refactor(docs-infra): include more info in search index data (#41368)
The AIO search index is built in a WebWorker on the browser from a set
of page information that is downloaded as a JSON file (`search-data.json`).
We want to keep this file as small as possible while providing enough
data to generate a useful index to query against.

Previously, we only included one copy of each (non-ignored) term from each
doc but this prevents more subtle ranking of query results, since the number
of occurences of a term in a doc is lost.

This commit changes the generated file in the following ways:

- All non-ignored terms are now included in the order in which they appear
  in the doc.
- The terms are indexed into a dictonary to avoid the text of the term being
  repeated in every doc that contains the term.
- Each term is pre-"stemmed" using the same Porter Stemming algorith that the
  Lunr search engine uses.

The web-worker has been updated to decode the new format of the file.
Now that all terms are included, it may enable some level of phrase based
matching in the future.

The size of the generated file is considerably larger than previously, but
on production HTTP servers the data is sent compressed, which reduces the
size dramatically.

PR Close #41368
2021-04-01 12:02:38 -07:00
Pete Bacon Darwin ad706c8271 feat(docs-infra): improve search query processing (#41368)
This commit tries to improve the search results by processing
the query and attempting progressively less restrictive searches
until a non-zero set of pages is matched.

The new procesing includes:

* stripping off quote marks, which were causing searches to fail
* first attempting to match pages where ALL the query terms exist
* second attempting to match pages where ANY of the query terms exist
* third attempting to match pages where the title contains partial word matches

The first query attempt approximates, quite well, the idea of searching
for multi-word phrases. This is given the technical nature of the terms
and the fairly small size of the corpus.

PR Close #41368
2021-04-01 12:02:37 -07:00
pavlenko c58f46b458 docs: fix misspelled word in VSCode Remote Development guide (#41376)
There is a plural word after indefinite article in readme file.

PR Close #41376
2021-04-01 12:02:02 -07:00
Adem Simsek f2389668c2 fix(dev-infra): Correctly place comments in dockerfile (#41374)
The doc in https://docs.docker.com/engine/reference/builder/#format says that
"Docker treats lines that begin with # as a comment, unless the line is a valid parser directive. A # marker anywhere else in a line is treated as an argument."

Fixes #41361

PR Close #41374
2021-04-01 11:55:54 -07:00
George Kalpakas dfad9018f9 fix(docs-infra): increase the max width of the file-not-found page (#41275)
Previously, the max width of the `file-not-found` page was limited to
50rem (800px by default). This allowed little space for showing
potentially helpful search results, which are shown in columns).

This commit increases the max width of the `file-not-found` page to
84rem (1344px by default) to allow search results to be visible without
requiring scrolling. This will not negatively affect UX, because the
page uses a multi-column layout and therefore there will rarely be long
lines of text to scan.

PR Close #41275
2021-04-01 11:36:45 -07:00
George Kalpakas fdfcd4a5ea fix(docs-infra): correctly show search results on narrow screens (#41275)
Previously, some part of the search results would be hidden and
inaccessible on narrow screens. This was caused by an issue with the
flexbox layout. See [here][1] for more info on the issue and the
available solutions.
NOTE: This issue affected both the search results shown when using the
search box (on the top right of the page) as well as the search results
shown in the `file-not-found` page.

This commit changes how the layout of search results is achieved to
ensure they are always accessible via scrolling on all screen sizes
(while keeping the same layout on larger screens).

Before: ![search results at 768px before][2]
After: ![search results at 768px after][3]

[1]: https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container#33455342
[2]: https://user-images.githubusercontent.com/8604205/111772790-efe2ac00-88b5-11eb-925d-a80faeaa5369.png
[3]: https://user-images.githubusercontent.com/8604205/111772810-f5d88d00-88b5-11eb-8b2a-60bdc3736ea3.png

PR Close #41275
2021-04-01 11:36:45 -07:00
Joey Perrott 4b17213b0b ci: update commit-message verification range parameters (#41341)
Update parameters used for commit message checks in pull requests.

PR Close #41341
2021-04-01 11:30:28 -07:00
Joey Perrott 055b408945 refactor(dev-infra): set up new method for checking range of commits (#41341)
Check a range of commits by retrieving the log files to be parsed with the expected
format for the parser.

This change is in part of a larger set of changes making the process for obtaining
and parsing commits for release note creation and message validation consistent.
This consistency will make it easier to debug as well as ease the design of tooling
which is built on top of these processes.

PR Close #41341
2021-04-01 11:30:28 -07:00
George Kalpakas 1125204878 docs: fix .docs-card tooltip and footer text in docs guide (#41250)
This commit updates the tooltip and footer description of the
"What is Angular" card in the `docs` guide to better match the card's
content. (It seems that the old content was copied/pasted from a
different card.)

It also updates the tooltip of the "Hello World" card to better describe
the card's purpose.

PR Close #41250
2021-04-01 11:20:00 -07:00
George Kalpakas ed2a2ba0b2 docs: correctly style alert in updating-content-github-ui guide (#41250)
This commit replaces the unknown `is-warning` CSS class from an alert in
the `updating-content-github-ui` guide with the `is-important` CSS class
(that causes the alert to be given an orange-ish background).

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas 6749ad674a refactor(docs-infra): consistently format docs-card elements in the guides (#41250)
This commit formats the `docs-card` elements used in
`contributors-guide-overview` and `docs` guides to have consistent
indentation and line-wrapping.

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas e97a8452a8 docs: several minor fixes/improvements to docs contributing guides (#41250)
This commit includes several minor fixes and improvements to the
`updating-content-github-ui` and `updating-search-keywords` guides.

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas eb364803f4 docs: use dedicated anchors for links to CONTRIBUTING.md (#41250)
Previously, some links to specific sections of `CONTRIBUTING.md` were
using hashes automatically generated by GitHub based on the section
headings. This resulted in less readable hashes which were directly tied
to the heading text and thus less robust (i.e. more likely to break if
the heading was re-worded in the future).

This commit switches such links to use the dedicated anchors, which are
more succinct/readable and more stable.

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas 5500f9c46e docs: fix URLs in reviewing-content and updating-search-keywords guides (#41250)
This commit fixes some incorrect URLs in `reviewing-content` and
`updating-search-keywords` guides.

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas 51288e41d4 fix(docs-infra): add updating-content-github-ui guide to the sidenav (#41250)
It seems that the `updating-content-github-ui` guide was accidentally
omitted from the sidenav in #41061.

This commit adds the guide to the sidenav.

PR Close #41250
2021-04-01 11:19:59 -07:00
George Kalpakas 15b94566a5 ci: remove redundant entries from .pullapprove.yml (#41250)
This commit removes some entries from `.pullapprove.yml` that do not
correspond to existing files on disk.

PR Close #41250
2021-04-01 11:19:58 -07:00
Alex Rickabaugh 723bfc717b Revert "feat(bazel): allow setting compilationMode in ng_module rule (#41366)"
This reverts commit 9d17a41b33.

This commit breaks the 11.2.x build. There is limited value in having it on
11.2.x in the first place, so reverting it is the right fix.
2021-03-31 09:33:01 -07:00
Joey Perrott e524012b2e ci: remove *.bazel from dev-infra ownership (#41382)
Historically all .bazel files were owned by dev-infra to assist in ensuring that
consistency was maintained in how rules were being used.  As this now has reached
a point of maturity in the repository where the check is mostly a rubber stamping,
this requirement can be removed.  Notably this is different than the requirement
of dev-infra approval for .bzl files as these contain the implementation of macros
rather than just the usage.

PR Close #41382
2021-03-30 16:59:01 -07:00
Kristiyan Kostadinov f9da27214b fix(compiler): handle case-sensitive CSS custom properties (#41380)
Currently we normalize all CSS property names in the `StylingBuilder` which breaks custom properties, because they're case-sensitive. These changes add a check so that custom properties aren't normalized.

Fixes #41364.

PR Close #41380
2021-03-30 16:57:45 -07:00
Paul Gschwendtner 9d17a41b33 feat(bazel): allow setting compilationMode in ng_module rule (#41366)
Adds a new attribute to the `ng_module` rule that allows users to
set the Angular compiler `compilationMode` flag. An alternative
would have been to just enable the option in the user-specified
tsconfig. Though that is more inconvenient if a Bazel workspace
wants to change the compilation mode conditionally at anaylsis
phase through build settings.

Related to: https://github.com/angular/components/pull/22351t

PR Close #41366
2021-03-30 16:55:38 -07:00
Paul Gschwendtner 06e5132818 ci: re-activate "devversion" in pullapprove after OOO (#41352)
After being OOO for a while, I have been denoted as OOO in the pullapprove
configuration (by commenting out the username in the reviewer lists).

See 3ba97ab391.

This re-activates `devversion` in the pullapprove configuration.

PR Close #41352
2021-03-30 16:54:49 -07:00
profanis 62ef7c788d docs: describe how to run tests in GitLab CI (#40411)
The documentation has a very useful configuration for Travis and CircleCI but not for GitLab CI.
So, I thought that might be useful to have that as well.

PR Close #40411
2021-03-30 16:53:31 -07:00
Obumuneme Nwabude 6ef90e4af8 docs(docs-infra): update docs on configuring project for Travis CI (#37473)
Remove sudo since it no longer has use in Travis CI build configurations.
Change chrome addons to use the latest required method.
Remove dist to make the Travis CI builds run in the latest Ubuntu release: Xenial.
This because Trusty uses an older version of Chrome which is not supported
by the current the latest Chrome Driver, used in ng e2e tests.

Fixes #36451

PR Close #37473
2021-03-30 16:45:33 -07:00
Yvonne Allen fa2b47f507 docs: review and update components overview guide (#41263)
* add links to navigate to the create workspace and application and install Angular CLI how-to steps for easy navigation
* add reviewed tag with date guide was reviewed

PR Close #41263
2021-03-30 16:44:02 -07:00
James Henry 6dcea34c24 refactor(compiler): option to include html comments in ParsedTemplate (#41251)
Adds a `collectCommentNodes` option on `ParseTemplateOptions` which will cause the returned `ParsedTemplate` to include an array of all html comments found in the template.

PR Close #41251
2021-03-29 15:16:27 -07:00
Joey Perrott 5e8afc9fd2 fix(dev-infra): use all non-header content for checking commit body length (#41367)
As discovered in #41316, commit body length checks should consider all of the non-header
content as the commit body rather than the conventional-commit-parser's current method
of considering everything after an issue/PR reference to be the footer.

PR Close #41367
2021-03-29 15:14:59 -07:00
Alex Rickabaugh d5e83bcd00 build: emit performance JSON file for each ng_module() (#41125)
A previous commit implemented a streamlined performance metric reporting
system for the compiler-cli, controlled via the compiler option
`tracePerformance`.

This commit adds a custom Bazel flag rule //packages/compiler-cli:ng_perf
to the repository, and wires it through to the `ng_module` implementation
such that if the flag is set, `ng_module` will produce perf results as part
of the build. The underlying mechanism of `//:ng_perf` is not exported from
`@angular/bazel` as a public rule that consumers can use, so there is little
risk of accidental dependency on the contents of these perf traces.

An alias is added so that `--ng_perf` is a Bazel flag which works in our
repository.

PR Close #41125
2021-03-24 13:42:26 -07:00
Alex Rickabaugh 56763d1165 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:26 -07:00
Zach Arend cc7b889e56 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:52 -07:00
Joey Perrott 09dcf86396 release: cut the v11.2.7 release (#41336) 2021-03-24 09:17:05 -07:00
George Kalpakas 2d183f63c6 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:47 -07:00
Marios Radis cdbec67032 docs: spelling changes in app.e2e-spec and validate-spec files (#41331)
PR Close #41331
2021-03-23 15:22:48 -07:00
Joey Perrott d8d77ed00d refactor(dev-infra): use conventional-commits-parser for commit parsing (#41329)
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 #41329
2021-03-23 14:17:08 -07:00
Joey Perrott a68f6b0ca6 docs: format browser-support tables for GitHub markdown (#41327)
Format the HTML used in browser-support.md such that the tables
render correctly under GitHub markdown.

PR Close #41327
2021-03-23 13:09:08 -07:00
Yvonne Allen 9cb11758c1 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:32 -07:00
waterplea c8edb04701 docs: add Alexander Inkin to GDE list (#41310)
PR Close #41310
2021-03-23 11:18:27 -07:00
Alex Rickabaugh 18cd7a0c69 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 89867eb5af 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:44 -07:00
George Kalpakas e3fce5ded1 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 8cac76731e docs: add some boilerplate button, h3, and hr styles (#41052)
PR Close #41052
2021-03-23 09:38:00 -07:00
Alisa Duncan 824f0a99de docs: add alisa duncan to GDE resources (#41295)
PR Close #41295
2021-03-23 09:37:11 -07:00
cindygk 17c5dc7bc5 docs: update contributors.json (#41284)
PR Close #41284
2021-03-22 08:56:48 -07:00
Joey Perrott d719a5d967 fix(dev-infra): remove commit message wizard and builder (#41280) (#41285)
Removing commit message builder and wizard as they are unused and
unneeded.

PR Close #41285
2021-03-22 08:56:20 -07:00
Pete Bacon Darwin 8fb4290a3c 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:54 -07:00
Pete Bacon Darwin 95d0e6608f docs: reduce the file size of contributor images (#41292)
Fixes #41287

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

PR Close #41303
2021-03-22 08:54:54 -07:00
Yvonne Allen 72c9565c34 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:51 -07:00
Pete Bacon Darwin f358d6b113 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:16 -07:00
Andrew Kushnir 8a53b5454e 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 https://github.com/angular/angular/commit/6f203c9575fe9a2da04529fbdf1e5f7b51e85e09). Later, the situation was improved to actually allow both bindings to co-exist (see https://github.com/angular/angular/commit/a153b610983389de6408f7a723fd5714a11c168e), 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:46 -07:00
Andrew Kushnir a4b42a27e9 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 230e7d3b06 docs(localize): expose documentation for the @angular/localize package (#40317)
PR Close #40317
2021-03-19 12:36:10 -07:00
Zach Arend 57644e95aa fix(compiler-cli): add useInlining option to type check config (#41268)
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 #41268
2021-03-19 12:31:27 -07:00
Zach Arend e58c8a68cb refactor(compiler-cli): don't use FakeEnvironment for tcb tests (#41268)
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 #41268
2021-03-19 12:31:27 -07:00
Samuel R 4690b6dbca 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 19fba2a295 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:58 -07:00
George Kalpakas 60ea0b1a1c docs: make HeroService#gerHero() in toh-pt5 compatible with TS strict mode (#41234)
Fixes #41207

PR Close #41234
2021-03-18 10:00:53 -07:00
George Kalpakas 9a1abe2164 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:53 -07:00
Preston Lamb 8f5f3d2c1e docs: add preston lamb to GDE resources (#41204)
PR Close #41204
2021-03-18 09:58:07 -07:00
Jessica Janiuk cbba7152fd release: cut the v11.2.6 release (#41247) 2021-03-17 10:43:01 -07:00
Alan Agius 78038027fc docs: update assets configuration to include followSymlinks option (#41238)
The `followSymlinks` is not listed in the assets configuration section.

PR Close #41238
2021-03-17 09:04:16 -07:00
Teri Glover 1cde7056db docs: minor update to what is Angular topic (#41123)
PR Close #41123
2021-03-17 09:01:36 -07:00
Gérôme Grignon 18cd7bbd9b docs: remove unused attribute (#41211)
Fixes #41210

PR Close #41211
2021-03-16 14:48:53 -07:00
George Kalpakas ca9af4078f build(docs-infra): upgrade cli command docs sources to 61b617392 (#41228)
Updating [angular#11.2.x](https://github.com/angular/angular/tree/11.2.x) from
[cli-builds#11.2.x](https://github.com/angular/cli-builds/tree/11.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/ab638724c...61b617392):

**Modified**
- help/generate.json
- help/new.json

PR Close #41228
2021-03-16 11:04:50 -07:00
Andrew Kushnir ae1255c55e ci: remove Stephen from PullApprove config (#41224)
This commit updates PullApprove config and removes Stephen from the list of reviewers.

PR Close #41224
2021-03-16 11:00:34 -07:00
Andrew Kushnir 6414590f8d perf(forms): make RadioControlRegistry class tree-shakable (#41126)
This commit makes the `RadioControlRegistry` class tree-shakable by adding the `providedIn` property to its
`@Injectable` decorator. Now if the radio buttons are not used in the app (thus no `RadioControlValueAccessor`
directive is initialized), the `RadioControlRegistry` should not be included into application's prod bundle.

PR Close #41126
2021-03-16 09:35:15 -07:00
Andrew Kushnir ffc93e0946 perf(forms): make FormBuilder class tree-shakable (#41126)
This commit makes the `FormBuilder` class tree-shakable by adding the `providedIn` property to its `@Injectable`
decorator. Now if the `FormBuilder` class is not referenced in application's code, it should not be included into
its production bundle.

PR Close #41126
2021-03-16 09:35:15 -07:00
JoostK be050b2582 fix(ngcc): do not compile JavaScript sources if typings-only processing is repeated (#41209)
The recently introduced typings-only mode in ngcc would incorrectly
write compiled JavaScript files if typings-only mode was requested, in
case the typings of the entry-point had already been processed in a
prior run of ngcc. The corresponding format property for which the
JavaScript files were written were not marked as processed, though, as
the typings-only mode excluded the format property itself from being
marked as processed. Consequently, subsequent runs of ngcc would not
consider the entry-point to have been processed and recompile the
JavaScript bundle once more, resulting in duplicate ngcc imports.

Fixes #41198

PR Close #41209
2021-03-16 09:33:54 -07:00
David Shevitz bec919ace9 docs: add contributors guide to aio (#41061)
PR Close #41061
2021-03-15 12:16:38 -07:00
Andrew Kushnir 804b6b6685 perf(forms): avoid direct references to the Validators class (#41189) (#41220)
Currently the `Validators` class contains a number of static methods that represent different validators as well as some helper methods. Since class methods are not tree-shakable, any reference to the `Validator` class retains all of its methods (even if you've used just one).

This commit refactors the code to extract the logic into standalone functions and use these functions in the code instead of referencing them via `Validators` class. That should make the code more tree-shakable. The `Validators` class still retains its structure and calls these standalone methods internally to keep this change backwards-compatible.

PR Close #41189

PR Close #41220
2021-03-15 12:15:16 -07:00
twerske da5f5a4910 docs: add youtube to social icons (#40987) (#41202)
PR Close #40987

PR Close #41202
2021-03-15 11:15:10 -07:00
George Kalpakas b4484125d6 docs: document help wanted and good first issue labels (#41195)
Previously, we used the `hotlist: community-help` label to mark issues
that were good candidates for contributions from the community.
Recently, we also started using the `good first issue` label to mark
issues that would additionally be suitable for first-time contributors.

This commit is part of the work to replace `hotlist: community-help`
with the newly added `help wanted` label, which (same as
`good first issue`) is a [default GitHub label][1]. This commit changes
all occurrences of `hotlist: community-help` in the documentation to
`help wanted` and also documents the purpose of the `help wanted` and
`good first issue` labels.

[1]: https://docs.github.com/en/github/managing-your-work-on-github/managing-labels#about-default-labels

PR Close #41195
2021-03-15 10:31:30 -07:00
Andrew Kushnir 5908eda7c1 perf(forms): make built-in ControlValueAccessors more tree-shakable (#41146) (#41197)
This commit updates Forms code to avoid direct references to all built-in ControlValueAccessor classes, which
prevents their tree-shaking from production builds. Instead, a new static property is added to all built-in
ControlValueAccessors, which is checked when we need to identify whether a given ControlValueAccessors is a
built-in one.

PR Close #41146

PR Close #41197
2021-03-12 16:48:59 -08:00
Andrew Kushnir 60ac964333 fix(forms): properly handle the change to the FormGroup shape (#40829)
Currently the code in the `FormGroupDirective` assumes that the shape of the underlying `FormGroup` never
changes and `FormControl`s are not replaced with other types. In practice this is possible and Forms code
should be able to process such changes in FormGroup shape.

This commit adds extra check to the `FormGroupDirective` class to avoid applying FormControl-specific to
other types.

Fixes #13788.

PR Close #40829
2021-03-12 14:23:02 -08:00
George Kalpakas b37296ae64 ci: remove CHANGELOG.md from the public-api group (#41135)
This commit changes the owning group for the `CHANGELOG.md` file from
`public-api` to `dev-infra` (similar to other top-level `.md` files).

Internal discussion:
https://angular-team.slack.com/archives/C040TF8UT/p1615218082023400

PR Close #41135
2021-03-12 13:27:14 -08:00
stefanos- 226834752c docs: add book about testing to resources (#41159)
PR Close #41159
2021-03-12 13:25:49 -08:00
George Kalpakas 35fa658a4d fix(docs-infra): fix <code-tabs> in IE11 (#41183)
Previously, `<code-tabs>` did not work correctly in IE11. More
specifically, due to how IE11 handles updates to `innerHTML`, the
contents of `<code-pane>` elements were cleared before we could capture
them and pass them to the `<aio-code>` components.

This commit fixes it by ensuring we capture the `<code-pane>` contents
before clearing unneeded HTML.

Before: ![code tabs in IE11 before][1]
After: ![code tabs in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110815248-f4460e00-8292-11eb-868e-eca7ba5e9cd3.png
[2]: https://user-images.githubusercontent.com/8604205/110815253-f5773b00-8292-11eb-80a6-1a0b1ea44d8f.png

PR Close #41183
2021-03-12 13:22:59 -08:00
George Kalpakas 06745fc057 fix(docs-infra): fix display of AngularJS logo on the "Press kit" page in IE11 (#41183)
Previously, the AngularJS SVG logo shown on the "Press kit" page was not
displayed correctly in IE11 (see the image below).

This commit fixes it by explicitly specifying the SVG `viewBox` on the
logo.

Before: ![presskit AngularJS logo in IE11 before][1]
After: ![presskit AngularJS logo in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110812629-7123b880-8290-11eb-9f71-0ae910536fa5.png
[2]: https://user-images.githubusercontent.com/8604205/110812633-7254e580-8290-11eb-896c-84f595d273b8.png

PR Close #41183
2021-03-12 13:22:59 -08:00
George Kalpakas 338c77c9b1 fix(docs-infra): fix the layout of the "Features" page in IE11 (#41183)
IE11 does not support `justify-content: space-evenly` and therefore
falls back to the default (`flex-start`), breaking the layout of the
items in the "Features" page (see the image below).

This commit fixes the layout by specifying `space-around` as a fallback
for `justify-content`, which keeps the layout closer to the intended.

Before: ![features page layout in IE11 before][1]
After: ![features page layout in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110811038-045bee80-828f-11eb-8027-d5851762a5eb.png
[2]: https://user-images.githubusercontent.com/8604205/110811076-0a51cf80-828f-11eb-98a0-2f2928128dd0.png

PR Close #41183
2021-03-12 13:22:58 -08:00
George Kalpakas 8cfc3d7fa2 fix(docs-infra): fix the layout of docs pages in IE11 (#41183)
IE11 does not recognize the `<main>` element as a block element and
therefore it does not apply margin/paddings/widths as expected. This
resulted in the layout of docs pages being broken in IE11 (see the image
below).

This commit fixes the layout by explicitly setting `.sidenav-content`
(which is a `<main>` element) to `display: block`.

Before: ![docs pages layout in IE11 before][1]
After: ![docs pages layout in IE11 after][2]

[1]: https://user-images.githubusercontent.com/8604205/110808902-1b014600-828d-11eb-9eef-c1234dc2d436.png
[2]: https://user-images.githubusercontent.com/8604205/110808907-1ccb0980-828d-11eb-91d9-06e5cfafc894.png

PR Close #41183
2021-03-12 13:22:58 -08:00
George Kalpakas 25f85de888 fix(docs-infra): fix angular.io on browsers that support Custom Elements but not ES2015 (#41183)
Before #41162, angular.io was broken on IE 11 due to missing a polyfill
for an API (`Reflect.construct()`) needed by the Custom Elements ES5
shim. #41162 tried to fix this by loading the necessary polyfill
(`es.reflect.construct.js`) on browsers that do not support ES2015
modules (including IE 11).

It turns out that the fix in #41162 was itself broken, because the
`es.reflect.consruct.js` script (included directly in the page via a
`<script>` tag) was in CommonJS format (which cannot run in the browser
as is). By chance, this still allowed browsers that supported neither
Custom Elements nor ES2015 modules (such as IE 11) to work correctly as
a side-effect of loading the `@webcomponents/custom-elements` polyfill
after the Custom Elements ES5 shim (`native-shim.js`). However, on the
few browsers that natively support Custom Elements but not ES2015
modules, angular.io would still be broken.

This commit correctly fixes angular.io on all browsers by properly
bundling the polyfills and transpiling to ES5.

Implementation-wise, we use [esbuild][1] for bundling the polyfills (and
converting from CommonJS to a browser-compatible, IIFE-based format) and
[swc][2] for downleveling the code to ES5 (since `esbuild` only supports
ES2015+).

[1]: https://esbuild.github.io/
[2]: https://swc.rs/

PR Close #41183
2021-03-12 13:22:58 -08:00
George Kalpakas 74aba139ed fix(docs-infra): fix angular.io on IE 11 (#41162) (#41184)
Previously, the angular.io app was broken on IE 11. In particular, pages
that included Custom Elements would fail to load, because the
`Reflect.construct()` method (which the Custom Elements ES5 shim relies
on) was not available.

This commit fixes this by loading the polyfill for `Reflect.construct()`
on browsers that do not support ES2015 (including IE 11).

PR Close #41162

PR Close #41184
2021-03-11 12:29:04 -08:00
George Kalpakas 3004520006 fix(docs-infra): avoid unnecessarily loading Custom Elements ES5 shim (#41162) (#41184)
The custom elements spec is not compatible with ES5 style classes. This
means ES2015 code compiled to ES5 will not work with a native
implementation of Custom Elements. To support browsers that natively
support Custom Elements but not ES2015 modules, we load
`@webcomponents/custom-elements/src/native-shim.js`, which minimally
augments the native implementation to be compatible with ES5 code.
(See [here][1] for more details.)

Previously, the shim was included in `polyfills.ts`, which meant it was
loaded in all browsers (even those supporting ES2015 modules and thus
not needing the shim).

This commit moves the shim from `polyfills.ts` to a `nomodule` script
tag in `index.html`. This will ensure that it is only loaded in browsers
that do not support ES2015 modules and thus do not needed the shim.

NOTE:
This commit also reduces size of the polyfills bundle by ~400B
(52609B --> 52215B).

[1]: https://www.npmjs.com/package/@webcomponents/custom-elements#es5-vs-es2015

PR Close #41162

PR Close #41184
2021-03-11 12:29:04 -08:00
Pete Bacon Darwin ed6c09ae45 fix(localize): trim extracted equiv-text values (#41180)
The ViewEngine message extraction would trim the values
of the `equiv-text` attributes. This commit aligns the Ivy
extraction of these attributes.

Fixes #41176

PR Close #41180
2021-03-11 10:31:39 -08:00
Stepan Suvorov 78e67130f7 docs: add stepan suvorov to GDE resources (#41178)
PR Close #41178
2021-03-11 09:31:50 -08:00
George Kalpakas ab784d5949 fix(docs-infra): generate the 404.html page correctly (#41163)
Previously, the generated `404.html` page did not include a `<body>`
tag. In some browsers (such as IE 11), this was causing warnings in the
console.

This commit ensures the generated page contains a `<body>` tag. It also
fixes the indentation in the generated page.

PR Close #41163
2021-03-11 09:30:05 -08:00
pniedermeyer 2fa231a83c docs: Remove of unnecessary Input (#41150)
remove unnecessary Input

PR Close #41150
2021-03-10 11:20:07 -08:00
Alan Agius 28931b59d6 build: remove commit message max line length limit (#41157)
With this change we remove the lines length restriction in commit message body. This was previously in place due to a bug in GitHub UI, which is now fixed.

PR Close #41157
2021-03-10 11:05:47 -08:00
Pete Bacon Darwin 7dbb550946 fix(localize): render correct closing tag placeholder names in XLIFF 2 (#41152)
When there are elements in a translated message, the start and end tags
are encoded as placeholders. The names of these placeholders are computed
from the name of the element. For example `<a> will be `START_LINK` and
`</a>` will be `CLOSE_LINK`.

If there are more than one element with the same name, but different attributes,
then the starting placeholder name is made unique.
For example `<a href="a">` would be `START_LINK`, while `<a href="b">` in
the same message would then be called `START_LINK_1`.
But the closing tags will not be made unique since there are no attrbutes;
the always have the same text `</a>`, which will produce, for example,
`CLOSE_LINK`.

Previously, when extracting XLIFF 2 formatted translation files, the closing
tag placeholder names were computed incorrectly from the opening tag
placeholder names. For example `CLOSE_LINK_1`.

This commit strips these `_1` type endings from the start tag placeholder
name when computing the closing tag placeholder name. It also ensures
that the `type` of the placeholder is computed accurately in these cases
too.

Fixes #41142

PR Close #41152
2021-03-10 11:00:05 -08:00
cexbrayat fa97166361 fix(core): remove duplicated EMPTY_OBJ constant (#41153)
The codebase currently contains several `EMPTY_OBJ` constants,
and they can end up in the bundle of an application.
A recent commit 6fbe219 tipped us off
as it introduced several `noop` occurrences in the golden symbol files.
After investigating, we decided to remove the duplicated symbols.

This probably shaves only a few bytes,
but this commit removes the duplicated functions,
by always using the one in `core/src/utils/empty`.

PR Close #41153
2021-03-10 10:48:13 -08:00
Andrew Kushnir 2c757591ee release: cut the v11.2.5 release (#41154) 2021-03-10 09:44:13 -08:00
Joey Perrott 01c1677151 build: update the lock closed sha to the latest sha (#41140)
Update to use the latest lock closed sha, additionally use the full length sha for
referencing the exact version to use.

PR Close #41140
2021-03-09 13:24:52 -08:00
George Kalpakas c4ea0ab4e0 fix(docs-infra): print info to help debugging SW cache issue (#41106) (#41139)
From time to time, an angular.io page fails to load due to requesting a
file that cannot be found neither on the server nor in the cache. We
believe this is caused by the browser's partially clearing a cache.
See #28114 for more details.

Some time ago, we introduced [SwUpdate#unrecoverable][1] to help work
around this issue by [reloading the page][2] when such an error is
detected.

However, this issue still pops up occasionally (for example, #41073).

In an attempt to help diagnose the issue, this commit prints more info
regarding the SW state and cache content when this error occurs. It will
result in something like the following being printed to the console:

```
ServiceWorker: activated

Cache: ngsw:/:db:control (2 entries)
  - https://angular.io/assignments: {"f5f02035-ee1f-463c-946c-e8b85badca25":"5c95f89a85255a6fefb4045a20f751ef32b2f3a4"}
  - https://angular.io/latest: {"latest":"5c95f89a85255a6fefb4045a20f751ef32b2f3a4"}

Cache: ngsw:/:5c95f89a85255a6fefb4045a20f751ef32b2f3a4:assets:app-shell:cache (24 entries)
  - https://angular.io/0-es2015.867022f8bb092ae1efb1.worker.js
  - https://angular.io/announcement-bar-announcement-bar-module-es2015.1b5b762c9c8837c770f8.js
  - https://angular.io/api-api-list-module-es2015.40a43cd22f50f64d63bb.js
  ...

Cache: ngsw:/:db:ngsw:/:5c95f89a85255a6fefb4045a20f751ef32b2f3a4:assets:app-shell:meta (1 entries)
  - https://angular.io/https://fonts.gstatic.com/s/robotomono/v13/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2:
      {"ts":1615031956601,"used":true}

If you see this error, please report an issue at https://github.com/angular/angular/issues/new?template=3-docs-bug.md
including the above logs.
```

NOTE:
This change increases the main bundle by 1649B (0.37%), but it can be
reverted as soon as we gather enough info to diagnose the issue.

[1]: https://angular.io/api/service-worker/SwUpdate#unrecoverable
[2]: https://github.com/angular/angular/blob/c676ec1ce5d586d4bc46/aio/src/app/sw-updates/sw-updates.service.ts#L55-L61

PR Close #41106

PR Close #41139
2021-03-09 11:31:31 -08:00
JoostK 16f90cac4b perf(compiler-cli): ensure module resolution cache is reused for type-check program (#39693)
The Angular compiler creates two `ts.Program`s; one for emit and one for
template type-checking. The creation of the type-check program could
benefit from reusing the `ts.ModuleResolutionCache` that was primed
during the creation of the emit program. This requires that the compiler
host implements `resolveModuleNames`, as otherwise TypeScript will setup
a `ts.ModuleResolutionHost` of its own for both programs.

This commit ensures that `resolveModuleNames` is always implemented,
even if the originally provided compiler host does not. This is
beneficial for the `ngc` binary.

PR Close #39693
2021-03-09 10:41:10 -08:00
Theoklitos Bampouris e7ce857bc6 docs(common): change misspelled constant (#41136)
Change misspelled constant from LOCAL_ID to LOCALE_ID
PR Close #41136
2021-03-09 08:57:41 -08:00
Aristeidis Bampakos 40a6c6d553 docs: use double quotes in Tour of Heroes (pt1) (#41134)
Use double quotes to be consistent across the component template

PR Close #41134
2021-03-09 08:56:52 -08:00
George Kalpakas f8de57fbba refactor(docs-infra): simplify code snippet indentation in the "Cheat sheet" guide (#41051)
Previously, the indentation of code snippets in the "Cheat sheet" guide
was done using `<br>` elements (for line breaks) and `&emsp;` HTML
entities (for space). This was laborious and put the onus on the author
to remember to use these symbols (instead of regular whitespace
characters).
(Discussed in
https://github.com/angular/angular/pull/41051#discussion_r585651621.)

This commit changes the way `<code>` elements are styles inside the
"Cheat sheet" guide to allow using regular whitespace characters in code
snippets. It also changes all `<br>`/`&emsp;` occurrences to `\n`/`  `
respectively to make code snippets more readable in the source code.

PR Close #41051
2021-03-09 08:52:57 -08:00
George Kalpakas 0cf54bec2f fix(docs-infra): improve the layout of the "Features" page on medium screens (#41051)
The "Features" page organizes features in groups/rows of 3 features
each. On wide screens, all 3 paragraphs of a group/row can be shown next
to each other. On narrow screens (between 768px and 1057px), the layout
changes to stack the paragraphs vertically. On medium screens, however,
there is not enough space to show more than two paragraphs next to each
other.

Previously, the 3rd paragraph was wrapped over to the next line.

This commit improves the layout on medium screens by switching to
immediately stacking the paragraphs vertically as soon as there is not
enough space for them to be displayed in one row. Since the total width
is still too much for one paragraph, the paragraphs are limited to 80%
of the total width.

Before (on 1000px width): [features page (on 1000px) before][1]
After (on 1000px width): [features page (on 1000px) after][2]

[1]: https://user-images.githubusercontent.com/8604205/109825316-62128a00-7c42-11eb-8391-650201257274.png
[2]: https://user-images.githubusercontent.com/8604205/109825323-6343b700-7c42-11eb-86c1-e8307c5a727a.png

PR Close #41051
2021-03-09 08:52:57 -08:00
George Kalpakas a6cdd32657 fix(docs-infra): avoid truncating several API list items (#41051)
Previously, with the min width of 220px per item, several API list items
were truncated.

This commit increases the min width per item to 330px, which allows
almost all items to have their full text shown. It also increases the
API list page's max content width from 50em (800px) to 62.5em (1000px)
to allow items to be shown on three columns despite their increased
width. This increase in the content width shouldn't negatively affect
UX, since the API list page uses a multi-column layout (i.e. it does not
contain 1000px-lines of text.)

Before: ![api-list before][1]
After: ![api-list after][2]

[1]: https://user-images.githubusercontent.com/8604205/109396457-5f5e1f00-793a-11eb-80cf-1418f409325a.png
[2]: https://user-images.githubusercontent.com/8604205/109396659-499d2980-793b-11eb-95d3-f54250f7fab5.png

PR Close #41051
2021-03-09 08:52:57 -08:00
George Kalpakas 2d7764280f fix(docs-infra): show ellipsis when text overflows in API list items (#41051)
Previously, when an API list item's text overflowed its container, it
was just hidden. This made it often difficult to realize that there was
more text.

This commit fixes this by ensuring an ellipsis (`...`) is shown when the
text overflows.

Before: ![api-list truncated before][1]
After: ![api-list truncated after][2]

[1]: https://user-images.githubusercontent.com/8604205/109396186-0cd03300-7939-11eb-921c-00621a3889a4.png
[2]: https://user-images.githubusercontent.com/8604205/109396187-0e016000-7939-11eb-9f3b-4535be083417.png

PR Close #41051
2021-03-09 08:52:57 -08:00
George Kalpakas 8c513dc163 fix(docs-infra): limit max content width on "Contributors" and "Cheat sheet" pages (#41051)
Previously, the content width on the "Contributors" page (`/about`) and
the "Cheat sheet" guide (`/guide/cheatsheet`) was unlimited (i.e. the
content would take up all the available space horizontally). This was
not very ergonomic on large screens. Especially on the "Cheat sheet"
guide there was a lot of unnecessary whitespace between the code shown
on the left column and the description shown on the right column.

This commit fixes this by setting a max content width for both pages of
84em (1404px by default). This keeps the content at a more manageable
width and avoids unnecessary whitespace.

Before (contributors): ![contributors page on 2500px before][1]
Before (cheatsheet): ![cheatsheet on 2500px before][2]
After (contributors): ![contributors page on 2500px after][3]
After (cheatsheet): ![cheatsheet on 2500px after][4]

[1]: https://user-images.githubusercontent.com/8604205/109394323-1bb1e800-792f-11eb-9cd6-c5b83e5ae921.png
[2]: https://user-images.githubusercontent.com/8604205/109394329-1fde0580-792f-11eb-91c0-4ed7ad408b17.png
[3]: https://user-images.githubusercontent.com/8604205/109394319-181e6100-792f-11eb-9463-a281dfe80448.png
[4]: https://user-images.githubusercontent.com/8604205/109394330-210f3280-792f-11eb-9837-ddc7a8d01d19.png

PR Close #41051
2021-03-09 08:52:56 -08:00
George Kalpakas e840b99806 refactor(docs-infra): use more consistent content width on marketing pages (#41051)
Previously, each marketing page used a different limit for its content's
width (if it had a limit at all) and implemented the width limiting in a
different way. Besides resulting in an inconsistent UX, this also made
it difficult to apply site-wide layout changes.

This commit makes the limit for most marketing pages consistent and uses
the same CSS class to make it easier to apply site-wide changes in the
future. The chosen limit is slightly larger than that of docs pages
(62.5em/1000px vs 50em/800px), because marketing pages have a different
type of content and layout (i.e. images, multi-column layout, etc.).
Finally, this commit also removes obsolete wrapper elements, CSS classes
and CSS styles, that are no longer necessary after the changes.

Notably, the homepage (`/`) and the "Contributors" page (`/about`) have
remained unchanged, because the former has its own layout that is
different from other marketing pages and the latter would offer a worse
UX with a small content width limit (as the one used on other marketing
pages).

The content widths of the rest of the marketing pages change slightly as
a result of the changes in this commit, but not in a way that would have
a negative impact on UX. More specifically:

| Page (URL)    | Size before | Size after |
|:--------------|------------:|-----------:|
| `/contribute` |       880px |     1000px |
| `/events`     |   unlimited |     1000px |
| `/features`   |       996px |     1000px |
| `/presskit`   |       800px |     1000px |
| `/resources`  |       800px |     1000px |

PR Close #41051
2021-03-09 08:52:56 -08:00
George Kalpakas 3533ee8f07 refactor(docs-infra): fix code indentation in ContributorListComponent's template (#41051)
This commit fixes the indentation of the template of
`ContributorListComponent` to make it more readable.

PR Close #41051
2021-03-09 08:52:56 -08:00
George Kalpakas 97cf5cbfe4 docs: fix indentation of code snippets in the "Cheat sheet" guide (#41051)
Previously, the indentation of code snippets in the "Cheat sheet" guide
was done using regular spaces. However, leading whitespace is ignored in
HTML elements (by default), which resulted in the identation being lost.

This commit fixes this by using the `&emsp;` HTML entity for
indentation, ensuring the code snippets are easier to read.

Some examples:

Before: ![cheatsheet code indentation before][1]
After: ![cheatsheet code since PR 40944][2]

[1]: https://user-images.githubusercontent.com/8604205/109385242-218dd600-78fb-11eb-9261-18ab5f2c308c.png
[2]: https://user-images.githubusercontent.com/8604205/109385246-25b9f380-78fb-11eb-8e82-d8a561deba21.png

PR Close #41051
2021-03-09 08:52:56 -08:00
George Kalpakas 4548efb718 refactor(docs-infra): remove unnecessary wrapper <div> from the "Cheat sheet" guide (#41051)
This commit removes an unnecessary wrapper `<div>` from the
"Cheat sheet" guide. The CSS styles that referenced the element's ID
(`#cheatsheet`) have been updated to use `.page-guide-cheatsheet`
instead.

PR Close #41051
2021-03-09 08:52:56 -08:00
George Kalpakas aff13b5cba fix(docs-infra): fix <code> styling in the "Cheat sheet" guide (#41051)
Since #40944, `<code>` elements have a distinctive background to make
them stand out from regular text. However, this styling is not desirable
in certain cells of the "Cheat sheet" guide's tables, which exclusively
contain code.

This commit updates the `<code>` styling to remove the distinctive
background in those "Cheat sheet" cells.

Before #40944: ![cheatsheet code before PR 40944][1]
Since #40944: ![cheatsheet code since PR 40944][2]
After this commit: ![cheatsheet code after][3]

[1]: https://user-images.githubusercontent.com/8604205/109383633-4f215200-78f0-11eb-95e2-2a2c4fb3a31f.png
[2]: https://user-images.githubusercontent.com/8604205/109383634-50527f00-78f0-11eb-8c48-ff5f96918c4d.png
[3]: https://user-images.githubusercontent.com/8604205/109383635-50eb1580-78f0-11eb-9cf2-98851692ddd9.png

PR Close #41051
2021-03-09 08:52:55 -08:00
George Kalpakas 8d2f2423a4 fix(docs-infra): fix styling of <code> elements on older browsers (#41051)
Previously, styling of `<code>` elements utilized the `:not()` CSS
pseudo-class with multiple selectors (`:not(h1, h2, ...)`). It turns out
that older browsers (such as IE11) do not support multiple selectors in
a single `:not()` instance.
(See [MDN][1] and [CanIUse][2] for more info.)

This commit fixes `<code>` styling to use multiple separate `:not()`
instances instead (`:not(h1):not(h2)...`), so that they are styled
correctly on older browsers as well.

NOTE:
This change seems to trigger some kind of bug in LightHouse that causes
the a11y score of `/start` to be calculated as 0 (which is clearly
wrong). This happens on Linux (tested on CI and locally using the
Windows Subsystem for Linux (WSL)) - on Windows the score is computed
correctly as 98/100.
([Example failure][3])

The bug seems to be related to the layout of the content and goes away
if we change the viewport size (for example, switching to LightHouse's
`desktop` config) or make another change that affects the content's
layout (for example, reducing the padding of `<code>` elements).

To work around the issue, this commit updates the `test-aio-a11y.js`
script to test `/start-routing` instead of `/start`.

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/:not#description:~:text=Using%20two%20selectors
[2]: https://caniuse.com/css-not-sel-list
[3]: https://circleci.com/gh/angular/angular/931038

PR Close #41051
2021-03-09 08:52:55 -08:00
George Kalpakas d8dade8d68 fix(docs-infra): improve the layout of the "Features" page on medium screens (#41051)
The "Features" page organizes features in groups/rows of 3 features
each. On wide screens, all 3 paragraphs of a group/row can be shown next
to each other. On narrow screens, the layout changes to stack the
paragraphs vertically. On medium screens, however, the 3rd paragragh is
wrapped over to the next line.

Previously, the wrapped content was left-aligned, which left a lot of
empty space on the right.

This commit improves the layout on medium screens by ensuring the
paragraphs are horizontally centered (with space distributed evenly
around them).

Before: ![features page before][1]
After: ![features page after][2]

[1]: https://user-images.githubusercontent.com/8604205/109344670-b64ef000-7877-11eb-9013-890562ff2f3d.png
[2]: https://user-images.githubusercontent.com/8604205/109344678-b7801d00-7877-11eb-9224-d7715f7d7235.png

PR Close #41051
2021-03-09 08:52:55 -08:00
George Kalpakas d7ccdb4e91 fix(docs-infra): use a fixed top-menu on marketing pages as well (#41051)
Previously, in contrast to docs pages, marketing pages had a non-fixed
top-menu, which meant that the top-menu would scroll out of the viewport
along with the rest of the content. This had a couple of downsides:
- The UI was different between pages (i.e. different top-menu behavior
  on docs vs marketing pages).
- Since some of the marketing pages are long, it was not easy for people
  to navigate to a different page (i.e. they had to scroll all the way
  back up).

This commit improves the UX by using the same, fixed top-menu on all
pages, which restores consistency and allows the user to navigate around
more easily.

NOTE:
The old behavior (non-fixed top-menu) is kept on the homepage, since its
top-menu design in a little different than other pages (e.g. it uses a
transparent top-menu) and would not play well with a fixed top-menu.

PR Close #41051
2021-03-09 08:52:55 -08:00
George Kalpakas 100f87cccd fix(docs-infra): do not underline link icons on hover (#41051)
The external links in the docs content and the download links in the
"Press kit" page have icons next to their text (an external link icon
and a download icon respectively).

Previously, when hovering over one of those links, the icons used to get
underlined along with the link text, which was not desirable.

This commit fixes it by changing the mechanics of how these icons are
positioned inside the anchor elements so that only the link text is
underlined on hover.

Before: ![external links on hover before][1]
Before: ![presskit links on hover before][2]
After: ![external links on hover after][3]
After: ![presskit links on hover after][4]

[1]: https://user-images.githubusercontent.com/8604205/109340455-b64bf180-7871-11eb-923b-3113a237b8d8.png
[2]: https://user-images.githubusercontent.com/8604205/109340461-b815b500-7871-11eb-9c9d-91b6ffb17346.png
[3]: https://user-images.githubusercontent.com/8604205/109340458-b77d1e80-7871-11eb-884c-c1093ec83e66.png
[4]: https://user-images.githubusercontent.com/8604205/109340462-b815b500-7871-11eb-8f00-702b2b61f6ac.png

PR Close #41051
2021-03-09 08:52:54 -08:00
Pete Bacon Darwin 1bebd66ee5 refactor(compiler): move factory out of injector definition (#41022) (#41133)
Previously, injector definitions contained a `factory` property that
was used to create a new instance of the associated NgModule class.

Now this factory has been moved to its own `ɵfac` static property on the
NgModule class itself. This is inline with how directives, components and
pipes are created.

There is a small size increase to bundle sizes for each NgModule class,
because the `ɵfac` takes up a bit more space:

Before:

```js
let a = (() => {
  class n {}
  return n.\u0275mod = c.Cb({type: n}),
  n.\u0275inj = c.Bb({factory: function(t) { return new (t || n) }, imports: [[e.a.forChild(s)], e.a]}),
  n
})(),
```

After:

```js
let a = (() => {
  class n {}
  return n.\u0275fac = function(t) { return new (t || n) },
  n.\u0275mod = c.Cb({type: n}),
  n.\u0275inj = c.Bb({imports: [[r.a.forChild(s)], r.a]}),
  n
})(),
```

In other words `n.\u0275fac = ` is longer than `factory: ` (by 5 characters)
and only because the tooling insists on encoding `ɵ` as `\u0275`.

This can be mitigated in a future PR by only generating the `ɵfac` property
if it is actually needed.

PR Close #41022

PR Close #41133
2021-03-09 08:51:59 -08:00
Pete Bacon Darwin b770e695ac refactor(compiler): separate compileFactoryFunction() from compileInjector() (#41022) (#41133)
This commit moves the creation of the injector's factory function
out so that it can be more easily refactored further.

PR Close #41022

PR Close #41133
2021-03-09 08:51:59 -08:00
Andrew Kushnir 6a38ffe5d0 test(forms): split Forms example app into Reactive and Template-driven ones (#41108)
One of the main goals of the bundling tests is to verify that unused symbols are tree-shaken away in prod bundles.
Currently both Reactive and Template-driven test apps are merged into one. In order to make these tree-shaking
tests even more useful, this commit splits exiting test app into two, so that we can further optimize sets of
symbols that should be retained in both scenarios.

PR Close #41108
2021-03-08 16:05:13 -08:00
Sagar Pandita c5ead386b8 docs: remove augury resource from docs, partially addresses #41030 (#41120)
PR Close #41120
2021-03-08 14:56:11 -08:00
Alex Rickabaugh 35935b422b docs(compiler-cli): add README.md for template type checking system (#41004)
This commit adds a semi-comprehensive README file which describes the
design goals and implementation of the template type checking engine,
which powers the Angular Language Service as well as the main compiler's
understanding of types in templates.

PR Close #41004
2021-03-08 12:07:06 -08:00
JoostK 532ae73738 perf(compiler-cli): avoid module resolution in cycle analysis (#40948)
The compiler performs cycle analysis for the used directives and pipes
of a component's template to avoid introducing a cyclic import into the
generated output. The used directives and pipes are represented by their
output expression which would typically be an `ExternalExpr`; those are
responsible for the generation of an `import` statement. Cycle analysis
needs to determine the `ts.SourceFile` that would end up being imported
by these `ExternalExpr`s, as the `ts.SourceFile` is then checked against
the program's `ImportGraph` to determine if the import is allowed, i.e.
does not introduce a cycle. To accomplish this, the `ExternalExpr` was
dissected and ran through module resolution to obtain the imported
`ts.SourceFile`.

This module resolution step is relatively expensive, as it typically
needs to hit the filesystem. Even in the presence of a module resolution
cache would these module resolution requests generally see cache misses,
as the generated import originates from a file for which the cache has
not previously seen the imported module specifier.

This commit removes the need for the module resolution by wrapping the
generated `Expression` in an `EmittedReference` struct. This allows the
reference emitter mechanism that is responsible for generating the
`Expression` to also communicate from which `ts.SourceFile` the
generated `Expression` would be imported, precluding the need for module
resolution down the road.

PR Close #40948
2021-03-08 12:05:53 -08:00
JoostK 2035b15d7a perf(compiler-cli): use bound symbol in import graph in favor of module resolution (#40948)
The import graph scans source files for its import and export statements
to extract the source files that it imports/exports. Such statements
contain a module specifier string and this module specifier used to be
resolved to the actual source file using an explicit module resolution
step. This is especially expensive in incremental rebuilds, as the
module resolution cache has not been primed during program creation
(assuming that the incremental program was able to reuse the module
resolution results from a prior compilation). This meant that all module
resolution requests would have to hit the filesystem, which is
relatively slow.

This commit is able to replace the module resolution with TypeScript's
bound symbol of the module specifier. This symbol corresponds with the
`ts.SourceFile` that is being imported/exported, which is exactly what
the import graph was interested in. As a result, no filesystem accesses
are done anymore.

PR Close #40948
2021-03-08 12:05:52 -08:00
Joey Perrott ed342f4e53 test(dev-infra): fix test order failure in tests for the release command (#41023)
Depending on test order, the `_npmPackageInfoCache` contains information
which causes the prompt results to be slightly different text.

PR Close #41023
2021-03-08 10:33:09 -08:00
Jason Bedard 925746b6d8 fix(bazel): fix incorrect rollup plugin method signature (#41101)
Update the resolveBazel method signature to align with the rollup plugin
resolveId API: https://rollupjs.org/guide/en/#resolveid

PR Close #41101
2021-03-08 10:06:48 -08:00
George Kalpakas 129d4f4dd5 ci: improve error message when payload size check fails (#41116)
Previously, when a payload size check failed, the error message prompted
the user to update the size limits using a CI-specific file path, which
was confusing (esp. for external contributors). See, for example,
https://circleci.com/gh/angular/angular/932733.

This commit improves the error message by printing the file path
relative to the repository root instead.

PR Close #41116
2021-03-08 10:04:01 -08:00
JoostK e35eceabac perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947)
In Angular programs, changing a file may require other files to be
emitted as well due to implicit NgModule dependencies. For example, if
the selector of a directive is changed then all components that have
that directive in their compilation scope need to be recompiled, as the
change of selector may affect the directive matching results.

Until now, the compiler solved this problem using a single dependency
graph. The implicit NgModule dependencies were represented in this
graph, such that a changed file would correctly also cause other files
to be re-emitted. This approach is limited in a few ways:

1. The file dependency graph is used to determine whether it is safe to
   reuse the analysis data of an Angular decorated class. This analysis
   data is invariant to unrelated changes to the NgModule scope, but
   because the single dependency graph also tracked the implicit
   NgModule dependencies the compiler had to consider analysis data as
   stale far more often than necessary.
2. It is typical for a change to e.g. a directive to not affect its
   public API—its selector, inputs, outputs, or exportAs clause—in which
   case there is no need to re-emit all declarations in scope, as their
   compilation output wouldn't have changed.

This commit implements a mechanism by which the compiler is able to
determine the impact of a change by comparing it to the prior
compilation. To achieve this, a new graph is maintained that tracks all
public API information of all Angular decorated symbols. During an
incremental compilation this information is compared to the information
that was captured in the most recently succeeded compilation. This
determines the exact impact of the changes to the public API, which
is then used to determine which files need to be re-emitted.

Note that the file dependency graph remains, as it is still used to
track the dependencies of analysis data. This graph does no longer track
the implicit NgModule dependencies, which allows for better reuse of
analysis data.

These changes also fix a bug where template type-checking would fail to
incorporate changes made to a transitive base class of a
directive/component. This used to be a problem because transitive base
classes were not recorded as a transitive dependency in the file
dependency graph, such that prior type-check blocks would erroneously
be reused.

This commit also fixes an incorrectness where a change to a declaration
in NgModule `A` would not cause the declarations in NgModules that
import from NgModule `A` to be re-emitted. This was intentionally
incorrect as otherwise the performance of incremental rebuilds would
have been far worse. This is no longer a concern, as the compiler is now
able to only re-emit when actually necessary.

Fixes #34867
Fixes #40635
Closes #40728

PR Close #40947
2021-03-08 08:41:22 -08:00
Igor Minar 67d3062907 refactor(core): don't use innerHTML in DOMTestComponentRenderer (#41099)
The use of innerHTML is unnecessary and causes TrustedType violations.

PR Close #41099
2021-03-08 08:39:11 -08:00
LordMsz a6be9a8031 docs: extend :host selector documentation (#41055)
explain behavior of selectors *before* `:host` that escape encapsulation
and explain preferred usage of `:host-context`

PR Close #41055
2021-03-08 08:36:06 -08:00
George Kalpakas bb71a2d7b4 docs: add Discord, YouTube, StackOverflow to the "Community" section in README.md (#41086)
PR Close #41086
2021-03-08 08:35:25 -08:00
Pete Bacon Darwin 26c6bc5705 build(docs-infra): capture all decorators in doc-gen (#41091)
In 6cff877 we broke the decorator docs because the
doc-gen no longer knew how to identify them.

This commit updates the dgeni processor responsible
for identifying the decorators in the code and ensures
that the docs are now generated correctly.

Fixes #40851

PR Close #41091
2021-03-08 08:34:42 -08:00
George Kalpakas 7224930002 test(docs-infra): run a11y tests against /tutorial and update a11y scores (#41103)
This commit adds `/tutorial` to the list of angular.io pages that we run
a11y tests against and updates the required scores to match the current
ones (to avoid a future regression going unnoticed).

PR Close #41103
2021-03-08 08:33:49 -08:00
George Kalpakas fe0d0f6642 test(docs-infra): print the browser version in audit-web-app.js to help debugging (#41103)
This commit updates the `audit-web-app.js` script (used to run PWA and
a11y tests on angular.io) to also print the version of the browser used
to run the tests. This can help when debugging a CI failure.

PR Close #41103
2021-03-08 08:33:49 -08:00
Sivamuthu Kumar 1f6d395e72 docs: update repo link to auto scroll to readme section (#41105)
Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>
PR Close #41105
2021-03-08 08:33:02 -08:00
Sivamuthu Kumar 645c9a94d3 docs: add angular-eslint and remove codelyzer from tooling (#41105)
fixes #41029

PR Close #41105
2021-03-08 08:33:01 -08:00
Quentin Monmert 4fd5d688ce docs: fix some typos in angular.io examples (#41093)
This commit updates example code to make the spacing more consistent.

PR Close #41093
2021-03-05 15:08:12 -08:00
Carl Fredrik Samson 2de7eef92e docs: fix issue #40941 (#40942)
setting the `hero` property as an optional property fixes the compilation
error: `Property 'hero' has no initializer and is not definitely assigned
in the constructor` when having the ts transpiler set to "strict" mode.

PR Close #40942
2021-03-05 09:47:46 -08:00
Andrew Kushnir 5238ad72c0 test(forms): add integration test app to keep track of payload size (#41045)
This commit adds a Forms-based test app into the `integration` folder to have an ability to measure and keep
track of payload size for the changes in Forms package.

PR Close #41045
2021-03-05 09:45:43 -08:00
Andrew Scott a05eb13caa fix(language-service): Only provide dom completions for inline templates (#41078)
We currently provide completions for DOM elements in the schema as well
as attributes when we are in the context of an external template.
However, these completions are already provided by other extensions for
HTML contexts (like Emmet). To avoid duplication of results, this commit
updates the language service to exclude DOM completions for external
templates. They are still provided for inline templates because those
are not handled by the HTML language extensions.

PR Close #41078
2021-03-04 14:51:08 -08:00
Pete Bacon Darwin 1d4fc94801 refactor(compiler): remove unused __BUILD_OPTIMIZER_* constants (#41040)
These constants were created in a very early phase of Ivy development.
They have never been used in the framework, no the build-optimizer tool.

PR Close #41040
2021-03-04 11:04:30 -08:00
Pete Bacon Darwin 94d4deee78 refactor(core): do not publish ɵɵgetFactoryOf() (#41040)
Previously, `ɵɵgetFactoryOf()` was "privately" published from
`@angular/core` since in the past it was assumed that this
might be an instruction generated by the compiler.

This is not currently the case, so this commit removes it from
the private exports and renames it to indicate that it is a local
helper function.

PR Close #41040
2021-03-04 11:04:29 -08:00
Pete Bacon Darwin 09d50fb535 refactor(core): remove getFactoryOf from angularCoreDiEnv (#41040)
This function is never actually generated directly so it can be removed
from the context passed to the JIT compiler.

PR Close #41040
2021-03-04 11:04:29 -08:00
Pete Bacon Darwin c1c7849576 refactor(compiler): remove unused emitAllPartialModules() and associated code (#41040)
This method does not appear to be used in the project.
This commit removes it and code that it exclusively
depended upon, or depended upon it.

PR Close #41040
2021-03-04 11:04:29 -08:00
Pete Bacon Darwin d7f4f1b43f refactor(compiler): remove unused function (#41040)
The `accessExportScope()` function is not used anymore.

PR Close #41040
2021-03-04 11:04:29 -08:00
Pete Bacon Darwin 5a9adbb484 refactor(core): use unknown rather than never for private properties (#41040)
Before `unknown` was available, the `never` type was used to discourage
application developers from using "private" properties. The `unknown` type
is much better suited for this.

PR Close #41040
2021-03-04 11:04:28 -08:00
Chris 1420bbb611 docs: remove Codelyzer recommendation from style guide (#40992)
Fixes #40903

PR Close #40992
2021-03-04 11:01:49 -08:00
Chris bc8c69cf0c docs: improve documentation on how to pass a stringified parameter list to HttpClient (#41010)
Fixes #40618

PR Close #41010
2021-03-04 11:00:24 -08:00
MG 4f4454d9ea docs: add ng-mocks to tooling resources (#41027)
closes #41025

PR Close #41027
2021-03-03 23:31:38 +00:00
George Kalpakas 072d3ce4f0 build(docs-infra): update Angular framework, Material and CLI to latest methods (#40994) (#41069)
This commit updates the Angular framework, Angular CDK/Material and
Angular CLI to latest stable versions (11.2.3, 11.2.2 and 11.2.2
respectively).

This update also fixes a Lighthouse audit fail due to
`@angular/core@11.0.0` being identified as vulnerable to XSS:
https://snyk.io/vuln/SNYK-JS-ANGULARCORE-1070902

Regarding the payload size increases, they are mostly attributed to
Angular Material:
- Before this commit:     448461 B
- After framework update: 448554 B ( +93 B)
- After Material update:  449292 B (+738 B)
- After CLI update:       449310 B ( +18 B)

PR Close #40994

PR Close #41069
2021-03-03 23:30:21 +00:00
George Kalpakas 532acd82a1 build(docs-infra): update Lighthouse to version 7.2.0 (#40994) (#41069)
In this version, we no longer need our custom logic to skip certain
HTTPS related audits on localhost, since Lighthouse will treat it as a
secure context (similar to how browsers do).
See also GoogleChrome/lighthouse#11766.

PR Close #40994

PR Close #41069
2021-03-03 23:30:20 +00:00
Zach Arend 2028a77dc8 release: cut the v11.2.4 release 2021-03-03 22:37:19 +00:00
Alex Rickabaugh 9322e6a076 fix(language-service): don't show external template diagnostics in ts files (#41070)
The compiler considers template diagnostics to "belong" to the source file
of the component using the template. This means that when diagnostics for
a source file are reported, it returns diagnostics of TS structures in the
actual source file, diagnostics for any inline templates, and diagnostics of
any external templates.

The Language Service uses a different model, and wants to show template
diagnostics in the actual .html file. Thus, it's not necessary (and in fact
incorrect) to include such diagnostics for the actual .ts file as well.
Doing this currently causes a bug where external diagnostics appear in the
TS file with "random" source spans.

This commit changes the Language Service to filter the set of diagnostics
returned by the compiler and only include those diagnostics with spans
actually within the .ts file itself.

Fixes #41032

PR Close #41070
2021-03-03 21:40:51 +00:00
Andrew Scott 6dd54972d4 fix(language-service): Always attempt HTML AST to template AST conversion for LS (#41068)
The current logic in the compiler is to bail when there are errors when
parsing a template into an HTML AST or when there are errors in the i18n
metadata. As a result, a template with these types of parse errors
_will not have any information for the language service_. This is because we
never attempt to conver the HTML AST to a template AST in these
scenarios, so there are no template AST nodes for the language service
to look at for information. In addition, this also means that the errors
are never displayed in the template to the user because there are no
nodes to map the error to.

This commit adds an option to the template parser to temporarily ignore
the html parse and i18n meta errors and always perform the template AST
conversion. At the end, the i18n and HTML parse errors are appended to
the returned errors list. While this seems risky, it at least provides
us with more information than we had before (which was 0) and it's only
done in the context of the language service, when the compiler is
configured to use poisoned data (HTML parse and i18n meta errors can be
interpreted as a "poisoned" template).

fixes angular/vscode-ng-language-service#1140

PR Close #41068
2021-03-03 21:13:59 +00:00
Andrew Scott f09e7abdf0 fix(language-service): provide element completions after open tag < (#41068)
An opening tag `<` without any characters after it is interperted as a
text node (just a "less than" character) rather than the start of an
element in the template AST. This commit adjusts the autocomplete engine
to provide element autocompletions when the nearest character to the
left of the cursor is `<`.

Part of the fix for angular/vscode-ng-language-service#1140

PR Close #41068
2021-03-03 21:13:59 +00:00
David Pine e4774da6c3 docs: update Angular Global Summit on event pages (#41050)
After my speaker meeting with the Geekle team, they communicated that
they moved the date to avoid colliding with ng-conf. Originally added
in#40697, per @mgechev.

PR Close #41050
2021-03-03 10:04:57 -08:00
David Shevitz ed1cb9d83d docs: update @reviewed date (#41060)
PR Close #41060
2021-03-03 10:03:58 -08:00
Kristiyan Kostadinov 20fb63812c fix(compiler): allow binding to autocomplete property on select and textarea elements (#40928)
Updates the schema to allow binding to the `autocomplete` property of a `textarea` or `select`.

Fixes #39490.

PR Close #40928
2021-03-03 10:00:28 -08:00
Andrew Scott c675acda7f fix(compiler): recover from an incomplete open tag at the end of a file (#41054)
The compiler's parsing code has logic to recover from incomplete open
tags (i.e. `<div`) but the recovery logic does not handle when the
incomplete tag is terminated by an EOF. This commit updates the logic to
allow for the EOF character to be interpreted as the end of the tag open
so that the parser can continue processing. It will then fail to find
the end tag and recover by marking the open tag as incomplete.

Part of https://github.com/angular/vscode-ng-language-service/issues/1140

PR Close #41054
2021-03-03 09:58:56 -08:00
Keen Yee Liau 95f748c238 fix(language-service): Add plugin option to force strictTemplates (#41063)
This commit adds a new configuration option, `forceStrictTemplates` to the
language service plugin to allow users to force enable `strictTemplates`.

This is needed so that the Angular extension can be used inside Google without
changing the underlying compiler options in the `ng_module` build rule.

PR Close #41063
2021-03-03 09:54:46 -08:00
Andrew Scott ef87953bc6 fix(language-service): only provide template results on reference requests (#41041)
VSCode only de-duplicates references results for "go to references" requests
but does not de-duplicate them for "find all references" requests. The
result is that users see duplicate references for results in TypeScript
files - one from the built-in TS extension and one from us.
While this is an issue in VSCode (see https://github.com/microsoft/vscode/issues/117095)
this commit provides a quick workaround on our end until it can be addressed there.

This commit should be reverted when microsoft/vscode/issues/117095 is resolved.

fixes https://github.com/angular/vscode-ng-language-service/issues/1124

PR Close #41041
2021-03-03 09:39:11 -08:00
George Kalpakas ac268d150c fix(docs-infra): correctly display event dates on all timezones (#41053)
Previously, the event dates displayed on the angular.io "Events" page
(`/events`) was off by one day on timezones with a negative offset from
UTC. See
https://github.com/angular/angular/pull/41050#issuecomment-788958888.

This commit fixes it by using the `getUTC*` methods of the `Date` object
to extract the date info, which are not affected by the user's timezone.

PR Close #41053
2021-03-03 09:37:22 -08:00
Daniel c10c7db21f docs: fix typo in router.md file (#41064)
PR Close #41064
2021-03-03 09:36:06 -08:00
Zach Arend 78bf697311 refactor(platform-browser): cast response of JSON.parse (#41020)
Casts the response of JSON.parse to `{}`, so that is not an `any` type.
This is because google3 does not allow the use of `any` type.

PR Close #41020
2021-03-01 15:48:24 -08:00
Alan Agius e3ccd56567 fix(compiler-cli): extend angularCompilerOptions in tsconfig from node (#40694) (#41036)
TypeScript supports non rooted extends, we should do the same

https://github.com/microsoft/TypeScript/blob/b346f5764e4d500ebdeff7086e43690ea533a305/src/compiler/commandLineParser.ts#L2603-L2628

Closes: #36715

PR Close #40694

(cherry picked from commit 5eb195416b)

PR Close #41036
2021-03-01 15:40:09 -08:00
Alan Agius 0aa5ba05e7 refactor(bazel): use readConfiguration to read config file (#40694) (#41036)
With this change we clean up the parsing of tsconfig files.

PR Close #40694

(cherry picked from commit 719f9ef7ac)

PR Close #41036
2021-03-01 15:40:08 -08:00
Alan Agius 2f3e2dff33 fix(compiler-cli): readConfiguration existing options should override options in tsconfig (#40694) (#41036)
At the moment, when passing an Angular Compiler option
in the `existingOptions` it doesn't override the defined in the TSConfig.

PR Close #40694

(cherry picked from commit b7c4d07e81)

PR Close #41036
2021-03-01 15:40:08 -08:00
Aristeidis Bampakos af6d9fe8a2 docs(http): add example for interceptor order (#39938)
Add an example for the order of interceptor with image

PR Close #39938
2021-03-01 15:33:37 -08:00
Kapunahele Wong 71921e8268 docs: rewrite structural-directives.md (#40015)
PR Close #40015
2021-03-01 15:32:27 -08:00
Kapunahele Wong 3f90336266 docs: improve contrast of colors and body padding in boilerplate CSS (#40890)
Shifts colors to pass WebAIM contrast checker and adds media
query so that body padding is smaller at smaller widths.
Body padding responsiveness will help on StackBlitz and small
screens.

PR Close #40890
2021-03-01 15:30:33 -08:00
Andrew Scott 1d01f6bfdc refactor(compiler): remove unreachable code (#40984)
1. The error function throws, so no code after it is reachable.
2. Some switch statements are exhaustive, so no code after them are reachable.

PR Close #40984
2021-03-01 15:29:20 -08:00
ivanwonder 1b1b65e1ea fix(language-service): can't provide the Input and Output custom binding property name (#41005)
Now the language service always uses the name of the JavaScript property on the
component or directive instance for this input or output. This PR will use the right
binding property name.

PR Close #41005
2021-03-01 15:26:43 -08:00
Pete Bacon Darwin 27d55f6730 fix(compiler-cli): ensure ngcc can handle wildcard base-paths (#41033)
Ngcc uses the `paths` property to compute the potential base-paths
for packages that are being processed. If the `paths` contain a wildcard
`*` within a path segment, ngcc was not finding the base-path correctly.

Now when a wildcard is found, there is an additional search to look for
paths that might match the wildcard.

Fixes #41014

PR Close #41033
2021-03-01 15:25:44 -08:00
Chris 2e0dea6710 docs: improve description, examples of DecimalPipe's digitsInfo parameter (#40714)
Fixes #40671

PR Close #40714
2021-02-26 15:42:29 -08:00
Pete Bacon Darwin 6efd5ee779 build(docs-infra): implement full template checking for examples (#40930)
This commit turns on full template type checking and fixes the examples
that had errors.

PR Close #40930
2021-02-26 15:40:45 -08:00
Pete Bacon Darwin b86d01dbc1 build(docs-infra): enable Ivy in StackBlitz examples (#40930)
We need to explicitly set the `enableIvy` option in a tsconfig file
to tell StackBlitz not to use ViewEngine.

This commit will generate an appropriate tsconfig.json file in the
example data that is sent to StackBlitz, which matches the Ivy
setting of the AIO project itself.

PR Close #40930
2021-02-26 15:40:45 -08:00
George Kalpakas b55dac3444 fix(docs-infra): improve the layout of the "Resources" page (#40944)
This commit improves the readability of the "Resources" page by limiting
the content's max width to 50em (which is 800px by default).

It also gets rid of custom color values and either uses the default
color or colors specified via Sass variables.

Before: ![resources page before][1]
After: ![resources page after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108601949-104b4380-73a8-11eb-864b-948db8c36f80.png
[2]: https://user-images.githubusercontent.com/8604205/108602036-894a9b00-73a8-11eb-870d-39bea9b46d97.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:31 -08:00
George Kalpakas 5215026782 refactor(docs-infra): clean up styling of the <aio-resource-list> component (#40944)
This commit cleans up the styles and the elements/classes used for
styling the content of the `<aio-resource-list>` component.

This change has been extracted from #36045.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:31 -08:00
George Kalpakas 0a04767756 fix(docs-infra): center the "Contribute" page (#40944)
This commit improves the layout of the "Contribute" page by centering
the content (similar to other marketing pages).

Before: ![contribute layout before][1]
After: ![contribute layout after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108595056-5b545f00-7386-11eb-97b6-c3606dbfb5fa.png
[2]: https://user-images.githubusercontent.com/8604205/108595060-5becf580-7386-11eb-91fa-b2877f2a4691.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:31 -08:00
George Kalpakas 8935774370 fix(docs-infra): use up-to-date URLs in "Contribute" links (and replace deprecated md-button) (#40944)
This commit replaces some outdated URLs in "Contribute" links (on the
"Contribute" page):
- `github.com/angular/material2` --> `github.com/angular/components`
- `github.com/angular/angularfire2` --> `github.com/angular/angularfire`

It also replaces the deprecated `md-button` attribute with `mat-button`.

PR Close #40944
2021-02-26 15:39:31 -08:00
George Kalpakas 1d997ac26b fix(docs-infra): remove unwanted underline when hovering over contributor info links (#40944)
This commit removes an unwanted underline effect when hovering over
contributor info links (`.contributor-info > .info-item`). This was
accidentally introduced in #40427.

Before: ![contributor info on hover before][1]
After: ![contributor info on hover after][2]

[1]: https://user-images.githubusercontent.com/8604205/108560170-045a7580-7305-11eb-98d2-4302d98581c6.png
[2]: https://user-images.githubusercontent.com/8604205/108560176-058ba280-7305-11eb-97eb-74cf2c830a39.png

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas fe7ff12cd2 fix(docs-infra): make inline code stand out more (#40944)
This commit improves the styling of inline code blocks to make them
stand out more.

Before: ![code formatting before][1]
After: ![code formatting after][2]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108554295-8e521080-72fc-11eb-94e8-09246ae334c8.png
[2]: https://user-images.githubusercontent.com/8604205/108553733-c9077900-72fb-11eb-8001-1f0baf8b95bc.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 3848a5b131 fix(docs-infra): improve the appearance of .filter-button elements (#40944)
This commit improves the appearance of `.filter-button` elements used to
jump between different categories in "Contributors" and "Resources" pages.

Before (wide screen): ![contributors buttons (wide screen) before][1]
Before (narrow screen): ![contributors buttons (narrow screen) before][2]
After (wide screen): ![contributors buttons (wide screen) after][3]
After (narrow screen): ![contributors buttons (narrow screen) after][4]

This change has been extracted from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108414895-72376c00-7235-11eb-9537-7a7b059d09fe.png
[2]: https://user-images.githubusercontent.com/8604205/108414923-782d4d00-7235-11eb-8ba4-87a3a9ae14cd.png
[3]: https://user-images.githubusercontent.com/8604205/108414929-78c5e380-7235-11eb-807a-109b4200e64e.png
[4]: https://user-images.githubusercontent.com/8604205/108414942-7cf20100-7235-11eb-8ef0-9b2da397b3ee.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 08bfb862fc refactor(docs-infra): move .filter-button styles inside .group-buttons (#40944)
Since `.filter-button` elements only appear inside `.group-buttons`
elements, this commit moves `.filter-button` CSS styles inside
`.group-buttons` styles.

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 9784ffcdf7 fix(docs-infra): put the license references in a separate paragraph in the footer (#40944)
This commit improves how sentences are broken up into lines in the
footer (due to the limited max-width of the content) by moving the
license references in a separate paragraph.

Before: ![footer before][1]
After: ![footer after][2]

[1]: https://user-images.githubusercontent.com/8604205/108595211-593ed000-7387-11eb-8ee5-f13c8bf522f4.png
[2]: https://user-images.githubusercontent.com/8604205/108595214-5a6ffd00-7387-11eb-9a9d-dbaa2175f51f.png

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 420ebd2c33 refactor(docs-infra): remove redundant Sass mixin (#40944)
This commit removes the `bp()` Sass mixin, which was only used in one
place (and also included several unused code-branches).

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 2c3cba60d5 refactor(docs-infra): use Sass variables for colors used in themes (#40944)
This change has been extracted from #36045.

NOTE:
The color names for the RC theme were computed using
https://www.color-blindness.com/color-name-hue.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:30 -08:00
George Kalpakas 50ec4b469a fix(docs-infra): increase margin of header-links (#40944)
This change has been extracted from #36045.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40944
2021-02-26 15:39:30 -08:00
Joey Perrott 2a696da6c2 fix(dev-infra): properly tag github releases as prerelease as appropriate (#40999)
Previously all github releases created by the release tooling tagged
releases as `latest`. Instead releases which are created for the `next`
tag on NPM should be tagged as `prerelease` for github.

PR Close #40999
2021-02-26 15:16:55 -08:00
Joey Perrott a044ea2f49 fix(dev-infra): clear cached bazel outputs before building artifacts for publishing (#41000)
Clearing the cached bazel outputs before building the artifacts for
publishing prevents an intermittent error found when the version is
cached between publishes.

PR Close #41000
2021-02-26 15:16:02 -08:00
Theoklitos Bampouris 8d7630f3e0 docs: Change lexical in security guide (#41016)
Change `onerror` attribute reference to `script` element reference
PR Close #41016
2021-02-26 15:14:58 -08:00
George Kalpakas 89ac771652 fix(docs-infra): add links to glossary for terms on the "Press kit" page (#40945)
The "Press kit" page has a "Terminology" section that lists a couple of
terms (currently AOT and JIT compilation).

This commit adds links to the corresponding entries in "Glossary" to
make it easier for people to find out what the terms mean.

PR Close #40945
2021-02-26 08:28:22 -08:00
George Kalpakas 135f251c48 fix(docs-infra): more clearly separate different sections on the "Press kit" page (#40945)
This commit adds a horizontal line and some extra spacing between
different sections of the "Press kit" page to make it easier to identify
where one section ends and the next begins.

Before: ![presskit sections before][1]
After: ![presskit sections after][2]

[1]: https://user-images.githubusercontent.com/8604205/108739638-8208c600-753d-11eb-99bb-ea119640de39.png
[2]: https://user-images.githubusercontent.com/8604205/108745297-95b72b00-7543-11eb-9a35-56325477534b.png

PR Close #40945
2021-02-26 08:28:22 -08:00
George Kalpakas eb09635d4c fix(docs-infra): improve the layout and appearance of the "Press kit" page (#40945)
This commit improves the layout and appearance of the "Press kit" page.
Most notable changes include:
- Center content and limit max width to 50em (which is 50px by default).
- Remove uppercase transform for headings.
- Use a two-column layout for icons (instead of one icon per row).
- Show "download" icons next to download links.

Before (wide): ![presskit page (wide) before][1]
Before (narrow 1/2): ![presskit page (narrow 1/2) before][2]
Before (narrow 2/2): ![presskit page (narrow 2/2) before][3]
After (wide): ![presskit page (wide) after][4]
After (narrow 1/2): ![presskit page (narrow 1/2) after][5]
After (narrow 2/2): ![presskit page (narrow 2/2) after][6]

This change is based on code from #36045.

[1]: https://user-images.githubusercontent.com/8604205/108739632-80d79900-753d-11eb-8ddc-ac542ec5b3ac.png
[2]: https://user-images.githubusercontent.com/8604205/108739641-82a15c80-753d-11eb-9b20-8119ad117460.png
[3]: https://user-images.githubusercontent.com/8604205/108739643-83d28980-753d-11eb-8afa-2d7a5e87d586.png
[4]: https://user-images.githubusercontent.com/8604205/108739638-8208c600-753d-11eb-99bb-ea119640de39.png
[5]: https://user-images.githubusercontent.com/8604205/108739642-8339f300-753d-11eb-9b25-5c1988adb1dd.png
[6]: https://user-images.githubusercontent.com/8604205/108739645-846b2000-753d-11eb-8ef3-b6a8b7c6d1ff.png

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40945
2021-02-26 08:28:22 -08:00
George Kalpakas 06ff277b60 fix(ngcc): do not fail hard when a format-path points to a non-existing or empty file (#40985)
Previously, when `ngcc` encountered an entry-point with a format-path
that pointed to a non-existing or empty file it would throw an error and
stop processing the remaining tasks.

In the past, we used to ignore such format-paths and continue processing
the rest of the tasks ([see code][1]). This was changed to a hard
failure in 2954d1b5ca. Looking at the code
history, the reason for changing the behavior was an (incorrect)
assumption that the condition could not fail. This assumption failed to
take into account the case where a 3rd-party library has an invalid
format-path in its `package.json`. This is an issue with the library,
but it should not prevent `ngcc` from processing other
packages/entry-points/formats.

This commit fixes this by reporting the task as failed but not throwing
an error, thus allowing `ngcc` to continue processing other tasks.

[1]: https://github.com/angular/angular/blob/3077c9a1f89c5bd75fb96c16e/packages/compiler-cli/ngcc/src/main.ts#L124

Fixes #40965

PR Close #40985
2021-02-26 08:26:34 -08:00
George Kapris 71ef11f0f1 docs: Change grammatically in security guide (#40995)
Change `controller` reference to `component` reference
PR Close #40995
2021-02-26 08:25:21 -08:00
Benjamin Blackwood a90a858b27 docs(forms): add array example to get method (#41008)
PR Close #41008
2021-02-26 08:24:22 -08:00
Pete Bacon Darwin 55eb7b5681 fix(compiler): ensure JIT compilation of ɵɵngDeclarePipe() works (#40929)
Previously the compiler was not evaluating the JIT compilation
of `ɵɵngDeclarePipe()` but there was no test to check it.

PR Close #40929
2021-02-24 15:07:08 -08:00
Pete Bacon Darwin ca271b84fc test(localize): ensure tests pass on Windows (#40952)
These tests were relying upon unix-like paths, which
caused them to fail on Windows.

Note that the `filegroup` Bazel rule tends not to work well
on Windows, so this has been replaced with `copy_to_bin`
instead.

PR Close #40952
2021-02-24 14:27:08 -08:00
Pete Bacon Darwin 81201caad2 ci: run localize tests on windows (#40952)
Added `//packages/localize/...` to the tests that are run in `test_win` job.

PR Close #40952
2021-02-24 14:27:08 -08:00
Pete Bacon Darwin 241784bde8 refactor(ngcc): support processing only the typings files of packages (#40976)
Some tools (such as Language Server and ng-packagr) only care about
the processed typings generated by ngcc. Forcing these tools to process
the JavaScript files as well has two disadvantages:

First, unnecessary work is being done, which is time consuming.

But more importantly, it is not always possible to know how the final bundling
tools will want the processed JavaScript to be configured. For example,
the CLI would prefer the `--create-ivy-entry-points` option but this would
break non-CLI build tooling.

This commit adds a new option (`--typings-only` on the command line, and
`typingsOnly` via programmatic API) that instructs ngcc to only render changes
to the typings files for the entry-points that it finds, and not to write any
JavaScript files.

In order to process the typings, a JavaScript format will need to be analysed, but
it will not be rendered to disk. When using this option, it is best to offer ngcc a
wide range of possible JavaScript formats to choose from, and it will use the
first format that it finds. Ideally you would configure it to try the `ES2015` FESM
format first, since this will be the most performant.

Fixes #40969

PR Close #40976
2021-02-24 14:23:14 -08:00
Andrew Scott d7133a8e4e release: cut the v11.2.3 release (#40981) 2021-02-24 09:36:12 -08:00
Andrew Scott 3fe759eb6c test(language-service): remove circular dependency (#40966)
This commit removes the circular dependency from buffer->util->project->buffer.

PR Close #40966
2021-02-24 08:54:36 -08:00
Andrew Scott c0b364c675 refactor(language-service): Remove old testing helpers (#40966)
All specs have been switched to the new testing package. The old test
helpers are no longer needed.

PR Close #40966
2021-02-24 08:54:36 -08:00
Andrew Scott ccc2a14ae0 refactor(language-service): convert references_spec to new testing package (#40966)
refactor(language-service): convert references_spec to new testing package

PR Close #40966
2021-02-24 08:54:36 -08:00
Andrew Scott 71d302c8ce refactor(language-service): migrate type_definitions_spec to the new testing package (#40966)
refactor(language-service): migrate type_definitions_spec to the new testing package

PR Close #40966
2021-02-24 08:54:36 -08:00
Andrew Scott d7ba1fb56e refactor(language-service): migrate quick_info_spec to new testing package (#40966)
refactor(language-service): migrate quick_info_spec to new testing package

PR Close #40966
2021-02-24 08:54:36 -08:00
Andrew Scott 6c6883be1a refactor(language-service): migrate definitions_spec to new testing package (#40966)
refactor(language-service): migrate definitions_spec to new testing package

PR Close #40966
2021-02-24 08:54:35 -08:00
Andrew Scott 79b75a3e74 refactor(language-service): migrate gettcb_spec to new testing package (#40966)
refactor(language-service): migrate gettcb_spec to new testing package

PR Close #40966
2021-02-24 08:54:35 -08:00
Andrew Scott 7f7fc6cb09 refactor(language-service): migrate diagnostic_spec to new test infrastructure (#40966)
refactor(language-service): migrate diagnostic_spec to new test infrastructure

PR Close #40966
2021-02-24 08:54:35 -08:00
Andrew Scott e433fe27b9 refactor(language-service): Migrate completions_spec to new testing API (#40966)
refactor(language-service): Migrate completions_spec to new testing API

PR Close #40966
2021-02-24 08:54:35 -08:00
Alex Rickabaugh 79ae25b7ba test(language-service): update compiler_spec to use the new testing env (#40966)
This commit updates compiler_spec.ts in the Ivy LS suite to utilize the new
testing environment which was introduced in the previous commit. Eventually
all specs should be converted, but converting one right now helps ensure
that the new testing env is working properly and able to support real tests.

PR Close #40966
2021-02-24 08:54:35 -08:00
Joey Perrott 35514347df build: update to rules_nodejs@3.2.1 (#40972)
Update to the latest version of rules_nodejs.

PR Close #40972
2021-02-24 08:00:03 -08:00
Carl Fredrik Samson 08372a1d24 docs: fix ch 4 so it compiles in strict mode (#40970)
Fixes error: `TS2564: Property 'heroes' has no initializer and is not definitely assigned in the constructor`
and makes `hero` property consistent with ch 3 (ref: #40942)

PR Close #40970
2021-02-24 07:57:53 -08:00
Keen Yee Liau db28ed2341 refactor(language-service): add type guard for NgLanguageService (#40954) (#40968)
This is patch PR for #40954

Type guard should be colocated with the `NgLanguageService` interface,
not in `@angular/vscode-ng-language-service`.

PR Close #40954

PR Close #40968
2021-02-23 13:25:00 -08:00
Keen Yee Liau 6ba060fc5f refactor(language-service): Clean up getTcb interface (#40954) (#40968)
`GetTcbResponse` should not be a union type with `undefined`.

PR Close #40954

PR Close #40968
2021-02-23 13:25:00 -08:00
Chris fa1784bd7c docs: improve examples, description of PipeTransform (#40863)
Fixes #37321

PR Close #40863
2021-02-23 13:15:44 -08:00
Kapunahele Wong c6e2234fa6 docs: improve accessibility for toh-pt1 example (#40560)
PR Close #40560
2021-02-23 10:41:56 -08:00
Kapunahele Wong b23c8bbec0 docs: improve accessibility of toh2 example (#40575)
Increases contrast of example copy.
Explicitly references inputs from labels.
Updates screenshot of styles that aren't accessible.
Removes the term master.
Provides more detailed alternate text for the image.
Adds padding to input so it is an easier target for touch or pointer.

PR Close #40575
2021-02-23 10:41:05 -08:00
Kapunahele Wong 437a081384 docs: improve accessibility of tohpt3 (#40617)
PR Close #40617
2021-02-23 10:40:09 -08:00
Kapunahele Wong 320542ba3c docs: improve accessibility of tohpt4 (#40622)
PR Close #40622
2021-02-23 10:39:44 -08:00
Kapunahele Wong 4761222bde docs: improve accessibility of toh-pt5 example (#40632)
PR Close #40632
2021-02-23 10:39:13 -08:00
Kapunahele Wong fc39ec42a6 docs: improve accessibility of toh-pt6 (#40805)
PR Close #40805
2021-02-23 10:38:50 -08:00
Joey Perrott 29866332bd test(bazel): use bazel runfiles helper for resolving file names (#40955)
Use bazel's runfiles helper to resolve file name paths rather than
require.

PR Close #40955
2021-02-23 10:38:09 -08:00
Andrew Scott 0dd1facc32 perf(language-service): Skip Angular analysis when quick info requested outside a template (#40956)
The Angular LS does not provide quick info when the given position is not
inside a template. As an optimization, we can quickly look at the
file and determine if we are at a position that is part of an Angular
template. If not, we bail before asking the compiler for any more
information. Note that the Angular LS _already_ provides no quick info
when outside a template file, but currently asks the compiler to analyze
the program before it determines that information.

PR Close #40956
2021-02-23 10:37:48 -08:00
Kapunahele Wong afa234d41c docs: move JsonParser class above CustomJsonInterceptor (#40964)
This move fixes the error in StackBlitz of
Cannot access 'JsonParser' before initialization

PR Close #40964
2021-02-23 10:37:26 -08:00
Alex Rickabaugh 09b92d755a refactor(compiler-cli): separate out constant target of g3 patch (#40950)
This commit moves a constant which is affected by a g3 sync patch into a
separate file. This way, changes to the rest of the compiler codebase have
no chance of conflicting with the patched code.

PR Close #40950
2021-02-22 15:19:45 -08:00
Andrew Scott 263bbd43c1 release: cut the v11.2.2 release (#40951) 2021-02-22 13:48:16 -08:00
Andrew Scott 73a3ff11cb perf(language-service): short-circuit LS operations (#40946)
When certain information is requested from the Angular Language Service, we
know that there will be no additional Angular information if the requested
position is not in an inline template, template url, or style url. To avoid
unnecessary compiler compilations, we short circuit and return `undefined`
before asking the compiler for any type of answer which would trigger a
partial compilation, at the very least.

fixes https://github.com/angular/vscode-ng-language-service/issues/1104

PR Close #40946
2021-02-22 13:19:09 -08:00
Dmitry Drobyshev 4a32579a4d fix(http): emit error on XMLHttpRequest abort event (#40786)
Before this change, when Google Chrome cancels a XMLHttpRequest, an Observable of the response
never finishes. This happens, for example, when you put your computer to sleep or just press
Ctrl+S to save the browser page. After this commit, if request is canceled or aborted an
appropriate Observable will be completed with an error.

Fixes #22324

PR Close #40786
2021-02-22 13:01:11 -08:00
Daniel Díaz 8beead1db2 docs: update year (#40925)
PR Close #40925
2021-02-22 12:37:40 -08:00
Jon Jaques 0d5fbea5dc refactor(zone.js): update Object.create params to match web platform (#34287)
This commit updates `Object.create` argument names used in Zone.js to match web platform.

PR Close #34287
2021-02-22 08:47:39 -08:00
Alex Rickabaugh 3a39fef6b6 test(language-service): update compiler_spec to use the new testing env (#40679)
This commit updates compiler_spec.ts in the Ivy LS suite to utilize the new
testing environment which was introduced in the previous commit. Eventually
all specs should be converted, but converting one right now helps ensure
that the new testing env is working properly and able to support real tests.

PR Close #40679
2021-02-22 08:40:41 -08:00
Alex Rickabaugh 48d42e57e4 test(language-service): introduce new, more configurable testing env (#40679)
The Ivy Language Service codebase testing suite contains a few testing
utilities which allow for assertions of Language Service operations against
an in-memory project. However, this existing utility lacks the flexibility
to test more complex scenarios, such as those involving multiple TS projects
with dependencies between them.

This commit introduces a new 'testing' package for the Ivy LS which attempts
to more faithfully represent the possible states of an IDE, and allows for
testing of more advanced scenarios. The new utility borrows from the prior
version and is geared towards more ergonomic testing. Only basic
functionality is present in this initial implementation, but this will grow
over time.

PR Close #40679
2021-02-22 08:40:41 -08:00
Andrew Kushnir ff86f919ab refactor(core): use RuntimeError to throw provider not found error (#40901)
This PR performs a small refactoring to use `RuntimeError` class and corresponding error code (by calling
`throwProviderNotFoundError` which formats the message) to make it more consistent with other places where
similar errors are thrown.

PR Close #40901
2021-02-19 14:38:19 -08:00
Jefiozie 3b884ed1fc fix(http): ignore question mark when params are parsed (#40610)
This commit adds a fix where params will ignore questions marks when
parsed.

Fixes #28722

PR Close #40610
2021-02-19 12:11:39 -08:00
Benjamin Kindle f1c64b3f38 fix(animations): error when setting position before starting animation (#28255)
it is now possible to set the position when the animation has not ever been started.

PR Close #28255
2021-02-19 12:09:02 -08:00
George Kalpakas dcbf600bbc refactor(docs-infra): convert Sass mixin from camelCase to kebab-case to follow Sass conventions (#40881)
This commit converts the last remaining camelCased Sass mixin
(`deployTheme`) to kebab-case (`deploy-theme`) to follow the Sass
conventions.

Discussed in
https://github.com/angular/angular/pull/40881#discussion_r577961617.

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 9aa0ef964e refactor(docs-infra): create mixin for styling marketing pages (#40881)
Previously, in order to apply some styles to marketing (i.e. non-docs)
pages, we listed the various `.page-*` classes that corresponded to docs
pages. This meant that adding/removing a marketing page required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
marketing pages.

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 181037cd21 refactor(docs-infra): remove duplicate or unused CSS styles (#40881)
This commit removes some CSS styles that have no effect (i.e. are
duplicates or overridden by other rules).

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 36f20919b3 fix(docs-infra): fix top margin of "Press kit" page on small screens (#40881)
Previously, the "Press kit" page had a larger top margin on smaller
screens, that seemed unnecessary.

This commit removes the extra top margin.

Before: ![presskit top section margin before][1]
After: ![presskit top section margin after][2]

[1]: https://user-images.githubusercontent.com/8604205/107988545-efb27080-6fd8-11eb-91d6-79651f2dffaf.png
[2]: https://user-images.githubusercontent.com/8604205/107988547-f04b0700-6fd8-11eb-9c4b-d444b39a34fe.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas af8c6d39a5 fix(docs-infra): use consistent padding in marketing pages (#40881)
This commit makes the padding of the "Events", "Features" and
"Press kit" pages consistent with that of other marketing pages.

Before: ![presskit padding before][1]
After: ![presskit padding after][2]

[1]: https://user-images.githubusercontent.com/8604205/107986067-f8547800-6fd3-11eb-9164-51793e431d05.png
[2]: https://user-images.githubusercontent.com/8604205/107986064-f7234b00-6fd3-11eb-9050-ed7ec04e7443.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 8bbe791c75 fix(docs-infra): make top-nav consistent across all marketing pages (#40881)
Previously, some of the marketing pages had different styles for the
top-nav than others (even if they had the same layout and
blue-background header). More specifically, the top-nav had a box-shadow
and it was absolutely positioned on some marketing pages, while it had
no box-shadow and was statically positioned on others.

This commit makes the appearance of marketing pages wrt the top-nav
consistent across all marketing pages by changing the styles for the
remaining pages:
- Contributors (`/about`)
- Contribute (`/contribute`)
- Press kit (`/presskit`)

Before: ![contribute topnav shadow before][1]
After: ![contribute topnav shadow after][2]

[1]: https://user-images.githubusercontent.com/8604205/107984898-a6aaee00-6fd1-11eb-8bf3-79393c8983ff.png
[2]: https://user-images.githubusercontent.com/8604205/107984900-a7438480-6fd1-11eb-8d9b-a643d69ab692.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 01a3bff576 fix(docs-infra): make the "Contributors" page header similar to other marketing pages (#40881)
Before (wide screen): ![contributors (wide screen) before][1]
Before (narrow screen): ![contributors (narrow screen) before][2]
After (wide screen): ![contributors (wide screen) after][3]
After (narrow screen): ![contributors (narrow screen) after][4]

[1]: https://user-images.githubusercontent.com/8604205/107983880-634f8000-6fcf-11eb-8ad9-5a5df65d3d5e.png
[2]: https://user-images.githubusercontent.com/8604205/107983893-6a768e00-6fcf-11eb-9ccd-158ec491404f.png
[3]: https://user-images.githubusercontent.com/8604205/107983903-6f3b4200-6fcf-11eb-94e1-182893b7a715.png
[4]: https://user-images.githubusercontent.com/8604205/107983895-6ba7bb00-6fcf-11eb-9ff5-59d221ba906d.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 9d04484b10 fix(docs-infra): add spacing between past and future events sections (#40881)
This commit adds some more spacing between the past and future events
sections on the "Events" page.

Before: ![events spacing before][1]
After: ![events spacing after][2]

[1]: https://user-images.githubusercontent.com/8604205/107989711-82eca580-6fdb-11eb-837e-1255d439d51a.png
[2]: https://user-images.githubusercontent.com/8604205/107989708-81bb7880-6fdb-11eb-8cf4-4653254e1c37.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 2c6ec052c7 refactor(docs-infra): create mixin for styling docs pages (#40881)
Previously, in order to apply some styles to docs (i.e. non-marketing)
pages, we listed the various `.folder-*` classes that corresponded to
docs pages. This meant that adding/removing a docs area required updates
in several places, which is error-prone.

This commit avoids this by using a Sass mixin for applying styles to
docs pages.

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas cb1400d28f fix(docs-infra): ensure the main font is applied to inputs (#40881)
It turns out that `<input>` and `<button>` elements do not inherit the
`font-family` style from `<body>` by default, but rather use a
user-agent defined style. This means that their font-family might be
different than the one used in the rest of the page.

This commit fixes it by ensuring `<input>` (and other) elements inherit
their `font-family` style from their parent element.

Before: ![inputs font before][1]
After: ![inputs font after][2]

(The difference in font is subtle, but it's there.)

[1]: https://user-images.githubusercontent.com/8604205/107853245-76bae980-6e1d-11eb-8318-e5f6e13876cc.png
[2]: https://user-images.githubusercontent.com/8604205/107853246-77538000-6e1d-11eb-86f2-e3e7e41158f5.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas f926b25e07 refactor(docs-infra): remove unnecessary font-family styles (#40881)
This commit removes some unnecessary styles setting `font-family` to
`$main-font`. These styles are redundant, because the targeted elements
already inherit this style from `<body>`.

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 3464a99f18 refactor(docs-infra): remove unused CSS for the version selector (#40881)
This commit removes some CSS rules targeting `.doc-version select` in
the sidenav. These rules do not match any elements any more, since now
we use a custom `<aio-select>` component (instead of the `<select>`
element).

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 44aa0d71be fix(docs-infra): merge docs with guide and start with tutorial in search-results (#40881)
Previously, the `docs.md` guide was appearing under "OTHER" in search
results and the results for the `/start*` tutorial pages were appearing
under "START".

This commit changes this so that `docs.md` appears under "GUIDES" and
`/start*` appear under "TUTORIALS", since that is where they belong
conceptually.

It also changes the header of the guides search-area from "GUIDE" to
"GUIDES" and that of tutorials from "TUTORIAL" to "TUTORIALS".

Before: ![search-results areas before][1]
After: ![search-results areas after][2]

[1]: https://user-images.githubusercontent.com/8604205/107811568-0ce80480-6d77-11eb-8652-e7a947c36e63.png
[2]: https://user-images.githubusercontent.com/8604205/107811569-0eb1c800-6d77-11eb-9a69-0000a3703c8a.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas fff93ae8f3 fix(docs-infra): show the "Errors List" page under "ERRORS" in search results (#40881)
Previously, the "Errors List" page was appearing under the "OTHER"
section in search results.

This commit fixes this to make it appear under the "ERRORS" section.

Before: ![search-results before][1]
After: ![search-results after][2]

[1]: https://user-images.githubusercontent.com/8604205/107691151-c1b8ed80-6cb3-11eb-8079-fcace685f0ec.png
[2]: https://user-images.githubusercontent.com/8604205/107691145-bfef2a00-6cb3-11eb-8523-b2747fa40469.png

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas 54abe9f66c fix(docs-infra): use relative URLs for internal links on error pages (#40881)
Previously, some of the links on the error pages had URLs prefixed with
`https://angular.io/`. This caused them to be treated as external URLs,
which had the following downsides:
- Links would always point to `angular.io` instead of the same version
  as the error page (e.g. `next.angular.io` or `v11.angular.io`).
- Dgeni would not be able to check that the URLs are valid (i.e. point
  to existing pages).
- An external link icon would incorrectly be shown next to the links on
  `angular.io`.

This commit fixes the links to use relative URLs.

PR Close #40881
2021-02-19 09:15:00 -08:00
George Kalpakas fc07b71d13 fix(docs-infra): show external link icons for external links on error pages (#40881)
This commit adds error pages to the list of docs pages that have an
external link icon next to links to external URLs.

PR Close #40881
2021-02-19 09:15:00 -08:00
Kapunahele Wong 0457aa1b6e docs: edit Component lifecycle title (#40894)
PR Close #40894
2021-02-19 09:10:37 -08:00
David Shevitz 3e813a1618 docs: add missing '@usageNotes' tag to documentation (#40909)
PR Close #40909
2021-02-19 09:09:44 -08:00
arturovt f8055f6fb8 fix(platform-browser): ensure that Hammer loader is called only once (#40911)
Currently, the function that is provided through `HAMMER_LOADER` is called the
same number of times as the `HammerGesturesPlugin.addEventListener` method is called
(until the Hammer is loaded).

This commit adds a class property in which the loader call is saved, thereby
preventing multiple calls to the loader function.

PR Close #25995

PR Close #40911
2021-02-19 09:08:35 -08:00
Amadou Sall c8233a74b8 docs: the token should be associated with LibHeaderComponent (#40922)
PR Close #40922
2021-02-19 09:07:01 -08:00
Kapunahele Wong 4e84b2f3ac docs: edit attribute-directives.md, move best practice to styleguide (#39849)
PR Close #39849
2021-02-19 08:14:55 -08:00
Chellappan 170692c18c refactor(compiler): add process title to Angular node binaries (#40648)
Set the process title for @angular/compiler-cli,@angular/localize packages

Resolves #40634

PR Close #40648
2021-02-17 17:06:27 -08:00
DerekRTP 972eddc1ff docs: update attribute-binding.md to correctly describe [attr.binding] rules (#40878)
PR Close #40878
2021-02-17 17:05:17 -08:00
Dmitrij Kuba 808bded9b0 docs: remove mention of unused Intl polyfill (#40883)
Since `Intl` API was dropped to use to improve browser support,
it is no longer needed as a polyfill to test Angular.

PR Close #40883
2021-02-17 17:04:15 -08:00
Dmitrij Kuba 7bf201ebe8 refactor(platform-browser): remove Intl references (#40883)
Since `Intl` API was dropped to use to improve browser support,
would be nice to remove the references of it.

PR Close #40883
2021-02-17 17:04:15 -08:00
Pete Bacon Darwin 501e15eb98 refactor(localize): avoid computing source-maps in extraction unnecessarily (#40891)
Previously we were calling `updateSourceLocations()` as part of
`extractMessages()` for every file that was passed in, regardless of
whether any `$localize` tagged strings were to be found in the file.

This was very wasteful because it is non-trivial to compute the flattened
source-map for files if it is not needed.

PR Close #40891
2021-02-17 17:02:57 -08:00
Joey Perrott 9a887e35c6 build: update dependencies to enable strict_visibility for bazel yarn_install (#40895)
Beginning with rules_nodejs@3.0.0, strict visibility defaults to true.  This means
that we are no longer, in bazel dependencies, able to depend on a package which was
transitively depended on from another dependency we do have in our package.json

PR Close #40895
2021-02-17 17:01:27 -08:00
David Shevitz a970c19f02 docs: fix minor grammar mistakes in What is Angular topic (#40892)
PR Close #40892
2021-02-17 13:23:49 -08:00
arturovt c8a2e3ae1c perf(core): use ngDevMode to tree-shake warning (#40876)
This commit adds `ngDevMode` guard to show the warning only
in dev mode (similar to how things work in other parts of Ivy runtime code).
The `ngDevMode` flag helps to tree-shake the warning from production builds
(in dev mode everything will work as it works right now) to decrease production bundle size.

PR Close #40876
2021-02-17 11:41:28 -08:00
David Shevitz e74365dd35 docs: add what is angular topic (#40811)
PR Close #40811
2021-02-17 11:13:21 -08:00
Joey Perrott 572e3a356c release: cut the v11.2.1 release (#40887) 2021-02-17 11:22:17 -07:00
Daniel 29a99e806e docs: fix grammar in angular-compiler-options file (#40879)
PR Close #40879
2021-02-17 06:56:39 -08:00
Amadou Sall 5f81eae238 docs: remove the extra backtick character (#40873)
PR Close #40873
2021-02-17 06:56:04 -08:00
abarghoud fead4648a2 docs(core): add documentation for HostListener (#40720)
add return value documentations for HostListener callbacks

Closes #40708

PR Close #40720
2021-02-17 06:55:29 -08:00
Pete Bacon Darwin cc99aec703 refactor(compiler-cli): error on cyclic imports in partial compilation (#40782)
Our approach for handling cyclic imports results in code that is
not easy to tree-shake, so it is not suitable for publishing in a
library.

When compiling in partial compilation mode, we are targeting
such library publication, so we now create a fatal diagnostic
error instead of trying to handle the cyclic import situation.

Closes #40678

PR Close #40782
2021-02-17 06:53:38 -08:00
George Kalpakas 44319c4d82 build: upgrade webdriver-manager to v12.1.8 (#40885)
ChromeDriver now supports Apple Silicon ARM processors.
`webdriver-manager` versions 12.1.7 and earlier will, however,
incorrectly download the arm64 ChromeDriver regardless of the
system's architecture. This results in failure to run Protractor tests
on macOS with the error: `spawn Unknown system error -86`

This commit fixes the problem by upgrading `webdriver-manager` to
version 12.1.8, which includes a fix.
See also https://stackoverflow.com/questions/65618558.

PR Close #40885
2021-02-17 06:51:47 -08:00
George Kalpakas 3f6aed69a4 build: use correct path for local dependencies in ivy-i18n integration project (#40885)
Previously, the paths to some local dependencies in the `ivy-i18n`
integration project were pointing to non-generic bazel files that would
normally not exist on a user's machine.

This commit changes these paths to relative paths pointing to build
artifacts that are guaranteed to exist (once the necessary build
commands have been executed).

PR Close #40885
2021-02-17 06:51:47 -08:00
George Kalpakas 4943dba322 build: ensure integration projects use root webdriver-manager (#40885)
Ensure that all integration projects use `webdriver-manager` from the
root `node_modules/`. See acfd0edd38 for
more details.

PR Close #40885
2021-02-17 06:51:47 -08:00
s4m0r4m4 53865c4517 docs(forms): fix link for browser compatibility of using selects in IE (#40855)
Co-authored-by: Andrew Kushnir <43554145+AndrewKushnir@users.noreply.github.com>
PR Close #40855
2021-02-16 13:06:54 -08:00
s4m0r4m4 5296ed6d40 docs(forms): remove reference to firefox bug that was fixed (#40855)
PR Close #40855
2021-02-16 13:06:54 -08:00
Kapunahele Wong 6794456a1c docs: edit builtin-directives doc (#39816)
Edit built-in-directives.md copy and headers, fixes affected
links, adds a docregion to make steps clearer.

PR Close #39816
2021-02-16 13:04:41 -08:00
Paul Gammans 4906bf6a50 fix(router): fix load interaction of navigation and preload strategies (#40389)
Fix router to ensure that a route module is only loaded once especially
in relation to the use of preload strategies with delayed or partial
loading.

Add test to check the interaction of PreloadingStrategy and normal
router navigation under differing scenarios.
Checking:
 * Prevention of duplicate loading of modules.
   related to #26557
 * Prevention of duplicate RouteConfigLoad(Start|End) events
   related to #22842
 * Ensuring preload strategy remains active for submodules if needed
   The selected preload strategy should still decide when to load submodules
 * Possibility of memory leak with unfinished preload subscription
   related to #26557
 * Ensure that the stored loader promise is cleared so that subsequent
   load will try the fetch again.
 * Add error handle error from loadChildren
 * Ensure we handle error from with NgModule create

Fixes #26557 #22842 #26557

PR Close #40389
2021-02-16 11:28:50 -08:00
Alexey Elin 5412cdfe43 docs: fix broken link in Default Architect builders and targets section (+ remove typo 'the') (#40847)
PR Close #40847
2021-02-16 10:04:48 -08:00
storm-sergey 8bb3550fe2 docs: update the copyright notice date (#40707)
PR Close #40707
2021-02-16 10:04:24 -08:00
David Shevitz d39f39115e docs: add observer-spy to resources page (#40624)
PR Close #40624
2021-02-16 10:03:58 -08:00
Alexey Elin b7d9761008 docs: use shorthand background CSS property in Routing example (#40834)
PR Close #40834
2021-02-16 09:26:27 -08:00
Alexey Elin 9db442fe56 docs: format null as code fragment + fix description of returned value (#40852)
PR Close #40852
2021-02-16 09:24:49 -08:00
Alexey Elin 4a23b2bcb1 docs: use TS Parameter properties in SkipSelf example (#40858)
PR Close #40858
2021-02-16 09:24:25 -08:00
Pete Bacon Darwin fb0ce2178a fix(compiler): support multiple selectors in :host-context() (#40494)
The previous commits refactored the `ShadowCss` emulator to support
desirable use-cases of `:host-context()`, but it dropped support
for passing a comma separated list of selectors to the `:host-context()` .

This commit rectifies that omission, despite the use-case not being
valid according to the ShadowDOM spec, to ensure backward compatibility
with the previous implementation.

PR Close #40494
2021-02-16 08:41:20 -08:00
Pete Bacon Darwin ab8ea87078 fix(compiler): handle :host-context and :host in the same selector (#40494)
In `ViewEncapsulation.Emulated` mode the compiler converts `:host` and
`:host-context` pseudo classes into new CSS selectors.

Previously, when there was both `:host-context` and `:host` classes in a
selector, the compiler was generating incorrect selectors. There are two
scenarios:

* Both classes are on the same element (i.e. not separated). E.g.
  `:host-context(.foo):host(.bar)`. This setup should only match the
  host element if it has both `foo` and `bar` classes. So the generated
  CSS selector should be: `.foo.bar<hostmarker>`.
* The `:host` class is on a descendant of the `:host-context`. E.g.
  `:host-context(.foo) :host(.bar)`. This setup should only match the
  `.foo` selector if it is a proper ancestor of the host (and not on the
  host itself). So the generated CSS selector should be:
  `.foo .bar<hostmarker>`.

This commit fixes the generation to handle these scenarios.

Fixes #14349

PR Close #40494
2021-02-16 08:41:20 -08:00
Pete Bacon Darwin c20e3047a5 fix(compiler): support multiple :host-context() selectors (#40494)
In `ViewEncapsulation.Emulated` mode, the compiler must generate additional
combinations of selectors to handle the `:host-context()` pseudo-class function.

Previously, when there is was more than one `:host-context()` selector in a
rule, the compiler was generating invalid selectors.

This commit generates all possible combinations of selectors needed to
match the same elements as the native `:host-context()` selector.

Fixes #19199

PR Close #40494
2021-02-16 08:41:20 -08:00
Pete Bacon Darwin bc816de4b5 docs: fix missing code line from tutorial example (#40789)
In #40419 we move the code that creates the `heroes` object
above the code that updates the message service. But this moved
that line of code outside of the docregion that is displayed in
the tutorial ealier on, making it non-sensical.

This commit ensures that this line of code is now rendered in the
tutorial be moving it within the correct docregion.

Closes #40788

PR Close #40789
2021-02-16 08:40:26 -08:00
George Kalpakas 8773385d8a fix(docs-infra): fix top padding of main content when a notification is visible (#40802)
This commit fixes the top padding of the main content on the homepage
and other pages when a notification is visible at the top of the page.
The problem was particularly obvious on the homepage (see images below).

Before: ![homepage top-right before][1]
After: ![homepage top-right after][2]

[1]: https://user-images.githubusercontent.com/8604205/107394349-74e2e480-6b04-11eb-8853-71a153cdc459.png
[2]: https://user-images.githubusercontent.com/8604205/107394336-71e7f400-6b04-11eb-9ef0-ff82f6f27875.png

PR Close #40802
2021-02-16 08:39:50 -08:00
George Kalpakas d876e4e6c3 fix(docs-infra): fix placement of TOC hover/active markers (dots) (#40802)
This commit fixes the placement of the TOC hover/active markers (dots)
so that they are horizontally in the middle of the marker "rail" and
vertically in the middle of the item's first line.

This commit also refactors the `_toc.scss` to be more DRY (wrt styling
the TOC markers/marker rail) and uses Sass variables and mixins to
ensure that the styling is kept up-to-date wrt future typography changes
to TOC items.

Before: ![toc marker before][1]
After: ![toc marker after][2]

[1]: https://user-images.githubusercontent.com/8604205/107270751-03e3f400-6a54-11eb-9d77-5b0a3cfb1c2b.png
[2]: https://user-images.githubusercontent.com/8604205/107270758-047c8a80-6a54-11eb-82c0-98b832c109a3.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 7b29cf7326 fix(docs-infra): improve line-spacing between TOC items (esp. for wrapped lines) (#40802)
Previously, the line-spacing between different TOC items was almost the
same as that between wrapped lines of the same item. This made it more
diffucult to distinguish the different items.

This commit fixes this by reducing the line-spacing between wrapped
lines of the same item and keeping a larger line-spacing between
different items.

Before: ![toc line-spacing before][1]
After: ![toc line-spacing after][2]

[1]: https://user-images.githubusercontent.com/8604205/107255272-ccb81780-6a40-11eb-9612-4e7b2058417d.png
[2]: https://user-images.githubusercontent.com/8604205/107255280-cd50ae00-6a40-11eb-8f60-9ce8fba10e12.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas fb4cd6f39c fix(docs-infra): fix sidenav top position on narrow screens (#40802)
On larger screens the top-bar has a height of 64px. On screens smaller
than 600px, the top-bar has a height of 56px. As a result, the sidenav
should have a top position of 56px on screens smaller than 600px and
64px on other screens.

Previously, the style setting the top position to 56px was tied to the
presence of the `.collapsed` class, which depends on whether the sidenav
is docked or not. The change from docked to collapsed sidenav, however,
happens at 992px. As a result, the sidenav had an incorrect top position
(56px instead of 64px) on screens between 600px and 991px.

This commit fixes this by ensuring the change of the top position for
the sidenav happens at 600px.

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 2e52350c63 fix(docs-infra): improve line-spacing between search results (esp. for wrapped lines) (#40802)
Previously, the line-spacing between different search result items was
the same as that between wrapped lines of the same result. This made it
difficult to distinguish the different results.

This commit fixes it by reducing the line-spacing between wrapped lines
of the same result item and keeping a larger line-spacing between
different results.

Before: ![search-results before][1]
After: ![search-results after][2]

[1]: https://user-images.githubusercontent.com/8604205/107229685-ca48c400-6a26-11eb-8161-0c0768b10a2d.png
[2]: https://user-images.githubusercontent.com/8604205/107229691-ccab1e00-6a26-11eb-9594-d4c37d0d72b2.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 96bf63fec5 fix(docs-infra): avoid page-breaks inside an image when printing (#40802)
Previously, when printing, a page-break could be inserted inside an
image (contained in a `.lightbox` element).

This commit ensures no page-breaks are inserted inside `.lightbox`
elements (which contain images).

Before: ![print-page-break before][1]
After: ![print-page-break after][2]

[1]: https://user-images.githubusercontent.com/8604205/106939709-48f0e900-6729-11eb-912c-e5cd0cb40897.png
[2]: https://user-images.githubusercontent.com/8604205/106939707-48585280-6729-11eb-8d5f-a12312f32056.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 6c3a8d9564 fix(docs-infra): fix search results top padding when a notification is visible (#40802)
Previously, when a notification was visible at the top of the page, the
search results pane had more top padding than necessary.

This commit fixes it by removing the extra padding.

Before: ![search-results before][1]
After: ![search-results after][2]

[1]: https://user-images.githubusercontent.com/8604205/106938100-3970a080-6727-11eb-8ae8-4e7a33af1daf.png
[2]: https://user-images.githubusercontent.com/8604205/106938103-3aa1cd80-6727-11eb-96f5-f607bde314be.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas e005228e5b fix(docs-infra): dim line-numbers in code examples (#40802)
This commit ensures that the line-numbers in code examples appear
"dimmed" to make it clearer that they are not part of the actual code.

Based on the CSS rules, it seems that the intention was to make it so,
but the color was incorrectly set on the `<ol>` elements instead of
targeting `li::marker`.

Before: ![line-numbers before][1]
After: ![line-numbers after][2]

[1]: https://user-images.githubusercontent.com/8604205/106937191-23aeab80-6726-11eb-9178-bdc067fa3d09.png
[2]: https://user-images.githubusercontent.com/8604205/106937184-227d7e80-6726-11eb-81d1-f709537b6a56.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 6bdc11e8cc fix(docs-infra): fix vertical alignment of contributor info items (#40802)
This commit fixes the vertical alignment of info items (i.e. links to
bio, Twitter, website) in the contributor list.

Before: ![contributor alignment before][1]
After: ![contributor alignment after][2]

[1]: https://user-images.githubusercontent.com/8604205/106926453-ca407f80-6719-11eb-9580-8614cc4f4907.png
[2]: https://user-images.githubusercontent.com/8604205/106926469-cd3b7000-6719-11eb-8ba8-c8ae01996c02.png

PR Close #40802
2021-02-16 08:39:49 -08:00
George Kalpakas 39638a768f fix(docs-infra): clear unneeded DOM nodes in CodeExample/TabsComponent (#40802)
Both `CodeExampleComponent` and `CodeTabsComponent` components receive
some code via content projection, grab the projected content and pass it
through to a `CodeComponent` instance for formatting and displaying.

Previously, the projected content was kept in the DOM (hidden). This
unnecessarily increased the number of DOM nodes.

This commit fixes this by clearing the projected DOM nodes once their
content has been captured.

PR Close #40802
2021-02-16 08:39:49 -08:00
Brandon Winchester 7f09945771 docs: Add documentation about the CLI failing (#35385)
The CLI seems to throw very non-descriptive errors. Adding a section to help users troubleshoot lazy-loading modules.

PR Close #35385
2021-02-16 08:04:06 -08:00
Pete Bacon Darwin 867c5aec09 docs(http): add custom JSONParser example (#40645)
Update the HTTP guide and associated example to demonstrate
how an interceptor can be used to provide a custom JSON parser.

Resolves #21079

PR Close #40645
2021-02-16 08:03:33 -08:00
Enea Jahollari f434eadc0d docs: remove unnecessary <hr /> tags in Getting Started sections (#40693)
After the docs UI redesign `h2` tags got a border top.
`border-top: 1px solid #dbdbdb;`;
In the sections of Getting Started guide in order to separate
`What's next` from above content an `<hr />` tag was used,
that now becomes unnecessary.

This commit removes unnecessary `<hr />` tags.

PR Close #40693
2021-02-16 08:00:42 -08:00
Dan Levy 0b401cce51 docs: add camelCase example to style notation (#40699)
PR Close #40699
2021-02-16 07:59:41 -08:00
Pete Bacon Darwin 52144948fa build(docs-infra): add a link to usage notes from description (#40835)
The "Usage Notes" section is often at the bottom of a long page of content
which can make it difficult to discover. This commit adds a link at the
end of the "Description" if there is a "Usage Notes" section on the page.
This link should help the reader to discover that there is more information
available further down the page.

This is basically a marginal fix. The longer term fix should be to
consider what content goes in which sections and how they should
be laid out on the page.

See #40753

PR Close #40835
2021-02-16 07:47:09 -08:00
Kristiyan Kostadinov 84b01127a7 refactor(docs-infra): use CDK clipboard service (#40840)
The CDK has had a service for copying strings to the clipboard. These changes switch
AIO to it, rather than having to maintain a custom solution.

PR Close #40840
2021-02-16 07:43:56 -08:00
Alexey Elin 7b4a8c898e docs: fix schematics' package name for ng generate sub-commands (#40846)
PR Close #40846
2021-02-16 07:43:02 -08:00
Daniel 378bf62938 docs: capitalize Angular word in upgrade-setup.md file (#40862)
PR Close #40862
2021-02-16 07:42:35 -08:00
mgechev 91c68f498e docs: add a style recommendation for initializing inputs (#40698)
This practice is to better align with `strictPropertyInitialization`
which is coming by default with strict mode in v12.

PR Close #40698
2021-02-12 17:07:30 -08:00
Bjarki b5f20700c2 fix(core): address Trusted Types bug in Chrome 83 (#40815)
In Chrome 83 passing a TrustedScript to eval just returns the
TrustedScript back without evaluating it, causing the
newTrustedFunctionFor{Dev,JIT} functions to fail. This is a browser bug
that has been fixed in Chrome 84, and only affects Angular applications
running with JIT (which includes unit tests).

As a temporary workaround for users still on Chrome 83, detect when this
occurs in the newTrustedFunctionFor* functions and fall back to the
straightforward, non-Trusted Types compatible implementation. The only
combination that is left affected consists of Angular applications
running with JIT, that have explicitly configured Trusted Types in
enforcement mode, with users that are still on Chrome 83.

Also correct docstring for newTrustedFunctionForJIT.

PR Close #40815
2021-02-12 16:59:58 -08:00
mgechev 7e3815cdc9 docs: add ng-conf 2021 (#40783)
PR Close #40783
2021-02-12 16:49:22 -08:00
Nils Mehlhorn d3d02f8897 docs: add NgRx book to resources (#39841)
PR Close #39841
2021-02-12 16:48:57 -08:00
Jeremy Elbourn a2fba9e2a5 docs: clarify that support schedule is subject to change (#40770)
Initially raised due to #39509, this change updates our
"Support policy and schedule" with the same disclaimer
from the "Release frequency" section above.

PR Close #40770
2021-02-12 16:14:52 -08:00
Sam Hrncir aa5c42af7e docs: Clarify new ng workspace options (#40816)
Hope this helps make the tutorial go even smoother for people after me.

PR Close #40816
2021-02-12 16:13:31 -08:00
JiaLiPassion 76dfcfbf4b release: cut the zone.js-0.11.4 release (#40775)
PR Close #40775
2021-02-12 13:33:05 -08:00
Daniel 1516b5d391 docs: capitalize Angular word in zone.md file (#40813)
PR Close #40813
2021-02-12 12:01:55 -08:00
Sam Hrncir ebbcf0cc04 docs: Update start-deployment.md (#40817)
Updated section reference to current name listed in sidebar.
PR Close #40817
2021-02-12 09:30:03 -08:00
Pete Bacon Darwin 8225bb5b57 refactor(compiler-cli): implement ɵɵngDeclarePipe() (#40803)
This commit implements creating of `ɵɵngDeclarePipe()` calls in partial
compilation, and processing of those calls in the linker and JIT compiler.

See #40677

PR Close #40803
2021-02-12 09:00:16 -08:00
Sam Hrncir f41637c459 docs: typo fix (#40804)
PR Close #40804
2021-02-12 08:59:47 -08:00
Sam Hrncir 9482a4df4c docs: copy paste error (#40812)
The removed bit was copied and pasted from a previous section.  Not relevent for the particular step of the tutorial.
The removed bit can we found as intended in __Adding Navigation__ section.
PR Close #40812
2021-02-11 15:59:55 -08:00
Alex Rickabaugh 87ac05290a fix(compiler-cli): set TS original node on imported namespace identifiers (#40711)
This commit causes imports added by ngtsc's `ImportManager` to have their
TypeScript "original node" set to the generated `ts.ImportDeclaration`
statement.

In g3, the tsickle transformer runs after the Angular transformer and post-
processes Angular's compilation output. One of its post-processing tasks is
to transform generated imports and references to imported symbols from the
commonjs module system to the g3 module system. Part of this transformation
involves recognizing modules with specific metadata and altering references
to symbols from those modules accordingly.

Normally, tsickle can rely on TypeScript's binding for an imported symbol to
find its origin module and thus the correct metadata for the symbol. However
the Angular transform generates new synthetic imports which don't have such
binding information. Angular's imports are always namespace imports of the
form:

```
import * as qualifier 'module/specifier';
```

References to such an import are then of the form `qualifier.SymbolName`.

To process such imports properly, tsickle needs to be able to associate the
reference to `qualifier` in the expression `qualifer.SymbolName` with the
`ts.ImportDeclaration` statement that defines it. It expects to do this by
looking at the `ts.getOriginalNode()` for the `qualifier` reference, which
should be the `ts.ImportDeclaration`. This commit changes ngtsc's import
generation mechanism to set the original node on `qualifier` identifiers
according to this expectation.

This commit is not tested in the direct compiler tests, since:

1) there is no observable behavior externally from setting the original node
2) we don't have tests that intercept transformer operations (which could be
   used to directly assert against the AST nodes)
3) tsickle's published version does not (yet) contain the g3-specific
   transformations which rely on the original node and would thus allow the
   behavior to be observed.

Instead, we rely on the g3 testing suite to validate the correctness of this
fix. Breaking this functionality would cause g3 compilation errors for
targets, since tsickle would be unable to transform imports correctly.

PR Close #40711
2021-02-11 15:58:25 -08:00
Joey Perrott 4c6d557ca9 build: update browserstacktunnel-wrapper (#40810)
Update browserstacktunnel-wrapper to address security vulnerabilities

PR Close #40810
2021-02-11 13:11:15 -08:00
Joey Perrott 75fb76c63b build: update cldr-data-downloader (#40810)
Update cldr-data-downloader to address security vulnerabilities.

PR Close #40810
2021-02-11 13:11:15 -08:00
Joey Perrott ac645ec951 build: update gulp and gulp-conventional-changelog (#40810)
Update gulp and gulp-conventional-changelog to address security vulnerabilities.

PR Close #40810
2021-02-11 13:11:15 -08:00
Joey Perrott 925e2b7434 build: remove jpm dependency (#40807)
Remove our dependency on jpm as it goes unused in our repository.

PR Close #40807
2021-02-11 12:30:55 -08:00
Joey Perrott b42497144d ci: remove BES usages from CI (#40809)
Removes BES configuration from CI bazel configuration as it is increasingly seeing timeouts
causing failures, but the uploaded results go largely unlooked at.

PR Close #40809
2021-02-11 12:28:55 -08:00
Joey Perrott 0227ca83ae Revert "fix(router): fix load interaction of navigation and preload strategies (#40389)" (#40806)
This reverts commit e9a19a6152.

PR Close #40806
2021-02-11 11:59:10 -08:00
GChuf 85a5336efb build: Update dependencies (#40726)
Updates some dependencies.

PR Close #40726
2021-02-11 11:17:21 -08:00
Paul Gammans bba1981c6e fix(router): fix load interaction of navigation and preload strategies (#40389)
Fix router to ensure that a route module is only loaded once especially
in relation to the use of preload strategies with delayed or partial
loading.

Add test to check the interaction of PreloadingStrategy and normal
router navigation under differing scenarios.
Checking:
 * Prevention of duplicate loading of modules.
   related to #26557
 * Prevention of duplicate RouteConfigLoad(Start|End) events
   related to #22842
 * Ensuring preload strategy remains active for submodules if needed
   The selected preload strategy should still decide when to load submodules
 * Possibility of memory leak with unfinished preload subscription
   related to #26557
 * Ensure that the stored loader promise is cleared so that subsequent
   load will try the fetch again.
 * Add error handle error from loadChildren
 * Ensure we handle error from with NgModule create

Fixes #26557 #22842 #26557

PR Close #40389
2021-02-11 09:15:09 -08:00
arturovt a2a5b4add5 fix(http): complete the request on timeout (#40771)
When using the [timeout attribute](https://xhr.spec.whatwg.org/#the-timeout-attribute) and an XHR
request times out, browsers trigger the `timeout` event (and execute the XHR's `ontimeout`
callback). Additionally, Safari 9 handles timed-out requests in the same way, even if no `timeout`
has been explicitly set on the XHR.

In the above cases, `HttpClient` would fail to capture the XHR's completing (with an error), so
the corresponding `Observable` would never complete.

PR Close #40771
2021-02-11 09:13:40 -08:00
Joey Perrott ce80d5ee19 fix(dev-infra): update npm package subsitutions to reflect no longer having an imported workspace (#40785)
Update replacements of the `//dev-infra/` piece of bazel path segments to reference the `@npm//`
workspace rather than creating its own workspace.

PR Close #40785
2021-02-11 09:13:00 -08:00
Joey Perrott 6ee5cdce9d ci: Remove language-service from testing group (#40795)
Much like the compiler-cli, the language-service package has internal testing
tools that are not intended for external use and do not need fw-testing review.
See #40679.

PR Close #40795
2021-02-11 09:03:23 -08:00
waterplea cadee6d63f docs(core): add missing dot at the end of the sentence (#40800)
PR Close #40800
2021-02-11 09:00:51 -08:00
waterplea 006a523815 docs(core): fix typo in interpolation property description (#40800)
PR Close #40800
2021-02-11 09:00:51 -08:00
Joey Perrott 9cbd9bed55 Revert "ci: Remove language-service from testing group (#40787)" (#40794)
This reverts commit 06671e85f9.

PR Close #40794
2021-02-10 16:06:21 -08:00
Nicholas Papadopoulos 636b6b4f94 docs: fix typo in workspace config docs (#40784)
PR Close #40784
2021-02-10 16:01:12 -08:00
Andrew Scott c23d029473 ci: Remove language-service from testing group (#40787)
Much like the compiler-cli, the language-service package has internal testing
tools that are not intended for external use and do not need fw-testing review.
See #40679.

PR Close #40787
2021-02-10 16:00:32 -08:00
Alex Rickabaugh e3f09ce845 release: cut the v11.2.0 release (#40790)
PR Close #40790
2021-02-10 14:08:21 -08:00
Amit Gharat cfbb1faa6f docs: add Angular + NgRx book by the asian BPB Publications (#39680)
PR Close #39680
2021-02-10 11:14:35 -08:00
Alexey Elin e2bb954a7a docs: fix absent documentation for digitsInfo parameter in the API docs (#40746)
PR Close #40746
2021-02-10 11:09:10 -08:00
Alexey Elin 5795c980b5 docs: add link to component-less routes description. (#40741)
Currently it's not clear what a component-less route is. Add a link to  make it clear

PR Close #40741
2021-02-10 11:08:40 -08:00
JoostK e99c4e230f fix(compiler): include parenthesis in expression source spans (#40740)
The parser does not include parenthesis in the AST, so if a LHS
expression would be parenthesized then its start span would start
after the opening parenthesis. Previously, some parent AST nodes would
be created with the start span of its LHS as its own start, so this
resulted in the parent AST node not encompassing the opening parenthesis
in its source span. This commit fixes the issue by capturing the start
index prior to parsing a child AST tree, which is then used as the
start of the source span of the the parent AST node that is parsed.

Fixes #40721

PR Close #40740
2021-02-10 11:07:12 -08:00
JoostK d36890c854 refactor(compiler-cli): remove event output helper from TCB (#40738)
In 5c547675b1 the `EventEmitter.subscribe`
API was extended with a new signature that allows the emitter's generic
type `T` to flow into the subscribe callback. This new signature removes
the need for the special `_outputHelper` function that used to be
emitted into TCBs when `strictOutputEventTypes`/`strictTemplates` is
enabled.

PR Close #40738
2021-02-10 11:06:36 -08:00
Mickael Istria 5adb47ff35 docs(language-service): Add note about Eclipse IDE support of Angular LS (#40551)
Mention Eclipse Wild Web Developer that ships with Angular language
service.

PR Close #40551
2021-02-10 11:05:53 -08:00
Kristiyan Kostadinov 7e0ff8cbb6 fix(compiler): throw error for duplicate template references (#40538)
Adds an error if a reference is used more than once on the same element (e.g. `<div #a #a>`).
We used to have this error in ViewEngine, but it wasn't ported over to Ivy.

Fixes #40536.

PR Close #40538
2021-02-10 11:05:16 -08:00
abarghoud bf85f04baf fix(common): date is not correctly formatted when year is between 0 and 99 (#40448)
use setFullYear method when parsing date to avoid javascript date factory behaviour

Fixes #40377

PR Close #40448
2021-02-10 11:04:38 -08:00
Kanstantsin Kamkou fffefd12e5 docs: clarify observables recommendation (#39237)
Observables are not the only async mechanism that Angular employs.
This change respects that application developers are not required to
use Observables in their own application architecture.

Closes #39155

PR Close #39237
2021-02-10 11:04:05 -08:00
stsogoo 9ae21ee118 fix(core): properly move embedded views of dynamic component's projectable nodes (#37167)
This commit fixes the issue of the ASSERTION ERROR issue when
a projected node(RNode) inside an array is checked against the types
of TNodeType.Element, TNodeType.Container, TNodeType.ElementContainer,
TNodeType.IcuContainer, TNodeType.Projection. As it's inside an array,
it doesn't fall into any of those types, as a result, it throws
the ASSERTION ERROR.

PR Close #37120

PR Close #37167
2021-02-10 11:03:06 -08:00
Zach Arend 95446fb15c fix(compiler-cli): don't crash when we can't resolve a resource (#40660)
Produces a diagnostic when we cannot resolve a component's external style sheet or external template.

The previous behavior was to throw an exception, which crashed the
Language Service.

fixes angular/vscode-ng-language-service#1079

PR Close #40660
2021-02-10 10:48:34 -08:00
ayazhafiz ba6d8d44b1 refactor(language-service): pull out interfaces on package toplevel (#40773)
This is patch PR for #40621.

Two motivations behind this change:

1. We would like to expose the types of the Language Service to external
   users (like the VSCode extension) via the npm package, on the top
   level of the package
2. We would like the View Engine and Ivy LS to share a common interface
   (notably after the inclusion of `getTcb`, the Ivy LS upholds a
   strict superset of `ts.LanguageService`; previously both VE and Ivy
   LS were aligned on `ts.LanguageService`.)

To this end, this commit refactors the exports on the toplevel of the
`language-service/` package to just be types common to both the VE and
Ivy language services. The VE and Ivy build targets then import and use
these types accordingly, and the expectation is that an external user
will just import the relevant typings from the toplevel package without
diving into either the VE or Ivy sources.

Follow up on #40607

PR Close #40773
2021-02-10 10:37:58 -08:00
Valerij Dobler 3b0c51e045 docs: edit example to fetch hero before sending message (#40419)
PR Close #40419
2021-02-09 14:46:18 -08:00
Kapunahele Wong 80c21bf6b0 docs: add redirect from updating-v10 to v11 (#40108)
Redirects from https://angular.io/guide/updating-to-version-10 to
https://angular.io/guide/updating-to-version-11 to avoid 404 errors.

PR Close #40108
2021-02-09 14:45:39 -08:00
Kapunahele Wong c0d1e34d53 docs: update docs-style-guide (#36281)
This commit updates the documentation style guide
so that it is in line with current standards, those
of Google as well as those within the Angular docs.

PR Close #36281
2021-02-09 14:26:06 -08:00
George Kalpakas 6973a9919b build(docs-infra): upgrade cli command docs sources to ab638724c (#40760)
Updating [angular#11.2.x](https://github.com/angular/angular/tree/11.2.x) from
[cli-builds#11.2.x](https://github.com/angular/cli-builds/tree/11.2.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/829e1bae4...ab638724c):

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

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/e98241829...ab638724c) since PR #40719:

**Modified**
- help/lint.json

##
Closes #40719

PR Close #40760
2021-02-09 14:25:26 -08:00
Pete Bacon Darwin 415ad8df13 fix(localize): support downleveled inlined helper localize calls (#40754)
When the downleveling helper function has been  inlined into the
`$localize` call, it is a bit more tricky to parse out the cooked and
raw strings. There was already code to do this but it assumed that
the `cooked` and `raw` items were both arrays.

Sometimes the `raw` array is just a copy of the `cooked` array
via an expression similar to `raw || (raw=tcookedslice(0))`. This
commit changes the `unwrapMessagePartsFromLocalizeCall()`
function to be able to handle such a situation.

Fixes #40702

PR Close #40754
2021-02-09 13:51:53 -08:00
George Kalpakas 9aa3e9f0fc fix(docs-infra): correctly handle entry-points with no public exports (#40737)
Previously, if an entry-point had no public exports (such as the
`@angular/platform-server/shims` introduced in #40559, which is a
side-effect-ful entry-point), it was incorrectly marked as having all
its exports deprecated (which marks the entry-point as deprecated as
well).

This commit fixes this by ensuring that an entry-point is not marked as
having all its exports deprecated if it has no public exports.

PR Close #40737
2021-02-09 10:56:18 -08:00
hilmer-martin 67333a98b9 docs: changes for typescript 2.7 (#40735)
Because of changes in Typescript a property must have an initializer
or be set to undefined.

PR Close #40735
2021-02-09 10:52:44 -08:00
Pete Bacon Darwin 24600ff77d fix(localize): improve invalid syntax in extraction error message (#40724)
Previously if the code is invalid the error message might look like:

```
Unexpected messageParts for `$localize` (expected an array of strings).
```

This is not very helpful for debugging where the problem occurs.

Now we build a "code-frame" description to give more useful information:

```
TypeError: Cannot create property 'message' on string '.../src/app/app.component.js:
Unexpected messageParts for `$localize` (expected an array of strings).
  4 | export class AppComponent {
  5 |     constructor() {
> 6 |         this.title = $localize(a = ['myapp'], []);
    |                                ^^^^^^^^^^^^^
  7 |     }
  8 | }
  ```

PR Close #40724
2021-02-09 10:52:18 -08:00
Matias Niemelä 74cb759c2a fix(animations): properly track listeners for a removed element (#40712)
Prior to this patch, if an element was removed multiple times (due
to the nature of parent/child elements), the leave listeners may
have been fired for an element that was already removed. This patch
adds a guard within the animations code to prevent this.

PR Close #40712
2021-02-09 10:50:20 -08:00
Joey Perrott a4e396dbcf fix(compiler-cli): update ngcc integration tests for latest changes in rules_nodejs (#40710)
Update the ngcc integration tests to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 1e064074ac fix(dev-infra): update build tooling for latest changes in rules_nodejs (#40710)
Update the build tooling to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 621c32d22a fix(bazel): update build tooling for latest changes in rules_nodejs (#40710)
Update the build tooling to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 305d41c0b0 fix(dev-infra): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 36a3a6af7f fix(bazel): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 52da337ca5 fix(benchpress): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott ceafef1a6a fix(compiler): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott bc7be8f1ab fix(compiler-cli): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott cd1b76478f fix(elements): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 57d46d4293 fix(localize): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 13857519e4 fix(platform-browser): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:46 -08:00
Joey Perrott 35c3d80f1d fix(router): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:45 -08:00
Joey Perrott 900bc87d20 fix(service-worker): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types.

PR Close #40710
2021-02-09 10:48:45 -08:00
Joey Perrott 86a6be753d fix(zone.js): update build tooling for latest changes in rules_nodejs (#40710)
Update the zone.js build tooling to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:45 -08:00
Joey Perrott 22f734f102 build: update tools directory for latest changes in rules_nodejs (#40710)
Update the scripts/tooling in the tools directory to handle the changes in the latest
version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:45 -08:00
Joey Perrott 63f6273346 fix(bazel): update integration test to use rules_nodejs@3.1.0 (#40710)
Update the integraiton tests for bazel to the latest rules_nodejs version.

PR Close #40710
2021-02-09 10:48:45 -08:00
Joey Perrott 98defb6e68 build: update to rules_nodejs@3.1.0 (#40710)
Update to the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:45 -08:00
George Kalpakas 345eccad8e refactor(docs-infra): use a single CSS class to target the API list container (#40704)
Previously, the API list container (in the template of the
`<aio-api-list>` component) had three different CSS classes
(`.api-list-container`, `.docs-content`, `.l-content-small`) that were
all used for styling it. This seemed unnecessary and made it more difficult
to see what styles were applied to the container.

This commit removes the extra classes and consolidates the styles under
the `.api-list-container` class (which was the most descriptive one).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 49c108e33c refactor(docs-infra): scope API list styles to the <aio-api-list> element (#40704)
This commit ensures that all styles for the API list page (which are
defined in `_api-list.scss`) only apply to elements inside an
`<aio-api-list>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas adcba1b9b2 refactor(docs-infra): move common .code-anchor styles to _code.scss (#40704)
The `.code-anchor` class can be used anywhere where we have code
examples (including API pages and docs guides). Previously, global
styles for `.code-anchor` were defined in `_api-list.scss` (i.e. the
styles from `_api-list.scss` were also applied to `.code-anchor`
elements in other pages/components).

This commit moves the `.code-anchor` styles to `_code.scss`, which
contains other common code-related styles.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas b282a94c31 refactor(docs-infra): move common .symbol styles to _api-symbols.scss (#40704)
The `.symbol` CSS class (which is primarily used to denote the type of
API symbols - classes, functions, interfaces, etc.) are used in several
places:
- In the API list page (with the corresponding styles defined in
  `_api-list.scss`).
- In search results (with the corresponding styles defined in
  `_errors.scss`).
- In error list page (with the corresponding styles defined in
  `search-results.scss`).
- In the `<aio-select>` component (with the corresponding styles defined
  in `_select-menu.scss`).

Previously, global styles for `.symbol` were defined in `_api-list.scss`
(i.e. the styles from `_api-list.scss` were also applied to `.symbol`
elements in other places/components). Also, some of the SCSS files
mentioned above defined some duplicate styles for `.symbol`.

This commit moves the `.symbol` styles to a new `_api-symbols.scss`
file, which contains common symbol-related styles.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas d79e62292c refactor(docs-infra): merge style rules in _api-list.scss (#40704)
This commit cleans up the styles in `_api-list.scss` by merging together
blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 8505865587 refactor(docs-infra): remove unused styles from _api-list.scss (#40704)
This commit removes some styles from `_api-list.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas d05f157209 refactor(docs-infra): scope TOC styles to the <aio-toc> element (#40704)
This commit ensures that all styles for the TOC (which are defined in
`_toc.scss`) only apply to elements inside an `<aio-toc>` element. This
will prevent the styles accidentally taking effect on a different part
of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 9bab583c58 refactor(docs-infra): merge style rules in _toc.scss (#40704)
This commit cleans up the styles in `_toc.scss` by merging together
blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas ea3ec5361e refactor(docs-infra): scope select-menu styles to the <aio-select> element (#40704)
This commit ensures that all styles for the select-menu element (which
are defined in `_select-menu.scss`) only apply to elements inside an
`<aio-select>` element. This will prevent the styles accidentally taking
effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas afce2987d1 refactor(docs-infra): scope Resources styles to the <aio-resource-list> element (#40704)
This commit ensures that all styles for the "Resources" page (which are
defined in `_resources.scss`) only apply to elements inside an
`<aio-resource-list>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 4e78e2196a refactor(docs-infra): merge style rules in _resources.scss (#40704)
This commit cleans up the styles in `_resources.scss` by merging
together blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 5766c2d52f refactor(docs-infra): remove unused styles from _resources.scss (#40704)
This commit removes some styles from `_resources.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 7e6595b59b refactor(docs-infra): merge style rules in _presskit.scss (#40704)
This commit cleans up the styles in `_presskit.scss` by merging together
blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 58ee0133e4 refactor(docs-infra): merge style rules in _label.scss (#40704)
This commit cleans up the styles in `_label.scss` by merging together
blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas b8d6e15447 refactor(docs-infra): remove unused styles from _label.scss (#40704)
This commit removes some styles from `_label.scss` that are no longer
used (i.e. their CSS selectors do not match any element in the app).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 7a68915d18 refactor(docs-infra): fix indentation in _label.scss (#40704)
This commit makes the indentation in `_label.scss` consistent with that
in most other `.scss` files in `aio/`.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 1e4c39ada8 refactor(docs-infra): remove unused _edit-page-cta.scss file (#40704)
This commit removes the `_edit-page-cta.scss` file, which is no longer
used (i.e. the rules it contains do not match any element in the app).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas b12e798685 refactor(docs-infra): merge style rules in _details.scss (#40704)
This commit cleans up the styles in `_details.scss` by merging
together blocks that target the same elements.

It also changes the `summary` selector to `details > summary`, but that
should not make any difference in practice, since `<summary>` elements
always appear as direct childs of `<details>`.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas b0613b7329 refactor(docs-infra): scope contributor-list styles to the <aio-contributor-list> element (#40704)
This commit ensures that all styles for the contributor list (which are
defined in `_contributor.scss`) only apply to elements inside an
`<aio-contributor-list>` element. This will prevent the styles
accidentally taking effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 9738878fbf refactor(docs-infra): remove unused styles from _contributor.scss (#40704)
This commit removes some styles from `_contributor.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 81c496d0a4 refactor(docs-infra): scope code example styles to the <aio-code> element (#40704)
This commit ensures that all styles for the code examples (which are
defined in `_code.scss`) only apply to elements inside an `<aio-code>`
element. This will prevent the styles accidentally taking effect on a
different part of the app.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 9675260a56 refactor(docs-infra): merge style rules in _code.scss (#40704)
This commit cleans up the styles in `_code.scss` by merging together
blocks that target the same elements.

It also normalizes the rules targeting Angular Material tabs to use
consistent selectors and use class names instead of tag names.

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 8216de27ed refactor(docs-infra): remove unused styles from _code.scss (#40704)
This commit removes some styles from `_code.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:22 -08:00
George Kalpakas 7a45153266 refactor(docs-infra): move common .group-buttons styles to _buttons.scss (#40704)
Both `<aio-contributor-list>` and `<aio-resource-list>` contain
`.group-buttons` elements. Previously, global styles for
`.group-buttons` were defined in `_contributor.scss` (i.e. the styles
from `_contributor.scss` were also applied to `.group-buttons` in
`<aio-resource-list>`). Also, `_contributor.scss` and `_resources.scss`
defined some duplicate styles for `.group-buttons`.

This commit moves the `.group-buttons` styles to `_buttons.scss`, which
contains common button-related styles.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas c3ed990f47 refactor(docs-infra): scope top-menu styles to the .app-toolbar element (#40704)
This commit ensures that all styles for the app top-menu (which are
defined in `_top-menu.scss`) only apply to elements inside an
`.app-toolbar` element. This will prevent the styles accidentally taking
effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas 07e071cec0 refactor(docs-infra): merge style rules in _top-menu.scss (#40704)
This commit cleans up the styles in `_top-menu.scss` by merging
together blocks that target the same elements.

It also makes similar changes to selectors in `_notification.scss` rules
that override top-menu styles (for consistency).

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas 3c1d9860d0 refactor(docs-infra): scope nav-item styles to the <aio-nav-item> element (#40704)
This commit ensures that all styles for the sidenav nav-items (which are
defined in `_sidenav.scss`) only apply to elements inside an
`<aio-nav-item>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas ba16665073 refactor(docs-infra): merge style rules in _sidenav.scss (#40704)
This commit cleans up the styles in `_sidenav.scss` by merging
together blocks that target the same elements.

It also applies the equivalent changes in `_notification.scss` rules
that override sidenav styles.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas d11cb25f4d refactor(docs-infra): remove unused styles from _sidenav.scss (#40704)
This commit removes some styles from `_sidenav.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas b01153cf84 refactor(docs-infra): remove unused styles from _layout-global.scss (#40704)
This commit removes some styles from `_layout-global.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas 698efeed63 refactor(docs-infra): scope footer styles to the <aio-footer> element (#40704)
This commit ensures that all styles for the page footer (which are
defined in `_footer.scss`) only apply to elements inside an
`<aio-footer>` element. This will prevent the styles accidentally taking
effect on a different part of the app.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas eda6c6d5c9 refactor(docs-infra): merge style rules in _footer.scss (#40704)
This commit cleans up the styles in `_footer.scss` by merging together
blocks that target the same elements.

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas 506b6a2ab6 refactor(docs-infra): remove unused styles from _footer.scss (#40704)
This commit removes some styles from `_footer.scss` that are no longer
used (i.e. either their CSS selectors do not match any element in the
app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:21 -08:00
George Kalpakas 3989a0a240 refactor(docs-infra): remove unused styles from _content-layout.scss (#40704)
This commit removes some styles from `_content-layout.scss` that are no
longer used (i.e. either their CSS selectors do not match any element in
the app or they are overridden by other rules).

PR Close #40704
2021-02-09 10:47:21 -08:00
mgechev 6345f89825 docs: clarify vscode integration maintenance (#40647)
PR Close #40647
2021-02-09 10:43:40 -08:00
Roman Sedov 4d05f533a8 docs: add Taiga UI to "EXPLORE ANGULAR RESOURCES" page (#40572)
PR Close #40572
2021-02-09 10:42:20 -08:00
Aristeidis Bampakos 192de59ddc docs(service-worker): copyedit getting started guide (#40543)
Fix numbered list for the `Making changes to your application` section

PR Close #40543
2021-02-09 10:34:15 -08:00
David Pine 7c1453614b docs: add Angular Global Summit to event pages (#40697)
/cc @mgechev

PR Close #40697
2021-02-04 10:48:55 -08:00
Enea Jahollari 11cc4c9dcf fix(docs-infra): switch code font from Droid Sans Mono to Roboto Mono (#40667)
`Droid Sans Mono` didn't look good on some screens.

Fixes #40666

PR Close #40667
2021-02-04 10:48:30 -08:00
Kristiyan Kostadinov 737bc7a3e5 fix(router): stop emitting to event observable on destroy (#40638)
No longer emits to `Router.events` after the router has been destroyed. Also
returns a resolved promise to the navigation methods.

Fixes #40502.

PR Close #40638
2021-02-04 10:46:46 -08:00
Jeremy Elbourn b1d589712c docs: add guide for branching process (#39924)
PR Close #39924
2021-02-04 10:45:32 -08:00
Misko Hevery 58f8ba0a8c release: cut the v11.2.0-rc.0 release 2021-02-03 15:38:34 -08:00
Misko Hevery 6ac05c05e9 release: cut the v11.2.0-next.1 release 2021-02-03 14:40:54 -08:00
Alan Agius 7c38a4a037 docs: clarify that fileReplacements only supports compilation source files (#40687)
fileReplacements is intended to only work on compilation source files

PR Close #40687
2021-02-03 09:10:24 -08:00
George Kalpakas 0b1f1930b9 build(docs-infra): upgrade cli command docs sources to 829e1bae4 (#40686)
Updating [angular#11.2.x](https://github.com/angular/angular/tree/11.2.x) from
[cli-builds#11.1.x](https://github.com/angular/cli-builds/tree/11.1.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/b427aeb88...829e1bae4):

**Modified**
- help/new.json

PR Close #40686
2021-02-03 09:09:45 -08:00
Andrew Kushnir 4877f687b5 refactor(forms): avoid duplicated code in AbstractControlStatus directive (#40651)
This commit updates `AbstractControlStatus` directive code to remove duplicated logic in getters and replaces
that logic with a new function that accepts an argument.

PR Close #40651
2021-02-03 09:08:02 -08:00
Pete Bacon Darwin 5c547675b1 fix(core): ensure the type T of EventEmitter<T> can be inferred (#40644)
The `AsyncPipe.transform<T>(emitter)` method must infer the `T`
type from the `emitter` parameter. Since we changed the `AsyncPipe`
to expect a `Subscribable<T>` rather than `Observable<T>` the
`EventEmitter.subscribe()` method needs to have a tighter signature.
Otherwise TypeScript struggles to infer the type and ends up making
it `unknown`.

Fixes #40637

PR Close #40644
2021-02-03 09:07:30 -08:00
Eliran Eliassy 1fbbb1e34d docs: add eliran eliassy to GDE list (#39521)
PR Close #39521
2021-02-03 09:06:20 -08:00
Alex Rickabaugh 4cc15fe78e refactor(compiler-cli): remove the overrideComponentTemplate API (#40585)
The `TemplateTypeChecker.overrideComponentTemplate` operation was originally
conceived as a "fast path" for the Language Service to react to a template
change without needing to go through a full incremental compilation step. It
served this purpose until the previous commit, which switches the LS to use
the new resource-only incremental change operation provided by `NgCompiler`.

`overrideComponentTemplate` is now no longer utilized, and is known to have
several hard-to-overcome issues that prevent it from being useful in any
other situations. As such, this commit removes it entirely.

PR Close #40585
2021-02-02 16:26:17 -08:00
Alex Rickabaugh 07a3d7a16b perf(language-service): update NgCompiler via resource-only path when able (#40585)
This commit changes the Language Service's "compiler factory" mechanism to
leverage the new resource-only update path for `NgCompiler`. When an
incoming change only affects a resource file like a component template or
stylesheet, going through the new API allows the Language Service to avoid
unnecessary incremental steps of the `NgCompiler` and return answers more
efficiently.

PR Close #40585
2021-02-02 16:26:10 -08:00
George Kalpakas 21994ee985 refactor(docs-infra): remove unused styles for .heading CSS class (#40427)
This commit removes some styles for the `.heading` CSS class which do
not have any effect (either because they are overridden in other rules
or because they do not make any difference).

NOTE:
The `.heading` class is kept in the HTML to make it easier to associate
the `.heading-children` element with its corresponding `.heading`
parent.

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas f25a1b9597 refactor(docs-infra): simplify the CSS rules for styling the "collapsed/expanded" sidenav icons (#40427)
This commit simplifies the styling of the "collapsed/expanded" icons in
sidenav nav-items with children by consolidating the CSS rules in one
block (instead of having duplicate blocks for different levels).

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas fa3f310745 fix(docs-infra): fix the styling of the cards in docs introduction page (#40427)
This commit fixes the layout and appearance of the cards shown in the
docs introduction page (`/docs`) in the following ways:

- Center the cards.
- Ensure two cards are shown per line (instead of 3 one the first line
  and 1 on the second).
- Adjust their widths to ensure their content fits well in them
  (given that the cards have a fixed height).
- Use more engaging styles to better indicate that the cards are
  clickable (as discussed [here][1]).

[1]: https://github.com/angular/angular/pull/40427#discussion_r560688953

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas e66b89a4e4 refactor(docs-infra): clean up styles in _card.scss (#40427)
This commit cleans up the styles in `_card.scss` by:
- Fixing incosistenct indentation/newlines.
- Removing rules for unused selectors.
- Removing unnecessary styles.

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 95d8f58393 fix(docs-infra): improve legibility and focus on content (#40427)
This commit changes the layout of the main content to improve
legibility, especially on wider screens:

- Limit main content width to 50em (800px by default).
- Center main content on the page.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 2fc618471a fix(docs-infra): improve typography styles (incl. bigger font size/line height) (#40427)
Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 08252b2c5e fix(docs-infra): make content links more prominent on hover (#40427)
Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 5f9053405a fix(docs-infra): improve heading styles (#40427)
This commit includes some general improvements to heading styles
(font-weight, margin/padding). It also adds a horizontal separator above
`<h2>` headings to segment important sections more easily.
(As a consequence, we can remove several `<hr />` elements right before
`<h2>` headings.)

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas f1d2afa496 fix(docs-infra): fix padding in sidenav and ensure all nav-items have equal height (#40427)
This commit improves the padding nav-menus and nav-items in the sidenav.
It also ensures that all nav-items have the same height, regardless of
their level and of whether they have children or not.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 6d5e6cf1cf fix(docs-infra): remove uppercase style from sidenav nav-items (#40427)
Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
George Kalpakas 746792b838 fix(docs-infra): update the sidenav background to better distinguish from main content (#40427)
Previously, we used a box-shadow to indicate that the sidenav is
separate from the main content.

This commits updates the sidenav styling to remove the shadow and give
it a slightly different background color instead.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
2021-02-02 12:04:57 -08:00
Viktor Uhryn da3dc29477 docs: fix typo in lazy-loading guide (#40668)
PR Close #40668
2021-02-02 12:04:22 -08:00
Alex Rickabaugh caafac2248 fix(compiler-cli): preserve user line endings in diagnostic template parse (#40597)
Normally the template parsing operation normalizes all template line endings
to '\n' only. This normalization operation causes source mapping errors when
the original template uses '\r\n' line endings.

The compiler already parses templates again to create a "diagnostic"
template AST with accurate source maps, to avoid other parsing issues that
affect source map accuracy. This commit configures this diagnostic parse to
also preserve line endings.

PR Close #40597
2021-01-29 11:15:17 -08:00
JiaLiPassion ff93a6723e refactor(router): fix several typos in router spec (#40626)
Fix a couple typos in router tests.

PR Close #40626
2021-01-29 11:14:36 -08:00
Pete Bacon Darwin 46d43267e3 fix(common): parse YYYY strings as UTC dates (#40629)
In b6cd38ff05 we fixed the DatePipe so
that when it parsed date strings that looked like `YYYY-MM` it created a UTC
date that was not affected by the local timezone of the JavaScript engine.

This commit does the same for date strings of the form `YYYY`.

(Note that the previous commit, mentioned above, attempted to fix this case
too but the test was not actually checking the correct input string.)

Fixes #33944

PR Close #40620

PR Close #40629
2021-01-29 11:14:05 -08:00
Pete Bacon Darwin 4c5f18dfda fix(common): parse YYYY-MM strings as UTC dates (#40620)
In 2aba8b0 we fixed the DatePipe so that when it parsed date strings
that looked like `YYYY-MM-DD` it created a UTC date that was not
affected by the local timezone of the JavaScript engine.

This commit does the same for date strings of the form `YYYY-MM`
and `YYYY`.

Fixes #33944

PR Close #40620
2021-01-28 16:00:58 -08:00
twerske 5fcf2f9a5f docs: add guide for NG0302 (#40580)
new guide for pipe not found common error
link from pipe error to new guide
add embedded debugging video

PR Close #40580
2021-01-28 15:56:41 -08:00
Pete Bacon Darwin 4d1b3177d8 ci: add pete to the fw-http group (#40619)
This allows @petebacondarwin to approve PRs for the
`@angular/common/http` package.

PR Close #40619
2021-01-28 15:54:53 -08:00
Teri Glover f261c1c66b docs: fix typo to remove space (#40601)
PR Close #40601
2021-01-28 15:54:20 -08:00
Misko Hevery 552009ec07 Revert "fix(core): remove duplicated EMPTY_ARRAY constant (#40587)"
This reverts commit cabe8bec40.
2021-01-28 14:35:58 -08:00
Andrew Scott 9d396f837c fix(compiler): Don't set expression text to synthetic $implicit when empty (#40583)
When parsing interpolations, if we encounter an empty interpolation
(`{{}}`), the current code uses a "pretend" value of `$implicit` for the
name as if the interplotion were really `{{$implicit}}`. This is
problematic because the spans are then incorrect downstream since they
are based off of the `$implicit` text.

This commit changes the interpretation of empty interpolations so that
the text is simply an empty string.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1077
Fixes https://github.com/angular/vscode-ng-language-service/issues/1078

PR Close #40583
2021-01-28 09:06:18 -08:00
Pete Bacon Darwin daa9b7e608 docs: add a @reviewed tag to the i18n guide (#40582)
PR Close #40582
2021-01-28 09:04:50 -08:00
Pete Bacon Darwin 47fe75e19d build(docs-infra): implement @reviewed tag definition (#40582)
The `@reviewed` tag can be used to specify the date when the
document was last reviewed.

PR Close #40582
2021-01-28 09:04:50 -08:00
George Kalpakas 44298dfb65 build(docs-infra): upgrade cli command docs sources to b427aeb88 (#40612)
Updating [angular#11.2.x](https://github.com/angular/angular/tree/11.2.x) from
[cli-builds#11.1.x](https://github.com/angular/cli-builds/tree/11.1.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/c366e223b...b427aeb88):

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

PR Close #40612
2021-01-28 09:03:46 -08:00
Joey Perrott 0463578944 fix(dev-infra): wait for changelog to cherry pick to next branch (#40605)
Wait for the cherry-picked changelog to be merged into the next
branch before completing the task.

PR Close #40605
2021-01-28 09:02:57 -08:00
George Kalpakas 584fd4513c build(zone.js): use npm_package.pack to build the Zone.js package (#40592)
Previously, we could not use `npm_package.pack` for building the Zone.js
package due to a bug in Windows. This bug has been fixed in version
2.3.0 of `bazelbuild/rules_nodejs`.

Now that we have updated `bazelbuild/rules_nodejs` to version 2.3.3
(in #40581) we can replace `npm pack` with `npm_package.pack`.

PR Close #40592
2021-01-28 09:01:57 -08:00
cexbrayat 5b0147512f refactor(animations): remove unused utils function (#40588)
The `mergeAnimationOptions` function is no longer used since 05472cb21b

PR Close #40588
2021-01-28 09:01:07 -08:00
JoostK 7a6d1e2bf2 fix(compiler): exclude trailing whitespace from element source spans (#40513)
If the template parse option `leadingTriviaChars` is configured to
consider whitespace as trivia, any trailing whitespace of an element
would be considered as leading trivia of the subsequent element, such
that its `start` span would start _after_ the whitespace. This means
that the start span cannot be used to mark the end of the current
element, as its trailing whitespace would then be included in its span.
Instead, the full start of the subsequent element should be used.

To harden the tests that for the Ivy parser, the test utility `parseR3`
has been adjusted to use the same configuration for `leadingTriviaChars`
as would be the case in its production counterpart `parseTemplate`. This
uncovered another bug in offset handling of the interpolation parser,
where the absolute offset was computed from the start source span
(which excludes leading trivia) whereas the interpolation expression
would include the leading trivia. As such, the absolute offset now also
uses the full start span.

Fixes #39148

PR Close #40513
2021-01-28 08:57:46 -08:00
cexbrayat cabe8bec40 fix(core): remove duplicated EMPTY_ARRAY constant (#40587)
The codebase currently contains several `EMPTY_ARRAY` constants,
and they can end up in the bundle of an application.
A recent commit 6fbe219 tipped us off
as it introduced several `noop` occurrences in the golden symbol files.
After investigating with @petebacondarwin,
we decided to remove the duplicated symbols.

This probably shaves only a few bytes,
but this commit removes the duplicated functions,
by always using the one in `core/src/utils/empty`.

PR Close #40587
2021-01-28 08:55:53 -08:00
Pete Bacon Darwin e11e6cf8c4 docs: update release notes for the 11.1.1 release (#40602)
Remove commits that had been reverted.

PR Close #40602
2021-01-27 13:04:43 -08:00
Jessica Janiuk f44a8e2cf6 release: cut the v11.2.0-next.0 release (#40600) 2021-01-27 13:05:08 -07:00
1206 changed files with 48379 additions and 35652 deletions
+7
View File
@@ -140,6 +140,13 @@ build:remote --remote_executor=remotebuildexecution.googleapis.com
# retry mechanism and we do not want to retry unnecessarily if Karma already tried multiple times.
test:saucelabs --flaky_test_attempts=1
################
# Flag Aliases #
################
# --ng_perf will ask the Ivy compiler to produce performance results for each build.
build --flag_alias=ng_perf=//packages/compiler-cli:ng_perf
####################################################
# User bazel configuration
# NOTE: This needs to be the *last* entry in the config.
-7
View File
@@ -20,11 +20,4 @@ build --local_ram_resources=32768
# All build executed remotely should be done using our RBE configuration.
build:remote --google_default_credentials
# Upload to GCP's Build Status viewer to allow for us to have better viewing of execution/build
# logs. This is only done on CI as the BES (GCP's Build Status viewer) API requires credentials
# from service accounts, rather than end user accounts.
build:remote --bes_backend=buildeventservice.googleapis.com
build:remote --bes_timeout=30s
build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
build --config=remote
+58 -34
View File
@@ -22,11 +22,15 @@ version: 2.1
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v1-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_3: &cache_key v4-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
# folder will contain all previously used versions and ultimately cause the cache restoring to
# be slower due to its growing size.
var_4: &cache_key_fallback v1-angular-node-12-{{ checksum ".bazelversion" }}
var_4: &cache_key_fallback v4-angular-node-12-{{ checksum ".bazelversion" }}
# Windows needs its own cache key because binaries in node_modules are different.
var_3_win: &cache_key_win v4-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v4-angular-win-node-12-{{ checksum ".bazelversion" }}
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
@@ -65,6 +69,7 @@ var_10: &only_on_master
# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version.
# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.)
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
# **NOTE 3**: If you change the version of Node.js provided by the docker images, also update `.devcontainer/recommended-Dockerfile` to match the new version.
executors:
default-executor:
parameters:
@@ -140,8 +145,8 @@ commands:
- run:
name: Set up environment
environment:
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
command: ./.circleci/env.sh
- run:
# Configure git as the CircleCI `checkout` command does.
@@ -186,7 +191,12 @@ commands:
- run: ./.circleci/windows-env.ps1
- run: node --version
- run: yarn --version
- run: yarn install --frozen-lockfile --non-interactive
- restore_cache:
keys:
- *cache_key_win
- *cache_key_win_fallback
# On Windows `~/` is not resolved when using as a CLI value. `../` results in the same path.
- run: yarn install --frozen-lockfile --non-interactive --cache-folder ../.cache/yarn
notify_webhook_on_fail:
description: Notify a webhook about failure
@@ -231,10 +241,10 @@ jobs:
- *cache_key_fallback
- run:
name: Running Yarn install
command: yarn install --frozen-lockfile --non-interactive
command: yarn install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
# Yarn's requests sometimes take more than 10mins to complete.
no_output_timeout: 45m
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
# Make the bazel directories and add a file to them if they don't exist already so that
# persist_to_workspace does not fail.
- run: |
@@ -261,7 +271,7 @@ jobs:
- run: yarn -s ts-circular-deps:check
- run: yarn -s ng-dev pullapprove verify
- run: yarn -s ng-dev ngbot verify
- run: yarn -s ng-dev commit-message validate-range --range $CI_COMMIT_RANGE
- run: yarn -s ng-dev commit-message validate-range $CI_GIT_BASE_REVISION $CI_GIT_REVISION
test:
executor:
@@ -423,7 +433,7 @@ jobs:
- custom_attach_workspace
- init_environment
# Install
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- run: yarn --cwd aio extract-cli-command-docs
# Run tools tests
- run: yarn --cwd aio tools-test
@@ -443,7 +453,7 @@ jobs:
- init_environment
- install_chrome_libs
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
@@ -453,7 +463,7 @@ jobs:
aio_preview:
executor: default-executor
environment:
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path "aio/tmp/snapshot.tgz"
steps:
- custom_attach_workspace
- init_environment
@@ -472,12 +482,11 @@ jobs:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- run: yarn --cwd aio install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- run:
name: Wait for preview and run tests
command: node aio/scripts/test-preview.js $CI_PULL_REQUEST $CI_COMMIT $CI_AIO_MIN_PWA_SCORE
# The `build-npm-packages` tasks exist for backwards-compatibility with old scripts and
# tests that rely on the pre-Bazel `dist/packages-dist` output structure (build.sh).
# Having multiple jobs that independently build in this manner duplicates some work; we build
@@ -500,16 +509,16 @@ jobs:
root: *workspace_location
paths:
- ng/dist/packages-dist
- ng/dist/angular-in-memory-web-api-dist
- ng/dist/zone.js-dist
# Save dependencies and bazel repository cache to use on subsequent runs.
- save_cache:
key: *cache_key
paths:
- "node_modules"
- "aio/node_modules"
- "~/bazel_repository_cache"
- "~/.cache/bazelisk"
- ~/.cache/yarn
- ~/bazel_repository_cache
- ~/.cache/bazelisk
# Build the ivy npm packages.
build-ivy-npm-packages:
@@ -526,6 +535,7 @@ jobs:
root: *workspace_location
paths:
- ng/dist/packages-dist-ivy-aot
- ng/dist/angular-in-memory-web-api-dist-ivy-aot
- ng/dist/zone.js-dist-ivy-aot
# This job creates compressed tarballs (`.tgz` files) for all Angular packages and stores them as
@@ -536,10 +546,12 @@ jobs:
publish_packages_as_artifacts:
executor: default-executor
environment:
NG_PACKAGES_DIR: &ng_packages_dir 'dist/packages-dist'
NG_PACKAGES_ARCHIVES_DIR: &ng_packages_archives_dir 'dist/packages-dist-archives'
ZONEJS_PACKAGES_DIR: &zonejs_packages_dir 'dist/zone.js-dist'
ZONEJS_PACKAGES_ARCHIVES_DIR: &zonejs_packages_archives_dir 'dist/zone.js-dist-archives'
AIMWA_PACKAGES_DIR: &aimwa_packages_dir "dist/angular-in-memory-web-api-dist"
AIMWA_PACKAGES_ARCHIVES_DIR: &aimwa_packages_archives_dir "dist/angular-in-memory-web-api-dist-archives"
NG_PACKAGES_DIR: &ng_packages_dir "dist/packages-dist"
NG_PACKAGES_ARCHIVES_DIR: &ng_packages_archives_dir "dist/packages-dist-archives"
ZONEJS_PACKAGES_DIR: &zonejs_packages_dir "dist/zone.js-dist"
ZONEJS_PACKAGES_ARCHIVES_DIR: &zonejs_packages_archives_dir "dist/zone.js-dist-archives"
steps:
- custom_attach_workspace
- init_environment
@@ -550,9 +562,17 @@ jobs:
- store_artifacts:
path: *ng_packages_archives_dir
destination: angular
# Publish `zone.js` package.
# Publish the `angular-in-memory-web-api` package.
- run:
name: Create artifacts for zone.js package
name: Create artifacts for the `angular-in-memory-web-api` package
# Need to remove the zone.js.tgz before archive
command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $AIMWA_PACKAGES_DIR $AIMWA_PACKAGES_ARCHIVES_DIR
- store_artifacts:
path: *aimwa_packages_archives_dir
destination: angular-in-memory-web-api
# Publish the `zone.js` package.
- run:
name: Create artifacts for the `zone.js` package
# Need to remove the zone.js.tgz before archive
command: rm -rf $ZONEJS_PACKAGES_DIR/archive && ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR
- store_artifacts:
@@ -703,7 +723,7 @@ jobs:
# We temporarily ignore the "engines" because the Angular components repository has
# minimum dependency on NodeJS v12 and Yarn 1.19.1, but the framework repository uses
# older versions.
command: yarn --ignore-engines --cwd ${COMPONENTS_REPO_TMP_DIR} install --frozen-lockfile --non-interactive
command: yarn --ignore-engines --cwd ${COMPONENTS_REPO_TMP_DIR} install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- save_cache:
key: *components_repo_unit_tests_cache_key
paths:
@@ -730,19 +750,19 @@ jobs:
- init_environment
- install_java
# Install
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
# Run zone.js tools tests
- run: yarn --cwd packages/zone.js promisetest
- run: yarn --cwd packages/zone.js promisefinallytest
- run: yarn bazel build //packages/zone.js:npm_package &&
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/ &&
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/ &&
cp dist/bin/packages/zone.js/npm_package/bundles/zone.umd.js ./packages/zone.js/build/test/closure/zone.js
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/ &&
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/ &&
cp dist/bin/packages/zone.js/npm_package/bundles/zone.umd.js ./packages/zone.js/build/test/closure/zone.js
- run: yarn --cwd packages/zone.js jest:test
- run: yarn --cwd packages/zone.js jest:nodetest
- run: yarn --cwd packages/zone.js electrontest
- run: yarn --cwd packages/zone.js closuretest
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- run: yarn --cwd packages/zone.js/test/typings test
# Windows jobs
@@ -753,11 +773,11 @@ jobs:
- setup_win
- run:
name: Build all windows CI targets
command: yarn bazel build --build_tag_filters=-ivy-only,-no-windows //packages/compiler-cli/... //tools/ts-api-guardian/...
command: yarn bazel build --build_tag_filters=-ivy-only //packages/compiler-cli/... //tools/ts-api-guardian/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: yarn bazel test --build_tag_filters=-no-windows --test_tag_filters="-ivy-only,-no-windows,-browser:chromium-local" //packages/compiler-cli/... //tools/ts-api-guardian/...
command: yarn bazel test --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/... //tools/ts-api-guardian/...
no_output_timeout: 15m
test_ivy_aot_win:
@@ -766,13 +786,17 @@ jobs:
- setup_win
- run:
name: Build all windows CI targets
command: yarn bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-no-windows,-fixme-ivy-aot //packages/compiler-cli/... //tools/ts-api-guardian/...
command: yarn bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/... //tools/ts-api-guardian/...
no_output_timeout: 15m
- run:
name: Test all windows CI targets
command: yarn bazel test --config=ivy --build_tag_filters=-no-windows --test_tag_filters="-no-ivy-aot,-no-windows,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //tools/ts-api-guardian/...
command: yarn bazel test --config=ivy --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //tools/ts-api-guardian/... //packages/localize/...
no_output_timeout: 15m
# Save dependencies to use on subsequent runs.
- save_cache:
key: *cache_key_win
paths:
- ~/.cache/yarn
workflows:
version: 2
+1 -1
View File
@@ -1,4 +1,4 @@
# VSCode Remote Development - Developing inside a Containers
# VSCode Remote Development - Developing inside a Container
This folder contains configuration files that can be used to opt into working on this repository in a [Docker container](https://www.docker.com/resources/what-container) via [VSCode](https://code.visualstudio.com/)'s Remote Development feature (see below).
+5 -5
View File
@@ -1,6 +1,8 @@
# Image metadata and config.
FROM circleci/node:10-browsers # Ideally, the image version should be what we use on CI.
# See `executors > browsers-executor` in `.circleci/config.yml`.
# Ideally, the Node.js version should match what we use on CI.
# See `executors > default-executor` in `.circleci/config.yml`.
FROM circleci/node:12-browsers
LABEL name="Angular dev environment" \
description="This image can be used to create a dev environment for building Angular." \
@@ -14,10 +16,8 @@ EXPOSE 4000 4200 4433 5000 8080 9876
USER root
# Configure `Node.js`/`npm` and install utilities.
# Configure `Node.js`/`npm`.
RUN npm config --global set user root
RUN npm install --global yarn@latest # Ideally, the version should be what we use on CI.
# See `commands > overwrite_yarn` in `.circleci/config.yml`.
# Go! (And keep going.)
+1 -1
View File
@@ -43,7 +43,7 @@ Share the link to the repo below along with step-by-step instructions to reprodu
Issues that don't have enough info and can't be reproduced will be closed.
You can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue
You can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#submit-issue
-->
## 🔥 Exception or Error
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@0fc6f4d839e93312ed0dd9a2be88d4c11e947a0b
- uses: angular/dev-infra/github-actions/lock-closed@7679cff885633cd33bf5ac7922a5304e8971a5a6
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
+1 -1
View File
@@ -4,7 +4,7 @@ import {CommitMessageConfig} from '../dev-infra/commit-message/config';
* The configuration for `ng-dev commit-message` commands.
*/
export const commitMessage: CommitMessageConfig = {
maxLineLength: 120,
maxLineLength: Infinity,
minBodyLength: 20,
minBodyLengthTypeExcludes: ['docs'],
scopes: [
+2
View File
@@ -14,6 +14,7 @@ export const merge: DevInfraMergeConfig['merge'] = async api => {
mergeReadyLabel: /^action: merge(-assistance)?/,
caretakerNoteLabel: /^(action: merge-assistance)|(PullApprove: disable)/,
commitMessageFixupLabel: 'commit message fixup',
breakingChangeLabel: 'flag: breaking change',
// We can pick any of the NPM packages as we are in a monorepo where all packages are
// published together with the same version and branching.
labels: await getDefaultTargetLabelConfiguration(api, github, release),
@@ -24,5 +25,6 @@ export const merge: DevInfraMergeConfig['merge'] = async api => {
'master': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
'10.0.x': '27b95ba64a5d99757f4042073fd1860e20e3ed24',
},
targetLabelExemptScopes: ['dev-infra', 'docs-infra']
};
};
+1
View File
@@ -0,0 +1 @@
engine-strict = true
+19 -24
View File
@@ -208,8 +208,8 @@ groups:
- petebacondarwin # Pete Bacon Darwin
- pkozlowski-opensource # Pawel Kozlowski
- Splaktar # Michael Prentice
- StephenFluin # Stephen Fluin
- twerske # Emma Twersky
- zarend # Zach Arend
# =========================================================
# Framework: Animations
@@ -293,7 +293,7 @@ groups:
users:
- alxhub
- crisbeto
# OOO as of 2020-09-28 - devversion
- devversion
# =========================================================
@@ -479,6 +479,7 @@ groups:
users:
- alxhub
- IgorMinar
- petebacondarwin
# =========================================================
@@ -681,7 +682,7 @@ groups:
- *can-be-global-approved
- *can-be-global-docs-approved
- >
contains_any_globs(files.exclude('packages/compiler-cli/**'), [
contains_any_globs(files.exclude('packages/compiler-cli/**').exclude('packages/language-service/**'), [
'packages/**/testing/**',
'aio/content/guide/testing.md',
'aio/content/guide/test-debugging.md',
@@ -804,6 +805,7 @@ groups:
users:
- kyliau
- atscott
- zarend
# =========================================================
@@ -919,13 +921,15 @@ groups:
'aio/content/examples/getting-started-v0/**',
'aio/content/examples/getting-started/**',
'aio/content/start/**',
'aio/content/images/guide/start/**'
'aio/content/images/guide/start/**',
'aio/content/examples/what-is-angular/**',
'aio/content/guide/what-is-angular.md'
])
reviewers:
users:
- aikidave
- IgorMinar
- StephenFluin
- jelbourn
# =========================================================
@@ -950,7 +954,6 @@ groups:
- aikidave
- IgorMinar
- mgechev
- StephenFluin
# =========================================================
# Docs: Observables
@@ -1136,9 +1139,14 @@ groups:
'aio/src/**',
'aio/tests/**',
'aio/tools/**',
'aio/content/images/guide/contributors-guide/**',
'aio/content/guide/contributors-guide-overview.md',
'aio/content/guide/docs-style-guide.md',
'aio/content/examples/docs-style-guide/**',
'aio/content/images/guide/docs-style-guide/**',
'aio/content/guide/reviewing-content.md',
'aio/content/guide/updating-content-github-ui.md',
'aio/content/guide/updating-search-keywords.md',
'aio/content/guide/visual-studio-2015.md'
])
reviewers:
@@ -1156,7 +1164,7 @@ groups:
conditions:
- *can-be-global-approved
- >
contains_any_globs(files.exclude("CHANGELOG.md").exclude("packages/compiler-cli/**/BUILD.bazel"), [
contains_any_globs(files, [
'*',
'.circleci/**',
'.devcontainer/**',
@@ -1166,19 +1174,7 @@ groups:
'.vscode/**',
'.yarn/**',
'dev-infra/**',
'docs/BAZEL.md',
'docs/CARETAKER.md',
'docs/CODING_STANDARDS.md',
'docs/COMMITTER.md',
'docs/DEBUG.md',
'docs/DEBUG_COMPONENTS_REPO_IVY.md',
'docs/DEVELOPER.md',
'docs/FIXUP_COMMITS.md',
'docs/GITHUB_PROCESS.md',
'docs/PR_REVIEW.md',
'docs/SAVED_REPLIES.md',
'docs/TOOLS.md',
'docs/TRIAGE_AND_LABELS.md',
'docs/*.md',
'docs/images/**',
'goldens/*',
'modules/*',
@@ -1205,12 +1201,11 @@ groups:
'tools/utils/**',
'tools/yarn/**',
'tools/*',
'**/*.bzl',
'**/*.bazel'
'**/*.bzl'
])
reviewers:
users:
# OOO as of 2020-09-28 - devversion
- devversion
- filipesilva
- gkalpak
- IgorMinar
@@ -1229,11 +1224,11 @@ groups:
- >
contains_any_globs(files, [
'goldens/public-api/**',
'CHANGELOG.md',
'docs/NAMING.md',
'aio/content/errors/*.md',
'aio/content/guide/glossary.md',
'aio/content/guide/styleguide.md',
'aio/content/examples/errors/**',
'aio/content/examples/styleguide/**',
'aio/content/images/guide/styleguide/*'
])
+242 -2
View File
@@ -1,14 +1,254 @@
## 11.2.11 (2021-04-21)
### Bug Fixes
* **common:** viewport scroller not finding elements inside the shadow DOM ([#41644](https://github.com/angular/angular/issues/41644)) ([3aa9235](https://github.com/angular/angular/commit/3aa92355ef730e19d8c7b555a35c3e68b76e37ba)), closes [#41470](https://github.com/angular/angular/issues/41470)
* **compiler-cli:** autocomplete literal types in templates ([296f887](https://github.com/angular/angular/commit/296f8873832a369f3c512fcba3215a6fcdb71e66))
* **router:** Only retrieve stored route when reuse strategy indicates it should reattach ([#30263](https://github.com/angular/angular/issues/30263)) ([f4376fc](https://github.com/angular/angular/commit/f4376fc0d45f1658555c5ac29c3dee93bdfb43fc)), closes [#23162](https://github.com/angular/angular/issues/23162)
* **router:** recursively merge empty path matches ([#41584](https://github.com/angular/angular/issues/41584)) ([8d62813](https://github.com/angular/angular/commit/8d6281311c8c21d4f113fdfdd8e5736e297ec184)), closes [#41481](https://github.com/angular/angular/issues/41481)
## 11.2.10 (2021-04-14)
### Bug Fixes
* **compiler-cli:** prevent eliding default imports in incremental recompilations ([#41586](https://github.com/angular/angular/issues/41586)) ([43050a1](https://github.com/angular/angular/commit/43050a16de1dfcf8090461d9bc8d9804a98d3403)), closes [#41377](https://github.com/angular/angular/issues/41377)
* **compiler-cli:** show a more specific error for Ivy NgModules ([#41534](https://github.com/angular/angular/issues/41534)) ([09eb125](https://github.com/angular/angular/commit/09eb1257d86061a26551d11efc042ba864b343d3))
* **core:** error if DebugRenderer2.destroyNode is called twice in a row ([#41565](https://github.com/angular/angular/issues/41565)) ([419c189](https://github.com/angular/angular/commit/419c189ad3620cbe02e1927875ca7fa72a46627f))
* **language-service:** bound attributes should not break directive matching ([#41597](https://github.com/angular/angular/issues/41597)) ([3dbcc7f](https://github.com/angular/angular/commit/3dbcc7f7a1f011f007c6b5abc2aff228bffba9b6)), closes [/github.com/angular/angular/blob/cdf1ea1951fb7187b1f6c9bb8a847c859c41e0b8/packages/compiler/src/render3/view/util.ts#L174-L206](https://github.com//github.com/angular/angular/blob/cdf1ea1951fb7187b1f6c9bb8a847c859c41e0b8/packages/compiler/src/render3/view/util.ts/issues/L174-L206)
* **language-service:** resolve to the pre-compiled style when compiled css url is provided ([#41538](https://github.com/angular/angular/issues/41538)) ([3d54980](https://github.com/angular/angular/commit/3d549809c3c8659197f323fc78a9fb3756e9969e)), closes [angular/vscode-ng-language-service#1263](https://github.com/angular/vscode-ng-language-service/issues/1263)
* **language-service:** use 'any' instead of failing for inline TCBs ([#41513](https://github.com/angular/angular/issues/41513)) ([f76873e](https://github.com/angular/angular/commit/f76873e4d5aefe9276873ee0270c331561329d9c)), closes [#41395](https://github.com/angular/angular/issues/41395)
* **router:** handle new navigations from a NavigationEnd event ([#41262](https://github.com/angular/angular/issues/41262)) ([#41511](https://github.com/angular/angular/issues/41511)) ([e34299a](https://github.com/angular/angular/commit/e34299af256326366ef2176bd905d9a64158f2df)), closes [#37460](https://github.com/angular/angular/issues/37460)
* **router:** Remove information about attached component when deactivating route ([#41381](https://github.com/angular/angular/issues/41381)) ([646f4a1](https://github.com/angular/angular/commit/646f4a1fe6057b0c70d61a20f3aecf28e71654da)), closes [#41379](https://github.com/angular/angular/issues/41379)
### Performance Improvements
* **compiler-cli:** allow incremental compilation in the presence of redirected source files ([#41587](https://github.com/angular/angular/issues/41587)) ([616145e](https://github.com/angular/angular/commit/616145e1a7aa594a26345ac0af909ecbacbe7b70))
## 11.2.9 (2021-04-07)
### Bug Fixes
* **bazel:** add missing dependency on `tslib` ([#41480](https://github.com/angular/angular/issues/41480)) ([8d005e5](https://github.com/angular/angular/commit/8d005e51322b68bb66ff311fc78fa34dd440b123)), closes [11.2.8/src/api-extractor/index.js#L20](https://github.com/11.2.8/src/api-extractor/index.js/issues/L20)
* **compiler-cli:** Allow analysis to continue with invalid style url ([#41403](https://github.com/angular/angular/issues/41403)) ([#41489](https://github.com/angular/angular/issues/41489)) ([07131fa](https://github.com/angular/angular/commit/07131fa8ef9f9e6930cf297c27e450c15fb4f10b))
* **compiler-cli:** fix extending angularCompilerOptions from non relative extension less TypeScript configuration files ([#41349](https://github.com/angular/angular/issues/41349)) ([e0165fd](https://github.com/angular/angular/commit/e0165fd7f8374694c1f9d74ecdea5af4f8bba4c7)), closes [#41343](https://github.com/angular/angular/issues/41343)
### Features
* **bazel:** allow setting `compilationMode` in `ng_module` rule ([#41418](https://github.com/angular/angular/issues/41418)) ([e6da38a](https://github.com/angular/angular/commit/e6da38a5e017bbb2e52857472363b5ab2cd84281))
### Performance Improvements
* **core:** add private hooks around user code executed by the runtime ([#41421](https://github.com/angular/angular/issues/41421)) ([94af9d9](https://github.com/angular/angular/commit/94af9d95bbde5d068e89d6697d87851dc246a88f))
* **language-service:** add perf tracing to LanguageService ([#41401](https://github.com/angular/angular/issues/41401)) ([7b0a800](https://github.com/angular/angular/commit/7b0a800b69170c6d32cc49dbc8961b2e2821fe40))
## 11.2.8 (2021-04-01)
### Bug Fixes
* **compiler:** handle case-sensitive CSS custom properties ([#41380](https://github.com/angular/angular/issues/41380)) ([f9da272](https://github.com/angular/angular/commit/f9da27214b74d60d398cf46493767711e710635c)), closes [#41364](https://github.com/angular/angular/issues/41364)
## 11.2.7 (2021-03-24)
### Bug Fixes
* **compiler:** correctly process multiple rules containing `:host` selectors ([#41261](https://github.com/angular/angular/issues/41261)) ([f358d6b](https://github.com/angular/angular/commit/f358d6b113e1a8215fcb50dbc3c5db8799699901)), closes [#41237](https://github.com/angular/angular/issues/41237)
* **compiler-cli:** add `useInlining` option to type check config ([#41268](https://github.com/angular/angular/issues/41268)) ([57644e9](https://github.com/angular/angular/commit/57644e95aadbfe9c8f336be77a22f7a5e1859758)), closes [#40963](https://github.com/angular/angular/issues/40963)
* **core:** remove obsolete check for [class] and [className] presence ([#41254](https://github.com/angular/angular/issues/41254)) ([8a53b54](https://github.com/angular/angular/commit/8a53b5454eea7b4db09498d9018687aa0b0ca7f3))
* **language-service:** show suggestion when type inference is suboptimal ([#41072](https://github.com/angular/angular/issues/41072)) ([18cd7a0](https://github.com/angular/angular/commit/18cd7a0c6921983556fe1fffbff93d42ae138007)), closes [angular/vscode-ng-language-service#1155](https://github.com/angular/vscode-ng-language-service/issues/1155) [#41042](https://github.com/angular/angular/issues/41042)
## 11.2.6 (2021-03-17)
### Bug Fixes
* **core:** remove duplicated EMPTY_OBJ constant ([#41153](https://github.com/angular/angular/issues/41153)) ([fa97166](https://github.com/angular/angular/commit/fa97166361b17802f8d1771e18b47ac55a117a53))
* **forms:** properly handle the change to the FormGroup shape ([#40829](https://github.com/angular/angular/issues/40829)) ([60ac964](https://github.com/angular/angular/commit/60ac9643334b83b6b720afd1b7d7fadf02c4e7fc)), closes [#13788](https://github.com/angular/angular/issues/13788)
* **localize:** render correct closing tag placeholder names in XLIFF 2 ([#41152](https://github.com/angular/angular/issues/41152)) ([7dbb550](https://github.com/angular/angular/commit/7dbb550946031d212b334b9e805e198232bc933b)), closes [#41142](https://github.com/angular/angular/issues/41142)
* **localize:** trim extracted `equiv-text` values ([#41180](https://github.com/angular/angular/issues/41180)) ([ed6c09a](https://github.com/angular/angular/commit/ed6c09ae45faa598b505c68bd68fe0d1ba3300c4)), closes [#41176](https://github.com/angular/angular/issues/41176)
* **ngcc:** do not compile JavaScript sources if typings-only processing is repeated ([#41209](https://github.com/angular/angular/issues/41209)) ([be050b2](https://github.com/angular/angular/commit/be050b2582eed2ad036fb4dd679926a146e17264)), closes [#41198](https://github.com/angular/angular/issues/41198)
### Performance Improvements
* **forms:** avoid direct references to the `Validators` class ([#41189](https://github.com/angular/angular/issues/41189)) ([#41220](https://github.com/angular/angular/issues/41220)) ([804b6b6](https://github.com/angular/angular/commit/804b6b66853aa53f446b3e9c3cb921ae8cb794c2))
* **forms:** make `FormBuilder` class tree-shakable ([#41126](https://github.com/angular/angular/issues/41126)) ([ffc93e0](https://github.com/angular/angular/commit/ffc93e0946dc7c5a2a64a25a97dbae551b3ffbec))
* **forms:** make `RadioControlRegistry` class tree-shakable ([#41126](https://github.com/angular/angular/issues/41126)) ([6414590](https://github.com/angular/angular/commit/6414590f8d09d5d33a9022b023e025fc1452f5b5))
* **forms:** make built-in ControlValueAccessors more tree-shakable ([#41146](https://github.com/angular/angular/issues/41146)) ([#41197](https://github.com/angular/angular/issues/41197)) ([5908eda](https://github.com/angular/angular/commit/5908eda7c11ebff169d07598e54f62d7e35f6580))
## 11.2.5 (2021-03-10)
### Bug Fixes
* **bazel:** fix incorrect rollup plugin method signature ([#41101](https://github.com/angular/angular/issues/41101)) ([925746b](https://github.com/angular/angular/commit/925746b6d8a84ce7281e9044f88bb1146dc1cd44))
* **language-service:** Only provide dom completions for inline templates ([#41078](https://github.com/angular/angular/issues/41078)) ([a05eb13](https://github.com/angular/angular/commit/a05eb13caa546e23caa2dee37435e549059d17c3))
### Performance Improvements
* **compiler-cli:** avoid module resolution in cycle analysis ([#40948](https://github.com/angular/angular/issues/40948)) ([532ae73](https://github.com/angular/angular/commit/532ae73738ded1764209072c4c1b17553d18f009))
* **compiler-cli:** detect semantic changes and their effect on an incremental rebuild ([#40947](https://github.com/angular/angular/issues/40947)) ([e35ecea](https://github.com/angular/angular/commit/e35eceabac6aef10a0505bcb08572ab0bafa70da)), closes [#34867](https://github.com/angular/angular/issues/34867) [#40635](https://github.com/angular/angular/issues/40635) [#40728](https://github.com/angular/angular/issues/40728)
* **compiler-cli:** ensure module resolution cache is reused for type-check program ([#39693](https://github.com/angular/angular/issues/39693)) ([16f90ca](https://github.com/angular/angular/commit/16f90cac4b78d8a9207ecbbcf515518bc01cb7b2))
* **compiler-cli:** use bound symbol in import graph in favor of module resolution ([#40948](https://github.com/angular/angular/issues/40948)) ([2035b15](https://github.com/angular/angular/commit/2035b15d7a35418ead6347c4e2cc0d9816a643d9))
## 11.2.4 (2021-03-03)
### Bug Fixes
* **compiler:** allow binding to autocomplete property on select and textarea elements ([#40928](https://github.com/angular/angular/issues/40928)) ([20fb638](https://github.com/angular/angular/commit/20fb63812ce4d750fe5d71fe7aa70ed5ac9b07c7)), closes [#39490](https://github.com/angular/angular/issues/39490)
* **compiler:** ensure JIT compilation of ɵɵngDeclarePipe() works ([#40929](https://github.com/angular/angular/issues/40929)) ([55eb7b5](https://github.com/angular/angular/commit/55eb7b5681ef4ef921dc690a2a1f0621aaf56e4e))
* **compiler:** recover from an incomplete open tag at the end of a file ([#41054](https://github.com/angular/angular/issues/41054)) ([c675acd](https://github.com/angular/angular/commit/c675acda7f42dba4709d1a7a898313f86ae7ad8e))
* **compiler-cli:** `readConfiguration` existing options should override options in tsconfig ([#40694](https://github.com/angular/angular/issues/40694)) ([#41036](https://github.com/angular/angular/issues/41036)) ([2f3e2df](https://github.com/angular/angular/commit/2f3e2dff33c298cf5824372fe85c1de781c6f1af))
* **compiler-cli:** ensure ngcc can handle wildcard base-paths ([#41033](https://github.com/angular/angular/issues/41033)) ([27d55f6](https://github.com/angular/angular/commit/27d55f6730b923f789798639f8def7f3ce8ad5f4)), closes [#41014](https://github.com/angular/angular/issues/41014)
* **compiler-cli:** extend `angularCompilerOptions` in tsconfig from node ([#40694](https://github.com/angular/angular/issues/40694)) ([#41036](https://github.com/angular/angular/issues/41036)) ([e3ccd56](https://github.com/angular/angular/commit/e3ccd56567fdc7ca00f3a0c7c7e5033b2bece865)), closes [/github.com/microsoft/TypeScript/blob/b346f5764e4d500ebdeff7086e43690ea533a305/src/compiler/commandLineParser.ts#L2603-L2628](https://github.com//github.com/microsoft/TypeScript/blob/b346f5764e4d500ebdeff7086e43690ea533a305/src/compiler/commandLineParser.ts/issues/L2603-L2628) [#36715](https://github.com/angular/angular/issues/36715)
* **language-service:** Add plugin option to force strictTemplates ([#41063](https://github.com/angular/angular/issues/41063)) ([95f748c](https://github.com/angular/angular/commit/95f748c238490edb983df80c8fd2b67f0c6ef24f))
* **language-service:** Always attempt HTML AST to template AST conversion for LS ([#41068](https://github.com/angular/angular/issues/41068)) ([6dd5497](https://github.com/angular/angular/commit/6dd54972d4efa968b84ecf71ac2b306d500a2ed7)), closes [angular/vscode-ng-language-service#1140](https://github.com/angular/vscode-ng-language-service/issues/1140)
* **language-service:** can't provide the Input and Output custom binding property name ([#41005](https://github.com/angular/angular/issues/41005)) ([1b1b65e](https://github.com/angular/angular/commit/1b1b65e1ea4c0b2cde6a267db2ef070395cc09d8))
* **language-service:** don't show external template diagnostics in ts files ([#41070](https://github.com/angular/angular/issues/41070)) ([9322e6a](https://github.com/angular/angular/commit/9322e6a076228cc5ea212f3cbe3bbdb6bb8cea82)), closes [#41032](https://github.com/angular/angular/issues/41032)
* **language-service:** only provide template results on reference requests ([#41041](https://github.com/angular/angular/issues/41041)) ([ef87953](https://github.com/angular/angular/commit/ef87953bc62d43254e3a532b2fe8f16e186f2612))
* **language-service:** provide element completions after open tag < ([#41068](https://github.com/angular/angular/issues/41068)) ([f09e7ab](https://github.com/angular/angular/commit/f09e7abdf0625a565bd890b5aa38274b59d58161)), closes [angular/vscode-ng-language-service#1140](https://github.com/angular/vscode-ng-language-service/issues/1140)
* **ngcc:** do not fail hard when a format-path points to a non-existing or empty file ([#40985](https://github.com/angular/angular/issues/40985)) ([06ff277](https://github.com/angular/angular/commit/06ff277b605760fc0c43346f4997fc5fdfa2ee24)), closes [/github.com/angular/angular/blob/3077c9a1f89c5bd75fb96c16e/packages/compiler-cli/ngcc/src/main.ts#L124](https://github.com//github.com/angular/angular/blob/3077c9a1f89c5bd75fb96c16e/packages/compiler-cli/ngcc/src/main.ts/issues/L124) [#40965](https://github.com/angular/angular/issues/40965)
## 11.2.3 (2021-02-24)
### Performance Improvements
* **language-service:** Skip Angular analysis when quick info requested outside a template ([#40956](https://github.com/angular/angular/issues/40956)) ([0dd1fac](https://github.com/angular/angular/commit/0dd1facc3292aec6b0ca6fd65fc73efae2c194fc))
## 11.2.2 (2021-02-22)
### Bug Fixes
* **animations:** error when setting position before starting animation ([#28255](https://github.com/angular/angular/issues/28255)) ([f1c64b3](https://github.com/angular/angular/commit/f1c64b3f38ed38c2d0c7369f6ee5dea5bbc24cf3))
* **http:** emit error on XMLHttpRequest abort event ([#40786](https://github.com/angular/angular/issues/40786)) ([4a32579](https://github.com/angular/angular/commit/4a32579a4d660b774c380314033e15787dfe4631)), closes [#22324](https://github.com/angular/angular/issues/22324)
* **http:** ignore question mark when params are parsed ([#40610](https://github.com/angular/angular/issues/40610)) ([3b884ed](https://github.com/angular/angular/commit/3b884ed1fc1b1c89c1da9aa6ee0e6b21ff4aa024)), closes [#28722](https://github.com/angular/angular/issues/28722)
* **platform-browser:** ensure that Hammer loader is called only once ([#40911](https://github.com/angular/angular/issues/40911)) ([f8055f6](https://github.com/angular/angular/commit/f8055f6fb839e5817a83c484d96afb77bae0aed5)), closes [#25995](https://github.com/angular/angular/issues/25995)
### Performance Improvements
* **core:** use `ngDevMode` to tree-shake warning ([#40876](https://github.com/angular/angular/issues/40876)) ([c8a2e3a](https://github.com/angular/angular/commit/c8a2e3ae1c12cadd505cdd5a12e26a7231682415))
* **language-service:** short-circuit LS operations when we know there is no Angular information to provide ([#40946](https://github.com/angular/angular/issues/40946)) ([73a3ff1](https://github.com/angular/angular/commit/73a3ff11cbca21ec0a64e064c7968c93c0bd8e0a))
## 11.2.1 (2021-02-17)
### Bug Fixes
* **compiler:** handle `:host-context` and `:host` in the same selector ([#40494](https://github.com/angular/angular/issues/40494)) ([ab8ea87](https://github.com/angular/angular/commit/ab8ea8707842b98b8154f5cbe942b4b24724b6ca)), closes [#14349](https://github.com/angular/angular/issues/14349)
* **compiler:** support multiple `:host-context()` selectors ([#40494](https://github.com/angular/angular/issues/40494)) ([c20e304](https://github.com/angular/angular/commit/c20e3047a58ce2404551c0b51d539e77687e7283)), closes [#19199](https://github.com/angular/angular/issues/19199)
* **compiler:** support multiple selectors in `:host-context()` ([#40494](https://github.com/angular/angular/issues/40494)) ([fb0ce21](https://github.com/angular/angular/commit/fb0ce2178add49f204486c41ef94936f0f178086))
* **compiler-cli:** set TS original node on imported namespace identifiers ([#40711](https://github.com/angular/angular/issues/40711)) ([87ac052](https://github.com/angular/angular/commit/87ac05290ac12ccca10580d10d092d747dae9b40))
* **core:** address Trusted Types bug in Chrome 83 ([#40815](https://github.com/angular/angular/issues/40815)) ([b5f2070](https://github.com/angular/angular/commit/b5f20700c2b9c5edebbfeac8c656f290e4d5d7ea))
* **http:** complete the request on timeout ([#40771](https://github.com/angular/angular/issues/40771)) ([a2a5b4a](https://github.com/angular/angular/commit/a2a5b4add5e68cebe89a4d2b6eff2d75e4cd23c7))
* **router:** fix load interaction of navigation and preload strategies ([#40389](https://github.com/angular/angular/issues/40389)) ([4906bf6](https://github.com/angular/angular/commit/4906bf6a50f307fb69080d276c3b91a60ba7fbae)), closes [#26557](https://github.com/angular/angular/issues/26557) [#22842](https://github.com/angular/angular/issues/22842) [#26557](https://github.com/angular/angular/issues/26557) [#26557](https://github.com/angular/angular/issues/26557) [#22842](https://github.com/angular/angular/issues/22842) [#26557](https://github.com/angular/angular/issues/26557)
* **router:** fix load interaction of navigation and preload strategies ([#40389](https://github.com/angular/angular/issues/40389)) ([bba1981](https://github.com/angular/angular/commit/bba1981c6e1963e5cd1f2c704bb656ca8fcec531)), closes [#26557](https://github.com/angular/angular/issues/26557) [#22842](https://github.com/angular/angular/issues/22842) [#26557](https://github.com/angular/angular/issues/26557) [#26557](https://github.com/angular/angular/issues/26557) [#22842](https://github.com/angular/angular/issues/22842) [#26557](https://github.com/angular/angular/issues/26557)
<a name="11.2.0"></a>
# 11.2.0 (2021-02-10)
### Bug Fixes
* **animations:** properly track listeners for a removed element ([#40712](https://github.com/angular/angular/issues/40712)) ([74cb759](https://github.com/angular/angular/commit/74cb759))
* **common:** date is not correctly formatted when year is between 0 and 99 ([#40448](https://github.com/angular/angular/issues/40448)) ([bf85f04](https://github.com/angular/angular/commit/bf85f04)), closes [#40377](https://github.com/angular/angular/issues/40377)
* **compiler:** include parenthesis in expression source spans ([#40740](https://github.com/angular/angular/issues/40740)) ([e99c4e2](https://github.com/angular/angular/commit/e99c4e2)), closes [#40721](https://github.com/angular/angular/issues/40721)
* **compiler:** throw error for duplicate template references ([#40538](https://github.com/angular/angular/issues/40538)) ([7e0ff8c](https://github.com/angular/angular/commit/7e0ff8c)), closes [#40536](https://github.com/angular/angular/issues/40536)
* **compiler-cli:** don't crash when we can't resolve a resource ([#40660](https://github.com/angular/angular/issues/40660)) ([95446fb](https://github.com/angular/angular/commit/95446fb)), closes [angular/vscode-ng-language-service#1079](https://github.com/angular/vscode-ng-language-service/issues/1079)
* **core:** properly move embedded views of dynamic component's projectable nodes ([#37167](https://github.com/angular/angular/issues/37167)) ([9ae21ee](https://github.com/angular/angular/commit/9ae21ee)), closes [#37120](https://github.com/angular/angular/issues/37120)
* **localize:** improve invalid syntax in extraction error message ([#40724](https://github.com/angular/angular/issues/40724)) ([24600ff](https://github.com/angular/angular/commit/24600ff))
* **localize:** support downleveled inlined helper localize calls ([#40754](https://github.com/angular/angular/issues/40754)) ([415ad8d](https://github.com/angular/angular/commit/415ad8d)), closes [#40702](https://github.com/angular/angular/issues/40702)
* **router:** stop emitting to event observable on destroy ([#40638](https://github.com/angular/angular/issues/40638)) ([737bc7a](https://github.com/angular/angular/commit/737bc7a)), closes [#40502](https://github.com/angular/angular/issues/40502)
<a name="11.2.0-rc.0"></a>
# 11.2.0-rc.0 (2021-02-03)
<a name="11.2.0-next.1"></a>
# 11.2.0-next.1 (2021-02-03)
### Bug Fixes
* **common:** parse `YYYY-MM` strings as UTC dates ([#40620](https://github.com/angular/angular/issues/40620)) ([4c5f18d](https://github.com/angular/angular/commit/4c5f18d)), closes [#33944](https://github.com/angular/angular/issues/33944)
* **common:** parse `YYYY` strings as UTC dates ([#40629](https://github.com/angular/angular/issues/40629)) ([46d4326](https://github.com/angular/angular/commit/46d4326)), closes [#33944](https://github.com/angular/angular/issues/33944) [#40620](https://github.com/angular/angular/issues/40620)
* **compiler:** Don't set expression text to synthetic `$implicit` when empty ([#40583](https://github.com/angular/angular/issues/40583)) ([9d396f8](https://github.com/angular/angular/commit/9d396f8))
* **compiler:** exclude trailing whitespace from element source spans ([#40513](https://github.com/angular/angular/issues/40513)) ([7a6d1e2](https://github.com/angular/angular/commit/7a6d1e2)), closes [#39148](https://github.com/angular/angular/issues/39148)
* **compiler-cli:** preserve user line endings in diagnostic template parse ([#40597](https://github.com/angular/angular/issues/40597)) ([caafac2](https://github.com/angular/angular/commit/caafac2))
* **core:** ensure the type `T` of `EventEmitter<T>` can be inferred ([#40644](https://github.com/angular/angular/issues/40644)) ([5c54767](https://github.com/angular/angular/commit/5c54767)), closes [#40637](https://github.com/angular/angular/issues/40637)
* **core:** remove duplicated EMPTY_ARRAY constant ([#40587](https://github.com/angular/angular/issues/40587)) ([cabe8be](https://github.com/angular/angular/commit/cabe8be))
### Performance Improvements
* **language-service:** update NgCompiler via resource-only path when able ([#40585](https://github.com/angular/angular/issues/40585)) ([07a3d7a](https://github.com/angular/angular/commit/07a3d7a))
<a name="11.2.0-next.0"></a>
# 11.2.0-next.0 (2021-01-27)
### Bug Fixes
* **core:** make DefaultIterableDiffer keep the order of duplicates ([#23941](https://github.com/angular/angular/issues/23941)) ([a826926](https://github.com/angular/angular/commit/a826926)), closes [#23815](https://github.com/angular/angular/issues/23815)
### Features
* **common:** implement `appendAll()` method on `HttpParams` ([#20930](https://github.com/angular/angular/issues/20930)) ([575a2d1](https://github.com/angular/angular/commit/575a2d1)), closes [#20798](https://github.com/angular/angular/issues/20798)
* **language-service:** Add diagnostics to suggest turning on strict mode ([#40423](https://github.com/angular/angular/issues/40423)) ([ecae75f](https://github.com/angular/angular/commit/ecae75f))
* **language-service:** Implement `getRenameInfo` ([#40439](https://github.com/angular/angular/issues/40439)) ([4e8198d](https://github.com/angular/angular/commit/4e8198d))
* **language-service:** initial implementation for `findRenameLocations` ([#40140](https://github.com/angular/angular/issues/40140)) ([9a5ac47](https://github.com/angular/angular/commit/9a5ac47))
* **language-service:** view template typecheck block ([#39974](https://github.com/angular/angular/issues/39974)) ([d482f5c](https://github.com/angular/angular/commit/d482f5c))
<a name="11.1.1"></a>
## 11.1.1 (2021-01-27)
### Bug Fixes
* **compiler:** support multiple `:host-context()` selectors ([#40494](https://github.com/angular/angular/issues/40494)) ([72c0ba6](https://github.com/angular/angular/commit/72c0ba6)), closes [#19199](https://github.com/angular/angular/issues/19199)
* **compiler-cli:** handle pseudo cycles in inline source-maps ([#40435](https://github.com/angular/angular/issues/40435)) ([566206b](https://github.com/angular/angular/commit/566206b)), closes [#40408](https://github.com/angular/angular/issues/40408)
* **compiler-cli:** use `Map` rather than `object` for map of partial linkers ([#40563](https://github.com/angular/angular/issues/40563)) ([33e0f2b](https://github.com/angular/angular/commit/33e0f2b))
* **core:** fix possible XSS attack in development through SSR ([#40525](https://github.com/angular/angular/issues/40525)) ([97ec6e4](https://github.com/angular/angular/commit/97ec6e4))
* **core:** fix possible XSS attack in development through SSR ([#40525](https://github.com/angular/angular/issues/40525)) ([3bf6a99](https://github.com/angular/angular/commit/3bf6a99))
* **core:** improve injector debug information in `ngDevMode` ([#40476](https://github.com/angular/angular/issues/40476)) ([4bb38c9](https://github.com/angular/angular/commit/4bb38c9))
* **forms:** allow `patchValue()` method of `FormGroup` and `FormArray` classes to skip `null` values ([#40534](https://github.com/angular/angular/issues/40534)) ([2fab148](https://github.com/angular/angular/commit/2fab148)), closes [#36672](https://github.com/angular/angular/issues/36672) [#21021](https://github.com/angular/angular/issues/21021)
* **forms:** properly cleanup in cases when FormControlName has no CVA ([#40526](https://github.com/angular/angular/issues/40526)) ([72fc6aa](https://github.com/angular/angular/commit/72fc6aa)), closes [#39235](https://github.com/angular/angular/issues/39235) [#40521](https://github.com/angular/angular/issues/40521)
+2 -2
View File
@@ -89,9 +89,9 @@ Before you submit your Pull Request (PR) consider the following guidelines:
We cannot accept code without a signed CLA.
Make sure you author all contributed Git commits with email address associated with your CLA signature.
4. Fork the angular/angular repo.
4. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the angular/angular repo.
5. Make your changes in a new git branch:
5. In your forked repository, make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2010-2020 Google LLC. https://angular.io/license
Copyright (c) 2010-2021 Google LLC. https://angular.io/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+7 -1
View File
@@ -112,7 +112,7 @@ Read through our [contributing guidelines][contributing] to learn about our subm
### Want to Help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing][contributing] and then check out one of our issues labeled as <kbd>[help wanted](https://github.com/angular/angular/labels/help%20wanted)</kbd> or <kbd>[good first issue](https://github.com/angular/angular/labels/good%20first%20issue)</kbd>.
### Code of Conduct
@@ -123,7 +123,10 @@ Help us keep Angular open and inclusive. Please read and follow our [Code of Con
Join the conversation and help the community.
- [Twitter][twitter]
- [Discord][discord]
- [Gitter][gitter]
- [YouTube][youtube]
- [StackOverflow][stackoverflow]
- Find a Local [Meetup][meetup]
[![Love Angular badge](https://img.shields.io/badge/angular-love-blue?logo=angular&angular=love)](https://www.github.com/angular/angular)
@@ -149,5 +152,8 @@ Join the conversation and help the community.
[npm]: https://www.npmjs.com/get-npm
[codeofconduct]: CODE_OF_CONDUCT.md
[twitter]: https://www.twitter.com/angular
[discord]: https://discord.gg/angular
[gitter]: https://gitter.im/angular/angular
[stackoverflow]: https://stackoverflow.com/questions/tagged/angular
[youtube]: https://youtube.com/angular
[meetup]: https://www.meetup.com/find/?keywords=angular"
+3 -8
View File
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "9d93d4e1340c43dbf6b2fd66b683d89630a6310bf8be3bf40ec96685dcacc26c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.3.3/rules_nodejs-2.3.3.tar.gz"],
sha256 = "f533eeefc8fe1ddfe93652ec50f82373d0c431f7faabd5e6323f6903195ef227",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.3.0/rules_nodejs-3.3.0.tar.gz"],
)
# Check the rules_nodejs version and download npm dependencies
@@ -44,11 +44,6 @@ load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
npm_bazel_protractor_dependencies()
# Load karma dependencies
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
npm_bazel_karma_dependencies()
# Setup the rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
@@ -59,7 +54,7 @@ load("//dev-infra/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
sass_repositories()
+1
View File
@@ -0,0 +1 @@
engine-strict = true
+2 -22
View File
@@ -44,17 +44,7 @@
"src/assets",
"src/generated",
"src/pwa-manifest.json",
"src/google385281288605d160.html",
{
"glob": "custom-elements.min.js",
"input": "node_modules/@webcomponents/custom-elements",
"output": "/assets/js"
},
{
"glob": "native-shim.js",
"input": "node_modules/@webcomponents/custom-elements/src",
"output": "/assets/js"
}
"src/google385281288605d160.html"
],
"styles": [
"src/styles/main.scss"
@@ -156,17 +146,7 @@
"src/assets",
"src/generated",
"src/pwa-manifest.json",
"src/google385281288605d160.html",
{
"glob": "custom-elements.min.js",
"input": "node_modules/@webcomponents/custom-elements",
"output": "/assets/js"
},
{
"glob": "native-shim.js",
"input": "node_modules/@webcomponents/custom-elements/src",
"output": "/assets/js"
}
"src/google385281288605d160.html"
],
"styles": [
"src/styles/main.scss"
+4 -4
View File
@@ -4,7 +4,7 @@
@shortDescription Expression has changed after it was checked
@description
Angular throws an `ExpressionChangedAfterItHasBeenCheckedError` when an expression value has been changed after change detection has completed. Angular only throws this error in development mode.
Angular throws an `ExpressionChangedAfterItHasBeenCheckedError` when an expression value has been changed after change detection has completed. Angular only throws this error in development mode.
In dev mode, Angular performs an additional check after each change detection run, to ensure the bindings haven’t changed. This catches errors where the view is left in an inconsistent state. This can occur, for example, if a method or getter returns a different value each time it is called, or if a child component changes values on its parent. If either of these occur, this is a sign that change detection is not stabilized. Angular throws the error to ensure data is always reflected correctly in the view, which prevents erratic UI behavior or a possible infinite loop.
@@ -13,8 +13,8 @@ This error commonly occurs when you’ve added template expressions or begun to
@debugging
The [source maps](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map) generated by the CLI are very useful when debugging. Navigate up the call stack until you find a template expression where the value displayed in the error has changed.
Ensure that there are no changes to the bindings in the template after change detection is run. This often means refactoring to use the correct [component lifecycle hook](https://angular.io/guide/lifecycle-hooks) for your use case. If the issue exists within `ngAfterViewInit`, the recommended solution is to use a constructor or `ngOnInit` to set initial values, or use `ngAfterContentInit` for other value bindings.
Ensure that there are no changes to the bindings in the template after change detection is run. This often means refactoring to use the correct [component lifecycle hook](guide/lifecycle-hooks) for your use case. If the issue exists within `ngAfterViewInit`, the recommended solution is to use a constructor or `ngOnInit` to set initial values, or use `ngAfterContentInit` for other value bindings.
If you are binding to methods in the view, ensure that the invocation does not update any of the other bindings in the template.
If you are binding to methods in the view, ensure that the invocation does not update any of the other bindings in the template.
Read more about which solution is right for you in ['Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error'](https://indepth.dev/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error/) and why this is useful at ['Angular Debugging "Expression has changed after it was checked": Simple Explanation (and Fix)'](https://blog.angular-university.io/angular-debugging/).
Read more about which solution is right for you in ['Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error'](https://indepth.dev/posts/1001/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error) and why this is useful at ['Angular Debugging "Expression has changed after it was checked": Simple Explanation (and Fix)'](https://blog.angular-university.io/angular-debugging/).
+2 -2
View File
@@ -4,9 +4,9 @@
@shortDescription Circular dependency in DI detected while instantiating a provider
@description
A cyclic dependency exists when a [dependency of a service](https://angular.io/guide/hierarchical-dependency-injection) directly or indirectly depends on the service itself. For example, if `UserService` depends on `EmployeeService`, which also depends on `UserService`. Angular will have to instantiate `EmployeeService` to create `UserService`, which depends on `UserService`, itself.
A cyclic dependency exists when a [dependency of a service](guide/hierarchical-dependency-injection) directly or indirectly depends on the service itself. For example, if `UserService` depends on `EmployeeService`, which also depends on `UserService`. Angular will have to instantiate `EmployeeService` to create `UserService`, which depends on `UserService`, itself.
@debugging
Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by [mapping out](https://angular.io/guide/dependency-injection-in-action) the component, module, or service’s dependencies and identify the loop causing the problem.
Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by [mapping out](guide/dependency-injection-in-action) the component, module, or service’s dependencies and identify the loop causing the problem.
Break this loop (or circle) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be reliant on one another.
+4 -4
View File
@@ -4,12 +4,12 @@
@shortDescription No provider for {token} found!
@description
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping that supplies a value that you can inject into the constructor of a class in your application.
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping that supplies a value that you can inject into the constructor of a class in your application.
Read more on providers in our [Dependency Injection guide](https://angular.io/guide/dependency-injection).
Read more on providers in our [Dependency Injection guide](guide/dependency-injection).
@debugging
Work backwards from the object where the error states that a [provider](https://angular.io/guide/architecture-services) is missing: `No provider for ${this}!`. This is commonly thrown in [services](https://angular.io/tutorial/toh-pt4), which require non-existing providers.
Work backwards from the object where the error states that a [provider](guide/architecture-services) is missing: `No provider for ${this}!`. This is commonly thrown in [services](tutorial/toh-pt4), which require non-existing providers.
To fix the error ensure that your service is registered in the list of providers of an `NgModule` or has the `@Injectable` decorator with a `providedIn` property at top.
@@ -17,4 +17,4 @@ The most common solution is to add a provider in `@Injectable` using `providedIn
```typescript
@Injectable({ providedIn: 'app' })
```
```
+4 -4
View File
@@ -1,13 +1,13 @@
@name Selector Collision
@name Selector Collision
@category runtime
@videoUrl https://www.youtube.com/embed/z_3Z5mOm59I
@shortDescription Multiple components match with the same tagname
@description
Two or more components use the same [element selector](https://angular.io/guide/component-overview#specifying-a-components-css-selector). Because there can only be a single component associated with an element, selectors must be unique strings to prevent ambiguity for Angular.
Two or more components use the same [element selector](guide/component-overview#specifying-a-components-css-selector). Because there can only be a single component associated with an element, selectors must be unique strings to prevent ambiguity for Angular.
@debugging
Use the element name from the error message to search for places where you’re using the same [selector declaration](https://angular.io/guide/architecture-components) in your codebase:
Use the element name from the error message to search for places where you’re using the same [selector declaration](guide/architecture-components) in your codebase:
```typescript
@Component({
@@ -18,4 +18,4 @@ Use the element name from the error message to search for places where you’re
Ensure that each component has a unique CSS selector. This will guarantee that Angular renders the component you expect.
If you’re having trouble finding multiple components with this selector tag name, check for components from imported component libraries, such as Angular Material. Make sure you're following the [best practices](https://angular.io/guide/styleguide#component-selectors) for your selectors to prevent collisions.
If you’re having trouble finding multiple components with this selector tag name, check for components from imported component libraries, such as Angular Material. Make sure you're following the [best practices](guide/styleguide#component-selectors) for your selectors to prevent collisions.
+2 -2
View File
@@ -4,7 +4,7 @@
@shortDescription Export not found!
@description
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. The export name is specified in the `exportAs` property of the directive decorator. This is common when using FormsModule or Material modules in templates, and you’ve forgotten to [import the corresponding modules](https://angular.io/guide/sharing-ngmodules).
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. The export name is specified in the `exportAs` property of the directive decorator. This is common when using FormsModule or Material modules in templates, and you’ve forgotten to [import the corresponding modules](guide/sharing-ngmodules).
<div class="alert is-helpful">
@@ -15,7 +15,7 @@ This is the runtime equivalent of a common compiler error [NG8003: No directive
@debugging
Use the export name to trace the templates or modules using this export.
Ensure that all dependencies are [properly imported and declared in your NgModules](https://angular.io/guide/sharing-ngmodules). For example, if the export not found is `ngForm`, we need to import `FormsModule` and declare it in the list of imports in `*.module.ts` to resolve the error.
Ensure that all dependencies are [properly imported and declared in your NgModules](guide/sharing-ngmodules). For example, if the export not found is `ngForm`, we need to import `FormsModule` and declare it in the list of imports in `*.module.ts` to resolve the error.
```typescript
import { FormsModule } from '@angular/forms';
+18
View File
@@ -0,0 +1,18 @@
@name Pipe Not Found
@category runtime
@videoUrl https://www.youtube.com/embed/maI2u6Sxk9M
@shortDescription Pipe not found!
@description
Angular can't find a pipe with this name.
The pipe referenced in the template has not been named or declared properly.
A [pipe](guide/pipes) must be either declared or imported in the `NgModule` where it is used, and the name used in a template must match the name defined in the pipe decorator.
@debugging
Use the pipe name to trace the templates or modules where this pipe is declared and used.
To resolve this error, ensure that:
- A local custom pipe is uniquely named in the pipe's decorator, and declared in the `NgModule`, or
- A pipe from another `NgModule` is added to the imports of the `NgModule` where it is used.
If you recently added an import or declaration, you may need to restart your server to see these changes.
+2 -2
View File
@@ -3,9 +3,9 @@
@shortDescription No suitable injection token for parameter
@description
There is no injection token for a constructor parameter at compile time. [InjectionTokens](https://angular.io/api/core/InjectionToken) are tokens that can be used in a Dependency Injection Provider.
There is no injection token for a constructor parameter at compile time. [InjectionTokens](api/core/InjectionToken) are tokens that can be used in a Dependency Injection Provider.
@debugging
Look at the parameter that throws the error and all uses of the class. This error is commonly thrown when a constructor defines parameters with primitive types like `string`, `number`, `boolean`, and `Object`.
Use the [@Injectable](https://angular.io/api/core/Injectable) method or [@Inject](https://angular.io/api/core/Inject) decorator from `@angular/core` to ensure that the type you are injecting is reified (has a runtime representation). Make sure to add a provider to this decorator so that you do not throw [NG0201: No Provider Found](https://angular.io/errors/NG0201).
Use the [@Injectable](api/core/Injectable) method or [@Inject](api/core/Inject) decorator from `@angular/core` to ensure that the type you are injecting is reified (has a runtime representation). Make sure to add a provider to this decorator so that you do not throw [NG0201: No Provider Found](errors/NG0201).
+55
View File
@@ -0,0 +1,55 @@
@name Import Cycle Detected
@category compiler
@shortDescription Import cycles would need to be created to compile this component
@description
A component, directive or pipe that is referenced by this component would require the compiler
to add an import that would lead to a cycle of imports. For example, consider a scenario where
a `ParentComponent` references a `ChildComponent` in its template:
<code-example path="errors/cyclic-imports/parent.component.ts" header="parent.component.ts"></code-example>
<code-example path="errors/cyclic-imports/child.component.ts" header="child.component.ts"></code-example>
There is already an import from `child.component.ts` to `parent.component.ts` since the `ChildComponent`
references the `ParentComponent` in its constructor.
But note that the parent component's template contains `<child></child>`. The generated code for this
template must therefore contain a reference to the `ChildComponent` class. In order to make this reference
the compiler would have to add an import from `parent.component.ts` to `child.component.ts`, which would
cause an import cycle:
```
parent.component.ts -> child.component.ts -> parent.component.ts
```
### Remote Scoping
To avoid adding imports that create cycles, additional code is added to the `NgModule` class where
the component is declared that wires up the dependencies. This is known as "remote scoping".
### Libraries
Unfortunately, "remote scoping" code is side-effectful, which prevents tree shaking, and cannot
be used in libraries. So when building libraries using the `"compilationMode": "partial"` setting,
any component that would require a cyclic import will cause this `NG3003` compiler error to be raised.
@debugging
The cycle that would be generated is shown as part of the error message. For example:
<code-example hideCopy="true">
<span class="nocode">The component ChildComponent is used in the template but importing it would create a cycle:
/parent.component.ts -> /child.component.ts -> /parent.component.ts</span>
</code-example>
Use this to identify how the referenced component, pipe or directive has a dependency back to the
component being compiled. Here are some ideas for fixing the problem:
* Try to re-arrange your dependencies to avoid the cycle. For example using an intermediate interface
that is stored in an independent file that can be imported to both dependent files without
causing an import cycle.
* Move the classes that reference each other into the same file, to avoid any imports between them.
+3 -3
View File
@@ -12,10 +12,10 @@ This is the compiler equivalent of a common runtime error `NG0304: '${tagName}'
</div>
@debugging
Use the element name in the error to find the file(s) where the element is being used.
Use the element name in the error to find the file(s) where the element is being used.
Check that the name and selector are correct. If the component is from a different module or import, check that the component is exported from its origin module and imported into the correct `*.modules.ts` file, and declared in the imports list.
Check that the name and selector are correct. If the component is from a different module or import, check that the component is exported from its origin module and imported into the correct `*.modules.ts` file, and declared in the imports list.
When using custom elements or web components, ensure that you add [`CUSTOM_ELEMENTS_SCHEMA`](https://angular.io/api/core/CUSTOM_ELEMENTS_SCHEMA) to the app module.
When using custom elements or web components, ensure that you add [`CUSTOM_ELEMENTS_SCHEMA`](api/core/CUSTOM_ELEMENTS_SCHEMA) to the app module.
If this does not resolve the error, check the imported libraries for any recent changes to the exports and properties you are using, and restart your server.
+1 -1
View File
@@ -13,4 +13,4 @@ This error arises when attempting to bind to a property that does not exist. Any
The runtime error for this is `NG0304: '${tagName}' is not a known element: …’`.
@debugging
Look at documentation for the specific [binding syntax](https://angular.io/guide/binding-syntax) used. This is usually a typo or incorrect import. There may also be a missing direction with property selector ‘name’ or missing input.
Look at documentation for the specific [binding syntax](guide/binding-syntax) used. This is usually a typo or incorrect import. There may also be a missing direction with property selector ‘name’ or missing input.
+2 -2
View File
@@ -4,7 +4,7 @@
@shortDescription No directive found with export
@description
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. This is common with a missing import or a missing [`exportAs`](https://angular.io/api/core/Directive#exportAs) on a directive.
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. This is common with a missing import or a missing [`exportAs`](api/core/Directive#exportAs) on a directive.
<div class="alert is-helpful">
@@ -16,7 +16,7 @@ This is the compiler equivalent of a common runtime error [NG0301: Export Not Fo
@debugging
Use the string name of the export not found to trace the templates or modules using this export.
Ensure that all dependencies are properly imported and declared in our Modules. For example, if the export not found is `ngForm`, we will need to import `FormsModule` and declare it in our list of imports in `*.module.ts` to resolve the missing export error.
Ensure that all dependencies are properly imported and declared in our Modules. For example, if the export not found is `ngForm`, we will need to import `FormsModule` and declare it in our list of imports in `*.module.ts` to resolve the missing export error.
```typescript
import { FormsModule } from '@angular/forms';
@@ -0,0 +1,14 @@
@Component({
selector: 'app-nav-bar',
template: `
<nav [style]='navStyle'>
<a [style.text-decoration]="activeLinkStyle">Home Page</a>
<a [style.text-decoration]="linkStyle">Login</a>
</nav>`
})
export class NavBarComponent {
navStyle = 'font-size: 1.2rem; color: cornflowerblue;';
linkStyle = 'underline';
activeLinkStyle = 'overline';
/* . . . */
}
@@ -4,11 +4,7 @@
<p appHighlight>Highlight me!</p>
<!-- #enddocregion applied -->
<!-- #docregion color-1 -->
<p appHighlight highlightColor="yellow">Highlighted in yellow</p>
<p appHighlight [highlightColor]="'orange'">Highlighted in orange</p>
<!-- #enddocregion color-1 -->
<!-- #docregion color-2 -->
<p appHighlight [highlightColor]="color">Highlighted with parent component's color</p>
<!-- #enddocregion color-2 -->
@@ -1,8 +1,8 @@
/* tslint:disable:no-unused-variable member-ordering */
// #docplaster
// #docregion imports,
// #docregion imports
import { Directive, ElementRef, HostListener } from '@angular/core';
// #enddocregion imports,
// #enddocregion imports
import { Input } from '@angular/core';
// #docregion
@@ -10,9 +10,8 @@ import { Input } from '@angular/core';
selector: '[appHighlight]'
})
export class HighlightDirective {
// #docregion ctor
constructor(private el: ElementRef) { }
// #enddocregion ctor
// #docregion mouse-methods
@HostListener('mouseenter') onMouseEnter() {
@@ -26,16 +25,7 @@ export class HighlightDirective {
private highlight(color: string) {
this.el.nativeElement.style.backgroundColor = color;
}
// #enddocregion mouse-methods,
// #enddocregion mouse-methods
// #docregion color
@Input() highlightColor: string;
// #enddocregion color
// #docregion color-2
@Input() appHighlight: string;
// #enddocregion color-2
// #docregion
}
// #enddocregion
@@ -10,13 +10,13 @@ export class HighlightDirective {
constructor(private el: ElementRef) { }
@Input('appHighlight') highlightColor: string;
// #docregion input
@Input() appHighlight: string;
// #enddocregion input
// #docregion mouse-enter
@HostListener('mouseenter') onMouseEnter() {
this.highlight(this.highlightColor || 'red');
this.highlight(this.appHighlight || 'red');
}
// #enddocregion mouse-enter
@HostListener('mouseleave') onMouseLeave() {
this.highlight(null);
@@ -12,9 +12,7 @@ export class HighlightDirective {
@Input() defaultColor: string;
// #enddocregion defaultColor
// #docregion color
@Input('appHighlight') highlightColor: string;
// #enddocregion color
// #docregion mouse-enter
@HostListener('mouseenter') onMouseEnter() {
@@ -7,11 +7,8 @@
<fieldset><h4>NgModel examples</h4>
<p>Current item name: {{currentItem.name}}</p>
<p>
<!-- #docregion without-NgModel -->
<label for="without">without NgModel:</label>
<input [value]="currentItem.name" (input)="currentItem.name=$event.target.value" id="without">
<!-- #enddocregion without-NgModel -->
<input [value]="currentItem.name" (input)="currentItem.name=getValue($event.target)" id="without">
</p>
<p>
@@ -27,10 +24,8 @@
</p>
<p>
<!-- #docregion NgModelChange -->
<label for="example-change">(ngModelChange)="...name=$event":</label>
<input [ngModel]="currentItem.name" (ngModelChange)="currentItem.name=$event" id="example-change">
<!-- #enddocregion NgModelChange -->
</p>
<p>
@@ -77,12 +72,9 @@
<!-- NgStyle binding -->
<hr><h3>NgStyle Binding</h3>
<!-- #docregion without-ng-style -->
<div [style.font-size]="isSpecial ? 'x-large' : 'smaller'">
This div is x-large or smaller.
</div>
<!-- #enddocregion without-ng-style -->
<h4>[ngStyle] binding to currentStyles - CSS property names</h4>
<p>currentStyles is {{currentStyles | json}}</p>
@@ -134,7 +126,6 @@
<hr>
<h4>Show/hide vs. NgIf</h4>
<!-- #docregion NgIf-3 -->
<!-- isSpecial is true -->
<div [class.hidden]="!isSpecial">Show with class</div>
<div [class.hidden]="isSpecial">Hide with class</div>
@@ -144,7 +135,6 @@
<div [style.display]="isSpecial ? 'block' : 'none'">Show with style</div>
<div [style.display]="isSpecial ? 'none' : 'block'">Hide with style</div>
<!-- #enddocregion NgIf-3 -->
<hr>
@@ -21,7 +21,10 @@ export class AppComponent implements OnInit {
item: Item; // defined to demonstrate template context precedence
items: Item[];
// #docregion item
currentItem: Item;
// #enddocregion item
// trackBy change counting
@@ -111,6 +114,9 @@ export class AppComponent implements OnInit {
trackById(index: number, item: any): number { return item.id; }
getValue(target: EventTarget): string {
return (target as HTMLInputElement).value;
}
}
@@ -5,9 +5,13 @@ import { Item } from './item';
selector: 'app-stout-item',
template: `I'm a little {{item.name}}, short and stout!`
})
// #docregion input
export class StoutItemComponent {
@Input() item: Item;
}
// #enddocregion input
@Component({
selector: 'app-best-item',
@@ -0,0 +1,13 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-not-great',
})
// #docregion not-great
export class NotGreatComponent {
buggyFunction() {
// things could be better here...
}
}
// #enddocregion not-great
@@ -0,0 +1,7 @@
import { Component } from '@angular/core';
import { ParentComponent } from './parent.component';
@Component({selector: 'app-child', template: 'The child!'})
export class ChildComponent {
constructor(private parent: ParentComponent) {}
}
@@ -0,0 +1,8 @@
import { NgModule } from '@angular/core';
import { ChildComponent } from './child.component';
import { ParentComponent } from './parent.component';
@NgModule({
declarations: [ParentComponent, ChildComponent]
})
export class AppModule {}
@@ -0,0 +1,4 @@
import { Component } from '@angular/core';
@Component({selector: 'app-parent', template: '<app-child></app-child>'})
export class ParentComponent {}
@@ -20,9 +20,9 @@
<!-- #docregion event-binding-3-->
<input [value]="currentItem.name"
(input)="currentItem.name=$event.target.value" >
without NgModel
(input)="currentItem.name=getValue($event.target)">
<!-- #enddocregion event-binding-3-->
without NgModel
</div>
<div class="group">
@@ -11,7 +11,7 @@ export class AppComponent {
currentItem = { name: 'teapot'} ;
clickMessage = '';
onSave(event?: KeyboardEvent) {
onSave(event?: MouseEvent) {
const evtMsg = event ? ' Event target is ' + (event.target as HTMLElement).textContent : '';
alert('Saved.' + evtMsg);
if (event) { event.stopPropagation(); }
@@ -21,9 +21,14 @@ export class AppComponent {
alert(`Delete the ${item.name}.`);
}
onClickMe(event?: KeyboardEvent) {
onClickMe(event?: MouseEvent) {
const evtMsg = event ? ' Event target class is ' + (event.target as HTMLElement).className : '';
alert('Click me.' + evtMsg);
}
// #docregion getValue
getValue(target: EventTarget): string {
return (target as HTMLInputElement).value;
}
// #enddocregion getValue
}
@@ -1,14 +1,15 @@
// #docplaster
// #docregion import-http
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
// #enddocregion import-http
@Injectable({
providedIn: 'root'
})
// #docregion props, methods, inject-http, get-shipping
export class CartService {
// #enddocregion get-shipping
items = [];
// #enddocregion props, methods
@@ -32,8 +33,10 @@ export class CartService {
}
// #enddocregion methods
// #docregion get-shipping
getShippingPrices() {
return this.http.get('/assets/shipping.json');
return this.http.get<{type: string, price: number}[]>('/assets/shipping.json');
}
// #docregion props, methods, inject-http
}
// #enddocregion props, methods, inject-http
@@ -12,7 +12,6 @@
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
@@ -29,6 +29,26 @@ const checkLogForMessage = async (message: string) => {
};
describe('Http Tests', () => {
// It seems that currently Chrome/ChromeDriver fail to click a button that is just outside the
// viewport (or maybe only partially inside the viewport) - at least in headless mode.
// Possible solutions:
// 1. Click the element via JavaScript (with something like
// `browser.executeScript('arguments[0].click', elem)`).
// 2. Manually scroll the element into view before clicking:
// https://stackoverflow.com/questions/47776774/element-is-not-clickable-at-point-in-headless-mode-but-when-we-remove-headless
// 3. Explicitly set the window size to a bigger size:
// https://stackoverflow.com/questions/62003082/elementnotinteractableexception-element-not-interactable-element-has-zero-size
//
// Since the default 800x600 window size in headless mode (as used on CI) causes the
// `<app-config>` buttons to be in a position that trigger the above issue, we explicitly set the
// window size to 1920x1080 when in headless mode.
beforeAll(async () => {
const config = await browser.getProcessedConfig();
if (config.capabilities?.chromeOptions?.args?.includes('--headless')) {
browser.driver.manage().window().setSize(1920, 1080);
}
});
beforeEach(() => browser.get(''));
describe('Heroes', () => {
@@ -66,6 +86,7 @@ describe('Http Tests', () => {
await checkLogForMessage('GET "assets/config.json"');
expect(await page.configSpan.getText()).toContain('Heroes API URL is "api/heroes"');
expect(await page.configSpan.getText()).toContain('Textfile URL is "assets/textfile.txt"');
expect(await page.configSpan.getText()).toContain('Date is "Wed Jan 29 2020" (date)');
});
it('can fetch the configuration JSON file with headers', async () => {
@@ -7,6 +7,7 @@
<span *ngIf="config">
<p>Heroes API URL is "{{config.heroesUrl}}"</p>
<p>Textfile URL is "{{config.textfile}}"</p>
<p>Date is "{{config.date.toDateString()}}" ({{getType(config.date)}})</p>
<div *ngIf="headers">
Response headers:
<ul>
@@ -2,7 +2,6 @@
// #docregion
import { Component } from '@angular/core';
import { Config, ConfigService } from './config.service';
import { MessageService } from '../message.service';
@Component({
selector: 'app-config',
@@ -40,7 +39,8 @@ export class ConfigComponent {
// #docregion v1
.subscribe((data: Config) => this.config = {
heroesUrl: data.heroesUrl,
textfile: data.textfile
textfile: data.textfile,
date: data.date,
});
}
// #enddocregion v1
@@ -71,5 +71,9 @@ export class ConfigComponent {
makeError() {
this.configService.makeIntentionalError().subscribe(null, error => this.error = error );
}
getType(val: any): string {
return val instanceof Date ? 'date' : Array.isArray(val) ? 'array' : typeof val;
}
}
// #enddocregion
@@ -14,6 +14,7 @@ import { catchError, retry } from 'rxjs/operators';
export interface Config {
heroesUrl: string;
textfile: string;
date: any;
}
// #enddocregion config-interface
// #docregion proto
@@ -0,0 +1,62 @@
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
// #docregion custom-json-interceptor
// The JsonParser class acts as a base class for custom parsers and as the DI token.
@Injectable()
export abstract class JsonParser {
abstract parse(text: string): any;
}
@Injectable()
export class CustomJsonInterceptor implements HttpInterceptor {
constructor(private jsonParser: JsonParser) {}
intercept(httpRequest: HttpRequest<any>, next: HttpHandler) {
if (httpRequest.responseType === 'json') {
// If the expected response type is JSON then handle it here.
return this.handleJsonResponse(httpRequest, next);
} else {
return next.handle(httpRequest);
}
}
private handleJsonResponse(httpRequest: HttpRequest<any>, next: HttpHandler) {
// Override the responseType to disable the default JSON parsing.
httpRequest = httpRequest.clone({responseType: 'text'});
// Handle the response using the custom parser.
return next.handle(httpRequest).pipe(map(event => this.parseJsonResponse(event)));
}
private parseJsonResponse(event: HttpEvent<any>) {
if (event instanceof HttpResponse && typeof event.body === 'string') {
return event.clone({body: this.jsonParser.parse(event.body)});
} else {
return event;
}
}
}
// #enddocregion custom-json-interceptor
// #docregion custom-json-parser
@Injectable()
export class CustomJsonParser implements JsonParser {
parse(text: string): any {
return JSON.parse(text, dateReviver);
}
}
function dateReviver(key: string, value: any) {
// #enddocregion custom-json-parser
if (typeof value !== 'string') {
return value;
}
const match = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(value);
if (!match) {
return value;
}
return new Date(+match[1], +match[2] - 1, +match[3]);
// #docregion custom-json-parser
}
// #enddocregion custom-json-parser
@@ -6,6 +6,7 @@ import { HTTP_INTERCEPTORS } from '@angular/common/http';
// #enddocregion interceptor-providers
import { AuthInterceptor } from './auth-interceptor';
import { CachingInterceptor } from './caching-interceptor';
import { CustomJsonInterceptor , CustomJsonParser, JsonParser} from './custom-json-interceptor';
import { EnsureHttpsInterceptor } from './ensure-https-interceptor';
import { LoggingInterceptor } from './logging-interceptor';
// #docregion interceptor-providers
@@ -21,6 +22,10 @@ export const httpInterceptorProviders = [
// #docregion noop-provider
{ provide: HTTP_INTERCEPTORS, useClass: NoopInterceptor, multi: true },
// #enddocregion noop-provider, interceptor-providers
// #docregion custom-json-interceptor
{ provide: HTTP_INTERCEPTORS, useClass: CustomJsonInterceptor, multi: true },
{ provide: JsonParser, useClass: CustomJsonParser },
// #enddocregion custom-json-interceptor
{ provide: HTTP_INTERCEPTORS, useClass: EnsureHttpsInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: TrimNameInterceptor, multi: true },
@@ -2,7 +2,7 @@
<h3>Search Npm Packages</h3>
<p><i>Searches when typing stops. Caches for 30 seconds.</i></p>
<!-- #docregion search -->
<input (keyup)="search($event.target.value)" id="name" placeholder="Search"/>
<input (keyup)="search(getValue($event.target))" id="name" placeholder="Search"/>
<!-- #enddocregion search -->
<input type="checkbox" id="refresh" [checked]="withRefresh" (click)="toggleRefresh()">
<label for="refresh">with refresh</label>
@@ -35,4 +35,9 @@ export class PackageSearchComponent implements OnInit {
toggleRefresh() { this.withRefresh = ! this.withRefresh; }
// #docregion getValue
getValue(target: EventTarget): string {
return (target as HTMLInputElement).value;
}
// #enddocregion getValue
}
@@ -1,4 +1,5 @@
{
"heroesUrl": "api/heroes",
"textfile": "assets/textfile.txt"
"textfile": "assets/textfile.txt",
"date": "2020-01-29"
}
@@ -40,6 +40,6 @@ describe('Interpolation e2e tests', () => {
const label = element(by.css('label'));
expect(await label.getText()).toEqual('Type something:');
await input.sendKeys('abc');
expect(await label.getText()).toEqual('Type something: abc');
expect(await label.getText()).toMatch(/^Type something:\s+abc$/);
});
});
@@ -3,11 +3,11 @@
// #docregion pure
import { Pipe, PipeTransform } from '@angular/core';
import { Flyer } from './heroes';
import { Hero } from './heroes';
@Pipe({ name: 'flyingHeroes' })
export class FlyingHeroesPipe implements PipeTransform {
transform(allHeroes: Flyer[]) {
transform(allHeroes: Hero[]) {
// #docregion filter
return allHeroes.filter(hero => hero.canFly);
// #enddocregion filter
+2 -2
View File
@@ -1,5 +1,5 @@
export interface Flyer { canFly: boolean; }
export const HEROES = [
export interface Hero { name: string; canFly: boolean; }
export const HEROES: Hero[] = [
{name: 'Windstorm', canFly: true},
{name: 'Bombasto', canFly: false},
{name: 'Magneto', canFly: false},
@@ -1,7 +1,6 @@
.button {
box-shadow: inset 0px 1px 0px 0px #ffffff;
background: linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
background-color: #ffffff;
box-shadow: inset 0 1px 0 0 #ffffff;
background: #ffffff linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
border-radius: 6px;
border: 1px solid #dcdcdc;
display: inline-block;
@@ -12,13 +11,12 @@
font-weight: bold;
padding: 6px 24px;
text-decoration: none;
text-shadow: 0px 1px 0px #ffffff;
text-shadow: 0 1px 0 #ffffff;
outline: 0;
}
.activebutton {
box-shadow: inset 0px 1px 0px 0px #dcecfb;
background: linear-gradient(to bottom, #bddbfa 5%, #80b5ea 100%);
background-color: #bddbfa;
box-shadow: inset 0 1px 0 0 #dcecfb;
background: #bddbfa linear-gradient(to bottom, #bddbfa 5%, #80b5ea 100%);
border-radius: 6px;
border: 1px solid #84bbf3;
display: inline-block;
@@ -29,6 +27,6 @@
font-weight: bold;
padding: 6px 24px;
text-decoration: none;
text-shadow: 0px 1px 0px #528ecc;
text-shadow: 0 1px 0 #528ecc;
outline: 0;
}
@@ -8,7 +8,6 @@
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
@@ -30,11 +30,11 @@ div.code {
}
hr {
margin: 40px 0
margin: 40px 0;
}
.odd {
background-color: palegoldenrod;
background-color: palegoldenrod;
}
td, th {
@@ -42,9 +42,10 @@ td, th {
vertical-align: top;
}
/* #docregion p-span */
p span { color: red; font-size: 70%; }
/* #enddocregion p-span */
p span {
color: red;
font-size: 70%;
}
.unless {
border: 2px solid;
@@ -5,27 +5,21 @@
<p>Conditional display of hero</p>
<blockquote>
<!-- #docregion built-in, asterisk, ngif -->
<!-- #docregion asterisk -->
<div *ngIf="hero" class="name">{{hero.name}}</div>
<!-- #enddocregion built-in, asterisk, ngif -->
<!-- #enddocregion asterisk -->
</blockquote>
<p>List of heroes</p>
<!-- #docregion built-in -->
<ul>
<!-- #docregion ngfor-li -->
<li *ngFor="let hero of heroes">{{hero.name}}</li>
<!-- #enddocregion ngfor-li -->
</ul>
<!-- #enddocregion built-in -->
<hr>
<h2 id="ngIf">NgIf</h2>
<!-- #docregion ngif-true -->
<p *ngIf="true">
Expression is true and ngIf is true.
This paragraph is in the DOM.
@@ -34,9 +28,7 @@
Expression is false and ngIf is false.
This paragraph is not in the DOM.
</p>
<!-- #enddocregion ngif-true -->
<!-- #docregion display-none -->
<p [style.display]="'block'">
Expression sets display to "block".
This paragraph is visible.
@@ -45,7 +37,6 @@
Expression sets display to "none".
This paragraph is hidden but still in the DOM.
</p>
<!-- #enddocregion display-none -->
<h4>NgIf with template</h4>
<p>&lt;ng-template&gt; element</p>
@@ -72,7 +63,7 @@
and continued on my way.
</p>
<!-- #enddocregion ngif-ngcontainer -->
<!-- #docregion ngif-span -->
<p>
I turned the corner
<span *ngIf="hero">
@@ -80,10 +71,9 @@
</span>
and continued on my way.
</p>
<!-- #enddocregion ngif-span -->
<p><i>&lt;select&gt; with &lt;span&gt;</i></p>
<!-- #docregion select-span -->
<div>
Pick your favorite hero
(<label><input type="checkbox" checked (change)="showSad = !showSad">show sad</label>)
@@ -95,7 +85,6 @@
</span>
</span>
</select>
<!-- #enddocregion select-span -->
<p><i>&lt;select&gt; with &lt;ng-container&gt;</i></p>
<!-- #docregion select-ngcontainer -->
@@ -148,17 +137,14 @@
<h4>NgSwitch</h4>
<!-- #docregion built-in , ngswitch -->
<div [ngSwitch]="hero?.emotion">
<app-happy-hero *ngSwitchCase="'happy'" [hero]="hero"></app-happy-hero>
<app-sad-hero *ngSwitchCase="'sad'" [hero]="hero"></app-sad-hero>
<app-confused-hero *ngSwitchCase="'confused'" [hero]="hero"></app-confused-hero>
<app-unknown-hero *ngSwitchDefault [hero]="hero"></app-unknown-hero>
</div>
<!-- #enddocregion built-in, ngswitch -->
<h4>NgSwitch with &lt;ng-template&gt;</h4>
<!-- #docregion ngswitch-template -->
<div [ngSwitch]="hero?.emotion">
<ng-template [ngSwitchCase]="'happy'">
<app-happy-hero [hero]="hero"></app-happy-hero>
@@ -173,7 +159,6 @@
<app-unknown-hero [hero]="hero"></app-unknown-hero>
</ng-template>
</div>
<!-- #enddocregion ngswitch-template -->
<hr>
@@ -189,6 +174,7 @@
<hr>
<h2 id="appUnless">UnlessDirective</h2>
<!-- #docregion toggle-info -->
<p>
The condition is currently
<span [ngClass]="{ 'a': !condition, 'b': condition, 'unless': true }">{{condition}}</span>.
@@ -198,6 +184,8 @@
Toggle condition to {{condition ? 'false' : 'true'}}
</button>
</p>
<!-- #enddocregion toggle-info -->
<!-- #docregion appUnless-->
<p *appUnless="condition" class="unless a">
(A) This paragraph is displayed because the condition is false.
@@ -10,8 +10,9 @@ import { Hero, heroes } from './hero';
export class AppComponent {
heroes = heroes;
hero = this.heroes[0];
// #docregion condition
condition = false;
// #enddocregion condition
logs: string[] = [];
showSad = true;
status = 'ready';
@@ -0,0 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'sg-app',
template: '<toh-hero-list></toh-hero-list>'
})
export class AppComponent { }
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { HeroComponent, HeroListComponent } from './heroes';
@NgModule({
imports: [
BrowserModule,
RouterModule.forChild([{ path: '05-18', component: AppComponent }])
],
declarations: [
AppComponent,
HeroComponent,
HeroListComponent
],
exports: [AppComponent]
})
export class AppModule {}
@@ -0,0 +1,24 @@
import { Component } from '@angular/core';
import { Hero } from '../shared/hero.model';
@Component({
selector: 'toh-hero-list',
template: `
<section>
Our list of heroes:
<toh-hero *ngFor="let hero of heroes">
</toh-hero>
Total powers: {{totalPowers}}<br>
Average power: {{avgPower}}
</section>
`
})
export class HeroListComponent {
heroes: Hero[] = [];
totalPowers = 1;
get avgPower() {
return this.totalPowers / this.heroes.length;
}
}
@@ -0,0 +1 @@
export * from './hero-list.component';
@@ -0,0 +1,15 @@
import { Component, Input } from '@angular/core';
// #docregion example
@Component({
selector: 'toh-hero',
template: `...`
})
export class HeroComponent {
// The exclamation mark suppresses errors that a property is
// not initialized.
// Ignoring this enforcement can prevent the type checker
// from finding potential issues.
@Input() id!: string;
}
// #enddocregion example
@@ -0,0 +1,17 @@
import { Component, Input } from '@angular/core';
// #docregion example
@Component({
selector: 'toh-hero',
template: `...`
})
export class HeroComponent {
@Input() id?: string;
process() {
if (this.id) {
// ...
}
}
}
// #enddocregion example
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
// #docregion example
@Component({
selector: 'toh-hero',
template: `...`
})
export class HeroComponent {
@Input() id = 'default_id';
}
// #enddocregion example
@@ -0,0 +1 @@
export * from './hero.component';
@@ -0,0 +1,3 @@
export * from './hero';
export * from './hero-list';
export * from './shared';
@@ -0,0 +1,4 @@
export interface Hero {
id: number;
name: string;
}
@@ -0,0 +1 @@
export * from './hero.model';
@@ -0,0 +1,2 @@
export * from './heroes';
export * from './app.component';
@@ -219,11 +219,9 @@ button</button>
<app-hero-detail [hero]="currentHero"></app-hero-detail>
<img bind-src="heroImageUrl">
<!-- ERROR: HeroDetailComponent.hero expects a
Hero object, not the string "currentHero" -->
<div *ngIf="false">
<app-hero-detail hero="currentHero"></app-hero-detail>
</div>
<!-- ERROR: HeroDetailComponent.hero expects a Hero object, not the string "currentHero" -->
<!-- <app-hero-detail hero="currentHero"></app-hero-detail> -->
<app-hero-detail prefix="You are my" [hero]="currentHero"></app-hero-detail>
<p><img src="{{heroImageUrl}}"> is the <i>interpolated</i> image.</p>
@@ -1,7 +1,7 @@
// tslint:disable-next-line:no-unused-variable
import { fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { interval, of } from 'rxjs';
import { delay, take } from 'rxjs/operators';
import {fakeAsync, tick, waitForAsync} from '@angular/core/testing';
import {interval, of} from 'rxjs';
import {delay, take} from 'rxjs/operators';
describe('Angular async helper', () => {
describe('async', () => {
@@ -183,7 +183,7 @@ describe('Angular async helper', () => {
// before loading zone.js/dist/zone-testing
it('should wait until promise.then is called', waitForAsync(() => {
let finished = false;
new Promise((res, rej) => {
new Promise<void>(res => {
jsonp('localhost:8080/jsonp', () => {
// success callback and resolve the promise
finished = true;
@@ -21,8 +21,8 @@ export class ActivatedRouteStub {
/** The mock paramMap observable */
readonly paramMap = this.subject.asObservable();
/** Set the paramMap observables's next value */
setParamMap(params?: Params) {
/** Set the paramMap observable's next value */
setParamMap(params: Params = {}) {
this.subject.next(convertToParamMap(params));
}
}
@@ -1,5 +1,5 @@
<!-- #docregion show-hero-1 -->
{{hero}}
<h2>{{hero}}</h2>
<!-- #enddocregion show-hero-1 -->
<!-- #docregion show-hero-2 -->
@@ -10,8 +10,7 @@
<!-- #docregion name-input -->
<div>
<label>name:
<input [(ngModel)]="hero.name" placeholder="name"/>
</label>
<label for="name">Hero name: </label>
<input id="name" [(ngModel)]="hero.name" placeholder="name">
</div>
<!-- #enddocregion name-input -->
@@ -0,0 +1,3 @@
input {
padding: .5rem;
}
@@ -4,7 +4,6 @@
<!-- #enddocregion pipe -->
<div><span>id: </span>{{hero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="hero.name" placeholder="name"/>
</label>
<label for="name">Hero name: </label>
<input id="name" [(ngModel)]="hero.name" placeholder="name">
</div>
@@ -16,16 +16,20 @@
border-radius: 4px;
}
.heroes li:hover {
color: #607D8B;
background-color: #DDD;
color: #2c3a41;
background-color: #e6e6e6;
left: .1em;
}
.heroes li.selected {
background-color: #CFD8DC;
background-color: black;
color: white;
}
.heroes li.selected:hover {
background-color: #BBD8DC;
background-color: #505050;
color: white;
}
.heroes li.selected:active {
background-color: black;
color: white;
}
.heroes .badge {
@@ -42,3 +46,7 @@
margin-right: .8em;
border-radius: 4px 0 0 4px;
}
input {
padding: .5rem;
}
@@ -17,9 +17,8 @@
<h2>{{selectedHero.name | uppercase}} Details</h2>
<div><span>id: </span>{{selectedHero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="selectedHero.name" placeholder="name"/>
</label>
<label for="hero-name">Hero name: </label>
<input id="hero-name" [(ngModel)]="selectedHero.name" placeholder="name">
</div>
<!-- #enddocregion selectedHero-details -->
@@ -19,7 +19,7 @@ export class HeroesComponent implements OnInit {
heroes = HEROES;
// #enddocregion component
// #docregion on-select
selectedHero: Hero;
selectedHero?: Hero;
// #enddocregion on-select
constructor() { }
@@ -35,4 +35,3 @@ export class HeroesComponent implements OnInit {
// #docregion component
}
// #enddocregion component
@@ -0,0 +1,3 @@
input {
padding: .5rem;
}
@@ -3,9 +3,8 @@
<h2>{{hero.name | uppercase}} Details</h2>
<div><span>id: </span>{{hero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="hero.name" placeholder="name"/>
</label>
<label for="hero-name">Hero name: </label>
<input id="hero-name" [(ngModel)]="hero.name" placeholder="name">
</div>
</div>
@@ -13,7 +13,7 @@ import { Hero } from '../hero';
})
export class HeroDetailComponent implements OnInit {
// #docregion input-hero
@Input() hero: Hero;
@Input() hero?: Hero;
// #enddocregion input-hero
constructor() { }
@@ -16,16 +16,20 @@
border-radius: 4px;
}
.heroes li:hover {
color: #607D8B;
background-color: #DDD;
color: #2c3a41;
background-color: #e6e6e6;
left: .1em;
}
.heroes li.selected {
background-color: #CFD8DC;
background-color: black;
color: white;
}
.heroes li.selected:hover {
background-color: #BBD8DC;
background-color: #505050;
color: white;
}
.heroes li.selected:active {
background-color: black;
color: white;
}
.heroes .badge {
@@ -0,0 +1,3 @@
input {
padding: .5rem;
}
@@ -2,8 +2,7 @@
<h2>{{hero.name | uppercase}} Details</h2>
<div><span>id: </span>{{hero.id}}</div>
<div>
<label>name:
<input [(ngModel)]="hero.name" placeholder="name"/>
</label>
<label for="hero-name">Hero name: </label>
<input id="hero-name" [(ngModel)]="hero.name" placeholder="name"/>
</div>
</div>
@@ -25,11 +25,11 @@ export class HeroService {
// #docregion getHeroes, getHeroes-1
getHeroes(): Observable<Hero[]> {
const heroes = of(HEROES);
// #enddocregion getHeroes-1
// TODO: send the message _after_ fetching the heroes
this.messageService.add('HeroService: fetched heroes');
// #docregion getHeroes-1
return of(HEROES);
return heroes;
}
// #enddocregion getHeroes, getHeroes-1
}
@@ -16,16 +16,24 @@
border-radius: 4px;
}
.heroes li:hover {
color: #607D8B;
background-color: #DDD;
color: #2c3a41;
background-color: #e6e6e6;
left: .1em;
}
.heroes li:active {
background-color: #525252;
color: #fafafa;
}
.heroes li.selected {
background-color: #CFD8DC;
background-color: black;
color: white;
}
.heroes li.selected:hover {
background-color: #BBD8DC;
background-color: #505050;
color: white;
}
.heroes li.selected:active {
background-color: black;
color: white;
}
.heroes .badge {
@@ -42,3 +50,4 @@
margin-right: .8em;
border-radius: 4px 0 0 4px;
}
@@ -15,10 +15,10 @@ import { MessageService } from '../message.service';
})
export class HeroesComponent implements OnInit {
selectedHero: Hero;
selectedHero?: Hero;
// #docregion heroes
heroes: Hero[];
heroes: Hero[] = [];
// #enddocregion heroes
constructor(private heroService: HeroService, private messageService: MessageService) { }
@@ -1,20 +1,19 @@
/* MessagesComponent's private CSS styles */
h2 {
color: red;
color: #A80000;
font-family: Arial, Helvetica, sans-serif;
font-weight: lighter;
}
button.clear {
font-family: Arial, sans-serif;
.clear {
color: #333;
background-color: #eee;
margin-bottom: 12px;
border: none;
padding: 5px 10px;
padding: 1rem;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
}
button:hover {
background-color: #cfd8dc;
.clear:hover {
color: white;
background-color: #42545C;
}
@@ -2,7 +2,7 @@
<h2>Messages</h2>
<button class="clear"
(click)="messageService.clear()">clear</button>
(click)="messageService.clear()">Clear messages</button>
<div *ngFor='let message of messageService.messages'> {{message}} </div>
</div>
@@ -46,7 +46,7 @@ describe('Tutorial part 5', () => {
appDashboardHref: navElts.get(0),
appDashboard: element(by.css('app-root app-dashboard')),
topHeroes: element.all(by.css('app-root app-dashboard > div h4')),
topHeroes: element.all(by.css('app-root app-dashboard > div a')),
appHeroesHref: navElts.get(1),
appHeroes: element(by.css('app-root app-heroes')),
@@ -1,23 +1,21 @@
/* AppComponent's private CSS styles */
h1 {
font-size: 1.2em;
margin-bottom: 0;
}
nav a {
padding: 5px 10px;
padding: 1rem;
text-decoration: none;
margin-top: 10px;
display: inline-block;
background-color: #eee;
background-color: #e8e8e8;
color: #3d3d3d;
border-radius: 4px;
}
nav a:visited, a:link {
color: #334953;
}
nav a:hover {
color: #039be5;
background-color: #cfd8dc;
color: white;
background-color: #42545C;
}
nav a.active {
color: #039be5;
background-color: black;
}
@@ -1,8 +1,6 @@
<h3>Top Heroes</h3>
<div class="grid grid-pad">
<a *ngFor="let hero of heroes" class="col-1-4">
<div class="module hero">
<h4>{{hero.name}}</h4>
</div>
<h2>Top Heroes</h2>
<div class="heroes-menu">
<a *ngFor="let hero of heroes">
{{hero.name}}
</a>
</div>
@@ -1,61 +1,50 @@
/* DashboardComponent's private CSS styles */
[class*='col-'] {
float: left;
padding-right: 20px;
padding-bottom: 20px;
h2 {
text-align: center;
}
[class*='col-']:last-of-type {
padding-right: 0;
.heroes-menu {
padding: 0;
margin: auto;
max-width: 1000px;
/* flexbox */
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
align-content: flex-start;
align-items: flex-start;
}
a {
text-decoration: none;
}
*, *::after, *::before {
box-sizing: border-box;
}
h3 {
text-align: center;
margin-bottom: 0;
}
h4 {
position: relative;
}
.grid {
margin: 0;
}
.col-1-4 {
width: 25%;
}
.module {
padding: 20px;
text-align: center;
color: #eee;
max-height: 120px;
min-width: 120px;
background-color: #3f525c;
border-radius: 2px;
padding: 1rem;
font-size: 1.2rem;
text-decoration: none;
display: inline-block;
color: #fff;
text-align: center;
width: 100%;
min-width: 70px;
margin: .5rem auto;
box-sizing: border-box;
/* flexbox */
order: 0;
flex: 0 1 auto;
align-self: auto;
}
.module:hover {
background-color: #eee;
cursor: pointer;
color: #607d8b;
}
.grid-pad {
padding: 10px 0;
}
.grid-pad > [class*='col-']:last-of-type {
padding-right: 20px;
}
@media (max-width: 600px) {
.module {
font-size: 10px;
max-height: 75px; }
}
@media (max-width: 1024px) {
.grid {
margin: 0;
}
.module {
min-width: 60px;
@media (min-width: 600px) {
a {
width: 18%;
box-sizing: content-box;
}
}
a:hover {
background-color: #000;
}
@@ -1,11 +1,9 @@
<h3>Top Heroes</h3>
<div class="grid grid-pad">
<h2>Top Heroes</h2>
<div class="heroes-menu">
<!-- #docregion click -->
<a *ngFor="let hero of heroes" class="col-1-4"
routerLink="/detail/{{hero.id}}">
<div class="module hero">
<h4>{{hero.name}}</h4>
</div>
<a *ngFor="let hero of heroes"
routerLink="/detail/{{hero.id}}">
{{hero.name}}
</a>
<!-- #enddocregion click -->
<!-- #enddocregion click -->
</div>
@@ -1,24 +1,18 @@
/* HeroDetailComponent's private CSS styles */
label {
display: inline-block;
width: 3em;
margin: .5em 0;
color: #607D8B;
color: #435960;
font-weight: bold;
}
input {
height: 2em;
font-size: 1em;
padding-left: .4em;
padding: .5rem;
}
button {
margin-top: 20px;
font-family: Arial, sans-serif;
background-color: #eee;
border: none;
padding: 5px 10px;
padding: 1rem;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
}
button:hover {
background-color: #cfd8dc;

Some files were not shown because too many files have changed in this diff Show More