Prevent Broken JavaScript Interop in ClojureScript Advanced Builds
Use externs files to protect external JavaScript names when compiling ClojureScript with :optimizations :advanced.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use externs files to protect external JavaScript names when compiling ClojureScript with :optimizations :advanced.
ClojureScript's :advanced compilation can shrink a Reagent app from 180 KB to 45 KB gzipped, but only if you describe every external JavaScript dependency in externs files. This post shows the size gains, the externs pitfall, and a practical CI profile strategy.
Use ClojureScript :advanced compilation for smaller release bundles while protecting JavaScript APIs with externs and verifying every interop boundary before deploy.
Learn how to shrink ClojureScript output by turning on advanced compilation and letting the compiler infer externs, with a step‑by‑step Reagent example and verification tips.
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.
Dev build works, release build throws 'undefined is not a function'? Diagnose ClojureScript :advanced compilation property renaming with pseudo-names, externs, and goog.object fixes.
Diagnose and fix ClojureScript advanced‑build ReferenceErrors caused by missing externs, with checks, fixes, and escalation steps.
Learn how to define requirements, create the smallest viable ClojureScript build with :advanced optimizations and externs, enforce trust boundaries, run operational checks, anticipate failure modes, and know when to adjust the design.
Goal I am upgrading a ClojureScript project's compiler and build tool to a newer release, and I want the existing :advanced optimization build to keep working against the third-party JavaScript libraries the app depends on. The :simple build is not a concern; the unresolved part is the aggressive renaming and dead-code elimination that :advanced applies thro