Modules / Module Patterns

tl;dr

Virtually all modules are CommonJS, of the Node.js / npm ecosystem, and so require Babel or some such compiler along with their chain of bundlers/builders/..., all from that black-hole of dependency hell, to "broswerify" it. We've gone from spaghetti code to recursively dependent modules.

Though each is atomic, such is fractal. That is, the modules are not separable, and that includes their build tools too. That's spaghetti code with superglue as the sauce.

Want to change the color of a component element? Well, you'll first have to update and manually repair the broken build tool chain from its year-old repo. And then start working on all its dependencies. Have a fun year.

(Nebulous) Lingo

The term module in the javascript world is generally applied to script(s), function(s), object(s), name(s), and/or whatev(s); both or either importing and/or exporting any such thing(s). Anytime and everywhere the context is about injecting any javascript thing from one file into some scope at another file, its all about "the module".

AMD / RequireJS Modules

Incompatible with CommonJS modules

CommonJS / Node.js Modules

Must be bundled for browser