thoughts on breaking change #1: named routes

8 views
Skip to first unread message

Bryan Larsen

unread,
Sep 4, 2012, 4:17:10 PM9/4/12
to hob...@googlegroups.com
I'm thinking of making 2 breaking changes for Hobo 1.4. The first
has to do with named routes. The rationale is in a response to Kevin
Potter: https://groups.google.com/forum/#!msg/hobousers/RXS8Ek-WeR0/cnU3EjehXqkJ

This will obviously impact a lot of people migrating projects from
Hobo 1.3, but I think it is a worthwhile change. Thoughts?

Also, answering this question would make my code a lot simpler:
http://stackoverflow.com/questions/12267897/determining-viability-of-routes-generated-with-polymorphic-url

That would let me get rid of Hobo::Routes as well.

thanks,
Bryan

Domizio Demichelis

unread,
Sep 5, 2012, 1:57:57 AM9/5/12
to hob...@googlegroups.com
We could probably keep both worlds together for now.

I would refactor the old system for the new, but maybe we could create a temporary route-alias system (with deprecation warnings) that kicks in when you use an old style route.
No idea about the practical implementation now, it's just a thought, but the solution would avoid to break any old code, nicely explaining the change to do to the users that still use the old way.

Bryan, we patch rails in a lot of places, so I don't think a temporary patch to grant compatibility would be a problem. What do you think?

ciao
dd


--
You received this message because you are subscribed to the Google Groups "Hobo Dev" group.
To post to this group, send email to hob...@googlegroups.com.
To unsubscribe from this group, send email to hobodev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobodev?hl=en.


Bryan Larsen

unread,
Sep 5, 2012, 9:59:30 AM9/5/12
to hob...@googlegroups.com
Actually, I just realized that Rails would be fine with duplicate
routes. I created a new option
config.hobo.dont_emit_deprecated_routes. If that's not set, we emit
both the new style and the old style routes. If it's not set, we
will take longer to emit 404's, but other than that there shouldn't
impact the app.

I think the default for new apps should be to set
dont_emit_deprecated_routes. That seem right to you?

Bryan

Domizio Demichelis

unread,
Sep 5, 2012, 10:28:20 AM9/5/12
to hob...@googlegroups.com
oh... true. We don't even need a patch if we duplicate the routes. Nice option too, and I agree: it should be set by default.

ciao
dd

Bryan Larsen

unread,
Sep 5, 2012, 10:29:39 AM9/5/12
to hob...@googlegroups.com
Only problem is that it doesn't emit a warning if you use the
deprecated route name. That would be nice, but not worth creating a
hack to do so.

Bryan
Reply all
Reply to author
Forward
0 new messages