Running Thoughts

Tim Bauer's webcast summaries/insights

Rails 3 – Merb Implications

So as I ramp up to do some automation in my business I am looking at Rails as the baseline. So the work going on with Rails 3 caught my eye and I took a spin through an overview given by Yehuda Katz back in May.

image005 · Why it caught my eye

Supposedly Merb allows plug in play w/ Rails so you aren’t trapped w/ pieces you don’t like.

· Would I recommend you watch it?:

If you are hard core into Rails yes as the conversation is very detailed. If you want a layman overview of what Rails 3 is about this is probably not the best angle.

· Most Notable Point:

Ability to plug and play w/ Rails 3 is the goal and looks viable. Both on ORM and other pieces.

· When should you fast forward?

No notable slow segments … very detailed.

· What some might of missed:

Rails Boost looks interesting (a template approach layered on top of rails 2.3)

Seems cool. Not sure if I will work from the alpha rails3 due out shortly or just poke up 2.3. Need to ponder more.

As always, for those amused here are my raw notes:

*** START OF RAW SCRIBBLE TAKEN WHILE RUNNING ***

• Actual presentation

• What to Expect in Rails 3.0 (Rails and Merb)

• Yehuda Katz – 5/22/09

• 0:33.296

…..○ Intro commentary

…..○ Worked on merb full time prior to merge

…..○ Defining audience

……….§ Merb targets the developer that wants to develop apps and extend RoR framework potentially

• 3:53.22 – ORM Agnostic

…..○ Merb

……….§ Form_for … allow activerecord or other types

……….§ Two valid types (valid, errors, new_record)

……….§ Net to two interfaces

…..○ ActionORM (name can change)

……….§ Upgrade on MERB

……….§ Have drivers to make other things pretend to be active records

……….§ I.e. Sequel driver

…..○ Two options – compliance or proxy

……….§ Object.to_model

…..○ 8:21.632 – Code changes required to do above in RoR

……….§ Error_messages_for changes

…..○ Community Extensions

……….§ Adaptor for sql for example

• 10:41.838 – Rack

…..○ MERB 0.05 – No rack, mongrel supported by support

…..○ Support pure rack (Mongrel, Thin, Ebb, CGI, FCGI, Webrick, IRB, Runner)

…..○ Merb 1 – Add some middleware

……….§ PathPrefix, ConditonalGet, Static

• 14:24.377 – Router#call

…..○ Get some rails to behave like rack in certain parts

…..○ Controller.action(:index) … rack object returns …

…..○ Middleware

……….§ Param Parsing (JSON, XML, etc – merge)

……….§ Rescuing – in RoR 2.3 in controller … in 3.0 just another middleware

……….§ Config.middleware.uss Foo to use

…..○ Integration Tests

……….§ Can test app w/ rack aspects with special handling

• 17:16.904 – End Game

…..○ Treat all aspects of Rails, Merb, Sinatra etc as one thing

…..○ Most will use RoR as it works today … but if you want to mount Merb or Sinatra apps … easily to your RoR app

• 18:24.169 – Refactoring Rails internals

…..○ Callbacks

……….§ Around Filters – Unify them – ActionPack, TestCase, Dispatcher, ActiveRecord

……….§ Speed

……………□ Like hello world request returning JSON (10-20% of time)

……………□ Every before_filter fires a ton of stuff (20:38.694)

……………□ Create _run_action_filters … rails compile to one tight method

…..○ ActionDispatch (22:26.253)

……….§ Not controller related … so move to action_dispatch (new)

……….§ Make controllers as fast as Rails Metal

…..○ AbstractController

……….§ Rails mailer, rails controller – same but forks

……….§ Rebuild controller on module approach that is more robust

……………□ Ability to super

……….§ Add new sugar to modules … include will setup super chain correctly

……….§ Layout module depends on renderer

…..○ Example of Rendering (25:51.864)

……….§ Render “foo” – render action foo

……….§ Render :template => “/foo” .. Removes slash (no lookup in abs dir)

……….§ Get Template object … AC::Renderer

……….§ Render Template object … Abstract::Renderer .. gets Template object

……….§ Set HTTP response .. Http base controller

……….§ Set response_body … main AbstractController

……….§ … so top down … normalize as you move up (top down in my list)

• ActionView (28:31.943)

…..○ ViewPathSet#find (single way in) … get Template object

……….§ Ask each of its paths (resolvers) do you have something that matches

……….§ Abstract file system physical from request for a template

…..○ Returns template

…..○ Template#render(self) – controller

…..○ ActionView.long_meth

• Public API (31:30.369)

…..○ Rails has … public doc is the API … one API

…..○ Merb 1 …

……….§ Public

……….§ Private

……….§ Plugin

• Rails 3 (32:43.202)

…..○ TBD

• Debugging

…..○ Rack::Bug (33:11.266)

…..○ Port of Django debug toolbar

…..○ Works in rails 2.3

…..○ Pluggable

…..○ Solution – Orchestra (34:23.441)

……….§ Event system in rails … 100 lines of code

……….§ Hook to ‘render’ event … not system

……….§ Publish a render event … works across stacks

……….§ Longer term goal … one place to override renderer and sequel

……….§ Make alerts custom … don’t block main thread w/ 10 callbacks

• Exception Middleware (36:38.514)

…..○ Rack thing

• Javascript

…..○ Rails 2.3 Bad

…..○ Merb .. Bring your own javascript

…..○ jQuery .. jRails (hard link to rails API – breaks)

…..○ Rails 3

……….§ Instead get javascript out of inline .. Semantic markup

……….§ jQuery example (38:44.851) of what you need

……….§ Separate behavior from markup

……….§ Generate Markup

……………□ Rails.prototype.js (HTML 5 question)

……………□ Rails.dojo.js

……………□ Rails.mootools.js

……………□ Etc

• Competition (40:27.494)

…..○ Remove Merb reduces competition

…..○ Why merger is good

…..○ ActiveRecord and DataMapper .. Allow choice

…..○ ActionController and MetalController … allow choice (for speed)

…..○ Known interfaces (drop our rails parts you don’t want)

…..○ Allow you to drop out pieces of rails that doesn’t work

…..○ Template Engines (42:59.934)

……….§ Good in 2.1 and up (so use rails)

……….§ Merb and ORMs – Work

…..○ Rails Boost (44:10.906)

……….§ Build part of stack .. Custom rails … create your stack on options

……….§ Don’t take away ‘rails foo’ experience

• Q&A (45:54.318)

…..○ Rails 3 release?

……….§ When its ready. Not prior to google summer of code. 2-3 months after that.

……….§ Get more plug-ins ready … goal stables are more stable

…..○ Will you do something like Rails Boost (48:2.728)

……….§ DHH is against a bunch of questions

…..○ Ease up upgrade from 2.3 to 3 (49:43.843)

……….§ API focus (don’t break that)

…..○ Help

……….§ Run apps and plugins on Master

…..○ Will rails 3 work 1.8.6 ruby … yes

…..○ Rails 3 trunk .. Is available (github)

…..○ Any alpha versions? Beta releases … maybe.

…..○ Books on rails 3? Later.

October 11, 2009 - Posted by | 2-Perhaps (what floats your boat?) | ,

No comments yet.

Leave a comment