Commit Graph

14266 Commits

Author SHA1 Message Date
Pawel Kozlowski 514ebf402a refactor(ivy): avoid calling other instructions from the loadViewQuery instruction ()
PR Close 
2019-05-21 13:14:14 -07:00
Sander Vanneste 7c0667d215 docs: delete double dashes on ng command in testing guide ()
Closes 

PR Close 
2019-05-21 13:12:47 -07:00
cexbrayat f6bf8928f2 fix(core): temporarily remove @deprecated jsdoc tag for a TextBed.get overload ()
PR  introduced a new `TestBed.get` signature and deprecated the existing one.
This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see  for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it.

Refs 
Fixes FW-1336

PR Close 
2019-05-21 13:11:21 -07:00
Brandon 6debe9dfb9 docs(docs-infra): add common/upgrade to authors package for API docs ()
This fixes an issue where the common/upgrade packge isn't included
on page reload when changes are made to the common/upgrade package

PR Close 
2019-05-21 13:09:09 -07:00
Brandon 0d52a27f41 docs(common): update API docs for unified location service for upgrading ()
PR Close 
2019-05-21 13:09:08 -07:00
George Kalpakas 697046c2b2 docs: document the `PR action: rerun CI at HEAD` label in `TRIAGE_AND_LABELS.md` ()
Related to .

PR Close 
2019-05-21 13:07:37 -07:00
George Kalpakas 53a0b26348 docs: document the `PR action: review` label in `TRIAGE_AND_LABELS.md` ()
PR Close 
2019-05-21 13:07:37 -07:00
George Kalpakas 8c00fced1c docs: add info about who adds/removes labels in `TRIAGE_AND_LABELS.md` ()
PR Close 
2019-05-21 13:07:37 -07:00
Stewart Rand a50c1bb7bc docs: fix spelling of 'its' ()
PR Close 
2019-05-21 13:07:13 -07:00
Miško Hevery f3c69e7f6b refactor(ivy): rewrite flatten function to be more memory efficient ()
The `flatten` function used `concat` and `slice` which created a lot of intermediary
object allocations. Because `flatten` is used from query any benchmark which
used query would exhibit high minor GC counts.

PR Close 
2019-05-21 13:06:23 -07:00
Brandon c9f5f3d802 docs: add section to upgrade guide on lazy loading AngularJS ()
PR Close 
2019-05-21 13:06:01 -07:00
Kara Erickson a96976e88f fix(core): remove deprecated `TestBed.deprecatedOverrideProvider` API ()
BREAKING CHANGE

In PR , we fixed a bug in `TestBed.overrideProvider` where
eager providers were not being instantiated correctly. However,
it turned out that since this bug had been around for quite a bit,
many apps were relying on the broken behavior where the providers
would not be instantiated. To assist in the transition, the
`TestBed.deprecatedOverrideProvider` method was temporarily
introduced to mimic the old behavior so that apps would have a
longer time period to migrate their code.

2 years and 3 versions later, it is time to remove the temporary
method. This commit removes `TestBed.deprecatedOverrideProvider`
altogether. Any usages of `TestBed.deprecatedOverrideProvider`
should be replaced with `TestBed.overrideProvider`. This may mean
that providers that were not created before will now be instantiated,
which could mean that your tests need to provide more mocks or stubs
for the dependencies of the newly instantiated providers.

PR Close 
2019-05-21 12:37:17 -07:00
George Kalpakas ebfbc04000 ci(docs-infra): fix `test_docs_examples_ivy` job ()
Context:
As part of the `test_docs_examples_ivy` job, we run 5 concurrent builds
on each VM (each for a different example/project). Additionally, all
example projects share the same `node_modules/` (via a symlink to
`aio/tools/examples/shared/node_modules/`), so all concurrent builds
operate on the same files.

Previously, we pre-ran ngcc with `--properties module` to process the
fesm5 bundles. Since we have switched to es2015 in 661a57d9e, we now
need the esm2015 bundles. As a result, the initial ngcc run is
redundant and ngcc runs again during each build (to process the fesm2015
bundles). Since there are 5 concurrent builds, we often end up with
multiple ngcc instances processing the same package and trying to write
to the same directories at the same time, causing a
`file already exists` error

This commit fixes it by pre-processing the esm2015 bundles, so there is
no need to re-run ngcc during each concurrent build.

Fixes 

PR Close 
2019-05-21 12:32:57 -07:00
Brandon e1af6e3c70 docs: use dynamic import syntax in examples using lazy loading ()
PR Close 
2019-05-21 09:09:35 -07:00
Trotyl Yu 9e946c9715 docs(changelog): remove docs-infra changes ()
PR Close 
2019-05-21 09:06:45 -07:00
Santosh Yadav 0d97143965 docs: correct typo in changelog ()
Fixes 

PR Close 
2019-05-21 09:06:02 -07:00
Miško Hevery df1d3fbd7b perf(ivy): minor cleanup; prevent sparse arrays ()
PR Close 
2019-05-21 09:04:39 -07:00
Manohar Reddy Poreddy e946594bf8 docs: move instructions to see changes after the error is fixed in the tutorial ()
docs: List only appears after the error is fixed

When the error happens, the list is not displayed too. Once the error is removed, the heroes list appears, so we can click and see the details.

PR Close 
2019-05-21 09:03:49 -07:00
Ben Lesh abe4433202 test(ivy): add tests around directive attribute ghosting ()
This battery of tests is to ensure the instructions we are generating have the same behavior in Ivy has they did in ViewEngine.

PR Close 
2019-05-21 09:03:03 -07:00
janith c79bffaacb docs: remove gender prefixes from examples ()
PR Close 
2019-05-20 16:42:59 -07:00
Fux, Etienne e58e5ec6a6 docs: improve consistency of style guide example ()
The text for entry Style 04-10 of the style guide talks about
FilterTextService however, the example folder structure has the inversed
filename.

PR Close 
2019-05-20 16:42:16 -07:00
Keen Yee Liau e688e02ee4 fix(bazel): ng test should run specific ts_web_test_suite ()
PR closes https://github.com/angular/angular/issues/30191

PR Close 
2019-05-20 16:40:11 -07:00
Ben Lesh d7eaae6f22 refactor(ivy): Move instructions back to ɵɵ ()
There is an encoding issue with using delta `Δ`, where the browser will attempt to detect the file encoding if the character set is not explicitly declared on a `<script/>` tag, and Chrome will find the `Δ` character and decide it is window-1252 encoding, which misinterprets the `Δ` character to be some other character that is not a valid JS identifier character

So back to the frog eyes we go.

```
    __
   /ɵɵ\
  ( -- ) - I am ineffable. I am forever.
 _/    \_
/  \  /  \
==  ==  ==
```

PR Close 
2019-05-20 16:37:47 -07:00
jenniferfell 1c3ee41902 docs: move old quick start content into new local setup guide ()
PR Close 
2019-05-20 10:16:23 -07:00
George Kalpakas f78bda9ff0 build: add recommended config files for VSCode remote development ()
Add some recommended config files to use (as is or as basis) for setting
up [remote development using docker containers][1] with VSCode. This is
an opt-in feature. See `.devcontainer/README.md` for more info.

The configuration can be further tweaked/improved, but is a good
starting point.

[1]: https://code.visualstudio.com/docs/remote/containers

PR Close 
2019-05-20 10:13:53 -07:00
Miško Hevery 6454f76cf6 refactor(ivy): remove ngPrivateData megamorphic prop access ()
PR Close 
2019-05-20 10:12:07 -07:00
Miško Hevery 28ae22ecb9 refactor(ivy): move `renderTemplate` into render_util.ts because it is only used in tests ()
PR Close 
2019-05-20 10:12:07 -07:00
George Kalpakas c1135ee18f build: update version to 8.0.0-rc.4 in `package.json` ()
PR Close 
2019-05-17 14:25:01 -07:00
George Kalpakas 1114053daa build: remove obsolete `branchPattern` field from `package.json` ()
PR Close 
2019-05-17 14:25:00 -07:00
cexbrayat 95830ee584 feat(common): stricter types for SlicePipe ()
Adds overloads to the `transform` methods of `SlicePipe`,
to have better types than `any` for `value` and `any` as a return.
With this commit, using `slice` in an `ngFor` still allow to type-check the content of the `ngFor`
with `fullTemplateTypeCheck` enabled in Ivy:

    <div *ngFor="let user of users | slice:0:2">{{ user.typo }}</div>
                                                        |
                                                        `typo` does not exist on type `UserModel`

whereas it is currently not catched (as the return of `slice` is `any`) neither in VE nor in Ivy.

BREAKING CHANGE
`SlicePipe` now only accepts an array of values, a string, null or undefined.
This was already the case in practice, and it still throws at runtime if another type is given.
But it is now a compilation error to try to call it with an unsupported type.

PR Close 
2019-05-17 14:21:36 -07:00
Brandon Roberts 661a57d9e2 docs: update docs example dependencies to version 8 ()
PR Close 
2019-05-17 14:16:55 -07:00
Alan Agius 660a091f41 ci: increase codefresh memory limit to decrease flakyness of known big tests ()
Such tests are:
```
//packages/language-service/test:test
//packages/bazel/test/ngc-wrapped:ngc_test
```

PR Close 
2019-05-17 13:34:11 -07:00
Alan 7d31f7b540 ci: include more tests in windows ci ()
We added most of the tests excluded the once which are tagged with `browser:chromium-local` as they are currently not working in CI but work locally.

The `--test_tag_filters` option is now passed via command line as it seems that it has no effect as it is passed in both RC and command line. IE command line options are not merged with the RC options but rather overridden.

PR Close 
2019-05-17 13:34:11 -07:00
Alan ab4a23d0e0 ci: update windows docker image for codefresh ()
This commit changes a couple of things

1) Sets the escape character to backtick. Setting the escape character to backtick is especially useful on Windows where `\` is the directory path separator.
2) Install Python since it is a requirement for certain bazel tool chains that are now used.
3) Install VS Build Tools with C++ components as they C++ compilation is required for certain bazel tools chains.
4) Removes Visual C++ Redistributable as it seems that is no longer required because of the VS Builds Tools

PR Close 
2019-05-17 13:34:11 -07:00
Alan a39f4e2301 test: fix paths tests to work cross platform ()
In Windows when `/test.txt` is resolved it will be resolved to `[DRIVE]:/test.txt`

PR Close 
2019-05-17 13:34:11 -07:00
Paul Gschwendtner 8e2e9dcee6 test(ivy): move render3 view_container_ref tests to acceptance ()
Moves all manual render3 view_container_ref tests that use property
bindings to acceptance tests with TestBed.

Two issues surfaced and refer to a difference between Ivy and View
engine:

* Multi-slot projection is not working with Ivy: FW-1331
* ViewContainerRef throws if index is invalid while View Engine clamped index: FW-1330

PR Close 
2019-05-17 13:33:22 -07:00
Kamil Myśliwiec 9d5abfb3d9 docs: add kamil mysliwiec to GDE resources ()
PR Close 
2019-05-17 13:32:44 -07:00
Alan fd7dd4d9fc refactor: clean up language service from unused code and imports ()
PR Close 
2019-05-17 13:32:06 -07:00
Ben Lesh 01919fbaae test(ivy): Add TODOs ()
PR Close 
2019-05-17 09:56:49 -07:00
Ben Lesh 80d4fc5e26 test(ivy): remove `new Component` use from inheritance tests ()
PR Close 
2019-05-17 09:56:49 -07:00
Pete Bacon Darwin eda09e69ea fix(ivy): ngtsc - do not wrap arguments unnecessarily ()
Previously we defensively wrapped expressions in case they ran afoul of
precedence rules. For example, it would be easy to create the TS AST structure
Call(Ternary(a, b, c)), but might result in printed code of:

```
a ? b : c()
```

Whereas the actual structure we meant to generate is:

```
(a ? b : c)()
```

However the TypeScript renderer appears to be clever enough to provide
parenthesis as necessary.

This commit removes these defensive paraenthesis in the cases of binary
and ternary operations.

FW-1273

PR Close 
2019-05-17 09:55:46 -07:00
JoostK 0937062a64 fix(ivy): type-checking should infer string type for interpolations ()
Previously, interpolations were generated into TCBs as a comma-separated
list of expressions, letting TypeScript infer the type of the expression
as the type of the last expression in the chain. This is undesirable, as
interpolations always result in a string type at runtime. Therefore,
type-checking of bindings such as `<img src="{{ link }}"/>` where `link`
is an object would incorrectly report a type-error.

This commit adjusts the emitted TCB code for interpolations, where a
chain of string concatenations is emitted, starting with the empty string.
This ensures that the inferred type of the interpolation is of type string.

PR Close 
2019-05-17 09:55:11 -07:00
JoostK 6f073885b0 refactor(ivy): translate template nodes to typescript using a visitor ()
PR Close 
2019-05-17 09:55:11 -07:00
Matias Niemelä f03475cac8 refactor(ivy): evaluate prop-based styling bindings with a new algorithm ()
This is the first refactor PR designed to change how styling bindings
(i.e. `[style]` and `[class]`) behave in Ivy. Instead of having a heavy
element-by-element context be generated for each element, this new
refactor aims to use a single context for each `tNode` element that is
examined and iterated over when styling values are to be applied to the
element.

This patch brings this new functionality to prop-based bindings such as
`[style.prop]` and `[class.name]`.

PR Close 
2019-05-17 09:54:19 -07:00
George Kalpakas 848e53efd0 test(platform-browser-dynamic): avoid swallowing error in `CachedResourceLoader` test ()
Previously, in order to assert that the promise was not resolved, an
error was thrown when the promise was resolved successfully. At the
same, `.catch()` was used to silence the (expected) promise rejection.
However, the chained `.catch()` handler would also catch (and swallow)
the error thrown on resolving the promise, making the test pass, even if
the promise was not rejected.

This commit fixes it by ensuring that the error thrown on resolving the
promise is not caught by the rejection handler.

PR Close 
2019-05-16 20:14:04 -07:00
George Kalpakas 6bf8b1007c test(platform-browser-dynamic): make `CachedResourceLoader` tests more reliable ()
Previously, [this test][1] would occasionally fail (e.g. on CI) with
"Template cache was not found in $templateCache". This was due to a
combination of:
1. [That test][2] (which removes the cache) being run right before the
   failing test.
2. The async `TestBed.compileComponents()` operation run in the
   `beforeEach()` block (which sets the cache) not having completed
   before the `it()` block.

This commit fixes the issue by ensuring the cache is always set, before
instantiating `CachedResourceLoader`.

This commit also moves some operations that are only needed in one test
from the `beforeEach()` block to that test's `it()` block.

[1]: 79903b1842/packages/platform-browser-dynamic/test/resource_loader/resource_loader_cache_spec.ts (L50)
[2]: 79903b1842/packages/platform-browser-dynamic/test/resource_loader/resource_loader_cache_spec.ts (L37)

Fixes 

PR Close 
2019-05-16 20:14:03 -07:00
Pawel Kozlowski 98ded949dd fixup! test(ivy): make the test run with benchpress ()
PR Close 
2019-05-16 20:04:04 -07:00
Pawel Kozlowski a5a1f4f52f fixup! test(ivy): enableProdMode ()
PR Close 
2019-05-16 20:04:03 -07:00
Pawel Kozlowski 8c1a041411 fixup! test(ivy): rebase, format and lint ()
PR Close 
2019-05-16 20:04:03 -07:00
Miško Hevery b1ba2d6f4e test(ivy): add expanding_rows performance benchmark which runs in ViewEngine and Ivy ()
PR Close 
2019-05-16 20:04:03 -07:00