John Lam is announcing a bunch of good IronRuby stuff at OSCON today, mainly around the project's commitment to open source. Part of this commitment is being able to collaborate with the Ruby community on projects that are related to IronRuby. This is where I fit in. :)
At RailsConf John Lam and I gave a talk about IronRuby, Rails, and Silverlight. We showed IronRuby running Rails, as well as the beginnings of an integration between Silverlight and Rails. I've hinted in the past about this very thing, but RailsConf was the first time I got to show it to working to actual Rails developers. Pretty awesome. Today, I get to share it with the world:
silverline is a Ruby on Rails plug-in which gives the ability to run Ruby in the browser to manipulate HTML, vector graphics, or just do some computation. Bottom line: it let's you write Rails code that can run on the client.
Check out the website: http://schementi.com/silverline.
And, most importantly, you can download the plug-in from github: http://github.com/jschementi/silverline.
Also, you can submit bugs/feature-requests on lighthouse: http://silverline.lighthouseapp.com
This is all possible because of Silverlight, the 4 megabyte download of the .NET Framework, and IronRuby, the implementation of Ruby on .NET and the Dynamic Language Runtime. silverline lets you do anything you can do in Silverlight with IronRuby, but it's a first-class part of your Rails application, and makes things a whole lot easier.
To see silverline in action, take a look at the demo site: http://silverline.schementi.com. The source is located at http://github.com/jschementi/silverline-demos. I will be posting walk-throughs of silverline's features shortly. Enjoy!
Note: "silverline" might not be the name of this thing in a couple days, so if you see something else on my blog that seems the same but has a different name, then it's the same thing.




7 comments:
Jimmy,
Sounds like a great idea! Question: how does it degrade? The site says you can just rename an .rjs to a .rb; what happens if the user doesn't have Silverlight? Can we detect this and have it render the .rjs? (Note: haven't actually looked much at the code yet, so forgive me if this seems ignorant.)
I have Silverligt 2 Beta 1 but when I go to:
http://silverline.schementi.com/watch
I get a link to download Silverlight. There I get:
"The site that you visited was built for an earlier, beta version of Silverlight - not the current one. Please contact the site owner to let them know that they must upgrade to the latest release of Silverlight 2"
What's up?
@jonelf: You'll need Silverlight 2 Beta 2 to view silverline.schementi.com. However, I had a bug in silverline where the "installation experience" looked for SL2Beta2, but when not found linked you to SL2Beta1 =P. That's fixed now, so you should be able to go the site, and it'll link you to the correct version of Silverlight if you don't have it installed. Let me know if you have any other problems.
@nick: Degrading is definitely something that this plugin needs to support. The RJS files running in Silverlight isn't fully implemented yet, but falling back to normal Rails behavior when Silverlight isn't found is something I'd like to do. You should open a bug on http://silverline.lighthouseapp.com.
Actually, detecting that Silverlight isn't there might be tricky, since RJS is processed on the server, and we don't know whether silverlight is there or not until it gets to the client. Tricky =P
Just a simple question, maybe blattantly obvious, but when you say it is a Ruby On Rails plugin, it is any RoR, right? There is no need for a Microsoft IIS running IronRuby, but i could just use it on a hosted RoR site, correct?
If that is the case, it is really awesome! :)
@nathanvda There is no "microsoft dependency" on the server side; the only dependency is Silverlight on the clients. I've tested it on ruby-1.8.6 using rails-2.0.2, both on windows and mac, and running under mongrel, webrick, and apache (fcgi and mod_rails). Actually, http://silverline.schementi.com is hosted on dreamhost using modrails. :)
oh, and I'm working on removing the silverlight dependency if you just want to use ruby/python for dom-manipulation ... More on that later :-P
Joe - Your work is amazing! I have been building a rails silverlight application - the silverlight ui is completely programmed in ruby and talks to a backend rails server via webservices - but now you have this awesome plugin - no need for all that ! It's really brilliant!
One question - is it possible to just use my existing ruby code with the plugin rather than converting it back to xaml? Any pointers in this direction would be great :) - keep up the great work :)
Post a Comment