Commit Graph

286 Commits

Author SHA1 Message Date
Greg Magolan 9fe522f3e2 build: yarn.lock updates (#28871)
PR Close #28871
2019-02-28 12:06:36 -08:00
Greg Magolan ea09430039 build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871)
PR Close #28871
2019-02-28 12:06:36 -08:00
Wassim Chegham dad5a258b8 style: enforce buildifier lint on CI (#28186)
PR Close #28186
2019-02-26 16:57:41 -08:00
Wassim Chegham ce68b4d839 style: enforce buildifier lint on CI (#28186)
PR Close #28186
2019-02-26 16:57:41 -08:00
Marc Laval dc9f0af080 fix(ivy): static host classes and styles should work on root component (#28926)
PR Close #28926
2019-02-26 13:29:36 -08:00
Alex Eagle 350802b207 build: update to latest bazel rules (#28931)
PR Close #28931
2019-02-22 17:27:09 -08:00
Greg Magolan f4d652568d build: use uname instead of relying on sed --version (#28900)
PR Close #28900
2019-02-21 17:49:17 -08:00
Greg Magolan 3cc9ba24c6 build: fix integration/bazel on OSX and update integration yarn.lock files (#28900)
PR Close #28900
2019-02-21 17:49:17 -08:00
Kristiyan Kostadinov e1aaa7ec48 fix(ivy): component destroy hook called twice when configured as provider (#28470)
Fixes the `ngOnDestroy` hook on a component or directive being called twice, if the type is also registered as a provider.

This PR resolves FW-1010.

PR Close #28470
2019-02-21 09:34:26 -08:00
Greg Magolan ebffde7143 build: update to rules_typescript 0.25.1 (#28625)
Updated a spot in the compiler which assumed es5 downlevelling get ready for es2015 devmode in the future.

PR Close #28625
2019-02-21 07:46:21 -08:00
Matias Niemelä cfb2d176f8 feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings (#28711)
Prior to this fix, both the `NgStyle` and `NgClass` directives made use
of `Renderer2` and this dependency raised issues for future versions of
Angular that cannot inject it. This patch ensures that there are two
versions of both directives: one for the VE and another for Ivy.

Jira Issue: FW-882

PR Close #28711
2019-02-20 13:46:15 -08:00
Keen Yee Liau b9eb662c4a test(bazel): Upgrade CLI dependencies for schematics test (#28872)
This commit makes the integration test for bazel-schematics more robust
by removing package.json.replace. Instead of replacing the file, the
test script now just overrides Angular packages with the local ones.

This commit also fixes running the test locally by providing default
argument for CI_CHROMEDRIVER_VERSION_ARG.

PR Close #28872
2019-02-20 10:55:29 -08:00
Keen Yee Liau e5e4e63e71 refactor(bazel): Schematics should fetch angular from distro (#28851)
PR Close #28851
2019-02-20 09:01:44 -08:00
Alex Eagle 1eccf64b15 build: Add .bzl/BUILD files to @angular/bazel package (#28769)
It's now possible to use it as a hybrid package in latest rules_nodejs, so no WORKSPACE dep is needed

PR Close #28769
2019-02-19 17:55:57 -08:00
Greg Magolan 02ee8c7bc5 build: fix inflight PR conflict in integration/bazel (#28720)
PR Close #28720
2019-02-19 16:28:14 -08:00
Greg Magolan 25aae64274 build(bazel): do not build rxjs from source under Bazel (#28720)
PR Close #28720
2019-02-19 16:28:14 -08:00
Kara Erickson a4638d5a81 fix(ivy): support static ViewChild queries (#28811)
This commit adds support for the `static: true` flag in
`ViewChild` queries. Prior to this commit, all `ViewChild`
queries were resolved after change detection ran. This is
a problem for backwards compatibility because View Engine
also supported "static" queries which would resolve before
change detection.

Now if users add a `static: true` option, the query will be
resolved in creation mode (before change detection runs).
For example:

```ts
@ViewChild(TemplateRef, {static: true}) template !: TemplateRef;
```

This feature will come in handy for components that need
to create components dynamically.

PR Close #28811
2019-02-19 15:29:00 -08:00
Paul Gschwendtner a834c745d7 test: bazel integration test should use angular npm packages (#28762)
PR Close #28762
2019-02-19 12:53:19 -08:00
Matias Niemelä 627cecdfe2 fix(ivy): ensure host bindings and host styling works on a root component (#28664)
Prior to this fix if a root component was instantiated it create host
bindings, but never render them once update mode ran unless one or more
slot-allocated bindings were issued. Since styling in Ivy does not make
use of LView slots, the host bindings function never ran on the root
component.

This fix ensures that the `hostBindings` function does run for a root
component and also renders the schedlued styling instructions when
executed.

Jira Issue: FW-1062

PR Close #28664
2019-02-14 19:23:25 +00:00
Greg Magolan 47574fef11 build(bazel): temporarily pin browser versions while upstream is fixed as work-around for #28681 (#28698)
PR Close #28698
2019-02-13 19:18:27 -08:00
Greg Magolan 28bdeeef3e build(bazel): update to rules_nodejs 0.18.6 (#28699)
PR Close #28699
2019-02-13 12:13:08 -08:00
Keen Yee Liau 49fb8c3cb0 fix(bazel): Install angular repo before yarn_install (#28670)
PR closes https://github.com/angular/angular/issues/28636

PR Close #28670
2019-02-13 09:52:30 -08:00
Paul Gschwendtner 44de68ce40 ci: do not install firebase-tools without cache (#28615)
Currently we install `firebase-tools` manually in the
integration tests run script. This is problematic
because it means that we cannot cache `firebase-tools`
properly and Yarn might time out downloading this
dependency. We can safely move this to the top level
`package.json` since Bazel now has a `.bazelignore` and
since we have a cache that works for PRs (with fallback
caching).

Note that the `.bazelignore` is relevant here because
`firebase-tools` has been mainly moved to the bash
script because it broke some Bazel calls.

See 4f0cae0676.

PR Close #28615
2019-02-08 10:23:19 -08:00
Filipe Silva 264ef72800 build: update render3 section of integration test readme (#28372)
PR Close #28372
2019-02-07 12:36:51 -08:00
Filipe Silva f889317f93 build: re-enable CLI integration test for prod mode e2e (#28372)
PR Close #28372
2019-02-07 12:36:51 -08:00
Filipe Silva df3cea41de build: add cli-hello-world-ivy-minimal test with renderComponent (#28372)
PR Close #28372
2019-02-07 12:36:51 -08:00
Filipe Silva 36284713b2 build: rename cli-hello-world-ivy test to cli-hello-world-ivy-compat (#28372)
There are two ways to bootstrap an Ivy app: with `platformBrowserDynamic().bootstrapModule` and `renderComponent`.

To distinguish between these two approaches we call the `platformBrowserDynamic().bootstrapModule` way `ivy-compat` and the `renderComponent` way just `ivy`.

PR Close #28372
2019-02-07 12:36:51 -08:00
Filipe Silva ce83231ce9 build: update version of Angular CLI and Build Optimizer used for tests (#28372)
PR Close #28372
2019-02-07 12:36:51 -08:00
Greg Magolan 7a6237bc50 build: update lock files (#28532)
PR Close #28532
2019-02-05 16:55:43 -05:00
Greg Magolan ebaceb37e0 build: fix for integration test bazel-schematics (#28532)
PR Close #28532
2019-02-05 16:55:43 -05:00
Greg Magolan 57034aa13d build: fix for integration/bazel (#28532)
PR Close #28532
2019-02-05 16:55:43 -05:00
Greg Magolan cec1fa04c2 build: remove all deps on io_bazel_rules_go (#28532)
PR Close #28532
2019-02-05 16:55:43 -05:00
Greg Magolan 0d1e065a1c build: update to rules_typescript 0.23.2 and rules_nodejs 0.16.8 (#28532)
PR Close #28532
2019-02-05 16:55:43 -05:00
Keen Yee Liau 4a92fa9471 refactor(bazel): Create `ng-add` schematic for Bazel (#28436)
The logic to create additional files needed for Bazel are currently
hosted in `ng new`. Such files include the main.*.ts files needed
for AOT and a different angular.json to use Bazel builder, among others.

This commit refactors the logic into `ng add` so that it can be used to
perform the same modifications in an existing project. Users could do so
by running `ng add @angular/bazel`.

With this change, `ng new` effectively becomes an orchestrator that runs
the original `ng new` followed by `ng add @angular/bazel`.

PR Close #28436
2019-02-05 14:40:46 -05:00
George Kalpakas 72c36956de ci: pin ChromeDriver to a version compatible with docker image's Chrome (#28494)
By default, `webdriver-manager update` will download the latest
ChromeDriver version, which might not be compatible with the Chrome
version included in the [docker image used on CI], causing CI failures.
Previously, we used to pin the ChromeDriver version on CI in
[ngcontainer's Dockerfile][2]. This was accidentally broken in #26691,
while moving from ngcontainer to default CircleCI docker images.

This commit fixes the issue by pinning ChromeDriver to a known
compatible version.

[1]: bfd48d156d/.circleci/config.yml (L16)
[2]: bfd48d156d/tools/ngcontainer/Dockerfile (L63)

PR Close #28494
2019-02-01 20:22:03 -05:00
Keen Yee Liau 36902e2f0e fix(bazel): Bazel builder resolves with require.resolve() (#28478)
This commit fixes a bug in the Bazel builder in which the path to Bazel
executable is constructed using the project path. For non-default
project, the node_modules directory is actually one level above the
project path.

This PR fixes the bug by resolving node_modules with require.resolve().
It requires @bazel/bazel v0.22.1 because previous versions do not have
index.js or main field in package.json and would cause node module
resolution to fail.

This has been tested with both bazel and ibazel.

PR Close #28478
2019-02-01 13:56:53 -05:00
Keen Yee Liau b1e099b657 fix(bazel): fix integration test for bazel-schematics (#28460)
With the release of @angular/bazel v7.2.3, the npm install step right
after `ng new` installs this version. However there is a bug in the
builder which results in bazel executable not found.

This bug was not discovered before because the dependencies of the
project created by `ng new` are not pinned.

The fix is to pin the version of @angular/bazel to 7.2.2 which relies on
global installation of bazel.

PR Close #28460
2019-01-30 19:05:11 -05:00
Keen Yee Liau c84739dc55 test(bazel): Integration test for Sass support (#28297)
Add .sass files to the integration test for bazel-schematics.

Also addressed Alex's comment in
https://github.com/angular/angular/pull/28167/files#r248149866
about the unit tests being too brittle.

PR Close #28297
2019-01-28 20:01:18 -08:00
George Kalpakas 6e16338302 test: log cli version in `cli-hello-world[-ivy]` integration projects (#26947)
This helps debug issues on CI.

PR Close #26947
2019-01-28 14:01:13 -08:00
George Kalpakas 9a3739142f refactor: correctly name `cli-hello-world-ivy` project to distinguish from `cli-hello-world` in logs (#26947)
PR Close #26947
2019-01-28 14:01:13 -08:00
Keen Yee Liau 3b48d13af8 fix(bazel): ng-new should run yarn install (#28381)
yarn install was disabled in ng-new for Bazel schematics because
Bazel manages its own node_modules dependencies and therefore
there is no need to install dependencies twice.

However, the first yarn install is needed for `ng` commands to work,
most notably `ng build`.

This commit restores the original behavior.

PR Close #28381
2019-01-28 11:54:37 -08:00
Keen Yee Liau 2a02f4beb2 test(bazel): Cleanup bazel-schematics integration test (#28351)
PR Close #28351
2019-01-25 12:47:25 -08:00
George Kalpakas 94e305f48e build: upgrade `cli-hello-world[-ivy]` integration projects to @angular/cli@7.2.1 (#27697)
PR Close #27697
2019-01-22 12:02:10 -08:00
Alex Eagle 9a965c9145 build: create dist/bin symlink with Bazel outputs (#27781)
Note that we had nasty problems in the past when this was enabled, but those have supposedly been fixed.

PR Close #27781
2019-01-22 09:52:46 -08:00
Alex Eagle 38343a2388 build: set a default module_name for ts_library rules (#28051)
PR Close #28051
2019-01-18 10:16:39 -08:00
Keen Yee Liau c1c87462fd build(bazel): Use local rollup & build-optimizer for ng_rollup_bundle (#28215)
The current build workflow depends on cross workspace dependency by
installing angular-cli as a Bazel repository. This is not ideal because
it introduces separate node_module directories other than the one
installed by Angular through the yarn_install rule (ngdeps).

This commit removes angular-cli from the Bazel workspace and installs
rollup and @angular-devkit/build-optimizer locally.

PR Close #28215
2019-01-18 09:07:52 -08:00
Keen Yee Liau f8ad4d1e99 test(language-service): Improve integration test (#28168)
The current integration test for language service involves piping the
results of one process to another using Unix pipes.
This makes the test hard to debug, and hard to configure.

This commit refactors the integration test to use regular Jasmine
scaffolding.

More importantly, it tests the way the language service will actually
be installed by end users. Users would not have to add
`@angular/language-service` to the plugins section in tsconfig.json
Instead, all they need to do is install the *extension* from
the VS Code Marketplace and Angular Language Service will be loaded
as a global plugin.

PR Close #28168
2019-01-17 14:11:28 -08:00
Keen Yee Liau 80967ce82c build(bazel): Use @angular/cli from root package.json (#28139)
A few integration tests now depend on @angular/cli.

This commit changes the affected tests to use the dependency
on @angular/cli defined at root package.json.

PR Close #28139
2019-01-16 17:37:22 -08:00
Keen Yee Liau a570fdf0f0 fix(bazel): Fix integration test after v8 bump (#28194)
The integration test for bazel-schematics installs Angular in
two different locations:

1. Bazel workspace
2. package.json -> fetched from npm

Pull request #28142 changes the test to always install (1) from
source. This breaks when there's a major version bump since the
versions locally and the version in package.json no longer match.

This change updates package.json to fetch @angular/* packages
locally as well.

PR Close #28194
2019-01-16 16:09:58 -08:00
Keen Yee Liau 2afbcafab7 test(bazel): Use local_repository to load Angular (#28061)
The current integration test for Bazel schematics downloads a
published version of Angular as required by the http_archive
rule in the CLI created WORKSPACE.
However, this makes the test less useful because it does not
actually test any changes to the Angular repo at source.
This PR replaces the http_archive method in the WORSPACE
with local_repository so that any local changes to the Angular
repo are tested accordingly.

With Typescript 3.2, the file e2e/src/app.po.ts generated by CLI
no longer compiles under Bazel due to missing type annotations.
A temporary file is placed in the integration/bazel-schematics
directory while the change is pending in CLI repo.
https://github.com/angular/angular-cli/pull/13406

PR Close #28061
2019-01-11 16:19:59 -08:00