Make JSON viewer use shared search-box component

RESOLVED INACTIVE

Status

()

Firefox
Developer Tools: JSON Viewer
P2
normal
RESOLVED INACTIVE
2 years ago
9 hours ago

People

(Reporter: ntim, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Use devtools/client/shared/components/search-box.js instead of devtools/client/jsonview/components/search-box.js
Priority: -- → P2
When I import the search-box component (const SearchBox = require("devtools/client/shared/components/search-box");), I get the error: Error: Module name "devtools/client/shared/key-shortcuts" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded

key-shortcuts is part of the search-box component, but wrapping the search-box module in define(function (require, exports, module) {}  doesn't solve the issue (it only generates similar errors for other modules further in the dependency chain)...
Flags: needinfo?(odvarko)
@Dalimil: can you please attach your patch so, I can try it?

Honzas
Flags: needinfo?(odvarko)
(Reporter)

Updated

2 years ago
Flags: needinfo?(dalimilhajek)
Created attachment 8813444 [details] [diff] [review]
Bug1310774.patch - rev1
Flags: needinfo?(dalimilhajek)
Attachment #8813444 - Flags: feedback?(odvarko)
Thanks for the patch Dalimil.

So yes, the module "devtools/client/shared/key-shortcuts" (+ all the other modules it requires) are not ready for being loaded through RequireJS. I am not sure if wrapping all the modules (key-shortcuts, event-emitter, keycodes) within `define()` function is the right way to go. Plus also, key-shortcuts.js is requiring an extra "Services" module.

There are also following options:

1) Time to use webpack.config for JSON Viewer? Does it solve the issue entirely? What about the "Services" module?
2) Do not explicitly require KeyShortcuts in the search-box component, but pass it in. We might have a helper that does that.

Brian, any tips?

Honza
Flags: needinfo?(bgrinstead)
Sorry for missing this request.  If we can work around this with (2) that seems ideal, since it'd be less work and we won't need to check in a bundle / load duplicate modules
Flags: needinfo?(bgrinstead)
Comment on attachment 8813444 [details] [diff] [review]
Bug1310774.patch - rev1

Just removing feedback request (already answered)

Honza
Attachment #8813444 - Flags: feedback?(odvarko)

Comment 7

9 hours ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 9 hours ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.