Open Bug 1789835 Opened 3 years ago Updated 2 months ago

Migrate DevTools to use absolute URL instead of absolute path when requiring commonjs modules

Categories

(DevTools :: General, task, P3)

task

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(2 obsolete files)

In order to migrate to ESM (bug 1525652), we will have to either import ESM via relative path (import foo from "./foo.js") or absolute URL (import foo from "resource://devtools/foo.js").

This issue is that, for now, with commonjs modules, we often use "absolute path" (require("devtools/foo").

In order to ease the migration, we should:

  • keep using relative path as-is (this doesn't cause any trouble when migrating to ESM)
  • always pass the file extension
  • usage of absolute path should be migrated to absolute URLs
Depends on: 1792803

Everywhere but:

  • the debugger (to be done independently)
  • jsonview (uses custom resource:// URLs)
  • dependencies of jsonview in client/shared (reps, react, and two components)

This will greatly help migrating to ES Modules which don't support path and only URLs or relatives.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Depends on: 1792847
Depends on: 1792848
Depends on: 1792849

Comment on attachment 9296610 [details]
Bug 1789835 - [devtools] Use absolute URLs to import modules in devtools/client.

Revision D158324 was moved to bug 1792847. Setting attachment 9296610 [details] to obsolete.

Attachment #9296610 - Attachment is obsolete: true

Comment on attachment 9296612 [details]
Bug 1789835 - [devtools] Allow node/jest to load modules from absolute resource:// URLs.

Revision D158325 was moved to bug 1792847. Setting attachment 9296612 [details] to obsolete.

Attachment #9296612 - Attachment is obsolete: true
Depends on: 1792850
Depends on: 1792851
No longer depends on: 1792803
Depends on: 1792856
Depends on: 1793395
Depends on: 1793396
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: