New Sep 5, 2024

Third Party Scripts

More Front-end Bloggers All from Frontend Masters Boost RSS Feed View Third Party Scripts on frontendmasters.com

Almost every site has at least one third-party script on it, and the average is 5. I’ve taken that from the blog post Introducing Nuxt Scripts from Harlan Wilton. While third-party scripts are a performance and security drain, they are, as Harlan puts it “fundamentally useful and aren’t going anywhere soon.”

Typically, you just chuck a third-party script in the HTML somewhere with a <script> tag that is high enough up that any usage of it comes after. But these days, with JavaScript frameworks abound, loading and using them is far more complicated. I applaud Nuxt for taking this head on and providing sensible helpers for them. Loading triggers and callbacks, types, bundling, etc.

Looks like it’s on the roadmap, but getting Partytown in there to gets the scripts off the main thread would be very good.

Scroll to top