feat(editor): Improve performance by importing routes dynamically and add route guards (no-changelog) (#7567)

**Before:**
<img width="657" alt="image"
src="https://github.com/n8n-io/n8n/assets/6179477/0bcced2b-9d3a-43b3-80d7-3c72619941fa">


**After:**
<img width="660" alt="image"
src="https://github.com/n8n-io/n8n/assets/6179477/e74e0bbf-bf33-49b4-ae11-65f640405ac8">
This commit is contained in:
Alex Grozav
2023-11-03 16:22:37 +02:00
committed by GitHub
parent c92402a3ca
commit 24dfc95974
21 changed files with 387 additions and 294 deletions

View File

@@ -20,9 +20,7 @@ import { GlobalComponentsPlugin } from './plugins/components';
import { GlobalDirectivesPlugin } from './plugins/directives';
import { FontAwesomePlugin } from './plugins/icons';
import { runExternalHook } from '@/utils';
import { createPinia, PiniaVuePlugin } from 'pinia';
import { useWebhooksStore } from '@/stores';
import { JsPlumbPlugin } from '@/plugins/jsplumb';
const pinia = createPinia();
@@ -42,10 +40,6 @@ app.use(i18nInstance);
app.mount('#app');
router.afterEach((to, from) => {
void runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
});
if (!import.meta.env.PROD) {
// Make sure that we get all error messages properly displayed
// as long as we are not in production mode