Closed
Bug 1480166
Opened 6 years ago
Closed 6 years ago
Use class fields for event handlers to avoid function.bind(this) calls
Categories
(Tree Management :: Treeherder: Frontend, enhancement, P2)
Tree Management
Treeherder: Frontend
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: camd, Assigned: camd)
References
Details
Attachments
(5 files)
In many cases, I had to bind functions to ``this`` in ``componentDidMount`` and even once in the ``render`` function to get the binding to work. We SHOULD only need to make those calls in the constructor. I can't prove this, but I feel that it is a side-effect of us being a hybrid angular/react app while we are transitioning.
So once we are a completely ReactJS app, we should move those ``bind`` calls to the constructor of the components.
Assignee | ||
Updated•6 years ago
|
Blocks: treeherder-react
Assignee | ||
Updated•6 years ago
|
Priority: -- → P2
Comment 1•6 years ago
|
||
We can also try using class properties, once we're on Neutrino 9:
https://reactjs.org/docs/handling-events.html
(search the page for "If you are using the experimental public class fields syntax")
Depends on: 1364894
Updated•6 years ago
|
Summary: Move function.bind(this) calls to component constructors when no longer using react2angular → Use class fields for event handlers to avoid function.bind(this) calls
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/8dab49d9eb8ff4dcae59926613faedd543356624
Bug 1480166 - Use class fields to avoid bind() calls in job-view root (#4317)
Comment 5•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/1547cb3eb6ee9dbf603c006e634c49ad935dbaf2
Bug 1480166 - Use class fields to avoid bind() calls in /context (#4318)
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/b002fdede3c330d2ebd783cb88f7228fa0d9600e
Bug 1480166 - Use class fields to avoid bind() calls in /pushes (#4321)
Comment 8•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/42a827cc6ee92b669496131c2bab99353444bfa5
Bug 1480166 - Use class fields to avoid bind() calls in /details (#4345)
Also remove AutoclassifyTab dead code
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/aefabbbda55e3351f0ca8fb037bce907e63c871f
Bug 1480166 - Use class fields to avoid bind() calls in App and /headerbars (#4355)
* Make handleUrlChanges function name consistent
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/2885a9a1e3c582d6bc2d5152a571625627424da0
Bug 1480166 - Use class fields to avoid bind() calls in the rest (#4370)
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → cdawson
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•