Open Bug 1298286 (dt-debt-es6) Opened 10 years ago Updated 8 months ago

[meta] Switch to ES6 classes in devtools

Categories

(DevTools :: General, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: ntim, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

No description provided.
It seems like a nice improvement, and other parts of Firefox (eg. WebExtensions) use those. Things to figure out: - how to convert Task.async() methods: `methodName: Task.async(function*() {})` I suspect we could wait for async functions to land, or we could return an async task within a normal function (although that would look ugly). - how to convert non function properties such as: `MyClass.prototype = { stuff: ["foo","bar"] }` We could use a getter: class MyClass { get stuff() { return ["foo", "bar"] } } Although that's longer unfortunately. But if they are constants, we can simply change them to top level vars.
Status of async functions: bug 1185106
Probably not the priority right now with more important stuff like devtools.html, but still worth a discussion for code we write in the future. Also, for react components, do we want to use createClass? or class foo extends ReactComp? Alex, Ryan, wdyt ?
Flags: needinfo?(poirot.alex)
Flags: needinfo?(jryans)
Keywords: meta
Also, I see lots of usage of Heritage.extend() so this will be a great opportunity to kill that.
I would say the main blocked at the moment is there is no JIT support for ES6 classes (bug 1167472), so I'd expect them to be slower than the traditional equivalent. I think we'd want to wait for that, at least before using them all over the place. So, we can think about making some changes once these JS features are really ready to go, but I don't see a need to do something right away.
Depends on: 1167472, 1185106
Flags: needinfo?(jryans)
(In reply to Tim Nguyen :ntim (use needinfo?) from comment #3) > Also, for react components, do we want to use createClass? or class foo > extends ReactComp? Bug 1253693 comment 1 suggests we would likely move away from createClass to ES6 classes for React components once the JIT issue is resolved.
Nothing much to add. Heritage is often used for single inheritance which could be done with just regular prototype usage. I see classes as a nice to have. We should first give it a try on a new codebase rather than refactoring everything blindly.
Flags: needinfo?(poirot.alex)
Severity: normal → enhancement
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
Summary: Switch to ES6 classes in devtools → [meta] Switch to ES6 classes in devtools
Type: enhancement → task
Depends on: 2004038
Depends on: 1522618
Depends on: 1412269, 1412023
Depends on: 1411588
Depends on: 1448798, 1990181
Depends on: 1512154
Depends on: 1443461
Depends on: 1411531
Depends on: 1409783, 1393453
Depends on: 1783160
Depends on: 1412311, 1419487
Depends on: 1510949
Depends on: 1514817, 1510951
Depends on: 1995744
Depends on: 1526053, 1409064
Depends on: 1992975
Depends on: 1577282, 1512153
Depends on: 1748431
Depends on: 1853163, 1877428
Depends on: 1418250
Depends on: 1981681, 1995761
Depends on: 1411920
Depends on: 1867722, 1417512
Depends on: 1410119
Depends on: 1908669
Alias: dt-debt-es6
Depends on: 2004203
Depends on: 2004204
Depends on: 2004205
Depends on: 2004206
Depends on: 2004207
Depends on: 2004208
Depends on: 2004209
Depends on: 2004210
Depends on: 2004211
Depends on: 2004212
Depends on: 2004213
Depends on: 2004214
Depends on: 2004215
Depends on: 2004216
Depends on: 2004217
Depends on: 2004218
Depends on: 2004219
Depends on: 2004220
Depends on: 2004221
Depends on: 2004222
Depends on: 2004223
Depends on: 2004224
Depends on: 2004225
Depends on: 2004226
Depends on: 2004227
Depends on: 2004228
Depends on: 2004229
Depends on: 2004230
Depends on: 2004231
Depends on: 2004232
Depends on: 2004233
Depends on: 2004234
Depends on: 2004235
Depends on: 2004236
Depends on: 2004237
Depends on: 2004238
Depends on: 2004239
Depends on: 2004240
Depends on: 2004241
Depends on: 2004242
Depends on: 2004243
Depends on: 2004244
Depends on: 2004245
Depends on: 2004246
Depends on: 2004247
Depends on: 2004248
Depends on: 2004249
Depends on: 2004250
Depends on: 2004251
Depends on: 2004252
Depends on: 2004253
Depends on: 2004254
Depends on: 2004255
Depends on: 2004256
Depends on: 2004257
Depends on: 2004258
Depends on: 2004259
Depends on: 2004260
Depends on: 2004261
Depends on: 2004262
Depends on: 2004263
Depends on: 2004264
Depends on: 2004265
Depends on: 2004266
Depends on: 2004267
Depends on: 2004268
Depends on: 2004269
Depends on: 2004270
Depends on: 2004271
Depends on: 2004272
Depends on: 2004273
Depends on: 2004274
Depends on: 2004275
Depends on: 2004276
Depends on: 2004277
Depends on: 2004278
Depends on: 2004279
Depends on: 2004280
Depends on: 2004281
Depends on: 2004282
Depends on: 2004283
Depends on: 2004284
Depends on: 2004285
Depends on: 2004286
Depends on: 2004287
Depends on: 2004288
Depends on: 2004289
Depends on: 2004290
Depends on: 2004291
Depends on: 2004292
Depends on: 2004293
Depends on: 2004294
Depends on: 2004299
Depends on: 2017061
Depends on: 2017062
Depends on: 2017063
Depends on: 2017064
Depends on: 2017218
You need to log in before you can comment on or make changes to this bug.