You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
loadScript: prefetch skipped on host-injected pages, and the 30s reused-tag timeout is not configurable #44
But the early return on line 40 bypasses it entirely:
if(window.ImageEditor){returnPromise.resolve();}
So on any page where the host injected embed.js itself — the exact scenario the tag-reuse logic on line 52 exists to support — the prefetch never happens and the first mount is a full round trip slower than it needs to be. Calling window.ImageEditor.load().catch(() => {}) before resolving would make both paths behave the same. (The embed loader caches its own promise, so an extra call is a no-op if the host already triggered it.)
REUSED_TAG_TIMEOUT_MS = 30_000 is a module constant. The reasoning behind having a bound is sound and well documented, but 30s is a long time to stare at a blank editor (see #37) and there's no way to shorten it — or to lengthen it on a slow network — without forking. Worth exposing through the component's props alongside scriptUrl, or at least exporting the constant.
Activity