yari
yari copied to clipboard
fix(live-sample): fix live samples for safari
Summary
Lazy loading is tricky. Let's be more defensive.
This hopefully resolves #10764
Problem
It looked like we were hitting a weird race condition in Safari.
Checking for the source and removing the eventListener should only improve things. This also sets the initialized flag in the runner earlier to avoid races.
How did you test this change?
Locally but it's hard to reproduce. Setting:
BUILD_LIVE_SAMPLES_BASE_URL=https://live.mdnyalp.dev
and disabling caching helps.
Converted to draft, as it doesn't resolve the issue (verified by deploying to stage).
This pull request has merge conflicts that must be resolved before it can be merged.