angular/packages/compiler-cli/src/transformers
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
..
api.ts Revert "feat(compiler-cli): add watch mode to ngc (#18818)" 2017-08-30 19:02:03 -07:00
compiler_host.ts fix(compiler-cli): use forward slashes for ts.resolveModuleName (#18784) 2017-08-18 22:28:08 -05:00
entry_points.ts refactor(compiler): simplify the CompilerHost used for transformers 2017-08-16 15:24:48 -07:00
lower_expressions.ts feat(compiler-cli): lower metadata useValue and data literal fields (#18905) 2017-08-31 09:46:16 -07:00
node_emitter.ts fix(compiler): quote non identifiers in map keys. (#18788) 2017-08-28 18:46:43 -05:00
node_emitter_transform.ts feat(compiler-cli): new compiler api and command-line using TypeScript transformers 2017-06-23 16:18:44 -07:00
program.ts Revert "feat(compiler-cli): add watch mode to ngc (#18818)" 2017-08-30 19:02:03 -07:00