refactor(packages/codegen): TSDown plugin strip all debugAssert* calls - #25987
Merged
graphite-app[bot] merged 1 commit intoAug 24, 2026
Conversation
This was referenced Aug 22, 2026
This was referenced Aug 22, 2026
Merged
Member
Author
This was referenced Aug 22, 2026
overlookmotel
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 22, 2026 01:43
9b6e495 to
ba80f23
Compare
overlookmotel
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 22, 2026 01:43
3e7eaae to
0a703b3
Compare
overlookmotel
marked this pull request as ready for review
August 22, 2026 02:04
graphite-app
Bot
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 22, 2026 09:44
0a703b3 to
1f92e23
Compare
graphite-app
Bot
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 22, 2026 09:45
ba80f23 to
f716744
Compare
graphite-app
Bot
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 22, 2026 10:35
1f92e23 to
6514151
Compare
graphite-app
Bot
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 22, 2026 10:36
f716744 to
999ab14
Compare
graphite-app
Bot
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 22, 2026 13:38
6514151 to
d4f4401
Compare
graphite-app
Bot
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 22, 2026 13:38
999ab14 to
7e4b3e4
Compare
camc314
approved these changes
Aug 24, 2026
Contributor
Merge activity
|
graphite-app
Bot
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 24, 2026 09:08
d4f4401 to
af2ee26
Compare
graphite-app
Bot
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 24, 2026 09:09
7e4b3e4 to
09bb6d8
Compare
…lls (#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.
graphite-app
Bot
force-pushed
the
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
branch
from
August 24, 2026 09:23
af2ee26 to
29a7749
Compare
graphite-app
Bot
force-pushed
the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
from
August 24, 2026 09:23
09bb6d8 to
b6c6036
Compare
Base automatically changed from
om/08-19-perf_packages_codegen_pass_start_and_end_to_write_and_mark_functions
to
main
August 24, 2026 09:31
graphite-app
Bot
deleted the
om/08-19-refactor_packages_codegen_tsdown_plugin_strip_all_debugassert_calls
branch
August 24, 2026 09:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refactor in preparation for #25989.
remove_assertsTSDown plugin removes debug assertions in release builds, but only when the assertion functions are imported fromasserts.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
debugAssertfunctions receivenode. #25989 removesnodeparam from functions containing these assertions, which meansnodebecomes 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.