Commit Graph

13155 Commits

Author SHA1 Message Date
Andrew Kushnir 495a9dd445 fix(ivy): update token used for fakeAsync test (#28383)
This commit updates the token used in fakeAsync test to the one available in both VE and R3 TestBeds. The goal of the test is to verify that fakeAsync works with inject function, so the actual token that is used for a test is irrelevant in that case. The logic to retrieve tokens from compiler injector (that the comment in "fixmeIvy" refers to) was implemented in PR #28196.

PR Close #28383
2019-01-29 16:39:14 -08:00
Andrew Kushnir 778d5739e2 refactor(ivy): minor refactoring of Host Bindings function generation (#28379)
Prior to this change, generation of host bindings and host styles was guarded by the "if" statement, which always returned true. Enforcing more strict check for bindings length broke some tests, since host styling instructions generation were inside the same "if" block. This update decouples bindings instruction generation from styling instructions, which makes it less error prone.

PR Close #28379
2019-01-29 16:38:25 -08:00
cexbrayat 66ce3b2f2f fix(ivy): scan simple children routes with no infinite recursion (#28370)
PR Close #28370
2019-01-29 16:37:48 -08:00
Andrew Kushnir 76cedb8bf3 fix(ivy): verify Host Bindings and Host Listeners before compiling them (#28356)
Prior to this change we may encounter some errors (like pipes being used where they should not be used) while compiling Host Bindings and Listeners. With this update we move validation logic to the analyze phase and throw an error if something is wrong. This also aligns error messages between Ivy and VE.

PR Close #28356
2019-01-29 16:36:22 -08:00
jithil-kore ad499628cb docs: fix typo for Browserslist in build guide (#28328)
PR Close #28328
2019-01-29 16:35:26 -08:00
Matti Järvinen 24f5428187 docs: fix typo for Browserslist in file structure guide (#28312)
PR Close #28312
2019-01-29 16:33:18 -08:00
Nazar Nasirzada a228d65412 docs: fix typo in lifecycle-hooks.md (#28206)
## PR Checklist
Please check if your PR fulfills the following requirements:
 
* [x]  The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
* [ ]  Tests for the changes have been added (for bug fixes / features)
* [x]  Docs have been added / updated (for bug fixes / features)
 
## PR Type
What kind of change does this PR introduce?

* [ ]  Bugfix
* [ ]  Feature
* [ ]  Code style update (formatting, local variables)
* [ ]  Refactoring (no functional changes, no api changes)
* [ ]  Build related changes
* [ ]  CI related changes
* [x]  Documentation content changes
* [ ]  angular.io application / infrastructure changes
* [ ]  Other... Please describe:

## What is the current behavior?
Issue Number: N/A

## What is the new behavior?
## Does this PR introduce a breaking change?
* [ ]  Yes
* [x]  No

## Other information
PR Close #28206
2019-01-29 16:32:02 -08:00
Janghyun Han dc8e461303 docs: angular.kr link added (#28113)
PR Close #28113
2019-01-29 16:31:37 -08:00
Erick Xavier eeadb37b19 docs(core): add relative path information to component metadata (#27962)
Adds the information that the templateUrl and styleUrls options supports only relative Urls.

Adds more information about relative paths and absolute URLs in project metadata.

PR Close #27962
2019-01-29 16:31:11 -08:00
onlyflix 41e68f7a7a style: change to American English (#27266)
PR Close #27266
2019-01-29 16:30:25 -08:00
jithil-kore dabcb3e17b docs: fix Redundant "See also:" link in ContentChild (#28334)
PR Close #28334
2019-01-29 12:03:25 -08:00
Filipe Silva bcf17bc91c refactor(compiler-cli): return TS nodes from TypeTranslatorVisitor (#28342)
The TypeTranslatorVisitor visitor returned strings because before it wasn't possible to transform declaration files directly through the TypeScript custom transformer API.

Now that's possible though, so it should return nodes instead.

PR Close #28342
2019-01-29 12:00:55 -08:00
Filipe Silva d45d3a3ef9 refactor(compiler-cli): use a transformer for dts files (#28342)
The current DtsFileTransformer works by intercepting file writes and editing the source string directly.

This PR refactors it as a afterDeclaration transform in order to fit better in the TypeScript API.

This is part of a greater effort of converting ngtsc to be usable as a TS transform plugin.

PR Close #28342
2019-01-29 12:00:55 -08:00
Filipe Silva f99a668b04 refactor(compiler-cli): refactor import adding logic into helper (#28342)
This logic will be common to transforms that add imports. Using it as a helper helps reduce duplication

PR Close #28342
2019-01-29 12:00:55 -08:00
Filipe Silva 70e426ba1b fix(bazel): also pass afterDeclarations transformers to emitWithTsickle (#28342)
Tsickle supports afterDeclarations transformers, but these were not being passed in.

PR Close #28342
2019-01-29 12:00:55 -08:00
jithil-kore ec414b432e perf: yarn version upgrade (#28360)
PR Close #28360
2019-01-29 11:58:47 -08:00
Benedikt Meurer 9af18c2fd0 perf(core): be more consistent about typeof checks (#28400)
When testing whether `value` is an object, use the ideal sequence of
strictly not equal to `null` followed by `typeof value === 'object'`
consistently. Specifically there's no point in using double equal with
`null` since `undefined` is ruled out by the `typeof` check.

Also avoid the unnecessary ToBoolean check on `value.ngOnDestroy` in
`hasOnDestroy()`, since the `typeof value.ngOnDestroy === 'function'`
will only let closures pass and all closures are truish (with the
notable exception of `document.all`, but that shouldn't be relevant
for the `ngOnDestroy` hook).

PR Close #28400
2019-01-29 11:50:47 -08:00
Jeremy Elbourn 2bb518c694 fix(ivy): add root components to the root view tree in renderComponent (#28409)
Previously, these components were not added to the view tree for the
(fake) root view in which they were bootstrapped. Without this,
root view destruction does not work as expected since the root view's
children are not present to be also destroyed.

PR Close #28409
2019-01-29 11:49:29 -08:00
WilliamKoza b87bf39eb4 fix(docs-infra): add hamburger button to CLI COMMANDS section (#28418)
Currently, when we navigate in the `CLI COMMANDS` section, the "hamburger button" isn't present because the class css `folder-cli` is missing.
This PR add this class in order to show this button when we are in this section.

PR Close #28418
2019-01-29 11:48:33 -08:00
Jason Aden 227f7e44d6 Revert "feat(compiler-cli): expose ngtsc as a TscPlugin" (#28433)
This reverts commit df2221c6476df1f2d2478b949702f3270c3a4565.

PR Close #28433
2019-01-29 11:29:48 -08:00
Alex Eagle 22f76df8f2 feat(compiler-cli): expose ngtsc as a TscPlugin (#28431)
This lets us run ngtsc under the tsc_wrapped custom compiler (Used in Bazel)
It also allows others to simply wire ngtsc into an existing typescript compilation binary

PR Close #28431
2019-01-29 09:44:58 -08:00
Jason Aden e18a52e24a Revert "feat(compiler-cli): expose ngtsc as a TscPlugin" (#28416)
This reverts commit cf4edbce40a3a65fdefe90760a93e43bc45b7d19.

PR Close #28416
2019-01-28 22:39:56 -08:00
Andrew Kushnir f38deb0f07 fix(ivy): update test after Content Queries inheritance fix (#28414)
This commit updates test that was added after Content Queries inheritance fix (that renames some instructions) was merged into master. The test used previous version of instructions, thus causing failures after merging Content Queries inheritance fix.

PR Close #28414
2019-01-28 22:07:32 -08:00
Alan Agius d940b5541f fix(docs-infra): boolean options default value is incorrect when it's undefined (#27024)
In the CLI when it's undefined it can mean `false`, or sometimes it will be overwritten by a runtime value.

PR Close #27024
2019-01-28 20:43:15 -08:00
Dhananjay Kumar 8e75a40735 docs(docs-infra): add ng-India to events list (#28119)
docs: add ng-India to events list
PR Close #28119
2019-01-28 20:18:51 -08:00
Alex Eagle 59cc724e3b feat(compiler-cli): expose ngtsc as a TscPlugin (#27806)
This lets us run ngtsc under the tsc_wrapped custom compiler (Used in Bazel)
It also allows others to simply wire ngtsc into an existing typescript compilation binary

PR Close #27806
2019-01-28 20:16:47 -08:00
Paul Gschwendtner 8ced999e47 build: improve compiler-cli codegen output test (#28191)
* Improves the `compiler-cli/integrationtest` codegen output test slightly by using a more clear test description and by adding an assertion that ensures that decorators are downleveled.

PR Close #28191
2019-01-28 20:07:22 -08:00
Paul Gschwendtner 4c8d17ffd4 build: fix outdated ngtools compiler-cli test logic (#28191)
* Fixes that the test logic for `ngtools` in the offline compiler test is no longer working due to being unmaintained for a long time
* Makes the path comparison logic platform agnostic, so that the tests can be also executed on Windows

PR Close #28191
2019-01-28 20:07:22 -08:00
Paul Gschwendtner 3e6a1f0bc4 build: fix outdated i18n compiler-cli test assertions (#28191)
PR Close #28191
2019-01-28 20:07:22 -08:00
Paul Gschwendtner 40d64b6b58 build: run offline_compiler_test using bazel (#28191)
PR Close #28191
2019-01-28 20:07:22 -08: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
Andrew Kushnir bb94434d85 fix(ivy): Content Queries inheritance fix (#28324)
Prior to this change contentQueriesRefresh functions that represent refresh logic for @ContentQuery list were not composable, which caused problems in case one Directive inherits another one and both of them contain Content Queries. Due to the fact that we used indices to reference queries in refresh function, results were placed into wrong Queries. In order to avoid that we no longer use indices to reference queries and instead maintain current content query index while iterating through them. This allows us to compose contentQueriesRefresh functions and make inheritance feature work with Content Queries.

PR Close #28324
2019-01-28 19:59:00 -08:00
Kristiyan Kostadinov ebac5dba38 fix(ivy): don't generate code for blank NgModule fields (#28387)
Currently `compileNgModule` generates an empty array for optional fields that are omitted from an `NgModule` declaration (e.g. `bootstrap`, `exports`). This isn't necessary, because `defineNgModule` has some code to default these fields to empty arrays at runtime if they aren't defined. The following changes will only output code if there are values for the particular field.

PR Close #28387
2019-01-28 19:50:44 -08:00
Paul Gschwendtner 29513296fb test: disable failing ivy example e2e tests (#28402)
PR Close #28402
2019-01-28 19:21:09 -08:00
Paul Gschwendtner 98e5af1480 build: switch example e2e tests to bazel (#28402)
* No longer builds the example e2e tests using "tsc". The examples are now built with Bazel and can therefore be built with Ivy by using the `--define=compile=aot` switch.
* No longer runs the example e2e tests using the protractor CLI. example e2e tests are executed with the Bazel protractor rule and can therefore run incrementally.

NOTE: Unit tests found within the examples are still running within the legacy jobs.

PR Close #28402
2019-01-28 19:21:09 -08:00
Alex Rickabaugh 66335c36e6 fix(ivy): getSourceFile() of transformed nodes returns undefined (#28412)
In some cases, calling getSourceFile() on a node from within a TS
transform can return undefined (against the signature of the method).
In these cases, getting the original node first will work.

PR Close #28412
2019-01-28 16:42:48 -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
George Kalpakas e98d508df2 ci(docs-infra): compile with Ivy (#26947)
Jira: FW-552

PR Close #26947
2019-01-28 14:01:13 -08:00
George Kalpakas 5639891e90 build(docs-infra): upgrade @angular/cli to 7.2.1 (#26947)
PR Close #26947
2019-01-28 14:01:13 -08:00
George Kalpakas 9d81bd39ca refactor(docs-infra): get rid of `on` component input (#26947)
Compiling with Ivy doesn't seem to allow input names starting with `on`.

PR Close #26947
2019-01-28 14:01:12 -08:00
George Kalpakas 9d3dae42e9 fix(ivy): return correct declaration for class indentifiers for ES5 in ngcc (#26947)
PR Close #26947
2019-01-28 14:01:12 -08:00
George Kalpakas 1699c88655 fix(ivy): add missing private render3 exports (#26947)
PR Close #26947
2019-01-28 14:01:12 -08:00
George Kalpakas 074400da60 refactor(core): remove duplicate check in `defaultStyleSanitizer` (#26947)
PR Close #26947
2019-01-28 14:01:12 -08:00
Alex Rickabaugh 7d954dffd0 feat(ivy): detect cycles and use remote scoping of components if needed (#28169)
By its nature, Ivy alters the import graph of a TS program, adding imports
where template dependencies exist. For example, if ComponentA uses PipeB
in its template, Ivy will insert an import of PipeB into the file in which
ComponentA is declared.

Any insertion of an import into a program has the potential to introduce a
cycle into the import graph. If for some reason the file in which PipeB is
declared imports the file in which ComponentA is declared (maybe it makes
use of a service or utility function that happens to be in the same file as
ComponentA) then this could create an import cycle. This turns out to
happen quite regularly in larger Angular codebases.

TypeScript and the Ivy runtime have no issues with such cycles. However,
other tools are not so accepting. In particular the Closure Compiler is
very anti-cycle.

To mitigate this problem, it's necessary to detect when the insertion of
an import would create a cycle. ngtsc can then use a different strategy,
known as "remote scoping", instead of directly writing a reference from
one component to another. Under remote scoping, a function
'setComponentScope' is called after the declaration of the component's
module, which does not require the addition of new imports.

FW-647 #resolve

PR Close #28169
2019-01-28 12:10:25 -08:00
Alex Rickabaugh cac9199d7c feat(ivy): cycle detector for TypeScript programs (#28169)
This commit implements a cycle detector which looks at the import graph of
TypeScript programs and can determine whether the addition of an edge is
sufficient to create a cycle. As part of the implementation, module name
to source file resolution is implemented via a ModuleResolver, using TS
APIs.

PR Close #28169
2019-01-28 12:10:25 -08:00
Alex Rickabaugh a789a3f532 test(ivy): clean up two parameters in ngtsc_spec.ts inferred as 'any' (#28169)
PR Close #28169
2019-01-28 12:10:25 -08:00
Keen Yee Liau 5dbc7d9a63 fix(bazel): Builder should invoke local bazel/iblaze (#28303)
Builder for `@angular/bazel` schematics should not expect bazel/ibazel
to be on the PATH. It should instead invoke the local executable
installed by yarn/npm.

PR Close #28303
2019-01-28 12:01:35 -08:00
Pawel Kozlowski fd8dbd5e40 test(ivy): @Injectable is required on type providers (#28331)
PR Close #28331
2019-01-28 12:01:07 -08:00
Keen Yee Liau 7033f39c61 fix(bazel): Bazel-workspace schematics should run in ScopedTree (#28349)
Users should be able to add Bazel workspace to an existing project.
The current approach assumes that the schematics is working on the same
tree as that of ng-new, which includes the top-level directory. Instead,
the schematic should work on the tree rooted at `appRoot` to enable
Bazel files to be added to existing project.

This change uses the newly implemented ScopedTree
a0ac4b0e3d
to achieve this.

NOTE: The version of `@angular-devkit/schematics` that is installed is
used to run the `@angular/bazel` schematic. Even if a different version
is used in the schematic itself, it has no effect.
Therefore, the *latest* Angular CLI should be used to generate the
files. As of this commit, the latest version is @angular/cli@7.3.0-rc.0

PR Close #28349
2019-01-28 12:00:16 -08:00