Closed Bug 1801695 Opened 2 years ago Closed 2 years ago

Remove SourceMapService in favor of SourceMapLoader

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox110 fixed)

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

Today there is an intermediate layer called "SourceMapService", built from the toolbox class:
https://searchfox.org/mozilla-central/rev/83b86005c6913c2062419efb8aabdf2e683aa47f/devtools/client/framework/toolbox.js#1380-1454

This uses JS Proxy to hack the SourceMapLoader layer. Instead these hacks should be distributed into either SourceMapLoader or the callsites.

Also, we could simplify the SourceMapLoader by:

  • using the regular DevTools Loader to load it
  • store the various worker module URLs in the "index.js" files instead of requiring the callsites to know the worker url.
  • rename sourceMapService to sourceMapLoader (this will clarify a bit more the difference between SourceMapLoader and SourceMapURLService).

This allows using a regular worker and no longer have to be related to any particular document.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

This simplify the frontend code/callsites by not having to know where the worker file is.

Now that source-map-loader uses ChromeLoader, it doesn't need to be loaded
via the Browser Loader. It was mostly used to be able to access window.Worker symbol.

It was also exposing fetch global symbol. DevTools Loader wasn't exposing it.
I fixed that as this symbol is available in JSM/ESM.

This will help get rid of the proxy entirely.

Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b80085248912 [devtools] Use ChromeWorker for devtools frontend workers. r=bomsy https://hg.mozilla.org/integration/autoland/rev/03a9f2939f63 [devtools] Store worker URL in their index.js module instead of callsite. r=bomsy https://hg.mozilla.org/integration/autoland/rev/4d081dac3e31 [devtools] Use regular devtools loader to load SourceMap modules. r=bomsy https://hg.mozilla.org/integration/autoland/rev/8435c181b8b9 [devtools] Remove applySourceMap proxy in favor of an event. r=bomsy https://hg.mozilla.org/integration/autoland/rev/208656a729be [devtools] Remove Proxy on top of SourceMapLoader. r=bomsy https://hg.mozilla.org/integration/autoland/rev/136a6746e5db [devtools] Rename SourceMapService to SourceMapLoader. r=bomsy
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: