[Ur] Active code?

Adam Chlipala adamc at impredicative.com
Tue Jul 24 09:25:06 EDT 2012


I recently added a new tag <active code={...}/>, where the code is a 
[transaction xbody], run whenever this HTML is added to the DOM, where 
the result of the transaction determines what appears at this point in 
the page.

I discovered that I needed to block the operations [recv], [rpc], and 
[sleep] in such positions, since otherwise we might need to delay 
initial rendering of the page indefinitely for network communication or 
sleeping, or implement a nasty (IMO) hack of showing some default 
content until then.

Edward has suggested that <active> could work with a [transaction unit] 
instead of a [transaction xbody], not directly affecting page output, 
but with the option to set some [source]s to affect reactive rendering 
elsewhere.

Does anyone else have thoughts on the right interface for this feature?  
I think it fills an important role, increasing modularity by allowing 
packaging of HTML fragments with the side effects needed to initialize them.



More information about the Ur mailing list