ActionView 2.0.2 broken without ActionController

Hello all,

You can easily reproduce with Rails 2.0.2 gems:

$ irb

require ‘rubygems’
require ‘active_support’
require ‘action_pack’
require ‘action_view’
BOOM

You should get an error:

MissingSourceFile: no such file to load – html/document

This is because html/document.rb is in lib/action_controller/vendor/html-scanner, and that directory is added to load paths only when action_controller is loaded. Without action_controller being loaded first, action_view doesn’t know how to find “html/document”.

On a related note: both ActionController and ActionView depend on ActiveSupport, but only action_controller requires active_support, and action_view doesn’t.

I would gladly patch all this, but first I wanted to hear others’ opinions. Maybe it’s time to rethink ActionPack loading?

I wonder why html-scanner is not in ActiveSupport along with builder
memcached xml-simple. That *should* take care of these loading issues,
right ?

ActionPack vendor stuff (presently only html-scanner) could be moved to ActiveSupport, yeah. Then active_support.rb could add that directory to load paths. Then, add require ‘active_support’ in action_view.rb and problem solved.

What do others think?

I wonder why html-scanner is not in ActiveSupport along with builder
memcached xml-simple. That *should* take care of these loading issues,
right ?

Seems ok to me, what are the downsides?

> I wonder why html-scanner is not in ActiveSupport along with builder
> memcached xml-simple. That *should* take care of these loading issues,
> right ?

Seems ok to me, what are the downsides?

That Active Support should be a place for things used widely by
multiple consumers. Not saying that html-scanner couldn't be that, but
it would seem that we'd need stronger reasons than loading errors.

We can just ensure in both Action Controller and Action View both
attempt to load the html-scanner if they need it. That would seem a
more prudent way to solve this particular issue.