20176 Commits

Author SHA1 Message Date
George Kalpakas
c704162800 fix(docs-infra): use consistent padding in marketing pages ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
09d36369b0 fix(docs-infra): make top-nav consistent across all marketing pages ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
b509a7dc42 fix(docs-infra): make the "Contributors" page header similar to other marketing pages ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
b0c8c4d696 fix(docs-infra): add spacing between past and future events sections ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
71ccb545c6 refactor(docs-infra): create mixin for styling docs pages ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
44e1f956d0 fix(docs-infra): ensure the main font is applied to inputs ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
7bcef26852 refactor(docs-infra): remove unnecessary font-family styles ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
90a61618c7 refactor(docs-infra): remove unused CSS for the version selector ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
64efe38d66 fix(docs-infra): merge docs with guide and start with tutorial in search-results ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
4fac4a8880 fix(docs-infra): show the "Errors List" page under "ERRORS" in search results ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
fb58a2bd54 fix(docs-infra): use relative URLs for internal links on error pages ()
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 
2021-02-19 09:14:59 -08:00
George Kalpakas
51c7d32c09 fix(docs-infra): show external link icons for external links on error pages ()
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 
2021-02-19 09:14:59 -08:00
Andrew Scott
a82fddf1ce feat(router): Allow for custom router outlet implementations ()
This PR formalizes, documents, and makes public the router outlet contract.

The set of `RouterOutlet` methods used by the `Router` has not changed
in over 4 years, since the introduction of route reuse strategies.

Creation of custom router outlets is already possible and is used by the
Ionic framework
(https://github.com/ionic-team/ionic-framework/blob/master/angular/src/directives/navigation/ion-router-outlet.ts).
There is a small "hack" that is needed to make this work, which is that
outlets must register with `ChildrenOutletContexts`, but it currently
only accepts our `RouterOutlet`.

By exposing the interface the `Router` uses to activate and deactivate
routes through outlets, we allow for developers to more easily and safely
extend the `Router` and have fine-tuned control over navigation and component
activation that fits project requirements.

PR Close 
2021-02-19 09:13:17 -08:00
Kapunahele Wong
d0b6270990 docs: edit Component lifecycle title ()
PR Close 
2021-02-19 09:10:37 -08:00
David Shevitz
b4301c3d88 docs: add missing '@usageNotes' tag to documentation ()
PR Close 
2021-02-19 09:09:43 -08:00
arturovt
228b5f73b1 fix(platform-browser): ensure that Hammer loader is called only once ()
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 

PR Close 
2021-02-19 09:08:34 -08:00
Amadou Sall
aed2782c4a docs: the token should be associated with LibHeaderComponent ()
PR Close 
2021-02-19 09:07:00 -08:00
Kapunahele Wong
30d5e25a28 docs: edit attribute-directives.md, move best practice to styleguide ()
PR Close 
2021-02-19 08:14:54 -08:00
Chellappan
542ba1fc00 refactor(compiler): add process title to Angular node binaries ()
Set the process title for @angular/compiler-cli,@angular/localize packages

Resolves 

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

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

PR Close 
2021-02-17 17:04:15 -08:00
Pete Bacon Darwin
f57cd19e0c refactor(localize): avoid computing source-maps in extraction unnecessarily ()
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 
2021-02-17 17:02:57 -08:00
Joey Perrott
bafab6de79 build: update dependencies to enable strict_visibility for bazel yarn_install ()
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 
2021-02-17 17:01:26 -08:00
David Shevitz
1de999b89d docs: fix minor grammar mistakes in What is Angular topic ()
PR Close 
2021-02-17 13:23:49 -08:00
Kristiyan Kostadinov
cdf1ea1951 refactor(compiler): retrieve variables from context inside nested template listener ()
This is a pre-requisite for . Given the following template which has a listener
that references a variable from a parent template (`name`):

```
<ng-template let-name="name">
  <button (click)="hello(name)"></button>
</ng-template>
```

We generate code that looks that looks like. Note how we access `name` through `ctx`:

```js
function template(rf, ctx) {
  if (rf & 1) {
    const r0 = ɵɵgetCurrentView();
    ɵɵelementStart(0, "button", 2);
    ɵɵlistener("click", function() {
      ɵɵrestoreView(r0);
      const name_r0 = ctx.name; // Note the `ctx.name` access here.
      const ctx_r1 = ɵɵnextContext();
      return ctx_r1.log(name_r0);
    });
    ɵɵelementEnd();
  }
}
```

This works fine at the moment, because the template context object can't be changed after creation.
The changes in  allow for the object to be changed, which means that the `ctx` reference
inside the listener will be out of date, because it was bound during creation mode.

This PR aims to address the issue by accessing the context inside listeners through the saved
view reference. With the new code, the generated code from above will look as follows:

```js
function template(rf, ctx) {
  if (rf & 1) {
    const r0 = ɵɵgetCurrentView();
    ɵɵelementStart(0, "button", 2);
    ɵɵlistener("click", function() {
      const restoredCtx = ɵɵrestoreView(r0);
      const name_r0 = restoredCtx.name;
      const ctx_r1 = ɵɵnextContext();
      return ctx_r1.log(name_r0);
    });
    ɵɵelementEnd();
  }
}
```

PR Close 
2021-02-17 11:45:46 -08:00
arturovt
b7a2d0da20 perf(core): use ngDevMode to tree-shake warning ()
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 
2021-02-17 11:41:28 -08:00
David Shevitz
8658cd59b2 docs: add what is angular topic ()
PR Close 
2021-02-17 11:13:21 -08:00
Joey Perrott
b31098d5e9
release: cut the v12.0.0-next.1 release () 2021-02-17 11:47:41 -07:00
Joey Perrott
a9936c22ba
docs: release notes for the v11.2.1 release () 2021-02-17 11:37:38 -07:00
Daniel
9b26f462d0 docs: fix grammar in angular-compiler-options file ()
PR Close 
2021-02-17 06:56:38 -08:00
Amadou Sall
0807d13201 docs: remove the extra backtick character ()
PR Close 
2021-02-17 06:56:03 -08:00
abarghoud
13d82ce248 docs(core): add documentation for HostListener ()
add return value documentations for HostListener callbacks

Closes 

PR Close 
2021-02-17 06:55:29 -08:00
Pete Bacon Darwin
322951af49 refactor(compiler-cli): error on cyclic imports in partial compilation ()
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 

PR Close 
2021-02-17 06:53:38 -08:00
George Kalpakas
a4c00c2148 build: upgrade webdriver-manager to v12.1.8 ()
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 
2021-02-17 06:52:31 -08:00
George Kalpakas
defd6b4230 build: use correct path for local dependencies in ivy-i18n integration project ()
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 
2021-02-17 06:52:31 -08:00
George Kalpakas
7d931d3e04 build: ensure integration projects use root webdriver-manager ()
Ensure that all integration projects use `webdriver-manager` from the
root `node_modules/`. See acfd0edd38d955a8559aeec3d97c0f9a23525079 for
more details.

PR Close 
2021-02-17 06:52:31 -08:00
s4m0r4m4
12f7101d92 docs(forms): fix link for browser compatibility of using selects in IE ()
Co-authored-by: Andrew Kushnir <43554145+AndrewKushnir@users.noreply.github.com>
PR Close 
2021-02-16 13:06:53 -08:00
s4m0r4m4
c56682783c docs(forms): remove reference to firefox bug that was fixed ()
PR Close 
2021-02-16 13:06:53 -08:00
Kapunahele Wong
75db0c7445 docs: edit builtin-directives doc ()
Edit built-in-directives.md copy and headers, fixes affected
links, adds a docregion to make steps clearer.

PR Close 
2021-02-16 13:04:41 -08:00
Paul Gammans
95ad452e54 fix(router): fix load interaction of navigation and preload strategies ()
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 
 * Prevention of duplicate RouteConfigLoad(Start|End) events
   related to 
 * 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 
 * 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   

PR Close 
2021-02-16 11:28:50 -08:00
Alexey Elin
c47dbbede7 docs: fix broken link in Default Architect builders and targets section (+ remove typo 'the') ()
PR Close 
2021-02-16 10:04:48 -08:00
storm-sergey
d1b3fa09c3 docs: update the copyright notice date ()
PR Close 
2021-02-16 10:04:23 -08:00
David Shevitz
82e7ba2702 docs: add observer-spy to resources page ()
PR Close 
2021-02-16 10:03:58 -08:00
Alexey Elin
dd3dd63845 docs: use shorthand background CSS property in Routing example ()
PR Close 
2021-02-16 09:26:26 -08:00
Alexey Elin
f4f7c33e1f docs: format null as code fragment + fix description of returned value ()
PR Close 
2021-02-16 09:24:49 -08:00
Alexey Elin
e3c21c5465 docs: use TS Parameter properties in SkipSelf example ()
PR Close 
2021-02-16 09:24:25 -08:00
Michael Jerred
4ec045e12b feat(forms): add emitEvent option for AbstractControl-based class methods ()
This commit adds the `emitEvent` option to the following FormArray and FormGroup methods:

* FormGroup.addControl
* FormGroup.removeControl
* FormGroup.setControl
* FormArray.push
* FormArray.insert
* FormArray.removeAt
* FormArray.setControl
* FormArray.clear

This option can be used to prevent an event from being emitted when adding or removing controls.

BREAKING CHANGE:

The `emitEvent` option was added to the following `FormArray` and `FormGroup` methods:

* FormGroup.addControl
* FormGroup.removeControl
* FormGroup.setControl
* FormArray.push
* FormArray.insert
* FormArray.removeAt
* FormArray.setControl
* FormArray.clear

If your app has custom classes that extend `FormArray` or `FormGroup` classes and override the 
above-mentioned methods, you may need to update your implementation to take the new options into
account and make sure that overrides are compatible from a types perspective.

Closes .
PR Close 
2021-02-16 08:42:08 -08:00
Pete Bacon Darwin
645c2ef973 fix(compiler): support multiple selectors in :host-context() ()
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 
2021-02-16 08:41:19 -08:00
Pete Bacon Darwin
679c3bf7ea fix(compiler): handle :host-context and :host in the same selector ()
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 

PR Close 
2021-02-16 08:41:19 -08:00