Commit graph

20681 commits

Author SHA1 Message Date
Renovate Bot
2ad2c26f16 build: update diff to version 5.0.0 (#41684)
PR Close #41684
2021-04-19 08:27:13 -07:00
George Kalpakas
e5af4e9f58 docs: add missing backticks in schematics-for-libraries.md (#41681)
PR Close #41681
2021-04-19 08:26:38 -07:00
George Kalpakas
010e6d4341 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:04 -07:00
George Kalpakas
a5cadd7b6f 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:04 -07:00
Alan Agius
4e7c2c65fa ci: disable automatic updates of rollup (#41672)
Rollup updates cannot be automated as these can cause golden files to be changed such as with this PR https://github.com/angular/angular/pull/41671
PR Close #41672
2021-04-19 08:25:29 -07:00
Renovate Bot
c80323a45a build: update graceful-fs to version 4.2.6 (#41668)
PR Close #41668
2021-04-19 08:25:02 -07:00
Renovate Bot
a1ed4f8efb build: update glob to version 7.1.6 (#41667)
PR Close #41667
2021-04-19 08:24:27 -07:00
Renovate Bot
db55842610 build: update dependency-graph to version 0.11.0 (#41665)
PR Close #41665
2021-04-19 08:23:52 -07:00
Kirk Larkin
52053d0a97 docs: correct appUnless desc re true/false (#41656)
PR Close #41656
2021-04-19 08:23:13 -07:00
George Kalpakas
3efd5ae403 docs: fix broken links to CLI wiki in the "Component styles" guide (#41516)
Fixes #41362

PR Close #41516
2021-04-19 08:22:23 -07:00
va-stefanek
620aaf4d28 docs: change link to the styles configuration guide (#41516)
PR Close #41516
2021-04-19 08:22:23 -07:00
Eduard Bondarenko
88dd08c020 docs: move lazy loading section to the best practices section (#41378)
PR Close #41378
2021-04-16 17:27:02 -07:00
Gérôme Grignon
bc3a37ce0f docs: add mention to CSS styles for hero-detail (#41214)
PR Close #41214
2021-04-16 17:26:31 -07:00
sovtara
43bd580a38 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:41 -07:00
Dharmen Shah
b24bb2ae71 docs: separate steps for github actions (#41594)
PR Close #41594
2021-04-16 17:25:04 -07:00
Dharmen Shah
0280150144 docs: add github actions in CI story (#41594)
PR Close #41594
2021-04-16 17:25:04 -07:00
Joey Perrott
e251ece18d 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:50 -07:00
Paul Gschwendtner
ab257b3701 fix(compiler): non-literal inline templates incorrectly processed in partial compilation (#41583)
Currently if a component defines a template inline, but not through a
string literal, the partial compilation references the template expression
as is. This is problematic because the component declaration can no longer
be processed by the linker later as there is no static interpretation. e.g.

```js
const myTemplate = `...`;

TestCmp.ɵcmp = i0.ɵɵngDeclareComponent({
  version: "0.0.0-PLACEHOLDER",
  type: TestCmp,
  selector: "test-cmp",
  ngImport: i0,
  template: myTemplate,
  isInline: true
});
```

To fix this, we use the the resolved template in such cases so that
the linker can process the template/component declaration as expected.

PR Close #41583
2021-04-16 09:33:05 -07:00
Paul Gschwendtner
4dc4be61ed refactor(compiler): clean up template information passed for partial compilation (#41583)
With the introduction of the partial compilation, the Angular compiler's
existing `parseTemplate` method has been extended to pass through multiple
properties purely in favor of the partial compilation.

e.g. the `parseTemplate` function now accepts an "option" called `isInline`.
This option is just passed through and returned as part of the `ParsedTemplate`.

This is not ideal because the `parseTemplate` function doesn't care
whether the specified template was inline or not. This commit cleans
up the `parseTemplate` compiler function so that nothing needed only
for the partial compilation is added to it.

We introduce a new struct for additional template information that
is specific to the generation of the `declareComponent` function. With
that change, we can simplify the component decorator handler and keep
logic more local.

PR Close #41583
2021-04-16 09:33:05 -07:00
Alan Agius
d6060539c0 test(docs-infra): run all example tests in IVY runtime (#41638) (#41662)
We have several tests which use system.js, this means that we cannot use NGCC with `--create-ivy-entry-points`, also we need to process UMD bundles since our system.js configurations use UMDs.

PR Close #41638

(cherry picked from commit d3edc5c0f5)

PR Close #41662
2021-04-16 09:26:18 -07:00
Alan Agius
542842580f build(docs-infra): update lite-server to fix errors on OSX (#41638) (#41662)
```
$ lite-server -c bs-config.aot.json
$ ngc -p tsconfig-aot.json && rollup -c rollup-config.js
/Users/xxxx/git/angular/aio/tools/examples/shared/node_modules/browser-sync/node_modules/chokidar/lib/fsevents-handler.js:26
  return (new fsevents(path)).on('fsevent', callback).start();
          ^
TypeError: fsevents is not a constructor
    at createFSEventsInstance (/Users/xxxx/git/angular/aio/tools/examples/shared/node_modules/browser-sync/node_modules/chokidar/lib/fsevents-handler.js:26:11)
    at setFSEventsListener (/Users/xxxx/git/angular/aio/tools/examples/shared/node_modules/browser-sync/node_modules/chokidar/lib/fsevents-handler.js:80:16)
    at FSWatcher.FsEventsHandler._watchWithFsEvents (/Users/xxxx/git/angular/aio/tools/examples/shared/node_modules/browser-sync/node_modules/chokidar/lib/fsevents-handler.js:244:16)
    at FSWatcher.<anonymous> (/Users/xxxx/git/angular/aio/tools/examples/shared/node_modules/browser-sync/node_modules/chokidar/lib/fsevents-handler.js:378:25)
    at LOOP (fs.js:1752:14)
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
completed: yarn serve:aot
```

PR Close #41638

(cherry picked from commit e920eac026)

PR Close #41662
2021-04-16 09:26:18 -07:00
Alan Agius
a1ff47c738 build(docs-infra): remove view engine related code (#41638) (#41662)
This is a pre-update to Angular 12 cleanup.

This is not needed for version 12, since applications cannot be built using View Engine.

PR Close #41638

(cherry picked from commit 70425539f7)

PR Close #41662
2021-04-16 09:26:18 -07:00
Alan Agius
13733161bc ci: remove AIO ViewEngine tests (#41638) (#41662)
With Angular CLI 12, it is not possible to build ViewEngine applications.

PR Close #41638

(cherry picked from commit 89529bca0e)

PR Close #41662
2021-04-16 09:26:18 -07:00
Zach Arend
8b2b5ef903 fix(compiler-cli): autocomplete literal types in templates. (#41456) (#41645)
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 attempt is in
1d12c50f63 and it was reverted in 75f881e078.

PR Close #41645
2021-04-16 08:54:28 -07:00
Renovate Bot
2894602150 build: update bazel packages (#41654)
PR Close #41654
2021-04-16 08:53:55 -07:00
Alan Agius
bda04cae71 ci: disable dependency updates of angular-mocks packages (#41650)
With this change we configure Renote Bot to ignore angular-mocks packages.

Similar to #41642 but for `angular-mocks` packages.

PR Close #41650
2021-04-16 08:53:16 -07:00
Renovate Bot
d1447d43e7 build: update angular packages (#41633)
PR Close #41633
2021-04-16 08:52:39 -07:00
Julien Marcou
16f41cd948 build: update TypeScript to v4.2.4 (#41620)
Update TypeScript to be consistent across different packages.

PR Close #41620
2021-04-16 08:51:55 -07:00
Teri Glover
c85710da4f docs: edits to remove jargon and abbreviations (#41530)
PR Close #41530
2021-04-15 16:00:56 -07:00
Teri Glover
9684cd36b1 docs: update copy in schematics.md (#41521)
PR Close #41521
2021-04-15 14:38:09 -07:00
Alan Agius
d799e7fa0c test: enable namedChunks in cli-hello-world-lazy integration test (#41636)
This ensure that the name of the lazy chunk remains the same during updates. When not using `namedChunks` the id of the bundle is set to "deterministic", which means that the bundle name changes whenever the bundle is updated.

PR Close #41636
2021-04-15 14:37:27 -07:00
Alan Agius
7a0c69f542 build: update angular cli packages to version 12.0.0-next.9 (#41636)
This enables us to remove the workaround that we needed to consume `@angular-devkit/build-angular` from the snapshot builds.

PR Close #41636
2021-04-15 14:37:27 -07:00
Alan Agius
df465c624d ci: disable dependency updates of Angular JS packages (#41642)
With this change we configure Renote Bot to ignore Angular JS packages.

Example of unwanted PR: https://github.com/angular/angular/pull/41639/files

PR Close #41642
2021-04-15 12:48:18 -07:00
Kristiyan Kostadinov
c0f5ba3d36 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:08 -07:00
jeripeierSBB
dad42c8cd6 fix(animations): allow animations on elements in the shadow DOM (#40134)
When determining whether to run an animation, the `TransitionAnimationPlayer`
checks to see if a DOM element is attached to the document. This is done by
checking to see if the element is "contained" by the document body node.

Previously, if the element was inside a shadow DOM, the engine would
determine that the element was not attached, even if the shadow DOM's
host was attached to the document. This commit updates the `containsElement()`
method on `AnimationDriver` implementations to also include shadow DOM
elements as being contained if their shadow host element is contained.

Further, when using CSS keyframes to trigger animations, the styling
was always added to the `head` element of the document, even for
animations on elements within a shadow DOM. This meant that those
elements never receive those styles and the animation would not run.
This commit updates the insertion of these styles so that they are added,
to the element's "root node", which is the nearest shadow DOM host, or the
`head` of the document if the element is not in a shadow DOM.

Closes #25672

PR Close #40134
2021-04-15 12:45:53 -07:00
Dmitrij Kuba
a4ff071e3f 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:
1d12c50f63/packages/router/src/operators/activate_routes.ts (L170-L172)

Fixes #23162

PR Close #30263
2021-04-15 11:33:02 -07:00
Renovate Bot
91ea316dc2 build: update @babel/cli to version 7.13.14 (#41634)
PR Close #41634
2021-04-15 11:29:59 -07:00
Joey Perrott
115d04c0fd refactor(dev-infra): move getRepoBaseDir() to GitClient (#41527)
As `getRepoBaseDir()` relies on git, it should be a method on `GitClient` for retrieval
rather than its own utility outside of the common GitClient used for all git ineractions.

PR Close #41527
2021-04-15 11:28:12 -07:00
Alan Agius
9438d48b89 refactor: update $schema and id keywords (#41574)
In Angular CLI version 12, JSON Schema `draft-04` will no longer be supported. Therefore `id` will need to be updated to `$id`.

- We replace id with $id, this no longer valid in draft-07.
- Replace all $schemas to http://json-schema.org/draft-07/schema, this is needed to "pin" the schema to draft-07.

More information about this draft can be found https://json-schema.org/draft-07/json-schema-release-notes.html

PR Close #41574
2021-04-14 18:50:32 -07:00
Martin Sikora
c6e952647d 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:28 -07:00
Michael Hladky
e655846627 docs: add rx-angular to resources.json (#39291)
PR Close #39291
2021-04-14 15:50:47 -07:00
Alan Agius
ba110791b5 docs: remove entryComponent from deprecated list (#41408)
This has been removed in https://github.com/angular/angular-cli/pull/20402

PR Close #41408
2021-04-14 15:49:33 -07:00
Kristiyan Kostadinov
9a3b82f19d perf(compiler): reduce amount of generated code for safe accesses and nullish coalescing (#41563)
This is follow-up from #41437 and it reduces the amount of code we generate for safe property accesses (`a?.b`) and nullish coalescing (`a ?? b`) by:
1. Reusing variables in nested nullish coalescing expressions.
2. Not initializing temporary variables to `null`. The way our code is generated means that the value will always be overwritten before we compare against it so the initializer didn't really matter.

Fixes #41491.

PR Close #41563
2021-04-14 15:48:22 -07:00
Andrew Scott
1179dc8cb3 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:10 -07:00
Charles Lyding
a5fe8b9589 fix(compiler-cli): do not error with prepocessing if component has no inline styles (#41602)
The asynchronous preprocessing check was not accounting for components that did not have any inline styles. In that case, the cache did not have an entry which then allowed the asynchronous check to run and fail the compilation. The caching during the asynchronous analysis phase now handles components without inline styles.

PR Close #41602
2021-04-14 15:46:22 -07:00
Joey Perrott
afed386f67 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:57 -07:00
Renovate Bot
16d6c9643c build: update typescript to version 4.2.4 (#41618)
PR Close #41618
2021-04-14 15:44:18 -07:00
Alan Agius
e866a4c38d refactor: format renovate configuration with 2 spaces (#41619)
Format renovate configuration file with 2 spaces

PR Close #41619
2021-04-14 15:43:14 -07:00
Alan Agius
fb436c5294 ci: configure Renovate to disable updates for dependencies versioned 0.0.0-PLACEHOLDER (#41619)
With this change we disable Renovate from updating `@angular/*` peerDependencies which are versioned `0.0.0-PLACEHOLDER`.

Example PR: https://github.com/angular/angular/pull/41615

PR Close #41619
2021-04-14 15:43:14 -07:00
Zach Arend
886bf37cd1
release: cut the v12.0.0-next.9 release (#41628) 2021-04-14 13:10:47 -07:00