[Feature] <Script /> component with web-worker support for third-party scripts #5045
Replies: 4 comments 3 replies
-
I've never really looked deeply into these kinds of things but my intuition has always been that it has nothing to do with a framework like Remix, does it?
I'd like to hear why it can't just be a |
Beta Was this translation helpful? Give feedback.
-
Creating our own I read the article you linked to @benjaminsehl and I'm still not clear on what exactly they mean by "interactive" as in "beforeInteractive". Does it refer to the DOMContentLoaded event? Or does it refer to some time after they have finished loading all the data they need? Maybe for the case of specific tag managers we could have some higher-level thing, like a |
Beta Was this translation helpful? Give feedback.
-
Thanks for the consideration @mjackson & @ryanflorence — I totally understand your position, and assumed that would be the case. FWIW, I applaud the restraint! I'll have a go at some experimentation and see where I run into trouble before pushing this further. As I think about it, I'm really just going after an easier ergonomic for setting up Partytown — but there is probably a better way to approach that than to obfuscate setup through adding to Remix. First thoughts would include a default inclusion in our Demo Store, a CLI command with I'd advise against doing anything that's vendor specific — there is no more populated arena than adtech, and it's the ones are a little lower on the list (but hyper-common in ecommerce) who are the worst offenders. One specific one that may make sense, is this feature of Shopify, but that should be in Hydrogen-land I'd think. |
Beta Was this translation helpful? Give feedback.
-
Coming from the user land, it's far too easy to drop a One DX tool I noticed while working on my first Remix project was the helpful warnings and errors provided by Remix. Maybe a good DX here is a similar warning for all non-deferred third party scripts added to the page. Something like I think this is is a nice way to gently nudge towards a better outcome without being overly opinionated or prescriptive. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Third party scripts, like tracking pixels and widgets, can be a huge drain on performance (especially in ecommerce). Whether extending the
<Scripts />
API, or providing a new component like Next.js'<Script />
, it would be very helpful to be able to apply best practices to loading these scripts, and additionally leveraging something like Partytown to offload scripts from the main thread onto a web-worker.Has this been discussed or considered?
A great article on this topic: https://www.patterns.dev/posts/third-party/
Beta Was this translation helpful? Give feedback.
All reactions