Very true, pointed criticism, but i'm afraid part of the answer is avoiding npm altogether.
Very true, pointed criticism, but i'm afraid part of the answer is avoiding npm altogether.
A massive majority of that code you download is from 3rd parties.
Ads, tracking, analytics, Instagram & Facebook embeds, etc...
Now you can suggest that we should move to not having any of these but from a business perspective that’s... very hard.
Trimming is possible, of course, but the reality is that npm is not the problem- sites were bloated with JS before it came along.
The problem ends up being when you're embedding this stuff and the provider has their own dependencies they're loading. Hubspot's embedded web forms pulls in an entire React framework. Mess.
If you're serious about doing this stuff, you include the bare minimum JS possible (GA/GTM, usually), store GUIDs in your request logs and put that into your analytics data pipeline.
And keep telling the Google rep to take a hike when they put pressure on you to use AMP.
AMP may be bullshit but it means a 5-10x increase in traffic so... again, missing the business case.
It's a great way for google to build a captive market of content providers, but once everyone is serving AMP pages, the benefit to brands (SERP) is gone.
I hate AMP with a passion but your specific objection hasn’t been true for us.