I have been doing some Test-After Development unit testing on an ASP.NET MVC app and hit code that uses the cache through HttpContext.Current.Cache (I bet @serialseb would just love that! :P ) which as you may know is a royal pain in the arse for getting at or mocking without a web server.

As most sane people do I binged (that just does not sound right!) for an answer to my problem and came across a few interesting things but the closest I came initially was a post from Phil Haacked on his HttpSimulator cache where someone mentioned that using HttpRuntime got around the issue. I tired, it failed and I went back to Bing and came up with a post on Scott Hanselman’s blog where he details a conversation about simply including System.Web along with System.Web.Caching in non-web applications. I was skeptical but people have noted success with this method so I tried it and what did I find, it sodding well worked!

Granted the articles I found are old but this is the first time I have tried to unit test the Cache before so this was quite useful.

In other news I have ordered a copy of Working Effectively with Legacy Code by Michael Feathers from Amazon after @chriscanal recommended it, looking forward to having a read.

 

jquery-vsdoc
Update: John Resig has uploaded the official vsdoc file for jQuery 1.3.1, the workaround posted below is obsolete. You can find the updated file

 at http://docs.jquery.com/Downloading_jQuery.

After the release of jQuery 1.3 earlier this month, those of you who have made use of the extended Visual Studio 2008 support for jQuery will no doubt have discovered the new version is not compatable with the 1.2.6 vsdoc.js file.

James Hart, has come to our rescue with the creation of a 1.3 compatible vsdoc.js file however it should be noted the structure for this file is different from the structure Microsoft used in the 1.2.6 file. As such there may be compatibility issues such as problems when working with extensions, just something to keep in mind.

There has not been any comment from Microsoft on an updated vsdoc file with 1.3 support.

 

jqueryThis is indeed a momentous day for the jQuery team with three major announcements; The release of jQuery 1.3, “Sizzle” (the new css selector engine) and the launch of a new API Documentation browser.

jQuery 1.3

As previously mentioned the new release is mainly about performance which in my book is always good. I really appreciate projects that are willing to go back over their work and improve it for the better.

Most important in this new release is Sizzle, the new CSS selector engine but more on that in a bit. Also in this release is a rewritten event engine, rewritten HTML injection engine which makes appending HTML even faster and my favourite’, the complete removal of all browser sniffing which has been replaced by feature detection. So the lightweight and nippy jQuery just got even nippier!

Live Events are another new feature in 1.3, they allow a developer to attach events to current and future elements through event delegation.

The full 1.3 release notes can be found here

Sizzle – The new CSS selector engine

In 1.2.6, jQuery already had a very fast CSS selector engine, even noticably so when compared to Prototype 1.6 however the new ‘Sizzle’ engine has taken jQuery’s performance to an even greater height.

If you are a stickler for the numbers you can find them here

The big news with Sizzle it is a new standalone public project with an aim to bring together more creators developers to work on a unified selector engine.

More importantly, though, we’re taking a big leap with Sizzle: We’re releasing it as a completely standalone project to be collaborated upon by many library creators and developers. We saw an opportunity to give something back to not just the jQuery community but to the JavaScript development community as a whole; and at the same time be able to collaborate with developers of other libraries on a single, unified, selector engine. We feel that there’s too much competition and not enough collaboration occurring and so we put our code out on the line as a good first step towards working together.

In addition, Sizzle has been handed over to the DoJo Foundation;

As a sign of good faith and willingness to collaborate, we’ve turned over Sizzle to the Dojo Foundation (an excellent non-profit well suited for this project, not to be confused with the Dojo Toolkit). We wanted a common meeting ground where all developers would be able to work together and under which there would be a clear long-term copyright holder.

The Sizzle project can be found at http://sizzlejs.com/

New API Documentation Browser

Any project is only as good as it’s documentation in my book and this is one thing that jQuery has done well with, right from when I started using it in September 2007 and quite probably before.

Remy Sharp has taken the API documentation and moulded it into an even more impressive format, written in both jQuery and Adobe AIR. The new API browser can be found at http://api.jquery.com/ and really does work very well.

Having the option of downloading the API as a windows application really does appeal to me so kudos to Remy for the port to AIR.

So there you have it, lots of new activity in the jQuery arena, now if I could just get my hands on some promotional merchandise (t-shirts) I would be over the moon. Ah well, I guess today’s news will have to do ;)

Oh, I should probably add that today, January 14th, is jQuery’s birthday, well 3rd birthday to be exact so Happy Birthday jQuery.

 

3 Posts in 24 hours, am I feeling OK?jquery

The next major version of the popular javascript framework jQuery (1.3) is almost finished with just the last few bugs to be tracked down. John Resig, lead developer and creator of jQuery published the beta of jQuery 1.3 back in the middle of December and yesterday announced on his twitter feed that 1.3 RC1 was out although this was quickly followed with a mention that RC2 would be required due to last minute bugs. The expected release date of 1.3 is the 14th of January as indicated on the beta announcement blog post.

A summary of what’s new in 1.3:

  • Selector Engine – The selector code has undergone a complete rewrite – it’s likely that some edge cases still exist here.
  • DOM Manipulation (append/prepend/before/after) – This code has also undergone a large rewrite along with some of the logic for executing inline script elements.
  • .offset() – Another method that has been completely rewritten.
  • Event Namespaces – The logic for handling namespaced events has been completely rewritten.
  • Event Triggering – When triggering an event the event now bubbles up the DOM – this is likely to cause some problems.

I have yet to have a play with the new version and indeed probably wont get the chance until it hits release but it is reassuring to see performance enhancements being implemented in this release as well as removing all browser sniffing code. I will add a little bit to my jQuery talk about the latest version.

 

Given how fast popularity for the jQuery JavaScript Framework has grown I figured collating a number of resources together would be a good idea. Feel free to post comments with more to add to the list. More to come soon.

The basics

UI

Plugins

Development

© 2011 Andy Gibson
Header image courtesy of Don Solo
Suffusion theme by Sayontan Sinha