Apr 12, 2005

During a bit of development downtime here, I've been working on making XBLinJS work on any ol' DOM nodes, not just HTML ones. Which, most notably today, means that you can in theory use XBLinJS as a drop-in replacement for the actual, factual XBL. It also means it can be used with other document structures that use DOM and the same basic event structure, like perhaps SVG someday. If we're extra good developers, we may someday see widgets that successfully integrate both XUL and SVG at the same time. Maybe even cross-browser...? Please?

Mostly it involves turning some document.createElement calls into document.createElementNS calls, and a little (very little!) bit of bookkeeping to decide which to use. (createElementNS is DOM2, which not all browsers support, so I can't require it, but you can't use DOM reasonably in a modern XML document without it.)

Which means, hooray!, another set of quirks to deal with. Because if you think that XUL might be implemented as a kind of super-HTML, almost identically implemented but with extra widgets, boy would you ever be wrong! Functionally, it's much more like an extra wimpy HTML, only with extra widgets that are extra likely to crash the browser or randomly and untracably fail. The theoretical power is greater, and you can certainly realize much of it, but what ought to be unmitigated benefits (especially as you can embed arbitrary XHTML in XUL) is severely weakened by its spotty implementation.

I had some real trouble with the getting the events to register correctly, but fortunately, while XUL doesn't like node.onclick for a node that isn't yet on the screen (more "it has to be rendered for it to be real" crapola that I remember from my XBL days), you can use addEventListener.

If these target-specific hacks start piling up, I'll factor them out into a support "Flavor" object so they don't clutter up the code and you can just load the one you want, but so far they are limited and can't add more than a couple hundred bytes to the compressed code. We'll see if they stay that way. (I'm currently guessing 50/50 there will be something like this in 0.4.)

In other news, I stumbled across this Javascript shell which is much nicer than the one I had before. It is compatibly licensed, so I am also currently sucking it into XBLinJS and 0.4 should have a much nicer HTML JS console. An interesting experiment, if I get bored, will be to try to get that working in XUL by labeling all of the nodes with the XHTML namespace and see what happens. It ought to work, in theory, except the event processing may be borked.

The XUL-support stuff is in CVS, but poorly tested. (My plan is to get to the point where a person who cares about XUL can do something real, but not necessarily perfectly, which is a pre-requisite for anyone to care.) The extra JS console, not for the moment.

XBLinJS 0.4 Release Plans
Apr 09, 2005

Features are always in flux until such time as the release occurs, but here is the current plan for 0.4:

No promises on any front, but that is the plan. I have no idea when this release will be because while I am using XBLinJS a lot in almost all of my current projects, a public release is a lot of work with no immediate and obvious benefit to either me or the project at the moment, and I have no idea when I'm going to be able to spare that time over the next few months. I'm getting dangerously close to living in those "interesting times" of the famed (if apocryphal) Chinese curse.

XBLinJS Version 0.3 Released
Apr 06, 2005

XBLinJS version 0.3 is released; get it at SourceForge.

A demo page is available, though at the moment I think it will still only impress serious Javascript programmers.

For people who don't really care about XBLinJS per se, but do care about web development issues, you may wish to check out my dangerously-close-to-rant statements about my experiences with Mozilla's technologies. (The only things saving them from being a rant is that I propose that XBLinJS, or at least something like it, is a solution to the issues I raise; I tend to think of rants as things with little or no constructive value.) This is why an XBLinJS release announcement is posted also on my blog's front page.

(I've already found a new bug in the .3 release; inherited className values can't be retrieved correctly with .get(). However, since AFAIK 0 people are using this library, I'm not going to make a new release for that one. Use the CVS if it ever becomes a problem for you.)

JSON counterpoint
Feb 11, 2005

JSON is pretty
cool for what it is; in a mix of dynamic languages where Javascript
(most likely in a browser) is involved it may not be a bad
choice. It's even a great choice if you're firing structured data
back and forth from Javascript and something else.

Read the rest (708 words)

XBLinJS 0.2 released
Jan 17, 2005

I've released XBLinJS 0.2, which includes some example widgets and much better documentation.

<- Future Posts


Site Links


All Posts