angular/packages/compiler/src/render3
Pete Bacon Darwin 1bebd66ee5 refactor(compiler): move factory out of injector definition (#41022) (#41133)
Previously, injector definitions contained a `factory` property that
was used to create a new instance of the associated NgModule class.

Now this factory has been moved to its own `ɵfac` static property on the
NgModule class itself. This is inline with how directives, components and
pipes are created.

There is a small size increase to bundle sizes for each NgModule class,
because the `ɵfac` takes up a bit more space:

Before:

```js
let a = (() => {
  class n {}
  return n.\u0275mod = c.Cb({type: n}),
  n.\u0275inj = c.Bb({factory: function(t) { return new (t || n) }, imports: [[e.a.forChild(s)], e.a]}),
  n
})(),
```

After:

```js
let a = (() => {
  class n {}
  return n.\u0275fac = function(t) { return new (t || n) },
  n.\u0275mod = c.Cb({type: n}),
  n.\u0275inj = c.Bb({imports: [[r.a.forChild(s)], r.a]}),
  n
})(),
```

In other words `n.\u0275fac = ` is longer than `factory: ` (by 5 characters)
and only because the tooling insists on encoding `ɵ` as `\u0275`.

This can be mitigated in a future PR by only generating the `ɵfac` property
if it is actually needed.

PR Close #41022

PR Close #41133
2021-03-09 08:51:59 -08:00
..
partial refactor(compiler-cli): implement ɵɵngDeclarePipe() (#40803) 2021-02-12 09:00:16 -08:00
view refactor(compiler): remove unused emitAllPartialModules() and associated code (#41040) 2021-03-04 11:04:29 -08:00
r3_ast.ts refactor(compiler-cli): add keySpan to reference nodes (#39616) 2020-11-12 15:12:53 -08:00
r3_factory.ts refactor(core): remove getFactoryOf from angularCoreDiEnv (#41040) 2021-03-04 11:04:29 -08:00
r3_identifiers.ts refactor(core): remove getFactoryOf from angularCoreDiEnv (#41040) 2021-03-04 11:04:29 -08:00
r3_jit.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_module_compiler.ts refactor(compiler): move factory out of injector definition (#41022) (#41133) 2021-03-09 08:51:59 -08:00
r3_pipe_compiler.ts refactor(compiler): remove unused emitAllPartialModules() and associated code (#41040) 2021-03-04 11:04:29 -08:00
r3_template_transform.ts fix(compiler): throw error for duplicate template references (#40538) 2021-02-10 11:05:16 -08:00
util.ts fix(compiler): incorrectly interpreting some HostBinding names (#40233) 2021-01-07 13:15:46 -08:00