Closed
Bug 1064279
Opened 10 years ago
Closed 10 years ago
[meta] Use the Flux pattern for more parts of Loop, and improve the flux style
Categories
(Hello (Loop) :: Client, defect, P5)
Hello (Loop)
Client
Tracking
(Not tracked)
RESOLVED
WORKSFORME
backlog | tech-debt |
People
(Reporter: NiKo, Unassigned)
References
Details
(Whiteboard: [tech-debt])
The more the UI related code for Loop grows, the more painful to maintain it gets:
- We're passing component dependencies around through props
- We listen to events from componentDidMount() and unregister from componentWillUnmount()
- We often rely on globals from within these component hook methods (navigator.mozLoop, window, document…)
This creates code hard to follow, grasp, track and debug. We should start investigating the Flux pattern[0] which has proven working great combined with React.
Basically the idea is to extract/decouple the app business logic from UI component code, so we'd just use a single app event handler capable of notifying any subscribing component from data state changes.
After discussing with :mikedeboer and :paolo, it seems this would be ideal for handling contacts API mutations, and more generally for anything mozLoop related.
[0]: http://facebook.github.io/react/docs/flux-overview.html
Comment 1•10 years ago
|
||
This change will probably be very large and may introduce a fair amount of risk considering that we will need to uplift this to Aurora.
How bad would it be to use the current pattern and only do flux on mozilla-central?
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #1)
> How bad would it be to use the current pattern and only do flux on
> mozilla-central?
That's definitely the plan, yes :)
Reporter | ||
Comment 3•10 years ago
|
||
Some good & illustrative reading about how Flux could help in Loop content code: https://github.com/rpflorence/react-training/blob/gh-pages/lessons/04-less-simple-communication.md
Updated•10 years ago
|
Whiteboard: [tech-debt]
Updated•10 years ago
|
backlog: --- → Fx36+
Updated•10 years ago
|
Summary: Investigate using the Flux pattern for Loop → [meta] Use the Flux pattern for more parts of Loop
Updated•10 years ago
|
Depends on: 1079202
Summary: [meta] Use the Flux pattern for more parts of Loop → [meta] Use the Flux pattern for more parts of Loop, and improve the flux style
Updated•10 years ago
|
backlog: Fx36+ → Fx37+
Updated•10 years ago
|
Priority: -- → P1
Updated•10 years ago
|
Severity: normal → major
Priority: P1 → P2
Updated•10 years ago
|
backlog: Fx37+ → -
Comment 4•10 years ago
|
||
Moved to blocking-loop "-" because this is a meta and the dependent bugs have been bucketed.
Comment 5•10 years ago
|
||
didn't get rid of as there's still some break-down of actions that could be added from comments in bug - but biggest ones broken out.
Severity: major → normal
backlog: - → tech-debt
Priority: P2 → P5
Comment 6•10 years ago
|
||
We've now got the main currently supported code running in the flux style. There's still some panel code that isn't, but currently we're not going to rewrite that as the cost/benefit doesn't match up at the moment and we'll consider it if it needs extensive work in the future.
The other improvements we should be specific about and file/handle as we go, hence I'm marking this bug as WFM.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•