Commit Graph

21213 Commits

Author SHA1 Message Date
Pete Bacon Darwin d59f2b0d0c refactor(core): remove unnecessary cast (#41960)
The `as any` is no longer needed since `providedIn` can accept `'any'`.

PR Close #41960
2021-05-10 10:28:31 -04:00
Pete Bacon Darwin adc732decb refactor(docs-infra): remove unused CSS rule (#41960)
The `.ngmodule-iist` is no longer used so can be removed.

PR Close #41960
2021-05-10 10:28:30 -04:00
Pete Bacon Darwin 71f37c9d9c build(docs-infra): add NgModules references to provided injectables (#41960)
Parse the `providers` property of each NgModule doc and add this doc to
the `ngModules` property of each provided injectable.

PR Close #41960
2021-05-10 10:28:30 -04:00
Pete Bacon Darwin 85f5cb45d2 build(docs-infra): associate `providedIn` injectables with their NgModule (#41960)
Such injectables were not appearing in the providers lists of their NgModule.
This commit updates the doc-gen to support associating these automatically.
Further, it also allows developers to mark other injectables that are provided
in an NgModule with a reference to the NgModule where they are provided.

The commit also does a refactoring of the `processNgModuleDocs` dgeni
processor code, to make it easier to maintain.

Fixes #41203

PR Close #41960
2021-05-10 10:28:30 -04:00
Andrew J Asche 23f6b76d1a fix(docs-infra): update glossary to include the term template-input-variable (#41632)
Template input variables are now described in the glossary.

PR Close #41632
2021-05-10 10:27:55 -04:00
Julien Marcou 744bd2b64f refactor(core): optimize calls to `split` and `slice` while computing version parts (#41208)
Reduce the number of calls made to `split` and `slice` while computing version parts by deconstructing the result.

PR Close #41208
2021-05-10 10:26:34 -04:00
Julien Marcou 562a782114 docs: fix package name in version.ts files in different packages (#41208)
PR Close #41208
2021-05-10 10:26:34 -04:00
Alex Rickabaugh cd252b99fe fix(compiler-cli): use '' for the source map URL of indirect templates (#41973)
Indirect templates are templates produced by a non-literal expression value
of the `template` field in `@Component`. The compiler can statically
determine the template string, but there is not guaranteed to be a physical
file which contains the bytes of the template string. For example, the
template string may be computed by a concatenation expression: 'a' + 'b'.

Previously, the compiler would use the TS file path as the source map path
for indirect templates. This is incorrect, however, and breaks source
mapping for such templates, since the offsets within the template string do
not correspond to bytes of the TS file.

This commit returns the compiler to its old behavior for indirect templates,
which is to use `''` as the source map URL for such templates.

Fixes #40854

PR Close #41973
2021-05-07 15:46:20 -04:00
Paul Gschwendtner 2843f15e8c fix(dev-infra): merge tool should ensure that token has `workflow` oauth scope (#41989)
Currently if a PR modifies any file that configures a Github action
(e.g. a workflow file), the caretaker might face an error when merging
such PR:

```
! [remote rejected]       merge_pr_target_11.2.x -> 11.2.x (refusing to allow a Personal Access Token to create or update workflow
```

This happens because Github requires the token being used for the
push operation to have the `workflow` scope set. This is a special
scope added by Github to ensure that no changes can be made on
upstream branches that might expose the `GITHUB_TOKEN` environment
variable, which is available for push builds and could cause the
token being leaked.

With this commit we enforce that the caretaker adds the workflow
scope to their github token. Since PRs can only be merged if reviewed
thoroughly, it's acceptable to allow workflow file changes being
merged through the merge tool by the caretaker (especially since we
also allow CircleCI config files being merged with the default
`repo`/`public_repo` scope).

PR Close #41989
2021-05-07 14:10:39 -04:00
Pete Bacon Darwin 3a48c0739d build(docs-infra): ensure that terminal code snippets render correctly (#41986)
After the changes to the `lang-none` styling in #41335, code snippets marked with

```
language="none" class="code-shell"
```

were being styled with the same foreground and background colours.

It turns out that most of these ought to be marked `language="sh"`
in which case the `code-shell` style became redundant and has been
removed.

Fixes #41984

PR Close #41986
2021-05-07 13:11:04 -04:00
Ajit Singh 4bc3cf216d feat(common): add URLSearchParams to request body (#37852)
URLSearch params are by default supported in the browser but are not supported by angular/http package added support for URLSearchParams

Fixes #36317

PR Close #37852
2021-05-07 10:45:02 -04:00
Joey Perrott e1c5cea2e7 fix(dev-infra): set the default LogLevel of GitClient logging to DEBUG (#41899)
Previously by default GitClient would log the commands it was executing at the
INFO level. This change moves the default level of this logging to DEBUG, while
still allowing callers of the methods to set the log level back to INFO.

PR Close #41899
2021-05-07 10:15:20 -04:00
profanis 5cf429d64e docs: change the documentation of creating-libraries by providing material links (#41982)
while reading the documentation, I noticed that there were
references in the material's documentation. Since the
links were absent, I had to google the terms and
continue my study. I find it easier for the reader not
to be distracted by googling, but just clicking
and following the suggested links

PR Close #41982
2021-05-07 10:11:08 -04:00
mgechev cb418bd696 ci: introduce action implementing feature request prioritization process (#41975)
Enable a GitHub action that implements our new feature request
[process](ce8e011a9f/docs/GITHUB_PROCESS.md (feature-request-process)).

As a prerequisite, we need to create the following labels:
- `in backlog`
- `votes required`
- `under consideration`
- `insufficient votes`

The bot will also use the existing `feature` label to identify feature
requests.

With its current configuration, we need to kick the process off
manually. We currently also have a limit, meaning the bot will process
only 50 feature requests before it exits. Additionally, now the bot will
not close issues, it'll just comment on them and if they have an
insufficient number of votes, the bot will label them with `insufficient
votes`.

On the next iteration, we can:
- Expand the limit from 50 to infinity (removing the option from the
yml file)
- Set a cron configuration to kick off the bot automatically
- Enable autoclose by setting the `close-when-no-sufficient-votes` to
`true`

PR Close #41975
2021-05-07 10:09:44 -04:00
mgechev 544e6a5ca1 fix(core): invoke profiler around ngOnDestroy lifecycle hooks (#41969)
Invoke the profiler for `ngOnDestroy` lifecycle hooks for services,
components, directives, and pipes.

PR Close #41969
2021-05-07 10:04:21 -04:00
Renovate Bot 3927e2529a build: update angular (#41955)
PR Close #41955
2021-05-07 10:03:36 -04:00
Joey Perrott e29eb8abfb docs: reword a few phrases in the GITHUB_PROCESS.md doc (#41977)
Reword a few things in the explanation around our `Feature request process` to make
the process a little clearer.

PR Close #41977
2021-05-06 18:11:04 -07:00
Andrew Scott 1be5d659a5 fix(language-service): fully de-duplicate reference and rename results (#40523)
Rather than de-duplicating results as we build them, a final de-duplication can be done at the end.
This way, there's no forgetting to de-duplicate results at some level.

Prior to this commit, results from template locations that mapped to
multiple different typescript locations would not be de-duplicated (e.g.
an input binding that is bound to two separate directives).

PR Close #40523
2021-05-06 17:54:14 -04:00
Andrew Scott 459af57a31 refactor(compiler-cli): Adjust generated TCB when checkTypeOfPipes is false (#40523)
When `checkTypeOfPipes` is set to `false`, our TCB currently generates
the a statement like the following when pipes appear in the template:
`(_pipe1 as any).transform(args)`

This did enable us to get _some_ information from the Language Service
about pipes in this case because we still had access to the pipe
instance. However, because it is immediately cast to `any`, we cannot
get type information about the transform access. That means actions like "go to
definition", "find references", "quick info", etc. will return
incomplete information or fail altogether.

Instead, this commit changes the TCB to generate `(_pipe1.transform as any)(args)`.
This gives us the ability to get complete information for the LS
operations listed above.

PR Close #40523
2021-05-06 17:54:14 -04:00
Andrew Scott a86ca4fe04 feat(language-service): Enable renaming of pipes (#40523)
This commit updates the logic in the LS renaming to handle renaming of
pipes, both from the name expression in the pipe metadata as well as
from the template.

The approach here is to introduce a new concept for renaming: an
"indirect" rename. In this type of rename, we find rename locations
in with the native TS Language Service using a different node than the
one we are renaming. Using pipes as an example, if we want to rename the
pipe name from the string literal expression, we use the transform
method to find rename locations rather than the string literal itself
(which will not return any results because it's just a string).

So the general approach is:
* Determine the details about the requested rename location, i.e. the
  targeted template node and symbol for a template rename, or the TS
  node for a rename outside a template.
* Using the details of the location, determine if the node is attempting
  to rename something that is an indirect rename (pipes, selectors,
  bindings). Other renames are considered "direct" and we use whatever
  results the native TSLS returns for the rename locations.
* In the case of indirect renames, we throw out results that do not
  appear in the templates (in this case, the shim files). These results will be
  for the "indirect" rename that we don't want to touch, but are only
  using to find template results.
* Create an additional rename result for the string literal expression
  that is used for the input/output alias, the pipe name, or the
  selector.

 Note that renaming is moving towards being much more accurate in its
 results than "find references". When the approach for renaming
 stabilizes, we may want to then port the changes back to being shared
 with the approach for retrieving references.

PR Close #40523
2021-05-06 17:54:13 -04:00
Andrew Scott c1bcbeb324 refactor(language-service): Separate reference and rename capabilities (#40523)
This commit separates the reference and rename functions into separate builders so it's easier
to locate functions specific to each

PR Close #40523
2021-05-06 17:54:13 -04:00
Andrew Scott 9bc8b343ea refactor(language-service): extract utility functions for reference and rename (#40523)
This commit extracts utility functions and separates them from the core logic of the
references and rename builder.

PR Close #40523
2021-05-06 17:54:13 -04:00
Andrew Scott b8bd3c3dd2 refactor(language-service): Update file names for references and rename (#40523)
This commit renames the files for the references and rename functionality to indicate
that they deal with _both_ references and rename, not just references.

PR Close #40523
2021-05-06 17:54:13 -04:00
mgechev ce8e011a9f docs: use relative path for the feature request process diagram (#41970)
Center the diagram and use a relative path to make sure we don't break a branch if we restructure `master`/`main`.

PR Close #41970
2021-05-06 17:35:33 -04:00
Georgii Dolzhykov 209768a570 refactor(compiler): stricter types for HTML AST (#41360)
A Node can only be an instance of one of the six classes.
This relation can be accurately expressed using a union type.

PR Close #41360
2021-05-06 17:34:52 -04:00
Joey Perrott 4d7294d9f7 feat(dev-infra): include release notes in Github release entries when publishing (#41964)
Include the release notes entry for the release in the release created on Github.

PR Close #41964
2021-05-06 15:45:48 -04:00
va-stefanek 640ec7828f refactor(common): change missing NgSwitch provider error message (#41704)
change error message of invalid NgSwitch use and add corner cases tests

PR Close #41704
2021-05-06 15:44:38 -04:00
iRealNirmal 2b939767fe docs: update testing components doc with generated compileComponent (#41947)
Updated testing-components-scenarios.md to match CLI generated test case.

Closes #39740

PR Close #41947
2021-05-06 15:40:36 -04:00
Kapunahele Wong 3a5f006ca6 docs: add redirect and update updating-to-v11 to v12 (#41625)
PR Close #41625
2021-05-06 15:15:08 -04:00
Kapunahele Wong a4e3ea0311 feat(docs-infra): add support for unformatted code-snippets (#41335)
This commit adds support for skipping formatting in `<aio-code>`
elements (which are used by `<code-example>` and `<code-pane>` elements
under the hood) by specifying the `language` option as `'root'`.

This is useful for code-snippets that include plain text.

PR Close #41335
2021-05-06 15:03:44 -04:00
Joey Perrott 5c9bd237e3 build: update release configuration to use new release notes system (#41905)
Update the ng-dev config for release to use the new release notes system
for generating release notes.

PR Close #41905
2021-05-06 09:40:29 -04:00
Joey Perrott 393ce94718 feat(dev-infra): Set up new common release notes generation tooling (#41905)
Enables the new common release notes generation within the ng-dev release publishing
tooling.

PR Close #41905
2021-05-06 09:40:29 -04:00
George Kalpakas 90d4b2277b build(docs-infra): upgrade cli command docs sources to 094a1b674 (#41958)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](cf9e03b35...094a1b674):

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

PR Close #41958
2021-05-06 09:39:13 -04:00
Alan Agius 8c9a236cf2 docs: replace `client-project` in app-shell documentation (#41957)
This option no longer exists, instead we now point to the `cli/generate#app-shell-command` guide.

PR Close #41957
2021-05-06 09:38:09 -04:00
mgechev 2e96724e93 docs: introduce details about feature request automation (#41953)
PR Close #41953
2021-05-06 09:36:46 -04:00
Renovate Bot 35fbd4f411 build: update dependency fs-extra to v10 (#41937)
PR Close #41937
2021-05-06 09:36:18 -04:00
Kristiyan Kostadinov abcd4bbfaa fix(compiler): preserve @page rules in encapsulated styles (#41915)
Currently the compiler treats `@page` rules in the same way as `@media`, however that is incorrect and it results in invalid CSS, because `@page` allows style declarations at the root (e.g. `@page (margin: 50%) {}`) and it only allows a limited set of at-rules to be nested into it. Given these restrictions, we can't really encapsulate the styles since they apply at the document level when the user tries to print.

These changes make it so that `@page` rules are preserved so that we don't break the user's CSS.

More information: https://www.w3.org/TR/css-page-3

Fixes #26269.

PR Close #41915
2021-05-06 09:33:56 -04:00
Kapunahele Wong efe8566321 docs: edit strict-mode.md to remove references for opting in (#41542)
As of v12, strict mode is the default, so you don't have
to opt in anymore. This commit removes the instructions
to add --strict to the ng new.

PR Close #41542
2021-05-06 09:32:42 -04:00
Misko Hevery d7454a1685 docs: release notes for the v12.0.0-rc.2 release 2021-05-05 16:00:36 -07:00
Misko Hevery 4802fe667c release: cut the v12.1.0-next.1 release 2021-05-05 14:53:42 -07:00
Misko Hevery c8c8b107a7 docs: release notes for the v11.2.13 release 2021-05-05 14:47:04 -07:00
David Shevitz c472c5b872 docs: initial commit of content projection topic. (#41143)
Content projection is an important part of Angular. However, it has
never been documented in the Angular documentation set. This topic
attempts to provide the basics of content projection for developers. It
is not a comprehensive guide; rather, it is a starting point that we
can hopefully expand upon in the future.

PR Close #41143
2021-05-05 13:47:27 -07:00
Kapunahele Wong 931d40b18a docs: add documentation for Angular linker (#41485)
PR Close #41485
2021-05-05 13:46:59 -07:00
George Kalpakas d64fa4fec8 build(docs-infra): upgrade cli command docs sources to cf9e03b35 (#41938)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](ac6fc449e...cf9e03b35):

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

PR Close #41938
2021-05-05 13:46:32 -07:00
Paul Gschwendtner 530e45f093 fix(dev-infra): publish script python check not working on windows (#41943)
We recently added a sanity check that ensures that `python` is
available for Bazel. The check relies on `/usr/bin/python` to check
if python is available w/ the correct version. The problem is
that on Windows there is no guarantee that the `/usr/bin` folder
exists, so the `ng-dev release publish` command always fails.

We fix this by just accessing the `env` binary that is also consulted
by scripts executed within Bazel actions. The `env` binary can be
assumed exist in the shell's `$PATH` and can point us to Python
as if it would be executed within Bazel.

PR Close #41943
2021-05-05 13:46:03 -07:00
Paul Gschwendtner 21c2a06811 fix(dev-infra): spawned child processes messing with tty output (#41948)
Currently we have a common utility method for running commands
in a child process. This method pipes all stdout and stderr, but sets
the `stdin` to `inherited`. This seemed to work as expected in terms of
allowing interactive commands being executed, but it messes with the
TTY in Windows (and potentially other platforms) so that colors and
prompts no longer work properly. See attached screenshot.

We fix this by not inheriting the stdin by default; but exposing
a dedicated method for interactive commands. This results in more
readable and obvious code too, so it's worth making this change
regardless of the TTY issues.

PR Close #41948
2021-05-05 13:45:28 -07:00
cexbrayat fb38175a40 docs: remove ts-node and tslint form dev deps (#41950)
A recent commit 3b589030a8 reintroduced these dev deps.
They were previously removed by #41826 and #41873

PR Close #41950
2021-05-05 13:45:00 -07:00
Alan Agius 753fb06cef docs: remove reference to strict mode in local setup (#41952)
This is turned on by default in version 12 and prompt has been removed.
PR Close #41952
2021-05-05 13:44:30 -07:00
Gopal Jayaraman 6b8baad940 fix(common): add body as an optional property on the options of HttpClient.delete (#19438) (#41723)
adding optional body for HTTP delete request options. This new param added as an optional so won't break the existing code also provide the capability the send the body when and where it required.

PR Close #41723
2021-05-04 21:09:58 -07:00
Paul Gschwendtner 19b12d7286 refactor(dev-infra): switch away from deprecated platform execution properties (#41941)
Bazel no longer recommends the use of `remote_execution_properties`
within `platform` definitions. Bazel intends to replace this attribute
with an object literal based attribute called `exec_properties`.

This simplifies the platform configuration and makes it more
readable. Additionally this make inheritance and overriding easier.

PR Close #41941
2021-05-04 21:09:30 -07:00