darkmagic
darkmagic copied to clipboard
Insights
A bunch of insights I had so far from experimenting with darkmagic:
- Async modules are fun, they make life easy
- Being able to selectively replace dependencies makes writing tests easier too
- Having one injector per process might be a problem in the long run
- "Riding" on the real module system cache has pros and cons (need to expand on that)
- Dependency inference needs stronger syntax than just parsing the parameters of a function. Should I give it to something like requirejs' string dependency array?
- dependency declaration at the client site needs to be decoupled from dependency declaration at the provider site, more specifically, if site A needs dep named B, this dep might be loaded without actually using the name B, but once loaded it will declare itself as B