Closed hirasso closed 8 months ago
88 passed
4 skipped
92 tests across 8 suites
1 minute, 25 seconds
a0422a6
Nice! I'd tend to answer no to both questions – the FetchOptions interface is also part of the public API of navigate()
and I'd rather keep that clean. We might refactor the whole thing though because currently it's a bit messy 🤠
The problem
Currently, all preload requests after the first
page:view
are being exited early. The reason for this is thatswup.fetchPage
falls back to swup's internalvisit
object if we don't provide a custom visit to it. It then calls the hookfetch:request
that exits early if the visit is already done.The solution
Pass the temporary visit from
performPreload
along in theFetchOptions
forfetchPage
.Future
visit
a required FetchOption so that we don't run into this again?FetchOptions.visit
public?I'd like to merge this as soon as possible, we can discuss possible improvements later.
Checks
master
branchnpm run lint
)npm run test
)