Exporting ClojureScript Functions to JavaScript with ^:export
Learn how to expose ClojureScript functions to plain JavaScript using ^:export, see a concrete example, and understand the trade‑offs with dead‑code elimination.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to expose ClojureScript functions to plain JavaScript using ^:export, see a concrete example, and understand the trade‑offs with dead‑code elimination.
Learn how to enable genuine dead‑code elimination in ClojureScript using Shadow‑CLJS with :optimizations :advanced, verify the bundle size, and avoid common interop pitfalls.
Learn how ClojureScript's :advanced compilation shrinks production bundles through dead‑code elimination and symbol renaming, while keeping JavaScript interop reliable via :foreign-libs and careful export handling.
Learn how Haxe’s dead‑code elimination flag trims output size, the assumptions behind it, and how to verify that only the needed code remains.
How to use -ffunction-sections, -fdata-sections and --gc-sections to strip unused code and shrink embedded binaries.
Why :advanced shrinks ClojureScript bundles, how dead-code elimination works, and what you must handle for interop and debugging.
Learn how the PureScript bundle optimizer removes unused PureScript definitions, see a minimal example, and understand its limits and common pitfalls.
Learn how Haxe’s -dce full flag and custom externs can shrink your JavaScript bundle by removing unused code, with a lodash.debounce example and practical verification steps.
Goal We want to confirm that the Haxe compiler's dead‑code elimination correctly removes an unused class when targeting JavaScript, while preserving classes that might be needed via dynamic or reflection access. Constraints The compiler performs reachability analysis per target. JavaScript and C++ backends typically prune unreachable symbols, but strings use