Compare commits

...

4 Commits

Author SHA1 Message Date
Shaunn Barron
fec51e1847
Merge b8e36828aa into f94d3f2bc6 2024-11-19 15:32:40 -05:00
renovate[bot]
f94d3f2bc6
chore(deps): update resolutions @types/node to v22.9.1 (main) (#29981)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-19 15:32:36 -05:00
renovate[bot]
9c8cd4b74b
chore(deps): update devdependency eslint-plugin-perfectionist to v4 (main) (#29982)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
2024-11-19 15:32:33 -05:00
pkgmain
b8e36828aa fix: useFetch with customized $fetch losing original event during ssr. 2024-06-28 10:00:07 -04:00
4 changed files with 185 additions and 259 deletions

View File

@ -189,7 +189,6 @@ export default createConfigForNuxt({
}, },
}, },
// Sort rule keys in eslint config // Sort rule keys in eslint config
// @ts-expect-error incorrect types 🤔
{ {
files: ['**/eslint.config.mjs'], files: ['**/eslint.config.mjs'],
name: 'local/sort-eslint-config', name: 'local/sort-eslint-config',

View File

@ -40,7 +40,7 @@
"@nuxt/ui-templates": "workspace:*", "@nuxt/ui-templates": "workspace:*",
"@nuxt/vite-builder": "workspace:*", "@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*", "@nuxt/webpack-builder": "workspace:*",
"@types/node": "22.9.0", "@types/node": "22.9.1",
"@unhead/dom": "1.11.11", "@unhead/dom": "1.11.11",
"@unhead/shared": "1.11.11", "@unhead/shared": "1.11.11",
"@unhead/vue": "1.11.11", "@unhead/vue": "1.11.11",
@ -75,7 +75,7 @@
"@nuxt/webpack-builder": "workspace:*", "@nuxt/webpack-builder": "workspace:*",
"@testing-library/vue": "8.1.0", "@testing-library/vue": "8.1.0",
"@types/eslint__js": "8.42.3", "@types/eslint__js": "8.42.3",
"@types/node": "22.9.0", "@types/node": "22.9.1",
"@types/semver": "7.5.8", "@types/semver": "7.5.8",
"@unhead/schema": "1.11.11", "@unhead/schema": "1.11.11",
"@unhead/vue": "1.11.11", "@unhead/vue": "1.11.11",
@ -91,7 +91,7 @@
"devalue": "5.1.1", "devalue": "5.1.1",
"eslint": "9.15.0", "eslint": "9.15.0",
"eslint-plugin-no-only-tests": "3.3.0", "eslint-plugin-no-only-tests": "3.3.0",
"eslint-plugin-perfectionist": "3.9.1", "eslint-plugin-perfectionist": "4.0.2",
"eslint-typegen": "0.3.2", "eslint-typegen": "0.3.2",
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e", "h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
"happy-dom": "15.11.6", "happy-dom": "15.11.6",

View File

@ -1,12 +1,12 @@
import type { FetchError, FetchOptions } from 'ofetch'
import type { NitroFetchRequest, TypedInternalResponse, AvailableRouterMethod as _AvailableRouterMethod } from 'nitro/types' import type { NitroFetchRequest, TypedInternalResponse, AvailableRouterMethod as _AvailableRouterMethod } from 'nitro/types'
import type { FetchError, FetchOptions } from 'ofetch'
import { hash } from 'ohash'
import type { MaybeRef, Ref } from 'vue' import type { MaybeRef, Ref } from 'vue'
import { computed, reactive, toValue } from 'vue' import { computed, reactive, toValue } from 'vue'
import { hash } from 'ohash'
import { useRequestFetch } from './ssr'
import type { AsyncData, AsyncDataOptions, KeysOf, MultiWatchSources, PickFrom } from './asyncData' import type { AsyncData, AsyncDataOptions, KeysOf, MultiWatchSources, PickFrom } from './asyncData'
import { useAsyncData } from './asyncData' import { useAsyncData } from './asyncData'
import { useRequestFetch } from './ssr'
// @ts-expect-error virtual file // @ts-expect-error virtual file
import { fetchDefaults } from '#build/nuxt.config.mjs' import { fetchDefaults } from '#build/nuxt.config.mjs'
@ -171,7 +171,7 @@ export function useFetch<
let _$fetch = opts.$fetch || globalThis.$fetch let _$fetch = opts.$fetch || globalThis.$fetch
// Use fetch with request context and headers for server direct API calls // Use fetch with request context and headers for server direct API calls
if (import.meta.server && !opts.$fetch) { if (import.meta.server) {
const isLocalFetch = typeof _request.value === 'string' && _request.value[0] === '/' && (!toValue(opts.baseURL) || toValue(opts.baseURL)![0] === '/') const isLocalFetch = typeof _request.value === 'string' && _request.value[0] === '/' && (!toValue(opts.baseURL) || toValue(opts.baseURL)![0] === '/')
if (isLocalFetch) { if (isLocalFetch) {
_$fetch = useRequestFetch() _$fetch = useRequestFetch()

File diff suppressed because it is too large Load Diff