Scott Hanselman

MS-Ajax Client Javascript integrated within the Aptana IDE

February 12, 2008 Comment on this post [8] Posted in ASP.NET | Javascript | Microsoft | Musings | Programming
Sponsored By

Aptana has a cool Eclipse-based IDE for writing AJAX-y websites. It's got built-in support, via plugins, for most of the major Javascript Libraries. At the core of ASP.NET's AJAX support is the Microsoft AJAX Library 3.5 (direct download), a collection of Javascript classes that you can use in any application, whether it uses ASP.NET or not. The library is licensed under the Ms-PL, the least restrictive Microsoft license. It's the "do what makes you happy" license.

Anyway, I wanted it integrated into Aptana's Studio, so I took the client libraries and bundled them into a JAR file as an Aptana (Eclipse) plugin. You just download this one JAR and save it in the Aptana\Plugins folder and when you make a new Web Project, Microsoft Ajax 3.5 will appear in the list.

clip_image002

When you select (it's a checkbox, so you can add multiple libraries to one project) you'll get the Javascript and "intellisense" for the libraries, as well as a Hello World Sample...

clip_image002[6]

...as well as integrated with the online Ajax Documentation

clip_image002[8]

I think that JS components like MS-Ajax should be easily accessible in other IDEs that aren't Visual Studio, like Aptana.

The one big feature that I didn't have time to do was full Intellisense (Aptana calls it "Code Assist") as it'll require a custom ScriptDoc XML file to describe each method within the libraries. This means that you'll not get the extra documentation tooltip, but I'm working in it.

Bertrand has a post explaining what our format for JS metadata looks like. The Open Ajax Alliance has an IDE Charter that describes an interoperable way for IDEs to interact with libraries, publish metadata,etc. Microsoft joined the Alliance last year and passed the Open Ajax Interop Test last September. Bertrand has a whole category dedicated to Open Ajax. When these specs gets better figured out, we'll make sure this gets supported. I may write a tool in the short term to convert between our format into Aptana's if folks ask. Eventually, however, everyone will use the standard (after it comes out, you know how standard take time).

I've  been talking with Aptana to get this support built in and possibly auto-downloadable, but for now, if you're running Aptana and you'd like MS-Ajax support, save this JAR (com.ajax.ms.3.5.21022.8.jar) into Aptana's plugin directory and restart the IDE.

Later, I'll show you how to do the inverse with Visual Studio, integrating Prototype and JQuery.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
February 12, 2008 13:04
As much as I like the Microsoft Ajax library, there is a huge deficiency that makes me ache for a jQuery or Prototype, namely a lack of CSS selector querying. That and the ability to set CSS attributes with JSON would help make Microsoft Ajax a first-class JavaScript Web front-end library. In the meantime, I am dying to read your how-to on how to integrate jQuery and Prototype with Visual Studio!

P.S. I would ask for YUI too, but I'll just wait until after Microsoft acquires Yahoo! for that one. ;)
February 12, 2008 17:08
I am a big Eclipse fan (I am a Java developer and Dot Net is my hobby programming language). Good to see Eclipse screenshot here. :-)

February 12, 2008 17:11
Most excellent!

@Joe, I somewhat agree, but I use JQuery and MS Ajax together as I found each has their own benefits. Overall, I use MS Ajax to make Ajax calls, but handle the results using JQuery.

JQuery
- easier to manipulate the Dom
- much easier to find your elements
- con: tedious Ajax calls from and to the .NET environment

MS Library
- easier to do ajax calls
- default authentication service and profile services
- Allows oo features for better organizations namely, namespace, inheritances, reflections and etc.

February 12, 2008 22:41
Hi Scott, I really like Aptana, and I was about to use it for all my jQuery work since VS 2008 was having problems with it, but the new VS patch fixes it! I added a bunch of XML comments to jQuery so now the intellisense rocks. Check it out!
February 13, 2008 0:05
I'm very interested in the inverse. I use the Dojo Toolkit and love it. They have their own style of documentation and I've been wondering how hard it would be to write some kind of transform to the xml comment structure. I assume you will do something similar for jQuery and Prototype?

Like shown on Brennan's blog here. Sounds like he may have done it manually?

I like the way he uses a separate file so you don't have to update the actual source. This also allows for regeneration as the source changes.

I would love to hear your plans on generating these files.

Mike

February 13, 2008 11:18
That's really cool! Thanks for updating us!
February 15, 2008 19:11
I just blogged about the approach we've just taken at my place of work to enable JQuery intellisense in VS2008. Looking forward to seeing how you approach it in your followup...
February 26, 2008 21:49
You know what I would love? support for asp.net files like .aspx, .ascx, .asmx, .cs etc... I hate opening aspx files and having aptana show all kinds of parse errors.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.