2018-09-11 21:11:32 -04:00
|
|
|
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
2018-07-16 03:49:56 -04:00
|
|
|
|
2019-01-16 04:19:01 -05:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
2018-07-16 03:49:56 -04:00
|
|
|
ts_library(
|
|
|
|
name = "test_lib",
|
2018-10-16 02:24:22 -04:00
|
|
|
testonly = True,
|
2019-03-20 09:47:58 -04:00
|
|
|
srcs = glob(
|
|
|
|
["**/*.ts"],
|
|
|
|
exclude = ["integration/**/*.ts"],
|
|
|
|
),
|
2018-07-16 03:49:56 -04:00
|
|
|
deps = [
|
2019-11-04 12:29:01 -05:00
|
|
|
"//packages/compiler",
|
2019-03-20 09:47:58 -04:00
|
|
|
"//packages/compiler-cli/ngcc",
|
2019-04-06 10:35:13 -04:00
|
|
|
"//packages/compiler-cli/ngcc/test/helpers",
|
2019-07-18 16:05:32 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
2019-06-06 15:22:32 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
|
|
"//packages/compiler-cli/src/ngtsc/file_system/testing",
|
2018-12-18 12:48:15 -05:00
|
|
|
"//packages/compiler-cli/src/ngtsc/imports",
|
|
|
|
"//packages/compiler-cli/src/ngtsc/partial_evaluator",
|
|
|
|
"//packages/compiler-cli/src/ngtsc/reflection",
|
2018-07-16 03:49:56 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/testing",
|
2018-07-16 03:55:04 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/transform",
|
2019-04-28 15:48:33 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/translator",
|
2019-06-06 15:22:32 -04:00
|
|
|
"//packages/compiler-cli/test/helpers",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/convert-source-map",
|
2019-06-06 15:22:32 -04:00
|
|
|
"@npm//convert-source-map",
|
2019-08-28 08:01:39 -04:00
|
|
|
"@npm//dependency-graph",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//magic-string",
|
|
|
|
"@npm//typescript",
|
2018-07-16 03:49:56 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test",
|
2019-06-06 15:22:32 -04:00
|
|
|
data = [
|
|
|
|
"//packages/compiler-cli/test/ngtsc/fake_core:npm_package",
|
|
|
|
],
|
2019-12-28 21:14:36 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
|
2018-07-16 03:49:56 -04:00
|
|
|
deps = [
|
|
|
|
":test_lib",
|
2019-12-28 21:14:36 -05:00
|
|
|
"//tools/testing:node_no_angular_es5",
|
2018-07-16 03:49:56 -04:00
|
|
|
],
|
|
|
|
)
|
2019-03-20 09:47:58 -04:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "integration_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = glob(
|
|
|
|
["integration/**/*.ts"],
|
|
|
|
),
|
|
|
|
deps = [
|
|
|
|
"//packages/compiler-cli/ngcc",
|
2019-04-06 10:35:13 -04:00
|
|
|
"//packages/compiler-cli/ngcc/test/helpers",
|
2019-06-06 15:22:32 -04:00
|
|
|
"//packages/compiler-cli/src/ngtsc/file_system",
|
|
|
|
"//packages/compiler-cli/src/ngtsc/file_system/testing",
|
|
|
|
"//packages/compiler-cli/src/ngtsc/testing",
|
|
|
|
"//packages/compiler-cli/test/helpers",
|
2019-03-20 09:47:58 -04:00
|
|
|
"@npm//rxjs",
|
feat(ngcc): add a migration for undecorated child classes (#33362)
In Angular View Engine, there are two kinds of decorator inheritance:
1) both the parent and child classes have decorators
This case is supported by InheritDefinitionFeature, which merges some fields
of the definitions (such as the inputs or queries).
2) only the parent class has a decorator
If the child class is missing a decorator, the compiler effectively behaves
as if the parent class' decorator is applied to the child class as well.
This is the "undecorated child" scenario, and this commit adds a migration
to ngcc to support this pattern in Ivy.
This migration has 2 phases. First, the NgModules of the application are
scanned for classes in 'declarations' which are missing decorators, but
whose base classes do have decorators. These classes are the undecorated
children. This scan is performed recursively, so even if a declared class
has a base class that itself inherits a decorator, this case is handled.
Next, a synthetic decorator (either @Component or @Directive) is created
on the child class. This decorator copies some critical information such
as 'selector' and 'exportAs', as well as supports any decorated fields
(@Input, etc). A flag is passed to the decorator compiler which causes a
special feature `CopyDefinitionFeature` to be included on the compiled
definition. This feature copies at runtime the remaining aspects of the
parent definition which `InheritDefinitionFeature` does not handle,
completing the "full" inheritance of the child class' decorator from its
parent class.
PR Close #33362
2019-10-23 15:00:49 -04:00
|
|
|
"@npm//typescript",
|
2019-03-20 09:47:58 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "integration",
|
2019-06-06 15:22:32 -04:00
|
|
|
timeout = "long",
|
2019-03-20 09:47:58 -04:00
|
|
|
data = [
|
|
|
|
"//packages/common:npm_package",
|
|
|
|
"//packages/core:npm_package",
|
|
|
|
"@npm//rxjs",
|
|
|
|
],
|
2019-06-06 15:22:32 -04:00
|
|
|
shard_count = 4,
|
2019-03-20 09:47:58 -04:00
|
|
|
tags = [
|
|
|
|
# Disabled in AOT mode because we want ngcc to compile non-AOT Angular packages.
|
|
|
|
"no-ivy-aot",
|
|
|
|
],
|
2019-12-28 21:14:36 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
|
2019-03-20 09:47:58 -04:00
|
|
|
deps = [
|
|
|
|
":integration_lib",
|
2019-12-28 21:14:36 -05:00
|
|
|
"//tools/testing:node_no_angular_es5",
|
2019-03-20 09:47:58 -04:00
|
|
|
"@npm//canonical-path",
|
|
|
|
"@npm//convert-source-map",
|
|
|
|
],
|
|
|
|
)
|