Though it’s probably a 1 in 1000 shot, I decided to throw my hat in the ring and pitch a proposal for speaking at RailsConf 2010. While I wouldn’t dare compare my career and achievements with the amazing speakers that are already lined up, I do think that I have some ideas worth sharing. I’ve posted my proposal below, what do you think? Would anyone be interested in hearing about this at one of the Chicago Ruby events?
Creating user-extensible Web applications is the next frontier for Rails developers. While Web 2.0 was all about user-generated data, the next generation of Web apps (Web 3.0?) will be all about user-generated functionality.
By enabling your power-users to extend your application’s functionality, you position your app as a platform upon which unique and meaningful experiences can be continually built.
Many Rails apps are already doing this successfully. Shopify was able to build itself as a platform by letting users use the Liquid templating system to build their own view layer. Apps that need to make data-level layers extensible (ex. user defined business rules) can give their users a custom DSL with which to configure the app.
In the work I have done with my current company I have done both, creating an extensible email marketing system that uses DSLs to define custom business logic and Liquid for building custom email templates. Through building this app, I have discovered a few significant pitfalls:
- DSLs can be difficult to build, maintain and keep user-friendly.
- Templating systems like Liquid allow for an extensible view, but relies on a strict set of pre-defined data nodes, tags and filters.
- System security is inherently at risk when introducing user extensions.
- Templating systems and custom DSLs both use their own distinct syntaxes and rules, creating significant barrier to entry for users.
I am currently building a hosting/CMS system that allows for user application extension at the model, controller AND view layers, and I am successfully solving all four of these problems with a single tool: user-generated, Ruby-executed Javascript.
- Javascript acts as a pre-built DSL. Users can use the familiar Javascript syntax to modify and extend the Rails app’s behavior.
- Javascript-powered templating allows the user to do more than simply use predefined tags and filters; they can even define and use their own custom Javascript helper functions to generate their views.
- Using a tool like the Johnson gem, user-generated Javascript is securely executed within an isolated runtime, and the Rails developer has full control over what data actually affects the stable Ruby environment.
- While the user does need to be able to understand and write Javascript, I believe this is both easier and more fruitful than asking users to learn custom DSLs and templating languages that are specific to the single application.
My goal with this talk would be to identify the benefits and challenges of allowing user-generated functionality, introduce Javascript as a viable solution and show specific code implementations using tools like Johnson and Erubis::Ejavascript for solving these problems.
Yeah, that sounds great – let me know if it gets picked up!!
Hey Chris – we’ve been checking out Talker at work and I think its another nice example of what you’re talking about. They have the idea of Plugins and its just jQuery.
Seems like it fits with your talk – check it out:
https://talker.tenderapp.com/faqs/api/frontend-plugin-api