Forum: Rails Engines Engines 2.3 compatibility

Acd62030df551952268e84c8fff26a5b?d=identicon&s=25 James Adam (lazyatom)
on 2009-04-20 12:13
(Received via mailing list)
Hi all,

I've just made the appropriate changes to bring the engines plugin
into compatibility with Rails 2.3, and the engine features it
implements. You can find these changes in the 'edge' branch of the git
repository, which I'm currently working on now.

The most notable change within your engine plugins is that I've
removed the custom routes handling from the engines plugin, in favour
of the implementation supplied by Rails itself. This means that your
routes should now be in config/routes.rb, rather than the plugin root,
and that map.from_plugin is no longer implemented.

The main reason for removing this is that I'm not very comfortable
patching Rails to change existing behaviour like this; it was simpler
when Rails didn't provide any plugin routing, but I'm keen not to
result in two kinds of engine plugins - ones that require the engines
plugin itself, and others that work with Rails out-of-the-box.

If the community feels that controlling the positioning of the routes
is necessary, we should be pursuing this as part of the Rails core
implementation, i.e. with tickets and patches and +1s.

I've also properly removed support for 'code_paths' in the plugin -
there are simpler and more obvious ways to support this.

I am keen to smoothly transition as much of the key functionality as
possible from the engines plugin into Rails itself. What remains,
IMHO, is the following:

   * a Rails.plugins map of loaded plugins
   * Migrations support
   * Public asset support

The major feature missing here is the 'code-mixing', which is
basically a short cut for requiring a controller/helper from the
plugin before reopening the class again in the application.

There's already been some discussion on the Rails lighthouse instance
about migrations, but without any suitable resolution. I'd be grateful
to hear any ideas or thoughts you might have, either specifically
about these features, or about this process in general.

Thanks again for your support,

James
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-15 20:19
> The main reason for removing this is that I'm not very comfortable
> patching Rails to change existing behaviour like this; it was simpler
> when Rails didn't provide any plugin routing, but I'm keen not to
> result in two kinds of engine plugins - ones that require the engines
> plugin itself, and others that work with Rails out-of-the-box.



Maybe having a
config.do_not_autoload_maps
and then [re] enabling
map.from_plugin

would be good for the map side, at least.
Then again, maybe nobody really needs ordered maps, so it might not be
all that necessary.
Just thinking out loud.
-=r
This topic is locked and can not be replied to.