When using data-turbo-preload the FetchRequest implementation is not used but a native fetch(). See
|
const response = await fetch(location.toString(), { headers: { "VND.PREFETCH": "true", Accept: "text/html" } }) |
So the preload function will not trigger any events and is therefore useless in some cases e.g. if fetchOptions are set in turbo:before-fetch-request
Expected behavior: Preload function should trigger fetch events like turbo:before-fetch-request
When using
data-turbo-preloadthe FetchRequest implementation is not used but a native fetch(). Seeturbo/src/core/drive/preloader.ts
Line 45 in c0b6bb6
So the preload function will not trigger any events and is therefore useless in some cases e.g. if fetchOptions are set in
turbo:before-fetch-requestExpected behavior: Preload function should trigger fetch events like
turbo:before-fetch-request