[Ur] ANNOUNCE: uru - the jQuery widget wrappers with a demo

Sergey Mironov grrwlf at gmail.com
Fri Oct 18 19:17:06 EDT 2013


2013/10/11 Adam Chlipala <adamc at csail.mit.edu>:
> On 10/11/2013 07:01 AM, Sergey Mironov wrote:
> I think this should work.  The compiler contains some logic for merging
> together .urp directives in a smart way, including by not duplicating .urs
> or .ur files in the combined list.  Said logic hasn't necessarily been
> tested thoroughly in many different scenarios, but I think it's worth
> trying, and submitting bug reports about anything that goes wrong.

Quick test shows that it works indeed!


> All of those changes sound reasonable, and I encourage you to implement them
> yourself!  If you don't yet have a wiki account with write privileges,
> please create an account and let me know its name, so I can grant
> privileges.  (Writing is off by default, because we don't have nearly a
> large enough community to do the spam policing that Wikipedia has.)

Sure, please grant 'grwlf' user with write permissions.


> This is a jQuery-specific event hook?  I wouldn't want to include such
> things with Ur/Web, but I would suggest adding library FFI code following
> the model of, e.g., [onClick] that you can see in basis.urs now.

Yes, the $(window).load(function() { .. callback .. })  is
jQuery-specific, the function talks to browser DOM internally in order
to implement this. DOMs differ from browser to browser, and jQuery
tries to do it's best to figure out the current one and handle the
call correctly (I want to believe in that:). So, it plays a role of
'de facto standard' more than anything else here.
Also, it is possible to include <script>callback(); </script> into the
<body> tag after all other content. If I understand it correctly, it
is also differs from including callback() into body.onload handler.
Some thirdparty scripts may belong on that too. I am not insisting on
moving such things to the standard library, just want to mention that
problem exists and it is better to have a guidelines to deal with such
things. Writing FFI lib should be OK as long as it is possible to
define the FFI signatures like

val includeBodyScript : transaction unit -> transaction xbody
val includeHeaderScript : transaction unit -> transaction xhead

In this case, the functions should determine the client-side name of
it's argument and serialize it into a string-representation of xml.
Not sure if it is currently possible or not..

I'll look into the [onClick] in a few days. I am in a hurry to finish
my current project now. It is a sketch of a company's website. If I am
lucky, I'll have a chance to implement the real site this way. I've
started a server running the demo on a public IP. Here is the links:

http://46.38.250.132:8080/AppMM/main
http://46.38.250.132:8080/AppMM/product/Topor
(most refs are stubs, but note that all the images and CSS are built
inside the application so I don't need to setup apache or something.
Also, the program is running on Windows 2008 R2, inside the cygwin.
The sources are in the uru's repo on a Github)

> Maybe you could elaborate a bit on the functionality that you have in mind?
> I'm not sure I understand the proposal at a high level.
Mm, that was a brief idea about blessing script urls separately from
the other urls. Now I'm not sure if it is that important. Never mind..


Regards,
Sergey



More information about the Ur mailing list