[whatwg] runat (or "server") attribute

Nils Dagsson Moskopp nils at dieweltistgarnichtso.net
Mon May 14 03:49:30 PDT 2012


Odin Hørthe Omdal <odinho at opera.com> schrieb am Sun, 13 May 2012
17:45:46 +0000:

> >> Just use type="text/server-js"...  
> > Is that really a good idea? It seems odd to use a mime type for
> > such a reason.  
> 
> I thought it was quite a nice idea.
> 
> Why would it not be?  

I find it profoundly odd to define templating language bits that are
not used (or even usable) by User Agents – especially because there
already are lots of widespread templating solutions.

> It's describing what's in the script tag, just
> like it's supposed to do. It's even a quite much used pattern for
> doing client side templates <script type="text/template"> on the web
> today.  

This appeal to tradition is weak and – arguably – intellectually
dishonest. Table layout once was a “quite much used pattern”.

> Mime types are not magical any more. Before we could make our own
> text/x-whatever, but prefixes are not really any use. If you want
> something specific to your program you could always use something
> specific as prefix, -- but for this use case just doing
> text/server-js  seems rather nice :-)  

Deviating from set standards regarding structured data in networks
solely for aesthetic reasons creates a world of pain for data consumers.

I once wrote an program to check for dead links that failed in it's
task quite unexpectedly when it encountered a web site whose owners
decided that “HTTP status codes are not magical any more” and answered
every request with a 404 (plus the actual content).

All problems with hashbang javascript routing are an instance of this
flawed line of reasoning (returning 200 for every link). If you do not
want to appear as a sociopathic hipster programmer, please emit
conservatively and use a prefix. Alternatively, register your MIME type.

-- 
Nils Dagsson Moskopp // erlehmann
<http://dieweltistgarnichtso.net>


-- 
Nils Dagsson Moskopp // erlehmann
<http://dieweltistgarnichtso.net>



More information about the whatwg mailing list