Skip to content

Releases: SilverAssist/next-script-loader

Release list

v0.1.1

Choose a tag to compare

@miguelcolmenares miguelcolmenares released this 31 Aug 17:19
4f0836a

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).