Closed Bug 1086588 Opened 10 years ago Closed 10 years ago

Consider reintroducing usage of a router for the Loop conversation window

Categories

(Hello (Loop) :: Client, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: NiKo, Unassigned)

Details

(Whiteboard: [tech-debt])

Currently we use manual parsing of conversation url hashes, and routing[0]; while we won't have many "routes", maintaining this form of code is a nightmare, and is hard to track and reason about. 

Having a router, eg. a Backbone one, would help structuring our main front controller, would reduce the size and bloat of the init() function, and the AppControllerView, which tries to mimic what actually wants to be that router.

I'll spike on migrating the init() function to use a very simple Backbone.Router (incoming, outgoing, room), so we can discuss about the idea.

[0]: http://mxr.mozilla.org/mozilla-central/source/browser/components/loop/content/js/conversation.jsx#548
Assignee: nobody → nperriault
Whilst a backbone router is appropriate, I don't think we should do this for a few reasons:

- It'd be nice to think we can move away from backbone completely. I'm not sure if its possible, but this would take us further away from the goal.

- Whilst a router has the functionality we need, there's a lot of functionality in it we're not using and never going to need. This therefore makes it seem excessive for what we really need.

- The standalone app is moving away from hashes in urls, therefore we're not going to be able to apply the router functionality there, though we're still going to want some similar idea for rooms versus calls (at least for the short-mid term).

This makes me think we should potentially be either sticking with the controller view idea, or writing our own minimal version that'll work for both desktop and standalone.
Whiteboard: [tech-debt]
I'd like us to move away from the router concept entirely in desktop code and rely on the Dispatcher entirely, our very own traffic warden.

It seems like we'd require a router for the purpose of
1) parsing a URL
2) setting a state flag based on the has found on the URL.

...whilst that is something flux/ React is perfectly good at. And URL parsing is a solved problem.
(In reply to Mike de Boer [:mikedeboer] from comment #3)
Ugh, posted too soon: scratch one 'entirely', please and make it 'based on the hash found...'

CAN HAZ BUGZILLA EDITING PLZ?
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.