How can I rewrite this code for the moved SyntaxContext?
I'm upgrading the Qwik optimizer and this code no longer works because expr.span no longer has the SyntaxContext.
However, the only other property is
How can I get at the syntax context to add the mark? Or is this the wrong approach and should I be doing one of https://swc.rs/docs/plugin/ecmascript/cheatsheet#deleting-node ? I'm not sure how to apply that though, since it marks by making the name invalid and then removes, but here I need to retain what's marked.
I don't quite understand how it works, but it removes statements that aren't used. The full code is at https://github.com/QwikDev/qwik/blob/b0802ca6dc448a82454dfba6b46f7392e0401c05/packages/qwik/src/optimizer/core/src/clean_side_effects.rs
However, the only other property is
expr.expr which is a Box<Expr>.How can I get at the syntax context to add the mark? Or is this the wrong approach and should I be doing one of https://swc.rs/docs/plugin/ecmascript/cheatsheet#deleting-node ? I'm not sure how to apply that though, since it marks by making the name invalid and then removes, but here I need to retain what's marked.
I don't quite understand how it works, but it removes statements that aren't used. The full code is at https://github.com/QwikDev/qwik/blob/b0802ca6dc448a82454dfba6b46f7392e0401c05/packages/qwik/src/optimizer/core/src/clean_side_effects.rs
GitHub
Instant-loading web apps, without effort. Contribute to QwikDev/qwik development by creating an account on GitHub.
SWC is an extensible Rust-based platform for the next generation of fast developer tools. It's used by tools like Next.js, Parcel, and Deno, as well as companies like Vercel, ByteDance, Tencent, Shopify, and more.
