Live data from Hacker News

CSS and JS code coverage in Chrome DevTools

developers.google.com

51–60 of 130 posts

Re: CSS and JS code coverage in Chrome DevTools

#51
post #38

Earlier quoted context omitted.

HTTP/2 happened. HTTP/2 allows you to send HTTP requests over a single TCP connection per domain. Headers are compressed. The request overhead is minimal compared to HTTP/1.x. Caching one big file has the draw back of busting the cache each time the file is updated for any small change. Caching multiple small files allows you to have a finer grain cache. Only bust the things that updated. And, since it's all the same…

>HTTP/2 allows you to send HTTP requests over a single TCP connection per domain. HTTP/1.x definitely has support for this. Not using it actually may get your IP temporarily blocked from many sites.

Sorry, wrote this before coffee. I was referring to H/2 eliminating head-of-line blocking. HTTP/2 gives you one TCP connection for multiple requests rather than the 7 connection limit browsers impose on HTTP 1.x

Re: CSS and JS code coverage in Chrome DevTools

#52
post #23

Earlier quoted context omitted.

HTTP/2 happened. HTTP/2 allows you to send HTTP requests over a single TCP connection per domain. Headers are compressed. The request overhead is minimal compared to HTTP/1.x. Caching one big file has the draw back of busting the cache each time the file is updated for any small change. Caching multiple small files allows you to have a finer grain cache. Only bust the things that updated. And, since it's all the same…

Can't you do that already by reusing the 1.1 connection? Or is the 2.0 change that requests are now parallel?

Yep, more wording was bad. In HTTP/2 it's all parallel.

Re: CSS and JS code coverage in Chrome DevTools

#54
"{ Version 57.0.2987.98 (64-bit)

   Updates are disabled by your administrator
"}

Guess I will only be able to comment on these when I get home. The full screen screenshot feature is going to be a welcomed addition. I will especially have to teach it to the BA's since they always want to take screenshots to show to business when design is finished but test is still acting up.

Re: CSS and JS code coverage in Chrome DevTools

#56
post #37
post #35

Earlier quoted context omitted.

There's a record button in the Coverage tab - the solid filled circle. Allows you to record over multiple pages (either a SPA or normal site).

It looks like it does that. But the results are only for the last page. I tried it by triggering function A on page 1 and function B on page 2. The report showed function A as not used.

I wonder if it is a bug perhaps?

Re: CSS and JS code coverage in Chrome DevTools

#57
post #16

Excellent timing, I had given up finding a good tool for coverage on JS and CSS and where right now using audits in Chrome trying to find unused CSS and searching through the code to find unused JS on our landing page. Even if it is hard for at tool to find everything that is unused on a page it will show what is used so we know what we don't have to check in the code

You should look at https://github.com/joelgriffith/navalia which can automate this

Re: CSS and JS code coverage in Chrome DevTools

#59
post #24

So I recorded my site for a while. Then sorted by unused bytes. What was on top? Google's own analytics.js

All 3rd party vendors have to include code for many features, websites, browsers and devices. They will always contain unused code. GA does a lot and it's doubtful you're using much of it.
Post reply on HN