Commit Graph

17010 Commits

Author SHA1 Message Date
Keen Yee Liau a8609ba0ad refactor(language-service): dedupe diagnostics using ts utility function (#35086)
This commit makes a minor refactoring that replaces `uniqueBySpan` with
`ts.sortAndDeduplicateDiagnostics()`.

PR Close #35086
2020-02-03 08:57:58 -08:00
Keen Yee Liau c8584e5d36 refactor(language-service): Replace TypeDiagnostic with ng.Diagnostic (#35085)
This commit cleans up `expression_type.ts` by

1. Removing the unnecessary `TypeDiagnostic` class. It's replaced by
`ng.Diagnostic`.
2. Consolidating `reportError()` and `reportWarning()` to
`reportDiagnostic()`.

This is prep work so that we could make some of the type diagnostics a
suggestion in later PRs.

PR Close #35085
2020-02-03 08:57:18 -08:00
Misko Hevery 01308e4c7c refactor(ivy): Remove `TNode.directives` in favor of `TData` (#35050)
`TNode.directives` was introduced in https://github.com/angular/angular/pull/34938. Turns out that it is unnecessary because the information is already present it `TData` when combining with `TNode.directiveStart` and `TNode.directiveEnd`

Mainly this is true (conceptually):
```
expect(tNode.directives).toEqual(
    tData.slice(
        tNode.directivesStart,
        tNode.directivesEnd - tNode.DirectivesStart -1
    )
);
```

The refactoring removes `TNode.directives` and adds `TNode.directiveStyling` as we still need to keep location in the directive in `TNode`

PR Close #35050
2020-02-03 08:56:51 -08:00
Misko Hevery 65dbd50594 test(ivy): correct var count in perf benchmarks. (#35071)
These tests are used for perf testing and don't run as part of CI, as a result they bit-rotted. This fixes that. Long term these tests should be run as part of CI.

PR Close #35071
2020-02-03 08:48:41 -08:00
Pete Bacon Darwin 3d4067a464 fix(ngcc): do not lock if the target is not compiled by Angular (#35057)
To support parallel CLI builds we instruct developers to pre-process
their node_modules via ngcc at the command line.

Despite doing this ngcc was still trying to set a lock when it was being
triggered by the CLI for packages that are not going to be processed,
since they are not compiled by Angular for instance.

This commit checks whether a target package needs to be compiled
at all before attempting to set the lock.

Fixes #35000

PR Close #35057
2020-02-03 08:46:43 -08:00
JiaLiPassion a3c7ab99b7 feat: performance improvement for eventListeners (#34613)
PR Close #34613
2020-02-03 08:40:49 -08:00
Misko Hevery 4d36b2f6e9 docs: release notes for the v9.0.0-rc.13 release 2020-01-31 18:31:37 -08:00
Pete Bacon Darwin f0b8f0cc7c build: temporarily disable components-repo-unit-tests (#35079)
Disabling this job until the fix at
https://github.com/angular/components/pull/18355 or similar lands.

PR Close #35079
2020-01-31 17:02:44 -08:00
Pete Bacon Darwin 2bfddcf29f feat(ngcc): automatically clean outdated ngcc artifacts (#35079)
If ngcc gets updated to a new version then the artifacts
left in packages that were processed by the previous
version are possibly invalid.

Previously we just errored if we found packages that
had already been processed by an outdated version.

Now we automatically clean the packages that have
outdated artifacts so that they can be reprocessed
correctly with the current ngcc version.

Fixes #35082

PR Close #35079
2020-01-31 17:02:44 -08:00
Pete Bacon Darwin 2e52fcf1eb refactor(compiler-cli): add `removeDir()` to `FileSystem` (#35079)
PR Close #35079
2020-01-31 17:02:44 -08:00
Pete Bacon Darwin 16e15f50d2 refactor(ngcc): export magic strings as constants (#35079)
These strings will be used when cleaning up outdated
packages.

PR Close #35079
2020-01-31 17:02:43 -08:00
Pete Bacon Darwin 3cf55c195b refactor(ngcc): add additional build marker helpers (#35079)
PR Close #35079
2020-01-31 17:02:43 -08:00
Pete Bacon Darwin cc43bfa725 refactor(ngcc): do not crash if package build version is outdated (#35079)
Now `hasBeenProcessed()` will no longer throw if there
is an entry-point that has been built with an outdated
version of ngcc.

Instead it just returns `false`, which will include it in this
processing run.

This is a precursor to adding functionality that will
automatically revert outdate build artifacts.

PR Close #35079
2020-01-31 17:02:43 -08:00
Pete Bacon Darwin 171a79d04f refactor(ngcc): remove unused code (#35079)
PR Close #35079
2020-01-31 17:02:43 -08:00
Alan Agius 6d11a81994 fix(compiler-cli): add `sass` as a valid css preprocessor extension (#35052)
`.sass` is a valid preprocessor extension which is used for Sass indented syntax

https://sass-lang.com/documentation/syntax

PR Close #35052
2020-01-31 13:28:39 -08:00
JiaLiPassion 58b29f1503 fix: should also allow subclass Promise without Symbol.species (#34533)
PR Close #34533
2020-01-31 13:17:59 -08:00
Greg Magolan 60018d265f build: update to rules_nodejs 1.2.2 (#34961)
Fixes issue with yarn_install not following yarn-path in .yarnrc when bazel run from yarn with `yarn bazel ...` (rules_nodejs: fix: unset YARN_IGNORE_PATH in yarn_install before calling yarn #1588)

PR Close #34961
2020-01-31 13:14:05 -08:00
Greg Magolan da604310c6 build: update to rules_nodejs 1.2.1 (#34961)
Fixes issue with conflicting linker module mappings introduced in 1.2.0

PR Close #34961
2020-01-31 13:14:05 -08:00
Greg Magolan 513c69169e build: update to rules_nodejs 1.2.0 (#34961)
This brings in a fix so that yarn_install picks up the yarn-path attribute of the .yarnrc file.

PR Close #34961
2020-01-31 13:14:05 -08:00
cexbrayat c77cf717aa test(common): unit test for http/testing expectOne with several requests (#27005)
PR Close #27005
2020-01-31 13:13:38 -08:00
cexbrayat 115b7e42c6 fix(common): http/testing expectOne lists the received requests if no matches (#27005)
Fixes #18013

Previously it was hard to debug an `expectOne` if the request had no match, as the error message was:

    Expected one matching request for criteria "Match URL: /some-url?query=hello", found none.

This commit adds a bit more info to the error, by listing the actual requests received:

    Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.

PR Close #27005
2020-01-31 13:13:37 -08:00
cexbrayat a622a281d3 test(common): unit tests for http/testing expectOne (#27005)
PR Close #27005
2020-01-31 13:13:37 -08:00
ajitsinghkaler e672b1f2ac feat(docs-infra): change navigation in resources page (#34756)
https://angular.io/resources needs to be sturctured to be able to navigate to all resources with improved user experience. A lone scroll bar in this page will not help the reader a great deal in exploring the resources

Fixes #33526

PR Close #34756
2020-01-31 11:27:09 -08:00
ajitsinghkaler 7431206247 refactor(docs-infra): remove unused functions in resources component page (#34756)
In resources component there were unused functions removed unused funtions

PR Close #34756
2020-01-31 11:27:09 -08:00
cexbrayat fcfce99e9e fix(common): remove extra & in http params (#34896)
Previous to this commit, HTTP params like `{ a: '1', b: [], c: '3' }` resulted in a request like `a=1&&c=3` (note the double &&).

The ideal fix would probably be to stringify these params to `a=1&b=&c=3` like we do for empty string values. But that might be breaking as some APIs may rely on the absence of the parameter.

This fixes the issue in a compatible way by just removing the extra and unnecessary `&`, resulting in `a=1&c=3`.

PR Close #34896
2020-01-31 11:26:25 -08:00
陈旭 6b710f7ae1 docs: update awade jigsaw's web site url of the resources (#35025)
PR Close #35025
2020-01-31 11:25:57 -08:00
Igor Minar c070037357 refactor(compiler): rename diagnostics/src/code.ts to diagnostics/src/error_code.ts (#35067)
the new filename is less ambiguous and better reflects the name of the symbol defined in it.

PR Close #35067
2020-01-31 11:25:27 -08:00
Igor Minar a4cacb55eb test: add the error code of ngc/ngtsc under api guard (#35067)
We should not change these error code without a good reason, so they should be guarded.

PR Close #35067
2020-01-31 11:25:27 -08:00
Wagner Maciel 69b52903f0 build: update to @bazel/protractor@1.2.0 (#35068)
we need this to be able to control the protractor version via peer dep, so that
we can update benchpress to protractor 6

PR Close #35068
2020-01-31 11:14:47 -08:00
Joey Perrott 68f51e0adc ci: update pullapprove.yml to cover all files in the repo (#35072)
PR Close #35072
2020-01-31 11:14:03 -08:00
Joey Perrott 374a8ec263 ci: fix StephenFluin's casing in entries in PullApprove (#35062)
PR Close #35062
2020-01-30 14:01:20 -08:00
Andrew Kushnir a25cb2d1e0 docs: release notes for the v9.0.0-rc.12 release 2020-01-30 13:57:41 -08:00
Alex Rickabaugh 9f5b490800 Revert "refactor(compiler): refactor and export Bazel host creation. (#34686)" (#35063)
This reverts commit cb142b6df9.

The intention of this commit was for a consumer of the `compile` function to
pass the `bazelHost` it returns into future invocations, reusing the
`FileCache` between them. However, first-party ngc_wrapped does not do this,
which caused a performance regression as the `FileCache` was no longer
shared between compilations.

PR Close #35063
2020-01-30 12:02:10 -08:00
Kristiyan Kostadinov cd9ae66b35 refactor(ivy): remove markDirty from global utilities (#34453)
Removes `markDirty` from the global debugging utilities API since we've already exposed `detectChanges`.

PR Close #34453
2020-01-30 11:30:32 -08:00
crisbeto 471375adbe docs(ivy): document global debugging utilities and clean up API (#34453)
Cleans up the public API of the global debugging utilities, documents them and exposes them in the API docs.

PR Close #34453
2020-01-30 11:30:32 -08:00
Kapunahele Wong d72cfc9d57 docs: remove deployment section on golang because of errors (#34099)
The golang section was recently added to the deployment guide
but has been reported as returning errors, where it had previously
worked. After discussion and testing with
Stephen Fluin, we are removing this section because of
inconsistency in functionality.

PR Close #34099
2020-01-30 10:20:19 -08:00
Alex Rickabaugh 37f39d6db5 build(compiler-cli): update to chokidar 3.x (#35047)
Update from chokidar 2.x to 3.x in ngc/ngtsc, to eliminate any possibility
of a security issue with a downstream dependency of the package.

FW-1809 #resolve

PR Close #35047
2020-01-30 08:41:13 -08:00
Miško Hevery c1cf46c5c3 refactor(ivy): clean of #34804 from previous merge (#35022)
This is a follow up for https://github.com/angular/angular/pull/34804

PR Close #35022
2020-01-29 16:35:08 -08:00
Misko Hevery ee8b8f52aa feat(ivy): Change static priority resolution to be same level as directive it belongs to (#34938)
This change changes the priority order of static styling.

Current priority:
```
(least priority)
- Static
  - Component
  - Directives
  - Template
- Dynamic Binding
  - Component
    - Map/Interpolation
    - Property
  - Directives
    - Map/Interpolation
    - Property
  - Template
    - Map/Interpolation
    - Property
(highest priority)
```

The issue with the above priority is this use case:

```
<div style="color: red;" directive-which-sets-color-blue>
```
In the above case the directive will win and the resulting color will be `blue`. However a small change of adding interpolation to the example like so. (Style interpolation is coming in https://github.com/angular/angular/pull/34202)
```
<div style="color: red; width: {{exp}}px" directive-which-sets-color-blue>
```
Changes the priority from static binding to interpolated binding which means now the resulting color is `red`. It is very surprising that adding an unrelated interpolation and style can change the `color` which was not changed. To fix that we need to make sure that the static values are associated with priority of the source (directive or template) where they were declared. The new resulting priority is:

```
(least priority)
- Component
  - Static
  - Map/Interpolation
  - Property
- Directives
  - Static
  - Map/Interpolation
  - Property
- Template
  - Static
  - Map/Interpolation
  - Property
(highest priority)
```

PR Close #34938
2020-01-29 15:41:47 -08:00
Misko Hevery cf07d428a1 refactor(ivy): make assert conditions more readable (#34938)
PR Close #34938
2020-01-29 15:41:47 -08:00
Adam 17650523a8 build: remove unneeded style code for ngClass and ngStyle (#34998)
With the release of Flex Layout v9.0.0-beta.28, some added code
after the recent styling refactor is no longer needed.

PR Close #34998
2020-01-29 14:57:21 -08:00
Joey Perrott 95383ee6a9 ci: don't run benchmark_tests on remote executors (#34996)
Since benchmarks are meant to test in a consistent environment, we
cannot execute the benchmark on RBE executors as executors do not
run in calibrated environments.

PR Close #34996
2020-01-29 14:15:25 -08:00
George Kalpakas 7ca74375cb ci: add missing codeowners for `aio/` files (#34988)
PR Close #34988
2020-01-29 14:12:58 -08:00
Igor Minar a3de110b52 build(docs-infra): update aio to @angular/cli@9.0.0-rc.11 (#35043)
PR Close #35043
2020-01-29 14:12:15 -08:00
Igor Minar d5205a01cb build: update to @angular/cli@9.0.0-rc.11 (#35042)
PR Close #35042
2020-01-29 14:11:38 -08:00
Stephen Fluin a892054448 docs: remove named node version (#35014)
PR Close #35014
2020-01-29 13:10:26 -08:00
Andrew Scott b8ffcf973c fix(ivy): update ViewContainerRef to get the correct parentInjector (#35013)
PR Close #35013
2020-01-29 12:46:04 -08:00
George Kalpakas 519e9e1ae8 ci: minor PullApprove fixes/improvements (#35015)
This is a follow-up to #34814 to fix some typos in patterns and make
them more similar to the old patterns from `.github/CODEOWNERS`.

PR Close #35015
2020-01-29 12:23:47 -08:00
Andrew Scott 4a5467bac6 fix(ivy): ensure multi providers in ModuleWithProviders are not duplicated (#34914)
The current logic pulls multiproviders up to the parent module's
provider list. The result is that the multi provider being defined both in
the imported ModuleWithProviders and the parent and getting an extra
item in the multi provided array of values. This PR fixes that problem
by not pulling providers in ModuleWithProviders up to the parent module.

PR Close #34914
2020-01-29 12:22:58 -08:00
Ayaz Hafiz b608fa55f0 fix(language-service): warn, not error, on missing context members (#35036)
The language service reports an error when a directive's template
context is missing a member that is being used in a template (e.g. if
`$implicit` is being used with a template context typed as `any`).
While this diagnostic message is valuable, typing template contexts
loosely as `any` or `object` is very widespread in community packages,
and often still compiles correctly, so reporting the diagnostic as an
error may be misleading to users.

This commit changes the diagnostic to be a warning, and adds additional
information about how the user can eliminate the warning entirely -- by
refining the template context type.

Closes https://github.com/angular/vscode-ng-language-service/issues/572

PR Close #35036
2020-01-29 12:22:09 -08:00