Closed
Description
I was working on #82114 and discovered that the toggle logic is written scattered all throughout main.js
. This seems suboptimal; I'd rather not be generating HTML in main.js. A lot of the toggle logic does things like check the classes of nearby items, etc, which seems super brittle.
I propose we move the toggle logic to Rust code instead; writing a wrapToggle()
method that wraps some HTML in a toggle.
Thoughts? @rust-lang/rustdoc
Might be worth creating a meta issue for reducing the size of main.js in general. We seem to do a fair amount of additional codegen there, not just for toggles.