[Ur] Javascript toolkit integration

Adam Chlipala adamc at impredicative.com
Sat Dec 11 08:43:14 EST 2010


Davor Ocelic wrote:
> Just a quick question, how would one approach integrating some kind
> of a Javascript toolkit (e.g. http://dojotoolkit.org/) into Ur/Web?
>    

Ur/Web has a JavaScript FFI, which I've found fairly easy to use.  For 
instance, at one point, I wrapped FCKeditor, though I never released the 
code (which has since bit-rotted).

> One could of course write the toolkit-specific code manually as it
> wouldn't clash with Ur, but that's not an optimal idea.
>
>
> To see what code one would have to insert for an e.g. dropdown
> widget, you could see:
>
>    http://dojotoolkit.org/reference-guide/dijit/form/DropDownButton.html#dijit-form-dropdownbutton
>    

This example seems so simple that I would guess it's nicer to implement 
in Ur/Web from scratch.

> This toolkit (and probably all others) also support some non-static
> behavior, such as dynamic ajax requests, events and some form of IO,
> which are additional things to consider.
>    

One thing to keep in mind is that Ur/Web presents a novel alternate 
picture of how to program client-side applications.  Many newcomers ask 
how they can access jQuery.  From my understanding of that library, I 
think the question is misguided, since Ur/Web provides, out-of-the-box, 
alternate, better ways of doing the main things jQuery does.  You might 
find that everything you're accustomed to needing to build up 
laboriously in JavaScript is actually trivial to do in the default 
Ur/Web client-side model.



More information about the Ur mailing list