angular/packages/compiler-cli/test/ngtsc
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
..
BUILD.bazel test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
component_indexing_spec.ts refactor(compiler-cli): update to use new file-system interfaces (#40281) 2021-01-08 09:34:44 -08:00
env.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:22 -08:00
incremental_error_spec.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:22 -08:00
incremental_semantic_changes_spec.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:22 -08:00
incremental_spec.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:22 -08:00
incremental_typecheck_spec.ts perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:22 -08:00
modulewithproviders_spec.ts test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
monorepo_spec.ts test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
ngtsc_spec.ts refactor(compiler): move factory out of injector definition (#41022) (#41133) 2021-03-09 08:51:59 -08:00
scope_spec.ts test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
sourcemap_utils.ts fix(compiler-cli): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:46 -08:00
template_mapping_spec.ts fix(compiler): exclude trailing whitespace from element source spans (#40513) 2021-01-28 08:57:46 -08:00
template_typecheck_spec.ts fix(compiler-cli): preserve user line endings in diagnostic template parse (#40597) 2021-01-29 11:15:17 -08:00