Skip to content

Instantly share code, notes, and snippets.

@swannodette
swannodette / inference.md
Last active August 7, 2023 16:13
Externs Inference

Externs Inference

Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).

In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen

@smsohan
smsohan / rename_angular_parts
Last active April 28, 2016 15:55
AngularJS renaming exercise
Because I think the hardest part of getting started with AngularJS is it's esoteric names, I'm suggesting the following replacements of the AngularJS terminology.
scope -> state
factory -> data/models
filter -> helper
directive {restrict: 'E'} -> custom_tag
directive {restrict: 'A'} -> custom_attribute