Closed Bug 1300866 Opened 5 years ago Closed 5 years ago

Add a `devtoolsRequire` hook to expose native modules

Categories

(DevTools :: Debugger, defect, P1)

defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Tracking Status
firefox51 --- fixed

People

(Reporter: jlong, Assigned: jlong)

References

Details

Attachments

(1 file)

When working in the Firefox panel, we need the ability to load devtools modules locally for enhanced functionality. We can do this by simple exposing the devtools require, and our webpack config will override specific modules to use it.
Attached patch 1300773.patchSplinter Review
Attachment #8788591 - Flags: review?(jlaster)
Assignee: nobody → jlong
Blocks: 1294139
Comment on attachment 8788591 [details] [diff] [review]
1300773.patch

Review of attachment 8788591 [details] [diff] [review]:
-----------------------------------------------------------------

Either of you can review this :) Need to commit this soon because current mochitests PRs depend on it.
Attachment #8788591 - Flags: feedback?(bgrinstead)
I decided to go ahead and push this because it's extremely low risk and a lot of stuff is dependent on it.
Nevermind, it won't help with my docker build because I'll have to wait until it merges with mozilla-central anyway. I'll wait for a proper review :)
Comment on attachment 8788591 [details] [diff] [review]
1300773.patch

Review of attachment 8788591 [details] [diff] [review]:
-----------------------------------------------------------------

Adding this as a global / external for the debugger bundle seems fine to me (with the caveat I don't have as much context with consumers of this as Jason).  What will devtoolRequire do when not loaded in the toolbox?
Attachment #8788591 - Flags: feedback?(bgrinstead) → feedback+
(In reply to Brian Grinstead [:bgrins] from comment #5)
> 
> Adding this as a global / external for the debugger bundle seems fine to me
> (with the caveat I don't have as much context with consumers of this as
> Jason).  What will devtoolRequire do when not loaded in the toolbox?

It's never used outside the toolbox. It's the special primitive that the webpack config can use only when targeting the panel: https://github.com/devtools-html/debugger.html/blob/master/webpack.config.devtools.js#L33

Otherwise, we assume that you have replicated all necessary functionality locally. There might be a better way to do this (and actually, if we ever load it as a resource:// URL, we'll have to find a different way) but this is a simple workaround for now.

Thanks!
Comment on attachment 8788591 [details] [diff] [review]
1300773.patch

Review of attachment 8788591 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good to me.
Attachment #8788591 - Flags: review?(jlaster) → review+
Pushed by jlong@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/ae2144aa4356
expose devtools require to new debugger r=jlast,bgrins
Friendly reminder to please triage debugger bugs that you opened yourself.
Priority: -- → P1
Sorry, for quick tiny bugs it's easy to forget especially :(
https://hg.mozilla.org/mozilla-central/rev/ae2144aa4356
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.