mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:** Refactor inline SWC helpers to use `packages/helpers/esm` as the canonical source and generate Rust helper artifacts from it. Key points: - Removes the duplicated hand-written inline helper JS files. - Keeps generated Rust artifacts checked in, so crate builds do not need Node, pnpm, or repo-relative helper sources. - Uses one generated Rust file per helper to keep diffs and ownership local. - Precomputes inline dependency closures during codegen, so runtime injection only ORs bitsets. - Uses `u128` for helper bitsets because the helper set is small, fixed-order, dependency-free, and cache-friendly. - Normalizes helper import/emit order to the generated table order (`packages/helpers/esm/index.js`, currently lexicographic). Inline deps used to expand during helper registration; this is safe because helpers are hoisted function declarations and codegen rejects order-sensitive preludes.