by mkmcdonald · 14y ago · 0 comments
I am interested, though, that the team has finally noticed that optional code should be the norm. Resig himself has been quoted as wanting nothing to do with it[0].
However, omitting every single "module" only truncates 2484 lines, which leaves the 1.8.1b source at a staggering 6763 lines of code. There is still a great deal of work to be done before "modular" is a fair term to apply to the API.
[1] https://groups.google.com/forum/#!topic/jquery-bugs-team/2zb...
JavaScript doesn't have a formal notion of a module. What we're referring to here is the ability to exclude some chunk of functionality from jQuery and know that, internally, jQuery does not require it. We cannot know whether other code on the page requires it.
> optional code should be the norm
Is there an easy way to know what is "optional" code when including third-party plugins, short of analyzing all the code in advance? That's what Closure Compiler AO does, but it is not for the weak.
> There is still a great deal of work to be done before "modular" is a fair term to apply to the API.
If you've got some ideas we're open to suggestions.