Skip to content

Is TDZ avoidance still needed?Β #2889

Closed as not planned
Closed as not planned
@robpalme

Description

When bundling with ESNext output, classes can still get downleveled, due to an intentional performance-workaround called TDZ avoidance. This creates a consequential performance hazard when private fields end up using WeakMaps.

It looks like TDZ avoidance workaround originated in ESBuild as a response to this issue which highlighted a performance bug in Safari. That bug was fixed over two years ago and has long since rolled out to all stable versions of Safari. So it looks like Safari performance is no longer a justification for this feature.

ESBuild still has the avoidTDZ code branches and the attached comment explains it exists due to Safari.

Is it ok to remove this feature now? Or should the comment be updated to describe some other reason?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions