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

Use _private instead of #private properties #1335

Merged
merged 1 commit into from
Sep 20, 2021

Commits on Sep 10, 2021

  1. Use _private instead of #private properties

    The updates to the template compiler made in support of strict mode
    introduced a number of uses of private class fields, some of them in hot
    paths. Although all supported versions of Node support private class
    fields, `tsc` transpiles private class fields to `WeakMap`s for all
    values of `target` lower than `ESNEXT`. As a result, the use of private
    class fields results in dramatically higher memory usage and garbage
    collection than in the previous version of the template compiler. This
    in turn causes at least a large portion of the regression noted in
    [emberjs/ember.js#19750][1].
    
    [1]: emberjs/ember.js#19750
    
    Here, we replace *all* private class fields with `_` private fields,
    which substantially (thought not 100%) closed the gap with the original.
    
    Co-authored-by: Brenden Palmer <[email protected]>
    chriskrycho and brendenpalmer committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    80eed34 View commit details
    Browse the repository at this point in the history