Commit Graph

16826 Commits

Author SHA1 Message Date
2d30e7dd28 Revert "build: add a before-all-other bootstrap script that patches require (#34589)" (#34730)
This reverts commit c3e8439954.

PR Close #34730
2020-01-10 14:12:17 -08:00
64b807e201 Revert "build: should use $(execpath) in npm_package_bin args (#34589)" (#34730)
This reverts commit 67044ef55d.

PR Close #34730
2020-01-10 14:12:16 -08:00
d71c1215f6 Revert "build: derive ts_library dep from jasmine_node_test boostrap label if it ends in _es5 (#34589)" (#34730)
This reverts commit 79a0d007b4.

PR Close #34730
2020-01-10 14:12:16 -08:00
d530dfc747 Revert "build: add better comments to defaults.bzl jasmine_node_test macro (#34589)" (#34730)
This reverts commit 753b5bc305.

PR Close #34730
2020-01-10 14:12:16 -08:00
96941c7300 Revert "build: cleanup //tools/ts-api-guardian:tests target (#34589)" (#34730)
This reverts commit 7a63e4f7d5.

PR Close #34730
2020-01-10 14:12:16 -08:00
80a7bc8168 Revert "test: add coverage to //tools/ts-api-guardian/... on WindowsCI (#34589)" (#34730)
This reverts commit 9e0583045c.

PR Close #34730
2020-01-10 14:12:16 -08:00
a5cdad57fe docs: move ngcc def from page to glossary (#34196)
PR Close #34196
2020-01-10 08:38:54 -08:00
87d2c0739f docs: apply standard header case convention (#34196)
PR Close #34196
2020-01-10 08:38:54 -08:00
613367508f test: add coverage to //tools/ts-api-guardian/... on WindowsCI (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
58cc83ef1f build: cleanup //tools/ts-api-guardian:tests target (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
c4e9cef314 build: add better comments to defaults.bzl jasmine_node_test macro (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
3e72381bb0 build: derive ts_library dep from jasmine_node_test boostrap label if it ends in _es5 (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
d83071c3b1 build: should use $(execpath) in npm_package_bin args (#34589)
This is recommended in the Bazel docs as $(location) is ambiguous and can mean either $(execpath) or $(rootpath) depending on the context.

PR Close #34589
2020-01-10 08:32:02 -08:00
68e6db5d7a build: add a before-all-other bootstrap script that patches require (#34589)
This removes the churn in the existing bootstrap scripts.

PR Close #34589
2020-01-10 08:32:02 -08:00
f7dc3a7b64 build: renamed "injected_scripts" target to "asset_injected_index_html" (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
e175878480 test: keep diff in integration/bazel minimal by not introducing additional_root_paths (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
d35451327e test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34589)
PR Close #34589
2020-01-10 08:32:02 -08:00
3a5147bc7a test: bump material cache_key version (#34589)
Also add comment that cache_key version should be bumped when switching forks or branches and added a comment from @devversion explaining how the fallback cache key works.

PR Close #34589
2020-01-10 08:32:01 -08:00
1ec2eb4376 test: update to latest angular/components commit to pick up rules_nodejs 1.0 update (#34589)
This commit includes https://github.com/angular/components/pull/18064 which is a pre-req for updating the angular repo to rules_nodejs 1.0.

PR Close #34589
2020-01-10 08:32:01 -08:00
1bb0fbd733 build: update to rules nodejs 1.0.1 (#34589)
This brings in a few minor fixes including a better way to patch require for bootstrap scripts.

PR Close #34589
2020-01-10 08:32:01 -08:00
e03c0f6ae5 build: update to @angular/cli 9.0.0-rc.4 (#34589)
This brings in a required fix to allow for 0.0.0 dev version of @angular/core for integration testing. Without this the following error is now observed:

```
This version of CLI is only compatible with Angular versions ^9.0.0-beta || >=9.0.0 <10.0.0,
but Angular version 0.0.0 was found instead.
```

NB: rc.7 breaks the cli-hello-world-ivy-i18n integration test

PR Close #34589
2020-01-10 08:32:01 -08:00
9f051752af build: update integration/bazel & @angular/bazel schematics to rules_nodejs 1.0.0 (#34589)
For the purposes of the integration test the zone.js script & bundle script tags can just go into the source index.html itself. The purpose of the integration test is is to test @angular/bazel & ng_module & ng_package so there is no need to exercise html_insert_assets in integration/bazel.

PR Close #34589
2020-01-10 08:32:01 -08:00
a812880054 build: package-build & release scripts should handle new pkg_npm naming (#34589)
bazel query now using: kind("ng_package|pkg_npm", //packages/...)

PR Close #34589
2020-01-10 08:32:01 -08:00
94e6452bac refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)
The major one that affects the angular repo is the removal of the bootstrap attribute in nodejs_binary, nodejs_test and jasmine_node_test in favor of using templated_args --node_options=--require=/path/to/script. The side-effect of this is that the bootstrap script does not get the require.resolve patches with explicitly loading the targets _loader.js file.

PR Close #34589
2020-01-10 08:32:01 -08:00
a9f13015b2 build: upgrade to io_bazel_rules_sass 1.24.0 (#34589)
PR Close #34589
2020-01-10 08:32:01 -08:00
0d9c7ba6b3 build: upgrade to rules_nodejs 1.0.0 (first stable release) (#34589)
Brings in the fix for stamping which was preventing many targets from getting cached.

PR Close #34589
2020-01-10 08:32:01 -08:00
2ef0b500ef refactor(language-service): rename expression completions method (#34518)
This commit renames `addAttributeValuesToCompletions`, which generates
expression completions and is not exclusive to processing attributes, to
`processExpressionCompletions`. Also removes the expression completion
logic in `visitBoundText` for a call to `processExpressionCompletions`.

The conditional branch in `visitBoundText` is also removed. This branch
was added in one of the first commits to the language service
(519a324454) and appears to be
unnecessary, as the expression AST is constructed from the template
position anyway.

PR Close #34518
2020-01-10 08:31:10 -08:00
a88dc17e5b fix(ngcc): recognize re-exports with imported TS helpers in CommonJS and UMD (#34527)
Previously, the `CommonJsReflectionHost` and `UmdReflectionHost` would
only recognize re-exports of the form `__export(...)`. This is what
re-exports look like, when the TypeScript helpers are emitted inline
(i.e. when compiling with the default [TypeScript compiler options][1]
that include `noEmitHelpers: false` and `importHelpers: false`).

However, when compiling with `importHelpers: true` and [tslib][2] (which
is the recommended way for optimized bundles), the re-exports will look
like: `tslib_1.__exportStar(..., exports)`
These types of re-exports were previously not recognized by the
CommonJS/UMD `ReflectionHost`s and thus ignored.

This commit fixes this by ensuring both re-export formats are
recognized.

[1]: https://www.typescriptlang.org/docs/handbook/compiler-options.html
[2]: https://www.npmjs.com/package/tslib

PR Close #34527
2020-01-10 08:28:50 -08:00
56a19f833e refactor(ivy): remove calls into other instructions from pipe instructions (#33714)
A while ago we made a pass through all instructions to make sure that none of them call directly into other instructions, however it seems like missed the `pipeBind*` since they still call into the pure functions. The result is that we have some unnecessary duplicated accesses of global state like `getLView` which are called twice in a row with nothing changing.

These changes move the common functionality into a shared file and make the pipe instructions call into them with the global state instead.

PR Close #33714
2020-01-10 08:27:27 -08:00
cb7dcb3d23 fix(language-service): do not use an i18n parser for templates (#34531)
The compiler's `I18NHtmlParser` may expand template nodes that have
internationalization metadata attached to them; for instance,

```html
<div i18n="@@i18n-el">{{}}</div>
```

gets expanded to an AST with the i18n metadata extracted and text filled
in as necessary; to the language service, the template above, as read in
the AST, now looks something like

```html
<div>{{$implicit}}</div>
```

This is undesirable for the language service because we want to preserve
the original form of the source template source code, and have
information about the original values of the template. The language
service also does not need to use an i18n parser -- we don't generate
any template output.

To fix this turns out to be as easy as moving to using a raw
`HtmlParser`.

---

A note on the testing strategy: as mentioned above, we don't need to use
an i18n parser, but we don't **not** need to use one if the parser
does not heavily modify the template AST. For this reason, the tests
target the functionality of not modifying a template with i18n metadata
rather than testing that the language service does not use an i18n parser.

---

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

PR Close #34531
2020-01-10 08:23:09 -08:00
2b878f4a18 ci(docs-infra): do not deploy Firebase Realtime Database rules (#34696)
Currently, the angular.io projects do not use Firebase's Realtime
Database and therefore we only need to configure and deploy changes for
`hosting`.

This commit removes the unused Realtime Database related configs and
files.

PR Close #34696
2020-01-10 08:22:38 -08:00
f312848c2e refactor(core): remove duplicate InjectableType declaration (#34679)
This duplication causes a compilation error with TypeScript 3.7

PR Close #34679
2020-01-09 16:05:21 -08:00
f7a2ed7d66 docs(ivy): document breaking change with <select> and binding order (#34709)
Closes #34470

PR Close #34709
2020-01-09 15:13:57 -08:00
cbb175f010 fix(forms): disabled input acceptance member not properly applied (#34502)
With 5cecd97493 we intended to expand
the input type of the `disabled` input of the `NgModel` directive.
Read more about the reason for this in the actual commit message.

Currently though, the acceptance coercion member does not have any
effect. This is because the acceptance member needs to refer to the
actual input property name, and not to the public input name.
`disabled` corresponds to the `isDisabled` property.

PR Close #34502
2020-01-09 15:12:10 -08:00
d63572e87c feat(ivy): improve ExpressionChangedAfterChecked error message for attributes (#34505)
This commit improves `ExpressionChangedAfterChecked` error message for attributes by including attribute name and the content of the entire expression that contains interpolation(s). In order to achieve that, metadata is now stored in `TData` array when `attribute` and `attributeInterpolate` instructions are being called (similar to `property` and `propertyInterpolate` instructions).

PR Close #34505
2020-01-09 13:47:58 -08:00
937d3fd112 feat(language-service): completions support for template reference variables (#34363)
PR Close #34363
2020-01-09 13:45:42 -08:00
180d214ff4 docs: Change screenshot to new Angular 9 app UI (#33998)
PR Close #33998
2020-01-09 13:45:12 -08:00
7a5c892557 test(language-service): make app.component a constant (#34587)
Cleans up usages of `app.component.ts` to be a constant file variable.

PR Close #34587
2020-01-09 13:31:40 -08:00
417682bbea build: update the recommended Dockerfile for VSCode remote development (#34697)
PR Close #34697
2020-01-09 13:31:14 -08:00
05c31fbbc6 ci: fix saucelabs bazel tests terminating after 5min (#34707)
Currently Bazel always terminates the Saucelabs Bazel tests
after 5mins. This is causing failing tests as Saucelabs tests
usually run longer than 5mins. Our current Saucelabs idle timeout
is 10min, so we should ensure that we don't exit early without
properly shutting down Karma / disconnecting the browsers.

PR Close #34707
2020-01-09 13:30:39 -08:00
8804e422e4 test(ivy): add test for class setters being invoked when not used (#34706)
Adds a test that we should make pass once the latest styling refactor has landed.

PR Close #34706
2020-01-09 13:29:17 -08:00
16a799d28d docs: fix non-working example in the Observables section (#34705)
PR Close #34705
2020-01-09 13:27:15 -08:00
bbeb0605ec docs: add note on importing AppRoutingModule (#34710)
Fixes #21207

PR Close #34710
2020-01-09 13:26:43 -08:00
f2952403dd fix(ngcc): insert definitions after statement (#34677)
If a class was defined as a class expression
in a variable declaration, the definitions
were being inserted before the statment's
final semi-colon.

Now the insertion point will be after the
full statement.

Fixes #34648

PR Close #34677
2020-01-08 15:09:25 -08:00
66a1db7c6d docs: deprecate undecorated base classes that use Angular features (#34668)
PR Close #34668
2020-01-08 15:08:54 -08:00
e2e030d5cd refactor(bazel): remove explicit deps param to ts_compile_actions (#34665)
This was already the default. I'm working on a change in the underlying TS rules where this parameter will be replaced, so ng_module needs to change first

PR Close #34665
2020-01-08 15:08:04 -08:00
83868be713 fix(ngcc): handle UMD factories that do not use all params (#34660)
In some cases, where a module imports a dependency
but does not actually use it, UMD bundlers may remove
the dependency parameter from the UMD factory function
definition.

For example:

```
import * as x from 'x';
import * as z from 'z';
export const y = x;
```

may result in a UMD bundle including:

```
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ?
        factory(exports, require('x'), require('z')) :
    typeof define === 'function' && define.amd ?
        define(['exports', 'x', 'z'], factory) :
    (global = global || self, factory(global.myBundle = {}, global.x));
}(this, (function (exports, x) { 'use strict';
...
})));
```

Note that while the `z` dependency is provide in the call,
the factory itself only accepts `exports` and `x` as parameters.

Previously ngcc appended new dependencies to the end of the factory
function, but this breaks in the above scenario. Now the new
dependencies are prefixed at the front of parameters/arguments
already in place.

Fixes #34653

PR Close #34660
2020-01-08 15:07:37 -08:00
4def99ed38 fix(ngcc): don't crash if symbol has no declarations (#34658)
In some cases TypeScript is unable to identify a valid
symbol for an export. In this case it returns an "unknown"
symbol, which does not reference any declarations.

This fix ensures that ngcc does not crash if such a symbol
is encountered by checking whether `symbol.declarations`
exists before accessing it.

The commit does not contain a unit test as it was not possible
to recreate a scenario that had such an "unknown" symbol in
the unit test environment. The fix has been manually checked
against that original issue; and also this check is equivalent to
similar checks elsewhere in the code, e.g.

https://github.com/angular/angular/blob/8d0de89e/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts#L309

Fixes #34560

PR Close #34658
2020-01-08 15:07:11 -08:00
7df28388c9 docs: add Angular-Slickgrid library to the list of resources (#34656)
PR Close #34656
2020-01-08 15:06:44 -08:00
8a295ac012 docs: clarifies how the service is injected (#34638)
There was some confusion about how the service will be injected in the sentence with the `new` keyword. This PR should hopefully clear the confusion.

Fixes #34612

PR Close #34638
2020-01-08 15:06:10 -08:00