Re:The cost of small modules
by brandonbloom on Monday August 15, 2016 @03:25PM
(#12292770)
The problem isn't (necessarily) small modules, it's the _dynamics_ of the Common.js (and similar) module systems. By conflating fully general, extensible, dynamically typed objects with both namespaces and modules, the semantics can't be constrained enough to perform certain kinds of both intra- and inter-module optimizations at compile time.
By contrast, the Google Closure compiler's module system (also for JavaScript) does not suffer from this problem, but in tradeoff, disallows many types of runtime metaprogramming, such as merging modules with Object.assign or similar.
By contrast, the Google Closure compiler's module system (also for JavaScript) does not suffer from this problem, but in tradeoff, disallows many types of runtime metaprogramming, such as merging modules with Object.assign or similar.