Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Switch emitDistinctChangesOnlyDefaultValue to true #41121

Closed

Commits on Mar 10, 2021

  1. fix(core): Switch emitDistinctChangesOnlyDefaultValue to true

    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`.
    mhevery committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    fa29891 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da5c248 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2021

  1. Configuration menu
    Copy the full SHA
    a6ba19b View commit details
    Browse the repository at this point in the history