Closed Bug 1821305 Opened 1 year ago Closed 1 year ago

Convert toolkit/components/crashmonitor/ to ES modules

Categories

(Toolkit :: General, task, P3)

task

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: standard8, Assigned: siya066btit21, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [esmification-timeline][lang=js])

Attachments

(2 files)

I'm happy to mentor work towards this bug. Please don't ask to be assigned to it, though you can say you're working on it. You'll be automatically assigned when you upload the first patches.

Here's what to do:

  • Make sure you have a local build of Firefox up and running. Use these instructions if you haven't already.
  • Using the ESMification walkthrough as a guide:
    1. Run ./mach esmify --convert path/to/files
    2. Examine the output for any errors from ESLint and fix them.
    3. Next convert the imports - ./mach esmify --import . --prefix path/to/files
    4. Again, check for any errors and fix them.
    5. Run a build to check it passes.
    6. Also run ./mach eslint --fix path/to/files and check there are no raised failures
    7. Commit the changes with a commit messages such as "Bug nnnnnn - Convert path/to/files to ES modules. r?Standard8"
  • Use moz-phab submit to submit the patches for review.

Hey Mark, I would like to work on this. Thank you for the help.

Hi Mark, I'd like to take up this task. I'd submit my patches soonest.

Flags: needinfo?(standard8)

(In reply to Godsent Michael from comment #2)

Hi Mark, I'd like to take up this task. I'd submit my patches soonest.

Please read the previous comments when working on a bug. Siya has already commented here that they would like to work on it. Additionally, my comment 0 explicitly says you don't need to be asked to be assigned to it. If you are having trouble finding issues to work on, please ask in the #introduction channel on Matrix.

Flags: needinfo?(standard8)
Attached image bug.PNG

Hello! When I run the command ./mach eslint --fix toolkit/components/crashmonitor/ I see 2 raised failures. When I open the toolkit/components/crashmonitor folder I see that CrashMonitor.jsm and nsCrashMonitor.jsm have been successfully esmified to CrashMonitor.sys.mjs and nsCrashMonitor.sys.mjs respectively but the jsm files still exist. Am I supposed to delete these jsm files now, seeing as we were supposed to convert the jsm files to esm(which did happen) but the original jsm files remain and are causing these raised failures?

Flags: needinfo?(standard8)

I think you should try a build and then run this command, might it help, I am not sure totally

(In reply to Abhishek from comment #5)

I think you should try a build and then run this command, might it help, I am not sure totally

So I did follow the steps mentioned above which included build, the build was successful. I went through the ESMification docs too, and I don't see any steps I missed.

If you don't mind, can I try this on my system

The problem is the previous command - ./mach esmify --convert toolkit/components/crashmonitor - that has failed for some reason, I'm looking into it.

Flags: needinfo?(standard8)

Ok, there appears to be some sort of conflict that is breaking the tool, maybe due to the naming of these files but I'm not sure. Here's what I think you can do:

  • Undo all the changes
  • Convert the files individually:
./mach esmify --convert toolkit/components/crashmonitor/nsCrashMonitor.jsm
./mach esmify --convert toolkit/components/crashmonitor/CrashMonitor.jsm
  • Then run the import conversion:
./mach esmify --import . --prefix toolkit/components/crashmonitor/
Assignee: nobody → siya066btit21
Flags: needinfo?(siya066btit21)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e943d04b66d3
Convert toolkit/components/crashmonitor/ to ES modules. r=Standard8
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Flags: needinfo?(siya066btit21)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: