Monday, April 30, 2007

Silverlight: Differences between the 1.0 Beta and 1.1 Alpha

This could be big. At Mix 07 Microsoft significantly augmented Silverlight. I watched the keynote, and I was a little confused at first, but here are the important bits from my perspective:
  • Silverlight 1.0 Beta for Mac OS X. Replaces the WPF/E CTP plug-in. Works on OS X 10.4 (though MS reqs don't say so, but Safari version is a giveaway) in Safari 2.0.4 and Firefox 1.5.0.8 + 2.0.x.
  • Silverlight 1.1 Alpha for Mac OS X. Big deal here is that this release includes a subset of the .NET CLR. How much? I haven't found anything that says truly yet. Works on OS X 10.4 (though MS reqs don't say so, but Safari version is a giveaway) in Safari 2.0.4 and Firefox 1.5.0.8 + 2.0.x.
  • Silverlight 1.0 Beta for Windows. Works on Vista and XP SP2 in IE 6, IE 7, Firefox 1.5.0.8, and Firefox 2.0.x
  • Silverlight 1.1 Alpha for Windows. Works on Vista and XP SP2 in IE 6, IE 7, Firefox 1.5.0.8, and Firefox 2.0.x
  • Silverlight 1.0 SDK. Credit to ActiveWin for linking to this. This isn't just for Windows, its for Mac OS X too!! This is not Visual Studio for Mac OS X, but it does start to answer the questions and criticism I and others leveled against MS for not inviting OS X developers to the party. I haven't fully dove in, and you will need to install Chmox to read the documentation since it's in Compressed HTML (CHM, pronounced chum) files. I actually didn't realize this existed, which is really cool.

What in the bits on OS X?
This isn't immediately obvious, but the Silverlight 1.1 Alpha is a superset of Silverlight 1.0 Beta. How do I know? By inspecting the files, installers and the plug-in. When you install Silverlight 1.0 Beta, this is what the installer package looks like immediately before letting it rip:

When the installer is done, this is what /Library/Internet Plug-Ins looks like:

So what's inside? Right-click on on the .plugin and click Show Package Contents. Then go to Contents/MacOS and this is what you see:

Look at the size of agcore and the Date Modified.
Now install Silverlight 1.1 Alpha. The first thing that set off my spidey sense was that the Install button had changed to Upgrade:

What a minute? This actually had me nervous at first, I didn't want to mess up 1.0 Beta by installing the 1.1 Alpha, how come the Silverlight plug-in can't have both versions side-by-side? Take a look at the contents of Silverlight.plugin after 1.1 Alpha is installed:

Talk about file explosion. The immediate most interesting thing is that agcore is the same size and has the same Date Modified with 1.1 Alpha installed as with 1.0 Beta (to bad there is no version info on these files). Ah hah, agcore is the same in both 1.0 Beta and 1.1 Alpha, thus 1.1 Alpha appears to be a superset and you can install it without fear of breaking code that uses 1.0 after you install 1.1. In fact, I think you can install 1.1 Alpha and just skip 1.0. The other clue to this is the info windows if you extract the plug-ins from the installer packages and Get Info on both:
Notice the version is the same, 0.8.5 (side rant: why isn't this at least 1.0.0? Oversight or more weird Microsoft versioning?). I kind of hope that MS preserves multiple version of Silverlight.plugin to avoid code conflicts, like the full .NET runtime does with major version releases. The packaged format of the plugin on OS X doesn't really support that right now, but no reason that I know of that couldn't be the case. It seems that's partially the beauty of the .plugin bundle on OS X, you can put just about anything you want in there, but my understanding of how files are loaded and referenced inside a bundle is pretty limited, so I could easily be glossing over a much more complicated problem. One more thing of interest, inside the plug-in is another bundle, CoreCLR.bundle, which has the following contents:

All and all, I am very excited about the possibilities. I am not ready to proclaim that Microsoft has changed the game as Robert McLaws has, but they certainly look like stronger competition to Flash/FLEX/Apollo than before today. I also can't believe that McLaws is correct and that the .NET CLR subset in Silverlight 1.1 Alpha is a stepping stone to MS having the complete .NET Framework running on Macs and PCs. I'll believe it when I see it.