0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00
astro/.changeset/forty-houses-taste.md
Matthew Phillips 84e94cc85c
Prevent rerunning scripts already ran in router (#12985)
* Prevent rerunning scripts already ran in router

In a long session you might navigate between several pages, some contain
the script and some not, but nevertheless the script should run a total
of 1 time.

This also helps with smaller bundled scripts in production, where some
are inlined.

* Add changeset

* better key

* more concise

* review changes

* move stuff around

* fix types

* take Martin's suggestion

* run detection when executing scripts

* adds an e2e test for data-astro-rerun

* fix support for data-astro-rerun

---------

Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
2025-03-03 09:35:14 -05:00

70 B

astro
patch

Prevent re-executing scripts in client router