Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy


Add to Technorati Favorites Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

Archives

VsDoc for jQuery 1.3.1 now available

John Resig tells us he just uploaded the VsDoc file for jQuery 1.3.1 to jquery.com. This enables IntelliSense for the latest available jQuery.

jQuery VsDoc file for 1.3.1 available from jquery.com

Download the file from the jQuery downloads page:
http://docs.jquery.com/Downloading_jQuery#Download_jQuery

More info on what this is:
http://weblogs.asp.net/bleroy/archive/2008/11/07/visual-studio-patched-for-better-jquery-intellisense.aspx

Comments

florim said:

Yes super.

# February 6, 2009 8:14 PM

jeffreyq21 said:

Hi I had a problem when i attach jQuery 1.3.1-vsdoc.js in scriptmanager. I have a page which when it will load it uses jquery and when the page loads a  javascript error was thrown says "jQuery.support.opacity is null or not an object". when I remove the jQuery 1.3.1-vsdoc.js in my scriptmanager it works fine..

# February 7, 2009 2:36 AM

MisterFantastic said:

Hi,

Thats really valuable news. Thanks for the sharin the info.

Thanks & regards,

Thanigainathan.S

# February 7, 2009 9:42 AM

Bertrand Le Roy said:

@Jeffrey: the solution is actually quite simple... :) You should never, ever use the vsdoc version at runtime. Always reference the regular jQuery file, the one you want to use at runtime. Visual Studio, if it has the JS IntelliSense hotfix, will just find the vsdoc version at design time.

# February 9, 2009 1:03 AM

SonuKapoor said:

Awesome! I love jQuery. I have been using it to implement some new features in the AjaxDataControls V2.

# February 11, 2009 10:08 AM

Alek Davis said:

Bertrand Le Roy said: "You should never, ever use the vsdoc version at runtime." May I ask why? I assume that the vsdoc version of the file is functionally the same as the original file (with the exception of the dummy vsdoc files generated for comments only). Thanks.

# February 17, 2009 6:47 PM

Bertrand Le Roy said:

Because it's much larger, because its code structure is slightly different (in principle it's equivalent but we do no testing to ensure it nor any claim to support it) and because you don't need to. With the VS patch, you can just reference the minimized version and VS will know where to find the vsdoc version to provide IntelliSense.

So rather than asking why you couldn't use the vsdoc file at runtime, the right question is why would you?

# February 17, 2009 7:30 PM

Alek Davis said:

I assume that the VS patch applies to VS 2008 SP1. If my assumption is correct, for projects which are still on VS 2005 and earlier, using the vsdoc version makes sense. Sure, it's larger, but would anyone -- meaning a human -- really notice a difference between the times to load the vsdoc version and another version? I doubt. If the vsdoc version is provided for documentation only, it should not contain any functional code (like a dummy file generated via InfoBasis JQuery IntelliSense Header Generator); otherwise, people assume that it's a functional version. I spent almost an hour trying to figure out what caused the error reported by jeffreyq21 (until I compared results to a non-vsdoc version). And if the vsdoc version is intended to be functional, then reported bugs must be addressed.

# February 17, 2009 8:39 PM

Bertrand Le Roy said:

@Alek: Visual Studio relies on actually running the script to determine a good deal of the IntelliSense information, and the final API of jQuery is created dynamically at runtime, with a lot of "code generation". Generating an empty doc file would mean lots of reverse engineering and unfolding of the code (we had to do some of that but only a little) and we would probably not get it exactly right in the end. It's much more reliable this way and much faster to generate, which is important seeing how often jQuery revs. We went to great efforts to make sure that you would never need to reference that file from VS while still getting full IntelliSense. We also made sure the file on jquery.com is labeled as documentation and not as a runtime file.

In the end, you do what you want, but there is no way we're going to support such a scenario and you need to understand the performance and possibly reliability impact.

# February 17, 2009 8:54 PM

Alek Davis said:

@Bertrand: OK, so if the vsdoc file is only intended for IntelliSense, what is the difference between the one you built and the one that can be generated using <a href="www.infobasis.com/.../">InfoBasis JQuery IntelliSense Header Generator</a>? The InfoBasis version does not contain any functional code, but I'm not sure if it contains the same documentation or if it's different. Thanks for quick responses.

# February 17, 2009 9:08 PM

Bertrand Le Roy said:

@Alek: feel free to use that file if you want. I don't know what these guys are doing to generate the file or how well it works. The vsdoc file on the other hand is produced by the same team that works on JavaScript IntelliSense in Visual Studio and is the best you can get for 2008 SP1.

# February 17, 2009 11:37 PM

Alek Davis said:

Thanks Bertrand. I appreciate the feedback.

# February 18, 2009 3:38 PM

Joe Chung said:

"Would anyone -- meaning a human -- really notice a difference between the times to load the vsdoc version and another version?"

A human would notice the bandwidth bills from using a 190K JavaScript file vs. using a 55K one.  People viewing your site on 56K modems would also notice.

The 1.3.2 vsdoc is out, by the way.

# February 25, 2009 8:28 AM

ZK@Web Marketing Blog said:

jQuery.support has been commented out (didn't have time to investigate the reason) -- so any code that references jQuery.support must also in turn be commented.  There are maybe 10 spots in the vsdoc file that code needs to be commented out.  Once you do that, you're golden.

# May 17, 2009 3:27 PM