fix: break import cycles
import/no-cycle (now active) flagged 17 cycles across 12 files: - shared/ui self-barrel cycles (Logo/Stat/StatGroup/ComboControl/ FilterGroup/SectionHeader): import siblings relatively instead of through the $shared/ui barrel that re-exports them - shared/lib/utils: roundToStepPrecision imports getDecimalPlaces relatively instead of via the utils barrel - routes: lazy-load Redirect in the router so it no longer statically imports a component that imports navigate back from it
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { createRouter } from 'sv-router';
|
||||
import Home from './Home.svelte';
|
||||
import Redirect from './Redirect.svelte';
|
||||
|
||||
/**
|
||||
* Single-page router for glyphdiff.
|
||||
@@ -18,6 +17,8 @@ export const {
|
||||
'/': Home,
|
||||
/**
|
||||
* Any unmatched path redirects to home until additional routes exist.
|
||||
* Lazy-loaded so `router` doesn't statically import `Redirect`, which
|
||||
* imports `navigate` from here — breaks the import cycle.
|
||||
*/
|
||||
'*notfound': Redirect,
|
||||
'*notfound': () => import('./Redirect.svelte'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user