parseQuery as originalParseQuery,
stringifyQuery as originalStringifyQuery,
} from './query'
-import { ref, Ref, markRaw, nextTick, App, warn } from 'vue'
+import { shallowRef, Ref, nextTick, App, warn } from 'vue'
import { RouteRecord, RouteRecordNormalized } from './matcher/types'
import { parseURL, stringifyURL, isSameRouteLocation } from './location'
import { extractComponentsGuards, guardToPromiseFn } from './navigationGuards'
const beforeGuards = useCallbacks<NavigationGuardWithThis<undefined>>()
const beforeResolveGuards = useCallbacks<NavigationGuardWithThis<undefined>>()
const afterGuards = useCallbacks<PostNavigationGuard>()
- const currentRoute = ref<RouteLocationNormalizedLoaded>(
+ const currentRoute = shallowRef<RouteLocationNormalizedLoaded>(
START_LOCATION_NORMALIZED
)
let pendingLocation: RouteLocation = START_LOCATION_NORMALIZED
}
// accept current navigation
- currentRoute.value = markRaw(toLocation)
+ currentRoute.value = toLocation
// TODO: this doesn't work on first load. Moving it to RouterView could allow automatically handling transitions too maybe
// TODO: refactor with a state getter
if (isBrowser) {
import { LocationQuery, LocationQueryRaw } from '../query'
import { PathParserOptions } from '../matcher/pathParserRanker'
-import { markRaw, Ref, ComputedRef, ComponentOptions } from 'vue'
+import { Ref, ComputedRef, ComponentOptions } from 'vue'
import { RouteRecord, RouteRecordNormalized } from '../matcher/types'
import { HistoryState } from '../history/common'
| RouteRecordMultipleViews
| RouteRecordRedirectRaw
-export const START_LOCATION_NORMALIZED: RouteLocationNormalizedLoaded = markRaw(
- {
- path: '/',
- name: undefined,
- params: {},
- query: {},
- hash: '',
- fullPath: '/',
- matched: [],
- meta: {},
- redirectedFrom: undefined,
- }
-)
+export const START_LOCATION_NORMALIZED: RouteLocationNormalizedLoaded = {
+ path: '/',
+ name: undefined,
+ params: {},
+ query: {},
+ hash: '',
+ fullPath: '/',
+ matched: [],
+ meta: {},
+ redirectedFrom: undefined,
+}
// make matched non enumerable for easy printing
// NOTE: commented for tests at RouterView.spec