Commit Graph

12501 Commits

Author SHA1 Message Date
Filipe Silva d6cfe2ed7e build: use cross platform workspace_status_command (#27431)
PR Close #27431
2019-01-09 10:47:13 -08:00
Filipe Silva eb1aae4043 ci: use image based cache for windows BuildKite (#27990)
PR Close #27990
2019-01-09 10:45:59 -08:00
Paul Gschwendtner 935ce63b73 fix(bazel): flat module misses AMD module name on windows (#27839)
* Fixes that the flat module out files do not have a proper AMD module name on Windows. This is currently blocking serving a `ng_module` using the Bazel TypeScript `devserver` on Windows.

PR Close #27839
2019-01-09 10:42:37 -08:00
Paul Gschwendtner 31fdff7121 build: re-enable disabled e2e tests (#27979)
Re-enables a few e2e tests which have been disabled a long time ago. Since these pass now, we should re-enable them.

PR Close #27979
2019-01-09 10:41:16 -08:00
Paul Gschwendtner c7d1890aaa build: remove travisci leftovers (#27979)
PR Close #27979
2019-01-09 10:41:16 -08:00
WilliamKoza c7346bfdba fix(aio): Treating some deprecated (#27981)
PR Close #27981
2019-01-09 10:39:25 -08:00
Dario Braun d2b2d813d5 docs(core): fix characters that corrupt link (#27982)
PR Close #27982
2019-01-09 10:38:22 -08:00
Andrew Kushnir 72fc0a747d test(ivy): updating root causes for tests within @angular/core (#28003)
The problem that `fixmeIvy`s refer to is resolved, but the tests are still broken due to other issue (not possible to retrieve host property bindings for DebugElement).

PR Close #28003
2019-01-09 10:34:50 -08:00
Kara Erickson cea3b8f885 test(ivy): update root cause of linker test (#28004)
PR Close #28004
2019-01-09 10:33:54 -08:00
George Kalpakas 5e7c71e51c build(docs-infra): remove unnecessary script to workaround cli issue (#28012)
The cli issue has been fixed and we no longer need to work around it.
This is essentially reverting #23470.

PR Close #28012
2019-01-09 10:29:43 -08:00
George Kalpakas 4e17212d44 test(upgrade): properly clean up after tests to avoid errors in unrelated tests (#28013)
Many `ngUpgrade` tests need to manually [bootstrap modules][1] (instead
of using `TestBed` which automatically cleans up) and thus need to also
manually clean up afterwards (e.g. by calling [destroyPlatform()][2]
after each test).

Failing to destroy the platform is usually not a problem, unless the
next test tries to manually destroy it (as a precaution), as happens
[here][3] (among other places).

More specifically, the problem happens, because (as part of the clean-up
happening on platform destruction) upgraded components will try to
[call a method][4] on `angular.element` after `angular` has been
[set to `undefined`][5] (assuming the last test was using the
[withEachNg1Version()][6] helper).

Because the test order is pseudo-random and thus different on each run,
these errors did not always come up and - when they did- they would go
away after a couple of reruns, making them appear as flakes on CI.

(For reference, the issue was introduced in 43c33d566.)

This commit eliminates the issue by always destroying the platform after
each `ngUpgrade` test.

Jira issue: FW-924

[1]: c3aa24c3f9/packages/upgrade/test/static/test_helpers.ts (L21)
[2]: c3aa24c3f9/packages/upgrade/test/static/integration/upgrade_component_spec.ts (L24)
[3]: c3aa24c3f9/packages/elements/test/create-custom-element_spec.ts (L31)
[4]: c3aa24c3f9/packages/upgrade/src/common/upgrade_helper.ts (L134-L135)
[5]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L115)
[6]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L31)

PR Close #28013
2019-01-09 10:27:46 -08:00
Andrew Kushnir c3aa24c3f9 fix(ivy): sanitization for Host Bindings (#27939)
This commit adds sanitization for `elementProperty` and `elementAttribute` instructions used in `hostBindings` function, similar to what we already have in the `template` function. Main difference is the fact that for some attributes (like "href" and "src") we can't define which SecurityContext they belong to (URL vs RESOURCE_URL) in Compiler, since information in Directive selector may not be enough to calculate it. In order to resolve the problem, Compiler injects slightly different sanitization function which detects proper Security Context at runtime.

PR Close #27939
2019-01-08 17:17:04 -08:00
Andrew Crites 1de4031d9c docs: use static zip function as an Observable creator. (#26790)
The existing example makes it seem like zip is a pipeable operator. It can be used this way, but I think that is for backwards compatibility. You can achieve the same functionality by using it as an Observable creator. I think this also makes the example clearer.

PR Close #26790
2019-01-08 17:16:45 -08:00
Alex Rickabaugh 1c39ad38d3 feat(ivy): reference external classes by their exported name (#27743)
Previously, ngtsc would assume that a given directive/pipe being imported
from an external package was importable using the same name by which it
was declared. This isn't always true; sometimes a package will export a
directive under a different name. For example, Angular frequently prefixes
directive names with the 'ɵ' character to indicate that they're part of
the package's private API, and not for public consumption.

This commit introduces the TsReferenceResolver class which, given a
declaration to import and a module name to import it from, can determine
the exported name of the declared class within the module. This allows
ngtsc to pick the correct name by which to import the class instead of
making assumptions about how it was exported.

This resolver is used to select a correct symbol name when creating an
AbsoluteReference.

FW-517 #resolve
FW-536 #resolve

PR Close #27743
2019-01-08 16:36:18 -08:00
Alex Rickabaugh 0b9094ec63 feat(ivy): produce diagnostics for missing exports, incorrect entrypoint (#27743)
This commit adds tracking of modules, directives, and pipes which are made
visible to consumers through NgModules exported from the package entrypoint.
ngtsc will now produce a diagnostic if such classes are not themselves
exported via the entrypoint (as this is a requirement for downstream
consumers to use them with Ivy).

To accomplish this, a graph of references is created and populated via the
ReferencesRegistry. Symbols exported via the package entrypoint are compared
against the graph to determine if any publicly visible symbols are not
properly exported. Diagnostics are produced for each one which also show the
path by which they become visible.

This commit also introduces a diagnostic (instead of a hard compiler crash)
if an entrypoint file cannot be correctly determined.

PR Close #27743
2019-01-08 16:36:18 -08:00
Alex Rickabaugh ac157170c8 feat(forms): export NumberValueAccessor & RangeValueAccessor directives (#27743)
@angular/forms declares several directives and a module which are not
exported from the package via the entrypoint, either intentionally or as a
historical accident.

Ivy's locality principle necessitates that directives used in user code be
importable from the package which defines them. This requires these forms
directives to be exported.

Several directives which define ControlValueAccessors are exported:

* NumberValueAccessor
* RangeValueAccessor

A few more directives and a module are exported privately (with a ɵ prefix):

* NgNoValidate
* NgSelectMultipleOption
* InternalFormsSharedModule

PR Close #27743
2019-01-08 16:36:18 -08:00
Alex Rickabaugh f4a9f5dae8 refactor(ivy): prep ngtsc and ngcc for upcoming import resolution work (#27743)
Upcoming work to implement import resolution will change the dependencies
of some higher-level classes in ngtsc & ngcc. This necessitates changes in
how these classes are created and the lifecycle of the ts.Program in ngtsc
& ngcc.

To avoid complicating the implementation work with refactoring as a result
of the new dependencies, the refactoring is performed in this commit as a
separate prepatory step.

In ngtsc, the testing harness is modified to allow easier access to some
aspects of the ts.Program.

In ngcc, the main change is that the DecorationAnalyzer is created with the
ts.Program as a constructor parameter. This is not a lifecycle change, as
it was previously created with the ts.TypeChecker which is derived from the
ts.Program anyways. This change requires some reorganization in ngcc to
accommodate, especially in testing harnesses where DecorationAnalyzer is
created manually in a number of specs.

PR Close #27743
2019-01-08 16:36:18 -08:00
Alex Rickabaugh 2a6108af97 refactor(ivy): split apart the 'metadata' package in the ngtsc compiler (#27743)
This refactoring moves code around between a few of the ngtsc subpackages,
with the goal of having a more logical package structure. Additional
interfaces are also introduced where they make sense.

The 'metadata' package formerly contained both the partial evaluator,
the TypeScriptReflectionHost as well as some other reflection functions,
and the Reference interface and various implementations. This package
was split into 3 parts.

The partial evaluator now has its own package 'partial_evaluator', and
exists behind an interface PartialEvaluator instead of a top-level
function. In the future this will be useful for reducing churn as the
partial evaluator becomes more complicated.

The TypeScriptReflectionHost and other miscellaneous functions have moved
into a new 'reflection' package. The former 'host' package which contained
the ReflectionHost interface and associated types was also merged into this
new 'reflection' package.

Finally, the Reference APIs were moved to the 'imports' package, which will
consolidate all import-related logic in ngtsc.

PR Close #27743
2019-01-08 16:36:18 -08:00
Alex Rickabaugh 37b716b298 refactor(ivy): move the flat module index generator to its own package (#27743)
This commit moves the FlatIndexGenerator to its own package, in preparation
to expand its capabilities and support re-exporting of private declarations
from NgModules.

PR Close #27743
2019-01-08 16:36:18 -08:00
Zheng Kai f6c91c5a5a docs: update rxjs example and change fromPromise to from (#27443)
the first example at https://angular.io/guide/rx-library,
https://github.com/ReactiveX/rxjs-tslint/issues/7

PR Close #27443
2019-01-08 16:15:53 -08:00
cexbrayat b621a69cda test: fix outDir in TS 3.2 integration test (#27774)
PR Close #27774
2019-01-08 16:00:26 -08:00
Igor Minar 3fba6eff79 ci: fix public api rule in codeowners (#27999)
@alxhub spotted that the public api rule in codeowners is being overriden by the Build & CI Owners rule.

swapping the two sections fixes the problem.

PR Close #27999
2019-01-08 15:56:13 -08:00
Miško Hevery b9c6df6da7 fix(ivy): use NgZone.onStable when bootstraped using PlatformRef (#27898)
PR Close #27898
2019-01-08 14:10:53 -08:00
Kara Erickson 1a7f92c423 test(ivy): re-enable passing animation tests (#27997)
PR Close #27997
2019-01-08 14:07:31 -08:00
Kara Erickson a0840242d7 ci: update payload size for cli-hello-world (#27994)
PR Close #27994
2019-01-08 11:58:40 -08:00
Pawel Kozlowski 090801532e test(ivy): update root cause analysis for the remaining query-related test (#27985)
PR Close #27985
2019-01-08 11:54:16 -08:00
Kara Erickson b541c48688 docs: group fixes and features for 7.2.0 in changelog desc (#27974)
PR Close #27974
2019-01-08 11:28:27 -08:00
Pawel Kozlowski b432eb1cae refactor(ivy): simplify signature of appendChild / removeChild (#27987)
Previously the appendChild / removeChild could take null as an argument for
a child to be added / removed. This is difficult to understand since the
mentioned methods are noop if a child is null.

This commit clarifies the appendChild / removeChild signature to systematically
require a child node to be added removed. It turns out that null could be passed
only for a very specific i18n cases so now we guard a call to removeChild with
an explicit check on the i18n side.

PR Close #27987
2019-01-08 11:26:07 -08:00
Alex Eagle cc5fb914bc docs: remove Travis status from README (#27973)
we no longer use TravisCI
PR Close #27973
2019-01-08 10:38:34 -08:00
George Kalpakas d72ae7b71e ci: compute commit range for rerun workflows (#27775)
On push builds, CircleCI provides `CIRCLE_COMPARE_URL`, which we use to
extract the commit range for a given build. When a workflow is rerun
(e.g. to recover from a flaked job), `CIRCLE_COMPARE_URL` is not
defined, causing some jobs to fail.

This commit fixes it by retrieving the compare URL from the original
workflow. It uses a slow process involving a (potentially large) number
of requests to CircleCI API.
It depends on the (undocumented) fact, that the `workspace_id` is the
same on all rerun workflows and the same as the original `workflow_id`.

PR Close #27775
2019-01-08 10:37:59 -08:00
Pawel Kozlowski aaa97f11d7 test(ivy): mark changed behaviour for queries and ng-container (#27977)
PR Close #27977
2019-01-08 10:37:39 -08:00
Olivier Combe 4b5b1f6d16 test(ivy): enable i18n test for nested templates (#27984)
The bug that was causing this test to fail has been resolved (see FW-903). The test now runs correctly.
PR Close #27984
2019-01-08 10:36:55 -08:00
Marc Laval c2f19515d6 test(ivy): enable last test in view injector integration spec (#27989)
PR Close #27989
2019-01-08 10:35:24 -08:00
Andrew Kushnir 6e7c46af1b fix(ivy): adding event listeners for global objects (window, document, body) (#27772)
This update introduces support for global object (window, document, body) listeners, that can be defined via host listeners on Components and Directives.

PR Close #27772
2019-01-08 10:33:17 -08:00
Filipe Silva 917c09cfc8 ci: update recommended buildkite VM (#27728)
PR Close #27728
2019-01-08 10:30:54 -08:00
Andrew Kushnir f5471107d9 test(ivy): root causes update for 'platform-browser-dynamic' and i18n tests (#27972)
PR Close #27972
2019-01-07 20:27:50 -08:00
Olivier Combe e6ab55daa0 fix(ivy): don't throw in `i18nAttributes` when a component is re-rendered (#27911)
`i18nAttributes` was throwing an error when it was called multiple times in the create part of the template function with the same index, for example when we create multiple components with the same template. It shouldn't throw in this case, and just use the cache when available.

FW-903 #resolve
PR Close #27911
2019-01-07 20:21:49 -08:00
Igor Minar 7db05c408c ci: remove required ci status for travis from angular-robot.yaml (#27970)
we missed this one!! oops

the robot should not expect travis status check on PRs any more.

PR Close #27970
2019-01-07 15:42:21 -08:00
Paul Gschwendtner 483f8250bf build: increase parallelism for "test_docs_examples" job (#27937)
PR Close #27937
2019-01-07 15:35:10 -08:00
Paul Gschwendtner 8e530a03b6 build: group sharded "test_docs_examples" jobs within circleci (#27937)
* Groups the two sharded `test_docs_examples` job using CircleCI's `parallelism` feature.  This makes the amount of jobs that show up on a PR, more reduced and also reduces code duplication for maintaining the Circle job definition.

PR Close #27937
2019-01-07 15:35:10 -08:00
Paul Gschwendtner b47c43af45 build: bazel integration test using limited resources (#27937)
PR Close #27937
2019-01-07 15:35:10 -08:00
Paul Gschwendtner 4fc41517d1 build: shard integration tests on circleci (#27937)
PR Close #27937
2019-01-07 15:35:09 -08:00
Igor Minar c80071dd59 test: fix integration/platform-server test which had missing @types/node devDep (#27937)
I'm not sure why this problem is visible only now or how this worked before, but the CI
is now failing because @types/node is missing.

I also added the yarn.lock file which was previously omitted. We want the yarn.lock file in so that
our deps don't change over time without us knowing.

PR Close #27937
2019-01-07 15:35:09 -08:00
Paul Gschwendtner 98472da03f build: remove "build.sh" script (#27937)
this script is now obsolete and not needed any more. yay!!!

PR Close #27937
2019-01-07 15:35:09 -08:00
Paul Gschwendtner 7ac8b02ec5 build: remove "test.sh" script (#27937)
test.sh is no longer needed... all the tests should now be executed via bazel.

if for whatever reason we need to run the legacy unit test setup, we should should follow the commands that we use to execute those tests in .circle/config.yaml

PR Close #27937
2019-01-07 15:35:09 -08:00
Paul Gschwendtner 0199e26167 ci: remove travis ci setup (#27937)
we no longer need it... yay!!!

PR Close #27937
2019-01-07 15:35:09 -08:00
Paul Gschwendtner 17291e66a0 ci: run legacy e2e tests in parallel (#27937)
PR Close #27937
2019-01-07 15:35:09 -08:00
Paul Gschwendtner 7de7b7a16a ci: move e2e tests from travis to circleci (#27937)
PR Close #27937
2019-01-07 15:35:09 -08:00
Igor Minar bb5ddee710 ci: remove build steps that are no longer needed (#27937)
the metadata build seems to be needed only by the offline compiler tests which is currently disabled

PR Close #27937
2019-01-07 15:35:09 -08:00
Igor Minar 04ca3bcf10 ci: move local and saucelabs unit tests to circle (#27937)
Moving the tests over to CircleCI in pretty much "as-is" state just so that we can drop the dependency on Travis.

In the followup changes we plan to migrate these tests to run on sauce under bazel. @gregmagolan is working on that.

I've previously verified that all the tests executed in legacy-unit-tests-local already under bazel.
Therefore the legacy-unit-tests-local job is strictly not necessary any more, but given how flaky legacy-unit-tests-saucelabs is,
it is good to have the -local job just so that we can quickly determine if any failure is a flake or legit issue
(the bazel version of these tests could theoretically run in a slightly different way and fail or not fail in a different way, so having -lcoal job is just an extra safety check).

This change was coauthored with @devversion

PR Close #27937
2019-01-07 15:35:09 -08:00