-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent rerunning scripts already ran in router #12985
base: main
Are you sure you want to change the base?
Conversation
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.
🦋 Changeset detectedLatest commit: aa4f9b8 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #12985 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like what we discussed on discord ;-)
Left two comments.
With that change in place, we can also remove astro/packages/astro/src/transitions/swap-functions.ts Lines 9 to 30 in 0968069
and
|
@martrapp |
!preview router-noexec |
Snapshots have been released for the following packages:
Publish Log
Build Log
|
Ah, right. The job of |
@martrapp I created a preview release, can you let the people who encountered the bug to try it out? |
Yes will do! Thanks a lot! Btw: taking |
We got 1 confirmation that it fixes their issue. Enough to merge this? |
Hi @matthewp, |
Looks like that actually broke tests :( |
Yes, the code that checks for same src resp. same text re-establishes the previous semantics. &&
// Inline
((!s1.src && s1.textContent === s2.textContent) ||
// External
(s1.src && s1.type === s2.type && s1.src === s2.src)) and all should be fine. |
Changes
Testing
Docs
N/A, bug fix.