top | item 30016288

(no title)

robpalmer | 4 years ago

#private fields are not slow when used natively.

It's true the down-levelled code that uses WeakMaps is slower. The decision to downlevel is in the hands of the user and is controlled by the tsconfig "target" option.

The only environment that needs downlevelled #private fields is IE11.

discuss

order

auggierose|4 years ago

Which value are you setting for target? I tried es2021, and it still doesn't give me native #. I cannot use esnext, because other stuff doesn't compile anymore.