ChromeDevTools / EmulatedDeviceLab

An experimental prototype exploring simultaneous emulation of devices via Chrome DevTools

Home Page:https://chrome.google.com/webstore/detail/oaonfodocibcdobdeelbbfggjombamff/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delay dependency load

paulirish opened this issue · comments

So I think I reported a bug for EmulatedDeviceLab to another project. :)

richgilbank/Scratch-JS#51

The difference appears to be

  • devtools_page will immediately load all those assets anytime devtools is opened
  • ( panels.create() will occur once a user navigates to the tab. )

can we only load traceur into the devtools once we need it?

From what I can see, it looks like the browserAction (the button)'s behaviour all takes place through background.js, but Traceur is also being loaded in by devtools.html every time DevTools loads. That said, I can't see any behaviour that actually relies on DevTools (though, admittedly I haven't looked too hard 😜). Is devtools.html needed at all?

Sorry for a late response, I've been offline lately.

Paul is right, some EDL scripts are, indeed, loaded with every DevTools instance*. I can, and will, reduce them to the minimum, but I believe that traceur.js is the biggest bottleneck here. What I could do is write a small ES5 script (that does not require traceur) to do all the checking and, only if EDL is really needed, load traceur and rest of the ES6 scripts. I would like to avoid that though - mixing ES5 and ES6 sounds like a really bad idea. What we can do instead, is to provide a production version of EDL. Currently, we are all running a dev version (ES6 is transpiled on the fly). I'll add a build script that transpiles, bundles and minifies all the scripts (#48). However, this repo is not a great place to keep the production version of EDL. That's why I was thinking about distributing it via CWS. Paul, what do you think about that? Can we have an official ChromeDevTools CWS account?

(*) @richgilbank devtools.html is needed to provide the style-syncing capability. See devtools.js for details.

Finally, I got this resolved. 'Light' version of EDL (with ES6 code transpiled and all dependencies bundled) is available here. I will update it with each release. Build process is described here.