From: Cédric Exbrayat Date: Sat, 9 May 2020 08:18:31 +0000 (+0200) Subject: feat: explicit injection symbols in dev mode (#228) X-Git-Tag: v4.0.0-alpha.11~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab88ee261c49b739545918deab583757aab561e;p=thirdparty%2Fvuejs%2Frouter.git feat: explicit injection symbols in dev mode (#228) --- diff --git a/src/injectionSymbols.ts b/src/injectionSymbols.ts index cac3b0f7..73ecdc97 100644 --- a/src/injectionSymbols.ts +++ b/src/injectionSymbols.ts @@ -8,18 +8,24 @@ export const hasSymbol = export const PolySymbol = (name: string) => // vr = vue router - hasSymbol ? Symbol(name) : `_vr_` + name + hasSymbol + ? Symbol(__DEV__ ? '[vue-router]: ' + name : name) + : (__DEV__ ? '[vue-router]: ' : '_vr_') + name // rvlm = Router View Location Matched -export const matchedRouteKey = PolySymbol('rvlm') as InjectionKey< - ComputedRef -> +export const matchedRouteKey = PolySymbol( + __DEV__ ? 'router view location matched' : 'rvlm' +) as InjectionKey> // rvd = Router View Depth -export const viewDepthKey = PolySymbol('rvd') as InjectionKey +export const viewDepthKey = PolySymbol( + __DEV__ ? 'router view depth' : 'rvd' +) as InjectionKey // r = router -export const routerKey = PolySymbol('r') as InjectionKey -// rt = route location -export const routeLocationKey = PolySymbol('rl') as InjectionKey< - RouteLocationNormalizedLoaded +export const routerKey = PolySymbol(__DEV__ ? 'router' : 'r') as InjectionKey< + Router > +// rt = route location +export const routeLocationKey = PolySymbol( + __DEV__ ? 'route location' : 'rl' +) as InjectionKey