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

Do not slice classNames and classNameBindings speculatively. #14389

Merged
merged 3 commits into from
Oct 27, 2016

Commits on Sep 30, 2016

  1. Do not slice classNames and classNameBindings per instance.

    The vast majority of the time these arrays are completely static on the
    prototype, there are relatively few instances where we actually need to
    slice them but we were speculatively doing this "just in case" you
    wanted it.
    
    This change does not remove the ability to have custom `classNames` /
    `classNameBindings` per instance, but it does make it so that folks
    wanting to do this would need to do `this.classNames.slice()` first.
    
    This avoids many extraneous array allocations, and just one more layer
    of wasted work during initial render.
    Robert Jackson committed Sep 30, 2016
    Configuration menu
    Copy the full SHA
    172d158 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    09140df View commit details
    Browse the repository at this point in the history
  3. Ensure concatenated properties are frozen.

    Mutating objects on the prototype (which includes concatenated
    properties) is not good. This changes the functionality of concatenated
    properties to freeze the resulting array while in debug mode, to make it
    clear that mutating them without slicing first is not good.
    Robert Jackson committed Sep 30, 2016
    Configuration menu
    Copy the full SHA
    0224f81 View commit details
    Browse the repository at this point in the history