-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How might one regret choosing injectjs for their next startup? :p #266
Comments
I believe in being very honest about Inject, RequireJS, and the whole "Module Loading" family. I welcome this discussion. Module Loading is an all-or-nothing approachPeople often think you can mix module loading code and regular all-or-nothing also extends to your build system. Once you have this beautiful module system, you are going to want some way to optimize for the browser. Downloading a few dozen files, even in parallell can be a huge performance hit. Many systems have some sort of caching plan in mind:
But then again, if you're going to put in place all the build system tooling for optimization, you might be better off with an internal module system such as Browserfy and delivering a single payload. Technically deprecated on arrivalIn theory, the ES6 spec already has support for a module system. While it's still draft, and while we may still be living with older versions of Internet Explorer for years to come, the reality is that the need for these kinds of libraries should be going away. All we need is every browser to support bleeding edge specifications... Wants to be node. Isn't nodeI personally believe the whole browser based CJS/AMD movement is rooted in our desire to offer npm/node power in the browser. It's just so easy to bring in a node module, have its dependencies managed, and you just use
Libraries come and goThis is true of any library, but especially since CJS/AMD libraries are all evolving quickly. It may be that we all universally agree on one true/simple way to solve this problem, and many of the libraries become obsolete. Thankfully, this isn't as scary as it sounds, because everyone is complying with a predefined specification. So, you can just swap one library for another. All you'll need to do is update your configuration. And even the configuration is slowly standardizing, making these libraries 100% interchangeable. Closing thoughtsThat's everything off the top of my head. Inject/RequireJS/etc are all pretty awesome. I look forward to the CJS/AMD library that uses Socket.IO to stream modules to the browser, eliminating roundtrips completely and managing the dependency tree on the server side. That will be delicious. :) |
I consider this an open discussion providing an opportunity to talk me out of using injectjs on my next big thing...
Also, responses such as "If you want it to NOT be awesome, then don't use injectjs." are always welcome!
The text was updated successfully, but these errors were encountered: