Skip to content
doy edited this page Nov 19, 2012 · 11 revisions

Current todo list:

OX::Tutorial

We really need more entry-level docs. Also, see https://github.com/iinteractive/OX/wiki/Advent-calendar-ideas.

Slurpy routes

It would be nice to be able to declare routes with slurpy components, so that

route '/search/*stuff' => 'root.search';

would allow any number of path components to follow /search. This will require adding support for this in Path::Router.

Inline routers as something other than mounts?

Inline routers currently work, but they can only be used as mounts. This is mostly okay, but it does mean that PATH_INFO may end up as an unexpected value. Being able to just merge the inline router into the top-level router may be a better solution in certain situations. This would probably look something like

router as {
    route '/foo' => router as {
        route '/' => 'foo.index';
    };
}

This could be easily implemented as a new RouteBuilder class, assuming router blocks returned the application object with a '&{}' overload, rather than just a coderef (or returned a coderef for the top level router, but an application object for nested routers, either one would probably work). The main issue here will be figuring out how to apply middleware defined in nested routers only to the routes defined in that router, but that should be doable with a bit of introspection and Plack::Middleware::Conditional.

The question is though, is this a reasonable/necessary idea?

Middleware in roles?

Implementing this is trivial, given the existing role implementation (in fact, I already did it in 0.06 before deciding to remove it until thinking about it some more), but is it a good idea? Having that sort of global effect in roles like that seems like it could be extra confusing. Maybe middleware in roles should only apply to that role specifically (via router introspection and conditional middleware), while middleware in classes gets applied globally? That difference seems like it could end up being confusing as well.