angular-cn/packages/compiler/test
Alex Rickabaugh 235a235fab feat: change @Injectable() to support tree-shakeable tokens (#22005)
This commit bundles 3 important changes, with the goal of enabling tree-shaking
of services which are never injected. Ordinarily, this tree-shaking is prevented
by the existence of a hard dependency on the service by the module in which it
is declared.

Firstly, @Injectable() is modified to accept a 'scope' parameter, which points
to an @NgModule(). This reverses the dependency edge, permitting the module to
not depend on the service which it "provides".

Secondly, the runtime is modified to understand the new relationship created
above. When a module receives a request to inject a token, and cannot find that
token in its list of providers, it will then look at the token for a special
ngInjectableDef field which indicates which module the token is scoped to. If
that module happens to be in the injector, it will behave as if the token
itself was in the injector to begin with.

Thirdly, the compiler is modified to read the @Injectable() metadata and to
generate the special ngInjectableDef field as part of TS compilation, using the
PartialModules system.

Additionally, this commit adds several unit and integration tests of various
flavors to test this change.

PR Close #22005
2018-02-12 14:34:59 -08:00
..
aot feat: change @Injectable() to support tree-shakeable tokens (#22005) 2018-02-12 14:34:59 -08:00
css_parser build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00
expression_parser build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00
i18n fix(compiler): fix ICU select messages to use male/female/other (#21713) 2018-01-23 16:32:23 -08:00
ml_parser fix(compiler): fix ICU select messages to use male/female/other (#21713) 2018-01-23 16:32:23 -08:00
output build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
render3 refactor(ivy): validate that identifier identity in emitted output (#21877) 2018-02-09 13:06:10 -08:00
schema build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
template_parser feat(ivy): update compiler to specification (#21657) 2018-01-20 09:28:44 -08:00
BUILD.bazel build: Remove angular_src nested workspace (#21096) 2018-01-19 10:17:37 -08:00
config_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
core_spec.ts feat: change @Injectable() to support tree-shakeable tokens (#22005) 2018-02-12 14:34:59 -08:00
directive_lifecycle_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
directive_normalizer_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
directive_resolver_mock_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
directive_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
integration_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
metadata_resolver_fixture.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
metadata_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
ng_module_resolver_mock_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
ng_module_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
parse_util_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
pipe_resolver_mock_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
pipe_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
resource_loader_mock_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
runtime_compiler_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
selector_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
shadow_css_spec.ts fix(compiler): Don't strip `/*# sourceURL ... */` (#16088) 2018-01-24 12:35:30 -08:00
spies.ts perf: switch angular to use StaticInjector instead of ReflectiveInjector 2017-08-07 15:42:34 -07:00
style_url_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
test_bindings.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
url_resolver_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
util_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00