#9310 implemented explicit resource management (`using` declarations) transform. A few tasks for us as follow-ups: * [ ] Document `enter_program` visitor. Which statements are moved into new block, and which aren't? Why? * [ ] Improve perf, by avoiding re-visiting statements (https://github.com/oxc-project/oxc/pull/9310#issuecomment-2702260897). * https://github.com/oxc-project/oxc/pull/9714 * https://github.com/oxc-project/oxc/pull/9715 * https://github.com/oxc-project/oxc/pull/9716 * [x] Add an option to enable/disable the transform. Currently it's always enabled. * [x] Fix scope of `using` declarations (#9666). * [ ] Fix semantic errors in transform after that change. * [x] Add test cases for scope re-parenting (https://github.com/oxc-project/oxc/pull/9310#discussion_r1988348266). * [x] Remove reliance on `SemanticBuilder::with_scope_tree_child_ids` (hopefully). Then remove [from example](https://github.com/oxc-project/oxc/blob/a10ead891317aadebfd7ab8d638a1581f0d43bd0/crates/oxc_transformer/examples/transformer.rs#L48). * #9744 * #9961 * [ ] Investigate span mismatch in transform conformance tests for this transform. @overlookmotel cc @camc314.
#9310 implemented explicit resource management (
usingdeclarations) transform.A few tasks for us as follow-ups:
enter_programvisitor. Which statements are moved into new block, and which aren't? Why?usingdeclarations (Bindings declared withusingshould be block scoped and const #9666).SemanticBuilder::with_scope_tree_child_ids(hopefully). Then remove from example.usingcrashes #9744cc @camc314.