Ok, I think I change my mind a little bit about the asset page extensions. *Today*, you have:
Today
ImageUrl()
Image/ImageFor() -- they do effectively the same thing w/ different mechanics. Duplication FTL!
Script(string[] names) -- only marks an asset as required, but doesn't write anything out
Asset(string[] names)-- only marks an asset as required, but doesn't write anything out
OptionalScript(string[] names)
OptionalAsset(string[] names)
Css(string names)-- only marks an asset as required, but doesn't write anything out
WriteCssTags() -- writes out all stylesheets that are queued up
WriteScriptTags() -- writes out all scripts that are queued up
WriteAssetTags() -- writes out all stylesheets & scripts that are queued up
ImmediatelyWriteCssTags()
ImmediatelyWriteScriptTags()
ImmediatelyWriteAssetTags()
In the world of tomorrow:
ImageUrl()
Image()/ImageFor() ImageFor delegates to Image()
Script(string[] names) -- writes script tags immediately
Css(string[] names) -- writes <link> tags immediately
OptionalScript(string[] names) -- writes the <script> tags if the scripts exist
OptionalAsset(string[] names)-- writes the <link> tags if the scripts exist
for all the other older extensions, I vote that we just have them delegate to the ones above.
The current asset pipeline was designed for a model where html conventions and html helpers could register assets that would be dumped into the page in the footer when the WriteScriptTags() method was called. It demo'd really well and sounded cool, but I'm a little indifferent now to going down that path again. I *think* that I vote for a much simpler model where we make users be explicitly responsible for declaring client side assets.
What do you think?