October 5, 2005

JSLib and the Mozilla trunk

Some of JSLib's features, especially its File handling routines, are so darned useful I can't imagine why it's not part of the mainstream Mozilla trunk. Yes, there's calendar's use of JSLib, but let's face it, that's not mainstream. (Sorry, Sunbird guys.)

Really, I'd like to see some of this code (again, mainly the File stuff) start getting checked in under mozilla/extensions/jslib (or somewhere else in the Mozilla trunk which everyone could use, like toolkit). So I'm wondering what it would take to land a subset of JSLib there. JSLib can continue to maintain independent development of a more complete JSLib toolset, but some basic stuff such as Calendar already uses would fit fine as an extension. You wouldn't have to build the JSLib extension by default, either.

UPDATE: Oops. Little did I know that JSLib isn't used by Calendar either...

Posted by WeirdAl at October 5, 2005 8:12 AM
Comments

AFAIK this has been discussed before, perhaps not seriously, but it's been discussed. And never went anywhere.

I'd love to see it included. Would be beneficial to many extension developers.

Posted by: Robert Accettura at October 5, 2005 9:00 AM

Well one thing I've found is many core Mozilla hackers like to do things the hard way. I even have this problem w/ the MDG team. They much prefer to do things the hard way. Why, I'm not sure. One complaint is that jsLib is a different API.

Also, the last thing we need is two split points of development of jsLib. I do wish there were more hackers helping me out w/ jsLib. I would devote a lot of time to it but need to make a living, so that's why development is slow going.

So that is the quagmire of jsLib.

--pete

Posted by: Pete Collins at October 5, 2005 9:11 AM

Calendar doesn't even use jsLib anymore. The files are just there because nobody took the time to remove them.

Posted by: mvl at October 5, 2005 9:52 AM

Calendar doesn't use JSLib anymore. As of bug 288045 it is no longer packaged.

Posted by: Simon Paquet at October 5, 2005 10:00 AM

The problem is that there are, what, 90,000,000 installs of Firefox out there WITHOUT JSLib bundled. That means that to ensure that JSLib is present, you need to either require that it be installed before your extension works, or simply include it within your own extension. Unfortunately, JSLib is, according to the install page, 140 KB (it's not clear where the 64 KB savings for the Lite version comes from...). For many (most?) authors, that's simply an unacceptable amount of cruft to be adding to one's extension.

You could, I suppose, require a very, very, very bleeding-edge version of Firefox, but if JSLib was the only dependency, it's likely that someone else would simply take the extension and remove the JSLib bits with the XPCOM calls that are being wrapped.

Basically: the slightly-cleaner code that results from JSLib doesn't really outweigh the hassles resulting from JSLib's size and lack of installed base.


What about this, though: take JSLib's most useful wrappers, functions, and idioms, refactor them to minimize inter-module dependencies, and then post the functions and code snippets on developer.mozilla.org and/or kb.mozillazine.org or whatever wiki, allowing devs to pick-and-choose the functionality of JSLib they want at development time rather than at runtime... ?

Posted by: Ben Karel at October 5, 2005 10:34 PM