Migrate DevTools to use absolute URL instead of absolute path when requiring commonjs modules
Categories
(DevTools :: General, task, P3)
Tracking
(Not tracked)
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
| Assignee | ||
Comment 1•3 years ago
|
||
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.
Updated•3 years ago
|
| Assignee | ||
Comment 2•3 years ago
|
||
Comment 3•3 years ago
|
||
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.
Comment 4•3 years ago
|
||
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.
Updated•2 months ago
|
Description
•