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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixed
reload() had no re-entrancy protection: two calls for the same variant in quick succession (before the first's script finished loading) tore down and recreated the script twice, and since removing a <script> element doesn't reliably cancel its in-flight network request, both could execute and each apply their side effects. reload() now shares the in-flight promise for a same-variant call already in progress, the same way load() already did.
Added
getGeneration() and an optional unload(atGeneration?) parameter -- a monotonically increasing counter, bumped on every load()/reload() call, that a delayed unmount cleanup can capture and pass back to unload() to detect it's been superseded by a newer mount and skip itself entirely (including the reference-count decrement).