Closed Bug 1690742 Opened 4 years ago Closed 4 years ago

Remove flow types from the debugger

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(firefox88 fixed)

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files, 7 obsolete files)

Debugger panel is the only panel to use flow and this require:

  • a build step, which:
    • require to run ./mach build faster before seeing the changes applied
    • doesn't support source map and makes it hard to understand stacktraces as locations aren't matching sources
  • a couple of non-trivial workarounds in order to address flow type system edge cases. Example stringToSourceActorId:
    https://searchfox.org/mozilla-central/source/devtools/client/debugger/src/reducers/source-actors.js#176-182
  • using yarn && yarn flow from debugger folder. Ideally, we should be able to work on any panel only by using ./mach commands.

I'm 100% in favor of removing flow.

(continuing the conversation on slack about losing a safety net when removing flow)
From what I remember, when we discussed debugger cleanups, we pushed back about removing the jest tests, because we were afraid we might lose coverage. I don't remember we had this argument about flow though.

Every time flow breaks, I update the types as quickly as I can to make it pass. It never "caught" any regression or issue for me.
I don't feel like flow brings much here. It's not well integrated in our tool chain and it's inconsistent with the rest of the code base.

I am also on board with removing it.

Honza

Blocks: 1671167
Severity: -- → S3
Priority: -- → P3

I feel the same, let's make our lives easier

This is an automated change, done via:
$ yarn global add flow-remove-type
$ ~/.yarn/bin/flow-remove-types devtools/client/debugger/src/ --out-dir devtools/client/debugger/src2
$ cp -r devtools/client/debugger/src2/* devtools/client/debugger/src/

Attached file Bug 1690742 - [devtools] - Auto-fix eslint issues (obsolete) (deleted) —

This is also automated, via ./mach eslint --fix

Attached file Bug 1690742 - [devtools] - Manual eslint fixes (obsolete) (deleted) —

./mach eslint wasn't able to auto-address all issues.
I'm going over all of them here.

Attached file Bug 1690742 - [devtools] - Remove flow plugin (obsolete) (deleted) —

Remove references to flow in build files.
This effectively stop stipping flow from debugger modules.
So any leftover would now start being kept in production file and do an error.

Attached file Bug 1690742 - [devtools] - Manual fixes (obsolete) (deleted) —

Some manual fixes are necessary.
Especially lots of attributes being types in the beginning of classes,
which ended up overloading the real implementation of attributes/functions.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Attached file Bug 1690742 - [devtools] - Remove // @flow comments. (obsolete) (deleted) —
Attachment #9203447 - Attachment description: Bug 1690742 - [devtools] - Stop running flow on try → Bug 1690742 - [devtools] - Remove flow plugin and stop running flow on try
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/552023cfd750
[devtools] - Strip flow from the debugger sources. r=nchevobbe,bomsy
https://hg.mozilla.org/integration/autoland/rev/3a94715fdff0
[devtools] - Remove eslint settings about flow. r=nchevobbe,bomsy
https://hg.mozilla.org/integration/autoland/rev/828c62bfc0a2
[devtools] - Remove flow plugin and stop running flow on try r=nchevobbe,bomsy
Attachment #9204020 - Attachment is obsolete: true
Attachment #9204019 - Attachment is obsolete: true
Attachment #9204018 - Attachment is obsolete: true
Attachment #9203445 - Attachment is obsolete: true
Attachment #9203443 - Attachment is obsolete: true
Attachment #9203442 - Attachment is obsolete: true
Attachment #9203444 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
Blocks: 1702858
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: