3 ms·
ELI5: ClojureScript uses an advanced Google Javascript compiler that eliminates dead code. To make that possible you have to be super careful about how you refe
by drcode 10y ago
ELI5: ClojureScript uses an advanced Google Javascript compiler that eliminates dead code. To make that possible you have to be super careful about how you reference external javascript libraries in your code, because these will get sucked into the dead code elimination- Which is GOOD, because you want to remove all the unused gunk from your libraries, but it's also BAD because only advanced ClojureScript users could sometimes figure out how to reference a new library.
This "externs inference" feature is the first step into automating the importing of javascript libraries, in order to make the process easier.
- dkersten 10y agoIt's not just for dead code elimination that externs are needed but also for identifier renaming (for minimisation). This is a very welcome feature!