I'm looking at how MDC uses closure modules for some inspiration: https://material.io/components/web/docs/closure-compiler/. I'm experimenting with cljs module-based code splitting here: https://github.com/johnmn3/cljs-main-code-splitting/blob/master/modules/mod_init/main.cljs It's at an extremely simply point right now, so I figured I'd drop it here to see if anyone has any strong opinions about the shape of things.
So here is an example of a "downstream" module that consumes upstream modules, provides a third party module, and implements a core module that uses the third party module: https://github.com/johnmn3/mod-acme
One thing about the defxmod
macro. It could instead use the current namespace, keyified, to use as the moduleId. Then make a version of loader/set-loaded-for-this-namespace!
or something, which just uses the current keyified namespace as the moduleId.
Then you could potentially just define lazily loadable module-functions in place and not have to worry about moduleIds. Just require them, call them, and if they haven't been loaded, they will be.