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
Since `.filter-button` elements only appear inside `.group-buttons`
elements, this commit moves `.filter-button` CSS styles inside
`.group-buttons` styles.
PR Close#40944
This change fixes an incompatibility between the old `@angular/http` package
and its successor (`@angular/common/http`) by re-introducing the types that were supported before.
It now allows to use number and boolean directly as HTTP params, instead of having to convert it to string first.
Before:
this.http.get('/api/config', { params: { page: `${page}` } });
After:
this.http.get('/api/config', { params: { page }});
`HttpParams` has also been updated to have most of its methods accept number or boolean values.
Fixes#23856
BREAKING CHANGE:
The methods of the `HttpParams` class now accept `string | number | boolean`
instead of `string` for the value of a parameter.
If you extended this class in your application,
you'll have to update the signatures of your methods to reflect these changes.
PR Close#40663
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
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
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
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
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
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
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
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
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
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
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#40756
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
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
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
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
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
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
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
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
`@angular/platform-server` provides the foundation for rendering an
Angular app on the server. In order to achieve that, it uses a
server-side DOM implementation (currently [domino][1]).
For rendering on the server to work as closely as possible to running
the app on the browser, we need to make DOM globals (such as `Element`,
`HTMLElement`, etc.), which are normally provided by the browser,
available as globals on the server as well.
Currently, `@angular/platform-server` achieves this by extending the
`global` object with the DOM implementation provided by `domino`. This
assignment happens in the [setDomTypes()][2] function, which is
[called in a `PLATFORM_INITIALIZER`][3]. While this works in most cases,
there are some scenarios where the DOM globals are needed sooner (i.e.
before initializing the platform). See, for example, #24551 and #39950
for more details on such issues.
This commit provides a way to solve this problem by exposing a
side-effect-ful entry-point (`@angular/platform-server/init`), that
shims the `global` object with DOM globals. People will be able to
import this entry-point in their server-rendered apps before
bootstrapping the app (for example, in their `main.server.ts` file).
(See also [#39950 (comment)][4].)
In a future update, the [`universal` schematics][5] will include such an
import by default in newly generated projects.
[1]: https://www.npmjs.com/package/domino
[2]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/domino_adapter.ts#L17-L21
[3]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/server.ts#L33
[4]: https://github.com/angular/angular/issues/39950#issuecomment-747598403
[5]: https://github.com/angular/angular-cli/blob/cc51432661eb4ab4b6a3/packages/schematics/angular/universal
PR Close#40559
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
This commit adds a warning in the Elements guide about using
`@Component.selector` as the tag name for the registered custom element.
See also #40452 for context.
PR Close#40510
This new `base-authoring-package` captures all the settings, which
turns of potentially fatal checks, in one place. This new package is
then used as a base for all the docs-watch related packages, rather
than dotting the settings in a variety of different packages. This also
has the benefit that the standard configuration for doc-gen is fatal
on failed checks by default.
PR Close#40479
When using `docs-watch` we try to match the changed file
to a dgeni package in order to trigger a minimal set of processors.
Previously, if the changed file could not be matched we emitted an
ugly error. Now we provide a helpeful message.
PR Close#40479
We can define regions in our examples that can be referenced
and rendered in guides as code snippets. It is quite hard to ensure
that these regions are maintained correctly. One reason for this is
it is hard to know whether a region is being used or not.
This commit adds a new processor that checks for unused named
regions in examples and fails if any are found.
Fixes#19761
PR Close#40479
In the `docs-watch` job we attempt to guess what additional files need
to be processed given a change to a single file. Previously we were not
finding links to examples that were defined over multiple lines. E.g.
```
<code-pane
header="src/app/app.component.html"
region="hero-birthday-template"
path="pipes/src/app/app.component.html">
</code-pane>
```
This commit improves the regular expression to handle these cases.
PR Close#40479
This commits adds some shortcut definitions for the angular.io PWA. The
user agent can use them to assemble a context menu to be displayed by
the operating system when a user engages with the app's icon. (In
addition, shortcuts provide an easy way for users to add links to
specific pages on their home screen.)
See [here][1] for more details on the `shortcuts` property of the PWA
manifest.
The choice of pages to create shortcuts to was influenced by the
following facts/criteria:
- It seems that only the first 4 shortcuts are displayed by Chrome (at
least on my Android phone).
- Since the PWA is mostly used on mobile, I omitted pages that are less
likely to be useful for mobile users (such as pages related to CLI).
[1]: https://developer.mozilla.org/en-US/docs/Web/Manifest/shortcuts
PR Close#40393
This commit moves some properties with simple, string values in
`pwa-manifest.json` to the top (i.e. above the more lengthy `icons`
array) to make them easier to discover.
PR Close#40393
Previously we only logged a warning if we attempted to auto-link
to a doc that had no `path` property, which implies that it is private
and is not rendered.
Now we fail hard during full doc-gen, although when running the
`yarn serv-and-sync` command it should not fail if changes are
only made to guides, which is what authors who use this tool
are most likely to do.
PR Close#40404
Previously, only the first layer of sub-classes were filtered to remove
private exports. But on recursing down further levels these were not
filtered out.
PR Close#40404
This tag-def is being used in the `platform-server` source code,
and was causing warnings in the doc-gen. Adding support
prevents the warning from being shown.
Other than that this change has no effect on the generated
documentation, since the `@default` tag is not used in any
templates.
PR Close#40404
This commit updates `dgeni` to the latest version, which
will now only display the stack-trace after an error if the
logger is set to `debug`.
Fixes#39610
PR Close#40404
The previous commit introduced extra checks to verify contributors.json data and this commit contains the necessary
fixes to the problems identified by the new set of checks.
PR Close#40369
This commit adds extra steps to verify contributors.json data, such as checking `lead` and `mentor` field as well as
making sure the list is sorted alphabetically.
PR Close#40369
This commit renames contributors/check-pictures.js to contributors/validate-data.js, since this file script will also
be used to include other checks.
PR Close#40369
Currently entries in the `contributors.json` file are not sorted and new entries are typically added at the very
end of the file, which is often causing merge conflicts. This commit updates the `contributors.json` to have all
entries sorted in alphabetical order (based on GitHub handles), which should reduce the number of merge conflicts.
PR Close#40369
Providing an array to `[style]` bindings is not supported and the behavior
of the rendered style attribute is not as one might expect.
This commit removes that array example from the table to discourage its
use.
Fixes#40147
PR Close#40334
In #37182 the in-memory-web-api module was moved into this repo.
Make links in the docs point to the new location of the in-memory-web-api.
Fixes#40190
PR Close#40203
PR #34934 switched the `getting-started` docs example from using the
index of a product in the `products` array to using the product's ID
property for indentifiying each product in the `ProductDetailsComponent`
component. However, some necessary changes in the example code and the
`start-routing.md` guide were missed in #34934, resulting in broken
instructions for the readers (see #40189).
This commit is essentially a follow-up to #34934, making the remaining
changes in the example code and the guide instructions.
Fixes#40189
PR Close#40197
This commit slightly refactors the code in the `get-product` docregion
of the `getting-started` docs example to make it easier to follow.
PR Close#40197
This commit does some minor clean-up in docregions of the
`getting-started` docs example. More specifically, it:
- Removes redundant docregion markers.
- Fixes whitespace inconsistencies.
- Adds `/* ... */` to indicate that there is more code before the end of
a docregion (in order to avoid confusion).
PR Close#40197
This commit aligns the code and style in the `getting-started-v0` docs
example with that of the `getting-started` example more closely (except
for the the parts that are intentionally different between the two).
PR Close#40197
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
"You should always include at least one generic family name in a font-family list,
since there's no guarantee that any given font is available. This lets the browser
select an acceptable fallback font when necessary."
PR Close#40254
With this change we change the `Boolean and enumerated options` to use kebab-case flags
as the camelCase variant are deprecated. We also remove the `enumerated option description`
as this is no longer correct and needed following the CLI MAN page update in #40038
PR Close#40224
Previously, the `SpyDirective` in the `lifecycle-hooks` docs example
would use a different ID when logging `onInit` and when logging
`onDestroy` for the same instance, making it impossible to associate the
two calls. This was not helpful and came in constrast with how the
directive was described in the corresponding guide and shown in the
accompanying `spy-directive.gif` image.
This commit fixes the logic of the `SpyDirective` class to use the same
ID for all log operations of an instance.
Partially addresses #40193.
PR Close#40208
Previously, the docregion code referenced a `nextId` variable that was
not shown in the code, which was confusing for the reader.
This commit makes the declaration of the `nextId` variable part of the
docregion, so it is clear to the reader where it comes from and how it
is initialized.
This commit also removes the `logIt()` helper method, which didn't seem
to add value and calls `logger.log()` directly instead.
PR Close#40208
This commit aligns the order of the links to the various sections of the
`lifecycle-hooks` docs example with the order in which the sections
appear in the template (which also coincides with the order in which
they are presented/discussed in the corresponding guide).
PR Close#40208
This commit updates the versions of Chrome and Firefox used in tests -
both with Bazel and without (via Puppeteer) - to the latest:
- Chrome v87
- Firefox v84
PR Close#40150
This commit updates `lighthouse` to version 7.0.0.
It also adds a `width` attribute to the `code-icon.svg` image on the
homepage, which was pointed out as missing in the Lighthouse report.
(Explicit `width`/`height` attributes on images help reduce the
[layout shift][1] of the page.)
[1]: https://web.dev/cls/
PR Close#40198
Angular has stopped to support browser that requires that CSS property.
All supported browsers support standard transition-timing-function CSS property
PR Close#40153
With this change we split the optimization and source map
configuration section section into two, improve it overall by adding
theoptions a table and add the new options
(`inlineCritical` and `minify`) that have been introduced in
CLI version 11.1
PR Close#40037
The `deploy-to-firebase.js` tests rely on git info retrieved from the
`angular/angular` repository (via `git ls-remote ...`).
Previously, different calls to `git ls-remote ...` could return
different values if a new commit was pushed or a new branch was created
during test execution, resulting in errors ([example CI failure][1]).
This commit makes the tests more stable by memoizing the result of
`git ls-remote ...` and returning the same result for subsequent calls
with the same arguments (even if meanwhile the remote has been updated).
[1]: https://circleci.com/gh/angular/angular/877626
PR Close#40088
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard CSS properties:
* @keyframes rule
* animation
PR Close#40084
Removed rule don't affect their component views.
The reason - the templates don't contain elements to which that rule is applied.
See https://angular.io/guide/view-encapsulation for more details
PR Close#40080
With this change we update the CLI docs template to seperate
the following the default and value types from the argument field.
This should make it clearer and more understandable
PR Close#40038
Removed rules don't affect their component views.
The reason - the templates don't contain elements to which that rules are applied.
See https://angular.io/guide/view-encapsulation for more details
PR Close#40069
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard CSS properties:
* border-radius
* border-bottom-left-radius
* border-bottom-right-radius
PR Close#40066
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard box-sizing CSS property
PR Close#40039
Currently the code sample displayed in this guide is not a valid.
The `trigger` is directly used in the `@Component` decorator.
It should instead be in the `animations` array of the `@Component` decorator.
PR Close#37262
The previous image referred to "Mr IQ". The example application
(and the content of the referring guide) actually uses "Dr IQ".
Closes#34823
PR Close#40022
The previous tutorial content referred to a `Routes` member of
`AppRoutingModule`, which is not correct. Instead there is a
`routes` variable that is passed to the `forRoot()` method when
configuring the `AppRoutingModule`.
Replaces #36583
PR Close#40023
1. In line 25 changed the word "components" to "component's".
2. In line 66 changed the phrase "you never refer to them" to "you should never refer to them".
3. Appended the paragraph containing the above phrase in a `div` with the class `alert is-helpful`.
PR Close#39246
Remove the statements where mentions the component in the `entryComponents`
array inside `NgModule` metadata.
This is not required since Angular version 9.
PR Close#39242
Aside from using the @input() decorator, we can use the @Attrbitute decorator too.
Of course, those two are different and support different causes.
I expected to see a working example on the Attribute Bindings section, but I didn't find one.
This PR depicts the usage of the Attribute decorator between two components
PR Close#38721
after angular version 8 string based lazy loading is not activated by default it is an opt in behaviour in which you have to add the lazy loaded routes in the tsconfig file for compilation. Aded a note too that it will be removed in version 11.
Fixes#35652
PR Close#35956
Since #39853, it is possible to deploy to multiple Firebase sites from a
single branch. In order to deploy to a site, we need to associate an
alias (`aio`) with a site. This is done via the `firebase target:apply`
command. However, when the command is called multiple times, it
associates the alias with many sites, which subsequently fails during
deployment ([example failure][1]), since the `firebase deploy` command
does not know what site to deploy to.
This commit fixes the deployment script by ensuring that any previous
association with the `aio` alias is cleared (via the
`firebase target:clear` command) before associating it with a new site.
[1]: https://circleci.com/gh/angular/angular/871020
PR Close#39948
Previously, test descriptions used `latest` to refer to the most
recent/highest version. This was ambiguous, because `latest` can also
refer to the stable version of a package (e.g. see `@latest` npm tag).
This commit replaces `latest` with `highest` (or `highest for major`) to
reduce ambiguity.
Discussed in:
https://github.com/angular/angular/pull/39853#discussion_r531730317
PR Close#39853
Currently there is an issue with redirecting `rc.angular.io` to
`angular.io` when there is no active RC. If a user has visited
`rc.angular.io` before and has a ServiceWorker registered for that
subdomain, they will never "see" the redirect to `angular.io`.
This commit fixes the problem by doing an additional deployment from the
stable branch to the `rc-angular-io-site` Firebase site when there is no
active RC. This additional deployment will ensure that:
1. Users will be temporarily redirected from `rc.angular.io` to
`angular.io`.
2. Users with a registered ServiceWorker (who don't see the redirect)
will have their ServiceWorker unregistered on the next visit.
3. The content on both sites is identical.
See #39760 for more details on the problem and the solution.
NOTE:
As mentioned in #39760, for this fix to take affect, we need to remove
the redirect from `rc.angular.io` to `angular.io` in the Firebase
console for site `rc-angular-io-site`.
Fixes#39760
PR Close#39853
Previously, a branch would be deployed as `archive` even if it had a
major version that was equal/higher than that of the stable branch (as
long as it was not the RC branch - i.e. not the most recent minor
branch). For example, with `11.0.x` as the stable branch and `12.0.x`
as the RC branch, `11.1.x` would be deployed as archive.
Theoretically, we should never find ourselves in such a situation.
Typically, there will only be at most one minor branch most recent than
the stable one (and that branch will be the RC branch). However, it
is possible under unusual circumstances.
This commit adds additional checks to guard against this problem. It
also refactors the code in preparation of fixing an issue with
`rc.angular.io` redirects in the presence of a ServiceWorker, which will
require identifying whether there is an active RC version or not.
See #39760 for more details.
PR Close#39853
Previously, the latest commit for branch may be computed multiple times
in the `deploy-to-firebase.js` tests.
This commit avoids the unnecessary re-computations by computing the
latest commits for the necessary branches at the beginning and using the
computed values throughout the tests.
PR Close#39853
Previously, the `deploy-to-firebase.js` script would only perform one
deployment operation on each run.
This commit adds support for performing multiple deployment operations.
NOTE:
In a subsequent commit, this will be leveraged fix an issue with
`rc.angular.io` redirects in the presence of a ServiceWorker by
deploying the same artifacts to multiple Firebase projects/sites.
See #39760 for more details.
PR Close#39853
Previously, the `deploy()` function in `deploy-to-firebase.js` would
also perform other operations (beyond deploying), such as building the
app, checking the generated payload size, testing the PWA score of the
deployed app.
This commit decouples these operations, so that deploying can be
performed independently.
NOTE:
In a subsequent commit, this will be leveraged fix an issue with
`rc.angular.io` redirects in the presence of a ServiceWorker by
deploying the same artifacts to multiple Firebase projects/sites.
See #39760 for more details.
PR Close#39853
Since we turned off the Selenium Promise Manager in #39600, the AIO e2e
tests have started flaking on CI. After trying out several things, the
only change that seems to eliminate the flakiness is turning the
Selenium Promise Manager back on (see #39873 for more details).
This commit turns the Selenium Project Manager on to get rid of the
flakiness.
Fixes#39872
PR Close#39905
This commit edits the copy on the interpolation page.
Tightens language, clarifies headers, and streamlines text.
There are no content or code changes.
PR Close#38687
DEPRECATION:
Mark the {[key: string]: any} type for the options property of the FormBuilder.group method as deprecated.
Using AbstractControlOptions gives the same functionality and is type-safe.
PR Close#39769
This adds angulararchitects.io to the tranings section in the
resources.json file for angular.io. It also adds a description
for angulararchitects.io.
PR Close#37139
The article previously referred was out of date. Most of the article content
was already duplicated here, or described how to generate multiple bundles. But
creating multiple bundles manually is now obsolete and the parameter `--localize`
should be preferred instead, because it is much faster.
This commit integrate the only interesting part left, relating to webserver configuration.
Co-authored-by: David Shevitz <dshevitz@google.com>
PR Close#36553
`en-US` makes it link to the English (US) version.
This patch removes this and let's MDN auto-redirect to the user's preferred/selected language/website locale.
PR Close#39842
This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).
PR Close#39818
This commit removes some code that is no longer necessary for the
`upgrade-module` docs example e2e tests to run. It used to be necessary
in earlier version of Protractor but not any more.
PR Close#39818
Previously, the tests made no meaningful assertions. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.
This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.
PR Close#39818
Previously, the test made no meaningful assertion. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.
This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.
PR Close#39818
Addresses documentation gaps as reported in #35078. The documentation only
contained a single statement on foreign function/value compatibility
without going into detail on what this means. This commit adds several
examples to the Ivy compatibility guide and explains why Ivy behaves differently
compared to VE.
PR Close#36092
Archives most of the content in the template expression operators doc.
The pipes precedence section that was originally in
template expression operators moves into the pipes doc
with some editing and an addition of a ternary example.
PR Close#39170
Edits copy and removes tokens and treeshaking
sections to reduce content duplication and keep
info focused. Moves provideParent() from di-navtree
to di providers.
PR Close#39403
While JavaScript does support implicit returns, it seems TypeScript will not infer the function return type from
the implicit return of the last statement (at least not in TS 3.4.3). So, when the `return` is missing from the
`get` function the implicit type of the function is `void`. So for the `get` function to be usable it needs to an
explicit return.
PR Close#31434
Occasionally, the SW would end up in a broken state where some of the
eagerly cached resources of an older version were available in the local
cache, but others (such as lazy-loaded bundles) were not. This would
leave the app in a broken state and a blank screen would be displayed.
See #28114 for a more detailed discussion.
This commit takes advantage of the newly introduced (in v11)
[SwUpdate#unrecoverable][1] API to detect these bad states and recover
by doing a full page reload whenever an [UnrecoverableStateEvent][2] is
emitted.
Partially addresses #28114.
NOTE:
Currently, `SwUpdate.unrecoverable` only works if the app has already
bootstrapped; i.e. if only lazy-loaded bundles have been purged from the
cache.
That should be fine in practice, since the cache entries are removed in
least-recently-used order. Thus the eagerly loaded bundles will be the
last to be removed from the cache (which rarely happens in practice).
[1]: https://v11.angular.io/api/service-worker/SwUpdate#unrecoverable
[2]: https://v11.angular.io/api/service-worker/UnrecoverableStateEvent
PR Close#39651
Previously, the `LocationService` depended on the `SwUpdatesService`.
This felt backwards, since `LocationService` is a more low-level and
basic service and should not be depending on a service for a
higher-level, specific feature (ServiceWorkers).
This commit inverses the relation, making `SwUpdatesService` depend on
`LocationService` instead.
PR Close#39651
Since we have a `MockLogger` class in `src/testing/`, there is no need
to create a new `MockLogger` class for the `SwUpdatesService` unit
tests.
This commit switches to using the `MockLogger` class from
`src/testing/`.
PR Close#39651
Removes duplicate info, moves document into conceptual
reference section, but doesn't edit remaining content.
Groups two dependency injection documents together in
one expandable nav section.
PR Close#39544
This commit fixes a confusing description of the `strictTemplates` flag.
> When `true`, enables strict template type checking in Angular version 9.
This seems to imply that the flag is only available in one version.
Strict template type checking is available in version 9 **and above**.
PR Close#39745
This commit downgrades `karma` to version 5.1.1, because of a regression
in version 5.2.0: karma-runner/karma#3560
It has been fixed with karma-runner/karma@05dc288016 on
master, but the fix is not included in the latest release (v5.2.3).
PR Close#39600
This commit updates `@angular/*` and `@angular/cli` (and related
packages) to version 11.0.0-rc.2. Apart from the automatic migrations,
this commit also tries to align `aio/` with new apps generated by the
latest CLI. (See [here][1] for a diff between a v10.1.3 and a
v11.0.0-rc.2 CLI app.)
[1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3...11.0.0-rc.2
PR Close#39600
Previously we hand coded the list of previous major versions
that are displayed in the left navigation.
Now these are generated from the tags in GitHub.
Closes#39688
PR Close#39689
ngNonBindable documentation was not present, on docs site added documentation for ngNonBindable. With this template primitive, Angular won't
evaluate expressions in elements.
Fixes#28577Fixes#19497
PR Close#36560
Since WebStorm 2019.1, all of Angular Compiler validations has been implemented
as inspections, which has some additional benefits of being able to provide some
basic quick fixes like adding missing selector property, or something as neat as
auto-module import.
See https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009914880
Signed-off-by: Adrien Crivelli <adrien.crivelli@gmail.com>
PR Close#39637
In #39470, the `deploy-to-firebase.sh` script (used to deploy AIO to
Firebase when building an upstream branch), was replaced by an
equivalent JS script. In this new `deploy-to-firebase.js` script, we
were overly aggressive with suppressing command output, which made it
hard to investigate failures ([example failing CI job][1]).
This commit updates the `deploy-to-firebase.js` script to capture
command output as usual in the CI job logs. This makes the output
similar to the one generated by the old [deploy-to-firebase.sh][2]
script ([example CI logs][3]).
One concern with capturing command output is having the value of a
secret environment variables leaked in the logs. This is not the case
here, since:
1. The secret env vars are not printed from the commands that use them.
2. CircleCI will [mask the values of secret env vars][4] in the output.
As an extra precaution (although not strictly necessary), we run `yarn`
with the `--silent` option, which avoid echoing the executed yarn
commands.
[1]: https://circleci.com/gh/angular/angular/849310
[2]: https://github.com/angular/angular/blob/3b0b7d22109c79b4dceb/aio/scripts/deploy-to-firebase.sh
[3]: https://circleci.com/gh/angular/angular/848109
[4]: https://circleci.com/docs/2.0/env-vars/#secrets-masking
PR Close#39596
The commit updates the AIO deployment script to also print the commit
SHA. This makes it easier to check whether a version has been
successfully deployed, by comparing the commit SHA from the CI job with
the SHA in the version string in the footer of the AIO app.
PR Close#39596
Previously, the documentation for each major Angular version was hosted
on each own Firebase project. This required creating a new project for
each major release and increased the administrative/maintenance cost.
Now that Firebase supports hosting [multiple websites][1] as part of the
same project, we are switching to deploying all major versions to sites
created on `angular-io` project.
This is part of the work needed to prepare angular.io for our
[new versioning/branching process][2] (also tracked in #39366).
[1]: https://firebase.google.com/docs/hosting/multisites
[2]: https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU
PR Close#39470
This commit breaks up the code in `deploy-to-firebase.js` script, that
we use for deploying angular.io to production, to smaller functions
(instead of a monolithic block). This makes the script easier to
maintain and also makes testing individual operations easier.
The commit also updates the `deploy-to-firebase.spec.js` spec file to
take advantage of the standalone functions to speed up testing by
calling the corresponding function instead of having to spawn a new
process and run the `deploy-to-firebase.js` script with the `--dry-run`
flag.
NOTE: Before updating the tests, I verified that the updated
`deploy-to-firebase.js` script passed the old tests.
PR Close#39470
Different deployment modes (such as `archive` and `next`) are identified
by the different colors used in prominent elements of the page, such as
the topbar and the footer.
Previously, the necessary styles for creating such a deployment mode
"theme" were duplicated for each mode.
This commit simplifies the creation/modification of a deployment mode
theme by introducing a Sass mixin that generates the necessary styles
(when provided with necessary theme colors).
PR Close#39470
Previously, the `deploy-to-firebase.js` script and the accompanying
`deploy-to-firebase.spec.js` spec file were using the `origin` remote
alias in certain commands. This works fine on CI, where `origin` points
to the `angular/angular` GitHub repo, but might not work locally.
This commit ensures that the correct remote is used by explicitly
specifying it by the URL, thus ensuring that the tests will behave
identically on CI and locally.
PR Close#39470
This commit switches the `deploy-to-firebase.sh` script, that we use for
deploying angular.io to production, from Bash to JavaScript. This makes
the script easier to maintain.
For the same reasons, it also switches the `deploy-to-firebase.test.sh`
script, that we use for testing the `deploy-to-firebase` script, from
Bash to JavaScript (using jasmine as the test runner).
Finally, this commit also updates ShellJS to the latest version to get
better error messages (including the actual error) when `exec()` fails.
NOTE: Before switching the test script to JS, I verified that the new
`deploy-to-firebase.js` script passed the tests with the old
`deploy-to-firebase.test.sh` script.
PR Close#39470
- Improves JSON formatting
- Add reference to font optimization
- Removes `="true"` from boolean command line args.
These are redundant and it can be confusing to why
boolean values need to be provided via a CLI.
PR Close#39427
The browser being launched needs to match the custom launcher name.
Otherwise Karma would still trigger the original Chrome executable without the flags.
PR Close#39480
Fixes#31186. This commit adds more context about the behavior
of template reference variables in nested templates and moves
doc into concepts section.
PR Close#31195
The ViewEngine message extraction generated a variety of legacy formats
for extracted message ids. These formats have a number of issues related
to whitespace handling and reliance upon information inside the original
HTML of a template. The new message format is more resilient, and can be
generated directly from calls to `$localize`. This allows messages in
application code to have the same id as identical messages in templates.
As a first step in migrating projects away from the legacy id format
for i18n messages, newly generated projects now turn off the legacy ids.
See https://github.com/angular/angular-cli/pull/19232.
This commit updates the documentation to include information about this
option, since it is now publicly exposed in new CLI projects.
PR Close#39453
adds RuntimeError and code enum to improve debugging experience
refactor ExpressionChangedAfterItHasBeenCheckedError to code NG0100
refactor CyclicDependency to code NG0200
refactor No Provider to code NG0201
refactor MultipleComponentsMatch to code NG0300
refactor ExportNotFound to code NG0301
refactor PipeNotFound to code NG0302
refactor BindingNotKnown to code NG0303
refactor NotKnownElement to code NG0304
PR Close#39188
The `generateKeywords` dgeni processor automatically generates keywords
for each document by extracting words from each string property of a
`doc` object.
This commit adds `basePath` to the list of ignored properties, so that
it is _not_ considered when generating keywords. `basePath` mostly
contains the path to some root directory (such as
`/home/circleci/ng/packages`) and as such it does not contain useful
keywords.
For example, searching for `circleci` will match all API docs, because
it happens to be in the `basePath`:
https://v10.angular.io/?search=circleci
PR Close#39409
group together similar error messages as part of error code efforts
ProviderNotFound & NodeInjector grouped into throwProviderNotFoundError
Cyclic dependency errors grouped into throwCyclicDependencyError
PR Close#39251