Live data from Hacker News

CSS and JS code coverage in Chrome DevTools

developers.google.com

61–70 of 130 posts

Re: CSS and JS code coverage in Chrome DevTools

#61
post #60

If you're interested in staying up to date with Chrome DevTools, I run this project called Dev Tips: https://umaar.com/dev-tips/ It contains around 150 tips which I display as short, animated gifs, so you don't have to read much text to learn how a particular feature works.

Two thumbs up for @umaar work - absolutely love the bits of knowledge and the GIF format. Thank you for discovering & sharing actually useful tips.

Re: CSS and JS code coverage in Chrome DevTools

#63
post #61
post #60

If you're interested in staying up to date with Chrome DevTools, I run this project called Dev Tips: https://umaar.com/dev-tips/ It contains around 150 tips which I display as short, animated gifs, so you don't have to read much text to learn how a particular feature works.

Two thumbs up for @umaar work - absolutely love the bits of knowledge and the GIF format. Thank you for discovering & sharing actually useful tips.

Thank you, means a lot!

Re: CSS and JS code coverage in Chrome DevTools

#64
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.

They could at least gzip the damn thing or whatever their own pagespeed tool says is wrong with every asset loaded from Google

Re: CSS and JS code coverage in Chrome DevTools

#65
post #44

Earlier quoted context omitted.

Depending on what you are loading it may be more efficient to bundle everything in one file. If you are only loading a few kb per page, the overhead and extra time required for the network requests mean it's probably not worth splitting code.

Yep, I agree. Optimization is about tradeoffs :) At my day job we use app splitting rather than page splitting. Instead of breaking our codebase into individual pages and loading only those files, it's broken into apps. So you might load too much stuff for what you're currently doing, but you're never loading code that's completely unrelated. A downside to that is that if you hit all our apps in one browsing session,…

> you might download some vendor libraries like 10 times

That reminds me that I once found 3 versions of jquery (or perhaps jquery-ui, my memory fades) linked from the same page.

One was linked in the master (yes, this was webforms), one was being injected through a user control and the last was written into the page.

All three were all different versions so were all being downloaded. This came to light when a controls stopped working when one version was 'updated'.

Re: CSS and JS code coverage in Chrome DevTools

#66
post #9
post #3

Earlier quoted context omitted.

Not that I don't appreciate the efforts that they put in to helping developers--and I'm sure this is for the single-page PWA crowd--but CSS and JS is far more complicated than looking at a single page (especially for big organisations).

If it's not for this page, then why are you loading it? Load it when the user goes to that other page. That's the idea behind bundle splitting and whatnot. Don't send users code they don't need yet. Most of them are never going to get to the part of the page that does need that code.

Because now the entire thing is loaded into the browser cache and doesn't need loading at all across the entire site

Re: CSS and JS code coverage in Chrome DevTools

#68

"{ 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.

What good reason would a sysadmin have to disable web browser updates?

Re: CSS and JS code coverage in Chrome DevTools

#69
post #64

Earlier quoted context omitted.

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.

They could at least gzip the damn thing or whatever their own pagespeed tool says is wrong with every asset loaded from Google

It complains about the cache expiration time being too short. But there are good reasons they can't cache it longer. The short cache has no significant effect on page performance, as long as it is loaded async, but there is no way the performance tool can determine that unless it white listed it which would not be fair to someone else's tracking script.
Post reply on HN