@factor/app
Advanced tools
Comparing version 1.1.29 to 1.1.30
import Vue from "vue" | ||
import { createApp } from "./app" | ||
const hmr = module?.hot || false | ||
const startClient = async (): Promise<void> => { | ||
@@ -23,2 +25,4 @@ const { vm, router, store } = await createApp() | ||
/* istanbul ignore next */ | ||
if (module && module.hot) module.hot.accept() | ||
if (hmr) { | ||
hmr.accept() | ||
} |
{ | ||
"name": "@factor/app", | ||
"version": "1.1.29", | ||
"version": "1.1.30", | ||
"license": "GPL-2.0", | ||
@@ -17,3 +17,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "65595d2dddb64a0f9fd070ad6b8d137ce989c962" | ||
"gitHead": "69150d5bf933403f1c05e3bf16e1af69e5409531" | ||
} |
@@ -11,3 +11,8 @@ import { applyFilters, runCallbacks, pushToFilter, addFilter } from "@factor/api/hooks" | ||
// Only run this before navigation on the client, it should NOT run on initial page load | ||
/** | ||
* In client, when we change routes, we should run checks for auth, preloaders, etc. | ||
* @param to - next route | ||
* @param from - current route | ||
* @param next - next function, call with false to prevent nav, must call! | ||
*/ | ||
const hookClientRouterBefore = async ( | ||
@@ -18,6 +23,7 @@ to: Route, | ||
): Promise<void> => { | ||
if (__initialPageLoad) next() | ||
else { | ||
if (__initialPageLoad || to.path == from.path) { | ||
next() | ||
} else { | ||
const doBefore = runCallbacks("client-route-before", { to, from, next }) | ||
emitEvent("ssr-progress", "start") | ||
const results = await doBefore | ||
@@ -46,2 +52,6 @@ | ||
/** | ||
* Creates the Vue Router instance | ||
* @library vue-router | ||
*/ | ||
export const createRouter = (): VueRouter => { | ||
@@ -48,0 +58,0 @@ const routes: RouteConfig[] = applyFilters("routes", []).filter((_: RouteConfig) => _) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45308
627