angular/packages/compiler-cli/src
Chuck Jazdzewski 0e64261f26 feat(compiler-cli): lower metadata useValue and data literal fields (#18905)
With this commit the compiler will "lower" expressions into exported
variables for values the compiler does not need to know statically
in order to be able to generate a factory. For example:

```
  providers: [{provider: 'token', useValue: calculated()}]
```

produced an error as the expression `calculated()` is not supported
by the compiler because `calculated` is not a
[known function](https://angular.io/guide/metadata#annotationsdecorators)

With this commit this is rewritten, during emit of the .js file, into
something like:

```
export var ɵ0 = calculated();

  ...

  provdiers: [{provider: 'token', useValue: ɵ0}]
```

The compiler then will now generate a reference to the exported `ɵ0`
instead of failing to evaluate `calculated()`.

PR Close #18905
2017-08-31 09:46:16 -07:00
..
diagnostics feat(compiler-cli): lower metadata useValue and data literal fields (#18905) 2017-08-31 09:46:16 -07:00
transformers feat(compiler-cli): lower metadata useValue and data literal fields (#18905) 2017-08-31 09:46:16 -07:00
codegen.ts fix(compiler-cli): propagate preserveWhitespaces option to codegen (#18773) 2017-08-21 17:32:10 -05:00
compiler_host.ts feat(compiler): use typescript for resolving resource paths 2017-08-16 15:24:48 -07:00
extract_i18n.ts fix(compiler): compile .ngfactory.ts files even if nobody references them. (#16899) 2017-05-25 11:00:26 -06:00
extractor.ts build: Bazel builds ngfactories for packages/core (#18289) 2017-07-21 18:09:47 -05:00
language_services.ts fix(language-service): remove tsickle dependency 2017-08-16 11:33:49 -07:00
main.ts Revert "feat(compiler-cli): add watch mode to ngc (#18818)" 2017-08-30 19:02:03 -07:00
ngtools_api.ts perf: latest tsickle to tree shake: abstract class methods & interfaces (#18236) 2017-07-21 16:35:37 -05:00
ngtools_impl.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
path_mapped_compiler_host.ts feat(compiler-cli): automatically lower lambda expressions in metadata 2017-07-31 11:30:44 -07:00
perform-compile.ts Revert "feat(compiler-cli): add watch mode to ngc (#18818)" 2017-08-30 19:02:03 -07:00
version.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00