Script# 0.5 Update and Associated CodePlex Project

Some words about the latest release of script#, now on CodePlex, and with support for localization, doc-comments and more.

This is a quick post on the latest release of Script# (Build 0.5). I'll be following up with subsequent posts with more details on some of the specific feature additions, but here is a list of whats new (besides bug fixes, and improved compiler error reporting):

  • Support for localization based on .resx files - now you can generate localized script files while using strongly typed resources using .resx tooling available in Visual Studio and other localization tools.
  • Support for generating script doc-comments - now XML doc-comments are automatically transformed into ASP.NET Ajax-style doc-comments, which are useful for driving intellisense in Visual Studio, if you're creating script libraries that will be used by others.
  • Updated compat layer to abstract browser differences now works for not just Mozilla but also WebKit-based (Safari, iPhone), and Opera browsers.
  • Support for creating overloaded APIs, and creating and invoking functions dynamically (these were limitations in the past).
  • Support for creating Silverlight 2 plugin instances.

Also, Script# is now on CodePlex (actually it has been on there for a month or so, but this is the first release since). The forums associated with the CodePlex project should significantly improve the experience around sending feedback, and having discussions around the technology and using it. Several folks have asked me in the past about open sourcing it. My plan is to eventually have the source out there as the project approaches its v1 status, starting the with the core framework and runtime, and subsequently the compiler itself. Stay tuned on that front for more in the next few months.

There are a couple of related CodePlex projects to call out:

  • Messenger Developer Samples - contains MIX08 Messenger samples including how you can use Messenger APIs using Script#
  • Script# proxy generator - Think wsdl.exe for Script#. A number of you have sent me mail about this feature. This project basically takes care of generating C# proxies for ASP.NET Ajax-enabled Web services.

Finally, I've updated my project site as well with more introduction to Script#, release notes, and a high-level roadmap. I will also be transitioning the documentation that is currently available in pdf form to the site over time.


[ Tags: | | | ]
Posted on Monday, 4/21/2008 @ 2:02 PM | #Script#


Comments

20 comments have been posted.

Eric J. Smith

Posted on 4/21/2008 @ 3:30 PM
We have been really interested in using this project, but we are really scared the project isn't being worked on or is dead. It would be a HUGE help to open source the project.

Jonx

Posted on 4/21/2008 @ 4:38 PM
Great release, I was expecting the cross browser compatibility for a long time already. Also the roadmap sounds good to me...

Also, just note that you wrote 2007 instead of 2008 as the release date on your project page: (Version 0.5.0.0, 4/20/2007)

Fahad

Posted on 4/22/2008 @ 4:59 AM
So COOL!!!!

Lorenzo

Posted on 4/22/2008 @ 6:27 AM
Ciao Nikhil,
where I can find tutorial or examples about script#?

Nikhil Kothari

Posted on 4/22/2008 @ 7:45 AM
Lorenzo - if you download the documentation you'll find a quick tutorial, and if you install script#, you'll see a samples.zip installed, which has a bunch of samples.

Peter

Posted on 4/22/2008 @ 10:57 AM
Hi Nikhil,

I like your project very much. I have been playing with the latest 0.5.0.0 release on VS2008 and found a few problems. I have submitted issues for them in CodePlex, hopefully you can take a look at them if you have time. Thanks for your great efforts - Peter

Tom

Posted on 4/23/2008 @ 1:03 AM
Totally agree about the open source comment; this project is most useful in a large deployment where management tends to come into play and risk factor is a major design decision.

Nikhil Kothari

Posted on 4/23/2008 @ 2:11 PM
Eric, Tom - totally understand your perspective on the open sourcing... many I've talked to have come back with this piece of feedback, and hence the decision to open source it to increase the appeal. I am working on that end... stay tuned.

On a related note, even groups within Microsoft have similar thoughts - eg. Office is using Script# in a big way (you can imagine their risk concerns)... one thing that helps make the case for technology initially, (until developers get to first hand experience the productivity wins) is the fact that script# is a development tool, and you can build and produce regular js files that can be deployed without any script# dependency. Furthermore, if at some point you want to stop using script#, you've still got your generated script files (that feel like they were hand-authored), and simply move on ... though by that point usually you've gotten addicted to this style of development, you can't go back :-)

hxu

Posted on 4/24/2008 @ 9:56 AM
Hi Nikhil,

Script# is going forward so fast. I still have version 0.4.5.0. Since I started to use Script#, I am almost never use javascript directly. Now I am feeling so comfortable writing silverlight 1.0 code with it. Here I have several issues that I can't figure out:

1. I can't create a Point object with X and Y value. Because it has no constructor. So How to use it?
2. I don't know how to set Storybaord.TargetName value to one of animation objects. Such as DoubleAnimationUsingKeyFrames. If I use SetValue, it can pass through compiler but it will get runtime error.

Can you show me an example?

Thanks. -hxu

Nikhil Kothari

Posted on 4/24/2008 @ 8:56 PM
hxu, in answer to your questions:
1. You set a Point property using a string foo.Prop = "x, y"... if I remember Point has an implicit conversion operator from string. The reason is Point is not creatable in Silverlight... you can only get a Point instance, when calling a property getter.

2. Storyboard.SetTargetName() is the way to set that property.

Alan Colón

Posted on 4/28/2008 @ 5:09 PM
Thanks for S#.5! I've been using S#.4.5 since January, and I love it. I've made additions / modifications to the framework. Would you be interested in implementing them?

1. Observable Collection int Count property, and this[int index] property,
2. Added references to existing Array.Add, AddRange, Clear, Insert, InsertRange, Remove, RemoveAt, and RemoveRange.
3. Window.ShowModalDialog, ShowModelessDialog,
4. DOMElement this[string key] property for expando functionality,
5. Table CellPadding, CellSpacing, Border properties
6. Removed TableElement.InsertRow(), parameter is required in non-IE,
7. Removed TableRowElement.InsertCell(), parameter is required in non-IE.

While it's pretty self-explanatory what I did, I would be happy to send you the source code.

I'd like to contribute! I'm a good tester, and a good developer.

Thanks
-Alan

PS: www.kenwoodusa.com/Support/Where_to_Buy

hxu

Posted on 5/5/2008 @ 12:22 PM
Nikhil,

Thank you for the answer to my previous post on 4/24/2008!

Suppose the script# should be browser independent. But it seems not true. Here is the page, which is created by Script#. 208.83.250.51/Nanawall.web/design.aspx.
It runs Ok in IE But it is not correct in Firefox. I have attached the code behind the page below. Do you think what kind of changes can make it run in both IE and Firefox?

Thanks,
hxu

#region members for category
string categoryTitle = "<string>{0}</strong>";
string criteriaRadio = @"<input type=""radio"" id=""{0}"" name=""{1}"" value=""{2}"">{3}";
void CreateCategoryRow(TableElement tbl, ModelCriteria criteria){
TableRowElement row = tbl.InsertRow();
TableCellElement cell = row.InsertCell();
cell.ClassName = "bg_color1 cad_td underline";
cell.InnerHTML = string.Format(categoryTitle, criteria.CategoryName);
}
void CreateCriteriaRow(TableElement tbl, ModelCriteria criteria){
TableRowElement row = tbl.InsertRow();
TableCellElement cell = row.InsertCell();
cell.ClassName = "cad_criteria";
cell.InnerHTML = string.Format(criteriaRadio, "chkCriteria" + criteria.Id,criteria.CategoryName, criteria.Id, criteria.CriteriaName);
DOMElement radio = Document.GetElementById("chkCriteria" + criteria.Id);
AttachEvent(radio, "onmouseup", NarrowModel);
}
void NarrowModel(){ GetNarrowModel(this, new SelectedHandlerArgs(Window.Event.SrcElement)); }
#endregion

Alan Colón

Posted on 5/5/2008 @ 10:33 PM
TableElement.InsertRow(int index) requires the index parameter.
TableRowElement.InsertCell(int index) requires the index parameter.

The overload with no parameters is only valid in IE.

Alan Colón

Posted on 5/5/2008 @ 10:34 PM
I guess I should also mention, use -1 as your parameter :)

Jose Gonzalez

Posted on 5/15/2008 @ 1:38 PM
Would it be possible to have ssc output to standard output? I would like to use Script# as part of an HTTP handler, which if you like you can distribute.

I was going to include the handler code here, but will e-mail it to you upon request.

John

Posted on 6/10/2008 @ 11:52 AM
The code plex project seems to not be published... any idea when it will be available again?

Doug

Posted on 6/11/2008 @ 7:56 AM
I am having the same problem as John, I can not get to the CodePlex project, it says "This project is not yet published"

Jean-François L'Heureux

Posted on 6/20/2008 @ 2:04 PM
Hi,
Thank you for this update with Safari support. I installed v0.5.0.0 and updated my projects. Some of them don't compile. It seems that some Silverlight classes had disappear. The list I have problems with are: ControlFactory, ControlParameters and ControlLoadCallback.

Am I right that these classes no longer exists or they have been moved elsewhere?

Thanks

Ray

Posted on 6/22/2008 @ 4:34 AM
Great product - has increased my productivity in writing js scripts

CodePlex project is set to not published.

Also - Event.button value is not being converted using compat script in FireFox

Ray

Jean-François L'Heureux

Posted on 6/23/2008 @ 6:55 AM
Finally, I found out by myself with Reflector help, where the missing classes were. I'll give the list for anyone that have the same problem that I had:
ControlFactory = SilverlightPlugin
ControlParameters = SilverlightPluginParameters
ControlLoadCallback = SilverlightPluginLoadCallback

Thanks again for Safari support! It's working now
The discussion on this post has been closed. Please use my contact form to provide comments.