perf(nuxt): remove vue-router dependency from minimal app (#8188)

This commit is contained in:
Daniel Roe 2022-10-14 09:36:03 +01:00 committed by GitHub
parent 9fa147dc22
commit 2083ed4a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
import { defineComponent, h, ref, resolveComponent, PropType, computed, DefineComponent, ComputedRef, onMounted, onBeforeUnmount } from 'vue' import { defineComponent, h, ref, resolveComponent, PropType, computed, DefineComponent, ComputedRef, onMounted, onBeforeUnmount } from 'vue'
import { RouteLocationRaw, Router } from 'vue-router' import type { RouteLocationRaw, Router } from 'vue-router'
import { hasProtocol } from 'ufo' import { hasProtocol } from 'ufo'
import { navigateTo, useRouter } from '../composables/router' import { navigateTo, useRouter } from '../composables/router'
import { useNuxtApp } from '../nuxt' import { useNuxtApp } from '../nuxt'
const firstNonUndefined = <T>(...args: (T | undefined)[]) => args.find(arg => arg !== undefined) const firstNonUndefined = <T> (...args: (T | undefined)[]) => args.find(arg => arg !== undefined)
const DEFAULT_EXTERNAL_REL_ATTRIBUTE = 'noopener noreferrer' const DEFAULT_EXTERNAL_REL_ATTRIBUTE = 'noopener noreferrer'

View File

@ -1,8 +1,8 @@
import { defineComponent, getCurrentInstance, reactive, toRefs } from 'vue' import { defineComponent, getCurrentInstance, reactive, toRefs } from 'vue'
import type { DefineComponent } from 'vue' import type { DefineComponent } from 'vue'
import { useRoute } from 'vue-router'
import { NuxtApp, useNuxtApp } from '../nuxt' import { NuxtApp, useNuxtApp } from '../nuxt'
import { useAsyncData } from './asyncData' import { useAsyncData } from './asyncData'
import { useRoute } from './router'
export const NuxtComponentIndicator = '__nuxt_component' export const NuxtComponentIndicator = '__nuxt_component'

View File

@ -1,7 +1,7 @@
import { computed, defineComponent, h, provide, reactive, onMounted, nextTick, Suspense, Transition, KeepAliveProps, TransitionProps } from 'vue' import { computed, defineComponent, h, provide, reactive, onMounted, nextTick, Suspense, Transition, KeepAliveProps, TransitionProps } from 'vue'
import type { DefineComponent, VNode } from 'vue' import type { DefineComponent, VNode } from 'vue'
import { RouteLocationNormalized, RouteLocationNormalizedLoaded, RouterView } from 'vue-router' import { RouterView } from 'vue-router'
import type { RouteLocation } from 'vue-router' import type { RouteLocationNormalized, RouteLocationNormalizedLoaded, RouteLocation } from 'vue-router'
import { generateRouteKey, RouterViewSlotProps, wrapInKeepAlive } from './utils' import { generateRouteKey, RouterViewSlotProps, wrapInKeepAlive } from './utils'
import { useNuxtApp } from '#app' import { useNuxtApp } from '#app'

View File

@ -1,5 +1,5 @@
import { KeepAlive, h } from 'vue' import { KeepAlive, h } from 'vue'
import { RouterView, RouteLocationMatched, RouteLocationNormalizedLoaded } from 'vue-router' import type { RouterView, RouteLocationMatched, RouteLocationNormalizedLoaded } from 'vue-router'
type InstanceOf<T> = T extends new (...args: any[]) => infer R ? R : never type InstanceOf<T> = T extends new (...args: any[]) => infer R ? R : never
export type RouterViewSlotProps = Parameters<InstanceOf<typeof RouterView>['$slots']['default']>[0] export type RouterViewSlotProps = Parameters<InstanceOf<typeof RouterView>['$slots']['default']>[0]