angular-docs-cn/packages/compiler-cli/ngcc/test
Misko Hevery 70962465b5 fix(core): Switch `emitDistinctChangesOnlyDefaultValue` to true (#41121)
BREAKING CHANGE:

Switching default of `emitDistinctChangesOnlyDefaultValue`
which changes the default behavior and may cause some applications which
rely on the incorrect behavior to fail.

`emitDistinctChangesOnly` flag has also been deprecated and will be
removed in a future major release.

The previous implementation would fire changes `QueryList.changes.subscribe`
whenever the `QueryList` was recomputed. This resulted in an artificially
high number of change notifications, as it is possible that recomputing
`QueryList` results in the same list. When the `QueryList` gets recomputed
is an implementation detail, and it should not be the thing that determines
how often change event should fire.

Unfortunately, fixing the behavior outright caused too many existing
applications to fail. For this reason, Angular considers this fix a
breaking fix and has introduced a flag in `@ContentChildren` and
`@ViewChildren`, that controls the behavior.

```
export class QueryCompWithStrictChangeEmitParent {
  @ContentChildren('foo', {
    // This option is the new default with this change.
    emitDistinctChangesOnly: true,
  })
  foos!: QueryList<any>;
}
```
For backward compatibility before v12
`emitDistinctChangesOnlyDefaultValue` was set to `false. This change
changes the default to `true`.

PR Close #41121
2021-03-12 10:47:56 -08:00
..
analysis perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:19 -08:00
dependencies test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
entry_point_finder fix(compiler-cli): ensure ngcc can handle wildcard base-paths (#41033) 2021-03-01 15:25:44 -08:00
execution refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
helpers refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
host perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:19 -08:00
integration feat(compiler): emit @__PURE__ or @pureOrBreakMyCode annotations in the generated code (#41096) 2021-03-08 10:30:08 -08:00
locking fix(compiler-cli): ngcc - remove outdated link (#40285) 2021-01-06 07:10:39 -08:00
migrations test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
packages refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
rendering fix(core): Switch `emitDistinctChangesOnlyDefaultValue` to true (#41121) 2021-03-12 10:47:56 -08:00
writing refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
BUILD.bazel perf(compiler-cli): detect semantic changes and their effect on an incremental rebuild (#40947) 2021-03-08 08:41:19 -08:00
ngcc_options_spec.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
utils_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00