Ideas for Twitter Flight + Router

85 views
Skip to first unread message

Timya

unread,
Feb 11, 2015, 9:58:29 PM2/11/15
to twitter...@googlegroups.com

Any ideas for implementing Router in a Twitter Flight based application.

Been trying to use https://github.com/wwwsevolod/flight-router, but has many limitations. Looking to have routes been defined in the required components or separate script route files kept per module, which get bundled using Browserify and are injected into the route handler.

Giuseppe Gurgone

unread,
Feb 14, 2015, 4:20:03 AM2/14/15
to twitter...@googlegroups.com
Have you ever seen "pushState to the future"? https://www.youtube.com/watch?v=hrZl_EQUbRQ
Todd Kloots explains how Twitter implements pushState navigation with Flight (which at that time wasn't open source yet I think)

Paul Swartz

unread,
Apr 4, 2015, 7:47:29 PM4/4/15
to twitter...@googlegroups.com
I realize this is a a pretty late reply, but what I ended up doing for my project is using Rlite (https://github.com/chrisdavies/rlite) and listening for 'hashchange' events.  Rlite then instantiates Page objects (like what you get from generator-flight), and attaches them to the appropriate part of the page (the node the router is attached to).

Hope this helps!

-p
Reply all
Reply to author
Forward
0 new messages