SIGN IN SIGN UP

refactor(packages/codegen): TSDown plugin strip all `debugAssert*` calls (#25987)

Refactor in preparation for #25989.

`remove_asserts` TSDown plugin removes debug assertions in release builds, but only when the assertion functions are imported from `asserts.ts`.

We have various other `debugAssert*` functions which are defined elsewhere. Make the plugin remove them too in release builds.

The reason this is needed is that many of these `debugAssert` functions receive `node`. #25989 removes `node` param from functions containing these assertions, which means `node` becomes a global. Minifier has to assume accessing a global may have side-effects and therefore does not remove these debug assertions. We need the plugin to do it.
O
overlookmotel committed
b6c60361d2fb65bdd264f842cb1f714a0fc82b4e
Parent: 29a7749