Web Inspector: we should lazily import three.js
https://bugs.webkit.org/show_bug.cgi?id=194305
Summary Web Inspector: we should lazily import three.js
Devin Rousso
Reported 2019-02-05 14:55:19 PST
In the case that the Layers tab isn't even enabled, we're still loading three.js. We should avoid loading it until the first time we show the Layers tab.
Attachments
Patch (3.77 KB, patch)
2019-08-05 09:08 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews212 for win-future (13.50 MB, application/zip)
2019-08-05 10:43 PDT, EWS Watchlist
no flags
Radar WebKit Bug Importer
Comment 1 2019-02-05 14:55:38 PST
Devin Rousso
Comment 2 2019-08-05 09:08:52 PDT
Created attachment 375529 [details] Patch One possible "solution" that's quite hacky :|
EWS Watchlist
Comment 3 2019-08-05 10:43:36 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2019-08-05 10:43:38 PDT Comment hidden (obsolete)
Nikita Vasilyev
Comment 5 2019-08-05 11:33:07 PDT
Comment on attachment 375529 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375529&action=review > Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js:149 > + request.open("GET", url, false); Note that the syncronous XHR on the main thread is already deprecated in Chrome and Firefox. If WebKit deprecates it, this would stop working.
Blaze Burg
Comment 6 2019-08-06 10:28:27 PDT
Comment on attachment 375529 [details] Patch r=me on the general approach Is there some reason this can't be a fetch instead?
Devin Rousso
Comment 7 2019-08-06 10:40:05 PDT
(In reply to Brian Burg from comment #6) > Is there some reason this can't be a fetch instead? `fetch` is async. The big "issue" with any attempt at lazy-loading something is that we need a way to basically block everything else (or queue it) until the lazy-loading is done. I'd tried prototyping something like this in the past for <https://webkit.org/b/172249>, but one of the issues I encountered was that there are SO many entry points to a tab (or it's main content view) that blocking/queuing them all is a tall order. In this case, thinking about it more, since THREE.js is only used in this file, I could create a local defer queue. I'll experiment and see.
Note You need to log in before you can comment on or make changes to this bug.