Quick Update - Microsoft WebMatrix Beta released

Scott Guthrie just announced the first beta release of Microsoft WebMatrix.  I'll leave you to check out his blog post to find out more.

This is also your first chance to try out Razor.  We haven't released the MVC View Engine for Razor, but WebMatrix includes ASP.Net Web Pages, a simple page model that uses Razor syntax.  After installing WebMatrix, just create a new site, drop a CSHTML file in it, put some code in and go!

I'll post more details later, but for now, check out the post and play with the bits!

Thursday, July 08, 2010 10:54:42 PM (Pacific Standard Time, UTC-08:00)
Issues :
01. No intellisense.... T__T

02. The sample, Twitter
It's makes script tag inside the .cshtml document...

Question :
01. is it possible for razor, to do partial cache ?
02. is it possible for razor, to make the script and/or css to be generated outside the .cshtml document ?
so .cshtml will automatically separate script and css in order to get out from .cshtml and link it ?
and with razor, to say this and that to be cached across any pages ?



Andrew
Friday, July 09, 2010 11:44:49 PM (Pacific Standard Time, UTC-08:00)
Re Issue #1: The WebMatrix editor team is well aware of this, but since this isn't Visual Studio, you do lose a lot of the infrastructure VS provides. I can say that the current plan is provide Intellisense in the future, but I can't say for sure if it will be v1 or v2.

Re Issue #2: Unfortunately, when dealing with an inline scripting model like Razor, it is difficult to do have a helper which is further down the page add scripts to the (already rendered) 'head' tag. We are aware that it isn't the best practice to put this script directly inside the document and are trying to work out a solution.

Re Question #1: In theory, it should be possible to do partial caching. I'm not familiar enough with Output Caching to know how that would work though.

Re Question #2: No, one Razor file generates a single stream of HTML with inline JavaScript and CSS. There is no way to have Razor automatically split JavaScript or CSS out in the current parsers. There are too many side issues and edge cases for us to implement something like that, so we're leaving it in the hands of the users.
Sunday, July 11, 2010 5:03:27 AM (Pacific Standard Time, UTC-08:00)
Q#2 :
What is the issue i wonder ?
i think your parser, capable to know which tag is script, which tag is style, which tags stay on html
then you can talk with asp.net team, how to implement the rest, this will solve issue number 2 too...
btw im not hoping the script goes to head, it is generated as another file out from html, but linked

link to the script in the end of html
link to the style in the start of html (head)

i know u can do it !!!
Andrew
Sunday, July 11, 2010 9:46:03 PM (Pacific Standard Time, UTC-08:00)
The issue isn't a matter of possible or impossible it's matter of resources. Wiring in a full JavaScript parser, full CSS parser, and full HTML parsers would be a lot of work and as far as I know, this is the first time we've heard this feature request. It's certainly open for extension if someone is interested!
Monday, July 12, 2010 9:04:42 AM (Pacific Standard Time, UTC-08:00)
Hmm.. I'm sorry for pushing this

I think your current parser is enough, why need full javascript, css parser

once your razor found script tag, i don't think u need to parse the javascript stuff, simply translate every time see @as code, and then simply found the end of the script tag, then write it into a file.js
and link it on the end of cshtml

thats super naive approach of course... someone at asp.net team should know better

for the css, http://lesscss.org/
its use ruby stuff, it use @ too...
something like that, but pulled out from cshtml
Andrew
Monday, July 12, 2010 4:07:41 PM (Pacific Standard Time, UTC-08:00)
There are a lot of edge cases which would require consideration (where do we store the generated file? how do we serve it? will behave exactly the same as it would inline? etc.). And I'm still not sure I see the benefit since if the script was shared among multiple pages, it would have to be in it's own file anyway. If we're just talking about page-specific scripts and styles, splitting them into multiple files would make performance _worse_ because the browser would have to make multiple requests to get all the data and you'd get no benefit.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview