7 ms·
I think an article outlining the details behind the non-trivial example, specifically on configuring how library names are resolved and how it can be modified d
by bmillare 11y ago
I think an article outlining the details behind the non-trivial example, specifically on configuring how library names are resolved and how it can be modified dynamically, would be instructive.
- derek 11y agoThe source code for the post is available[1], as is the macro[2] which is loaded via XHR. The short of it is that a load function is passed to `cljs/compile-str`, which provides the mapping. In this case, it doesn't bother to do any mapping because it knows that it is loading `bar.core`. However, `bar-url` could instead be in a map from the namespace to the URL. Surprisingly simple, actually! 1. https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/cljs_next/core.cljs#L138 https://github.com/swannodette/swannodette.github.com/blob/m... 2. http://swannodette.github.io/assets/cljs/bar/core.cljs http://swannodette.github.io/assets/cljs/bar/core.cljs