@vaadin/hilla-file-router 24.9.0-alpha4 → 24.9.0-alpha5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/hilla-file-router",
3
- "version": "24.9.0-alpha4",
3
+ "version": "24.9.0-alpha5",
4
4
  "description": "Hilla file-based router",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -62,9 +62,9 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "@ungap/with-resolvers": "0.1.0",
65
- "@vaadin/hilla-generator-utils": "24.9.0-alpha4",
66
- "@vaadin/hilla-react-auth": "24.9.0-alpha4",
67
- "@vaadin/hilla-react-signals": "24.9.0-alpha4",
65
+ "@vaadin/hilla-generator-utils": "24.9.0-alpha5",
66
+ "@vaadin/hilla-react-auth": "24.9.0-alpha5",
67
+ "@vaadin/hilla-react-signals": "24.9.0-alpha5",
68
68
  "tsc-template": "0.2.3",
69
69
  "typescript": "5.8.3"
70
70
  }
@@ -67,7 +67,7 @@ function isWildcardRoute(route) {
67
67
  */
68
68
  export default function createFallbackTransformer([notFoundFallback, indexFallback]) {
69
69
  return ({ original, override, children, dupe }) => {
70
- if (original && !original.index && !getHandleFlag(original, RouteHandleFlag.IGNORE_FALLBACK) && !dupe) {
70
+ if (original && !getHandleFlag(original, RouteHandleFlag.IGNORE_FALLBACK) && !dupe) {
71
71
  if (!children) {
72
72
  return original;
73
73
  }
@@ -1 +1 @@
1
- {"mappings":"AAAA,SAA6B,4BAA6B;AAG1D,SAAS,eAAe,mCAA2D;;;;;;;;;AAmBnF,OAAO,SAAS,qBAAqBA,WAA0BC,QAAqC;AAClG,QAAO,CACL;EAAE,MAAM;EAAK,SAAS,cAAc,UAAU;EAAE,QAAQ;CAAQ,GAChE;EAAE,OAAO;EAAM,SAAS,cAAc,UAAU;EAAE,QAAQ;CAAQ,CACnE;AACF;;;;;;AAOD,SAAS,aAAaC,OAA6B;AACjD,UAAS,MAAM;AAChB;;;;;;AAOD,SAAS,gBAAgBA,OAA6B;AACpD,UAAS,MAAM,MAAM,SAAS,IAAI;AACnC;;;;;;AAOD,SAAS,gBAAgBA,OAA6B;AACpD,QAAO,MAAM,SAAS;AACvB;;;;;;;;;;;;;;;;;;;;;;;AAwBD,eAAe,SAAS,0BAA0B,CAAC,kBAAkB,cAA8B,EAAoB;AACrH,QAAO,CAAC,EAAE,UAAU,UAAU,UAAU,MAAM,KAAK;AACjD,MAAI,aAAa,SAAS,UAAU,cAAc,UAAU,gBAAgB,gBAAgB,KAAK,MAAM;AACrG,QAAK,UAAU;AACb,WAAO;GACR;GAED,IAAIC;AAEJ,OAAI,SAAS,KAAK,CAAC,UAAU,gBAAgB,MAAM,CAAC,EAAE;AACpD,eAAW,CAAC,aAAc;GAC3B,WAAU,SAAS,KAAK,CAAC,UAAU,aAAa,MAAM,IAAI,gBAAgB,MAAM,CAAC,EAAE;AAClF,eAAW,CAAC,gBAAiB;GAC9B,OAAM;AACL,eAAW,CAAC,kBAAkB,aAAc;GAC7C;AAED,UAAO;IACL,GAAG;IACH,UAAU,CAAC,GAAG,UAAU,GAAG,QAAS;GACrC;EACF;AAED,SAAO;CACR;AACF","names":["component: ComponentType","config?: ViewConfig","route: RouteObject","fallback: RouteObject[]"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/file-router/src/runtime/configuration-builder/createFallbackTransformer.ts"],"sourcesContent":["import { type ComponentType, createElement } from 'react';\nimport type { RouteObject, NonIndexRouteObject } from 'react-router';\nimport type { ViewConfig } from '../../types.js';\nimport { getHandleFlag, RouteHandleFlag, type RouteTransformer } from './utils.js';\n\n/**\n * A tuple of fallback routes:\n * - A wildcard route (`path: '*'`) that renders the component for any unmatched\n * path.\n * - An index route (`index: true`) that renders the component for the empty\n * path.\n */\nexport type FallbackRoutes = readonly [notFoundFallback: RouteObject, indexFallback: RouteObject];\n\n/**\n * Creates fallback routes for handling unmatched paths and index routes.\n *\n * @param component - The React component to render for the fallback routes\n * @param config - Optional view configuration to attach to the route handles\n *\n * @returns A tuple of fallback routes.\n */\nexport function createFallbackRoutes(component: ComponentType, config?: ViewConfig): FallbackRoutes {\n return [\n { path: '*', element: createElement(component), handle: config },\n { index: true, element: createElement(component), handle: config },\n ];\n}\n\n/**\n * Determines whether the given route object represents an index route.\n *\n * @param route - The route object to check.\n */\nfunction isIndexRoute(route: RouteObject): boolean {\n return !!route.index;\n}\n\n/**\n * Determines whether the given route is optional based on its path.\n *\n * @param route - The route object to check.\n */\nfunction isOptionalRoute(route: RouteObject): boolean {\n return !!route.path?.includes('?');\n}\n\n/**\n * Determines whether the given route is a wildcard route.\n *\n * @param route - The route object to check.\n */\nfunction isWildcardRoute(route: RouteObject): boolean {\n return route.path === '*';\n}\n\n/**\n * Creates a route transformer that adds fallback routes to handle unmatched\n * paths.\n *\n * This transformer adds two types of fallback routes:\n * - A wildcard route (`path: '*'`) that renders the specified fallback\n * component for any unmatched path.\n * - An index fallback route (`index: true`) that renders the fallback component\n * for the empty path.\n *\n * The transformer logic determines which fallback to add based on the existing\n * child routes:\n * - If a wildcard child route already defined, only the index fallback is\n * added.\n * - If an index or optional child route exists, only the wildcard fallback is\n * added.\n * - Otherwise, both fallback routes are added.\n *\n * @param component - The React component to render as the fallback.\n * @param config - A view configuration of the fallback route if any.\n * @returns A route transformer function.\n */\nexport default function createFallbackTransformer([notFoundFallback, indexFallback]: FallbackRoutes): RouteTransformer {\n return ({ original, override, children, dupe }) => {\n if (original && !original.index && !getHandleFlag(original, RouteHandleFlag.IGNORE_FALLBACK) && !dupe) {\n if (!children) {\n return original;\n }\n\n let fallback: RouteObject[];\n\n if (children.some((route) => isWildcardRoute(route))) {\n fallback = [indexFallback];\n } else if (children.some((route) => isIndexRoute(route) || isOptionalRoute(route))) {\n fallback = [notFoundFallback];\n } else {\n fallback = [notFoundFallback, indexFallback];\n }\n\n return {\n ...original,\n children: [...children, ...fallback],\n } satisfies NonIndexRouteObject;\n }\n\n return override as RouteObject | undefined;\n };\n}\n"],"version":3}
1
+ {"mappings":"AAAA,SAA6B,4BAA6B;AAG1D,SAAS,eAAe,mCAA2D;;;;;;;;;AAmBnF,OAAO,SAAS,qBAAqBA,WAA0BC,QAAqC;AAClG,QAAO,CACL;EAAE,MAAM;EAAK,SAAS,cAAc,UAAU;EAAE,QAAQ;CAAQ,GAChE;EAAE,OAAO;EAAM,SAAS,cAAc,UAAU;EAAE,QAAQ;CAAQ,CACnE;AACF;;;;;;AAOD,SAAS,aAAaC,OAA6B;AACjD,UAAS,MAAM;AAChB;;;;;;AAOD,SAAS,gBAAgBA,OAA6B;AACpD,UAAS,MAAM,MAAM,SAAS,IAAI;AACnC;;;;;;AAOD,SAAS,gBAAgBA,OAA6B;AACpD,QAAO,MAAM,SAAS;AACvB;;;;;;;;;;;;;;;;;;;;;;;AAwBD,eAAe,SAAS,0BAA0B,CAAC,kBAAkB,cAA8B,EAAoB;AACrH,QAAO,CAAC,EAAE,UAAU,UAAU,UAAU,MAAM,KAAK;AACjD,MAAI,aAAa,cAAc,UAAU,gBAAgB,gBAAgB,KAAK,MAAM;AAClF,QAAK,UAAU;AACb,WAAO;GACR;GAED,IAAIC;AAEJ,OAAI,SAAS,KAAK,CAAC,UAAU,gBAAgB,MAAM,CAAC,EAAE;AACpD,eAAW,CAAC,aAAc;GAC3B,WAAU,SAAS,KAAK,CAAC,UAAU,aAAa,MAAM,IAAI,gBAAgB,MAAM,CAAC,EAAE;AAClF,eAAW,CAAC,gBAAiB;GAC9B,OAAM;AACL,eAAW,CAAC,kBAAkB,aAAc;GAC7C;AAGD,UAAO;IACL,GAAG;IACH,UAAU,CAAC,GAAG,UAAU,GAAG,QAAS;GACrC;EACF;AAED,SAAO;CACR;AACF","names":["component: ComponentType","config?: ViewConfig","route: RouteObject","fallback: RouteObject[]"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/file-router/src/runtime/configuration-builder/createFallbackTransformer.ts"],"sourcesContent":["import { type ComponentType, createElement } from 'react';\nimport type { RouteObject, NonIndexRouteObject } from 'react-router';\nimport type { ViewConfig } from '../../types.js';\nimport { getHandleFlag, RouteHandleFlag, type RouteTransformer } from './utils.js';\n\n/**\n * A tuple of fallback routes:\n * - A wildcard route (`path: '*'`) that renders the component for any unmatched\n * path.\n * - An index route (`index: true`) that renders the component for the empty\n * path.\n */\nexport type FallbackRoutes = readonly [notFoundFallback: RouteObject, indexFallback: RouteObject];\n\n/**\n * Creates fallback routes for handling unmatched paths and index routes.\n *\n * @param component - The React component to render for the fallback routes\n * @param config - Optional view configuration to attach to the route handles\n *\n * @returns A tuple of fallback routes.\n */\nexport function createFallbackRoutes(component: ComponentType, config?: ViewConfig): FallbackRoutes {\n return [\n { path: '*', element: createElement(component), handle: config },\n { index: true, element: createElement(component), handle: config },\n ];\n}\n\n/**\n * Determines whether the given route object represents an index route.\n *\n * @param route - The route object to check.\n */\nfunction isIndexRoute(route: RouteObject): boolean {\n return !!route.index;\n}\n\n/**\n * Determines whether the given route is optional based on its path.\n *\n * @param route - The route object to check.\n */\nfunction isOptionalRoute(route: RouteObject): boolean {\n return !!route.path?.includes('?');\n}\n\n/**\n * Determines whether the given route is a wildcard route.\n *\n * @param route - The route object to check.\n */\nfunction isWildcardRoute(route: RouteObject): boolean {\n return route.path === '*';\n}\n\n/**\n * Creates a route transformer that adds fallback routes to handle unmatched\n * paths.\n *\n * This transformer adds two types of fallback routes:\n * - A wildcard route (`path: '*'`) that renders the specified fallback\n * component for any unmatched path.\n * - An index fallback route (`index: true`) that renders the fallback component\n * for the empty path.\n *\n * The transformer logic determines which fallback to add based on the existing\n * child routes:\n * - If a wildcard child route already defined, only the index fallback is\n * added.\n * - If an index or optional child route exists, only the wildcard fallback is\n * added.\n * - Otherwise, both fallback routes are added.\n *\n * @param component - The React component to render as the fallback.\n * @param config - A view configuration of the fallback route if any.\n * @returns A route transformer function.\n */\nexport default function createFallbackTransformer([notFoundFallback, indexFallback]: FallbackRoutes): RouteTransformer {\n return ({ original, override, children, dupe }) => {\n if (original && !getHandleFlag(original, RouteHandleFlag.IGNORE_FALLBACK) && !dupe) {\n if (!children) {\n return original; //: IndexRouteObject;\n }\n\n let fallback: RouteObject[];\n\n if (children.some((route) => isWildcardRoute(route))) {\n fallback = [indexFallback];\n } else if (children.some((route) => isIndexRoute(route) || isOptionalRoute(route))) {\n fallback = [notFoundFallback];\n } else {\n fallback = [notFoundFallback, indexFallback];\n }\n\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return {\n ...original,\n children: [...children, ...fallback],\n } as NonIndexRouteObject;\n }\n\n return override as RouteObject | undefined;\n };\n}\n"],"version":3}
@@ -19,7 +19,7 @@ export function createMenuItems() {
19
19
  vaadinObj.registrations ??= [];
20
20
  vaadinObj.registrations.push({
21
21
  is: feature ? `@vaadin/hilla-file-router/${feature}` : "@vaadin/hilla-file-router",
22
- version: "24.9.0-alpha4"
22
+ version: "24.9.0-alpha5"
23
23
  });
24
24
  })("createMenuItems", window.Vaadin);
25
25
  const collator = new Intl.Collator("en-US");
@@ -1 +1 @@
1
- {"mappings":"AACA,SAAsB,2CAA4C;AAIlE,OAAO,MAAMA,cAAkF,OAC5F,OAAwB,QAAQ,MAClC;AAED,SAAS,WAAWC,OAA4B;AAC9C,UAAS,MAAM,MAAM;AACtB;AAED,SAAS,uBAAuBC,MAAuB;AACrD,QAAO,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,QAAQ,WAAW,IAAI,CAAC;AAClE;;;;;;;;;AAUD,OAAO,SAAS,kBAA2D;AAGzE,EAAC,CAAC,SAAS,YAAa,WAAW,WAAW,CAAE,MAAM;AACtD,YAAU,kBAAkB,CAAE;AAC9B,YAAU,cAAc,KAAK;GAC3B,IAAI,WAAW,4BAA4B,QAAQ,IAAI;GACvD,SAAS;EACV,EAAC;CACH,GAAE,mBAAoB,OAAwB,OAAO;CACpD,MAAM,WAAW,IAAI,KAAK,SAAS;AACnC,MAAK,YAAY,OAAO;AACtB,SAAO,CAAE;CACV;CAED,MAAM,QAAQ,OAAO,QAAQ,YAAY,MAAM;AAE/C,QACE,MAEG,OAAO,CAAC,CAAC,MAAM,MAAM,MAAM,WAAW,MAAM,KAAK,uBAAuB,KAAK,CAAC,CAE9E,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM;EACxB,IAAI;EACJ,MAAM,OAAO,MAAM;EACnB,OAAO,OAAO,MAAM,SAAS,OAAO;EACpC,OAAO,OAAO,MAAM;EACpB,QAAQ,OAAO;CAChB,GAAE,CAEF,KAAK,CAAC,OAAO,UAAU;EACtB,MAAM,cAAc,MAAM,SAAS,OAAO,cAAc,MAAM,SAAS,OAAO;AAC9E,SAAO,eAAe,IAAI,aAAa,SAAS,QAAQ,MAAM,IAAI,MAAM,GAAG;CAC5E,EAAC;AAEP;AAED,IAAI,OAAO,KAAK,KAAK;AACnB,QAAO,KAAK,IAAI,GAAG,mBAAmB,MAAM;AAC1C,QAAM,iBAAiB,CACpB,KAAK,OAAO,SAAS,KAAK,MAAM,CAAC,CACjC,KAAK,CAAC,SAAS;AACd,eAAY,QAAQ;EACrB,EAAC,CACD,MAAM,CAACC,MAAe;AACrB,WAAQ,MAAM,8BAA8B,EAAE;EAC/C,EAAC;CACL,EAAC;AACH","names":["viewsSignal: Signal<Readonly<Record<string, Readonly<ViewConfig>>> | undefined>","value: ViewConfig","path: string","e: unknown"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/file-router/src/runtime/createMenuItems.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\nimport { type Signal, signal } from '@vaadin/hilla-react-signals';\nimport type { VaadinWindow } from '../shared/internal.js';\nimport type { MenuItem, ViewConfig } from '../types.js';\n\nexport const viewsSignal: Signal<Readonly<Record<string, Readonly<ViewConfig>>> | undefined> = signal(\n (window as VaadinWindow).Vaadin?.views,\n);\n\nfunction isExcluded(value: ViewConfig): boolean {\n return !!value.menu?.exclude;\n}\n\nfunction hasVariablePathSegment(path: string): boolean {\n return path.split('/').some((segment) => segment.startsWith(':'));\n}\n\n/**\n * Creates menu items from the views provided by the server. The views are sorted according to the\n * {@link ViewConfig.menu.order}, filtered out if they are explicitly excluded via {@link ViewConfig.menu.exclude}.\n * Note that views with no order are put below views with an order. Ties are resolved based on the path string\n * comparison.\n *\n * @returns A list of menu items.\n */\nexport function createMenuItems<T = unknown>(): ReadonlyArray<MenuItem<T>> {\n // @ts-expect-error: esbuild injection\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n ((feature, vaadinObj = (globalThis.Vaadin ??= {})) => {\n vaadinObj.registrations ??= [];\n vaadinObj.registrations.push({\n is: feature ? `@vaadin/hilla-file-router/${feature}` : '@vaadin/hilla-file-router',\n version: '24.9.0-alpha4',\n });\n})('createMenuItems', (window as VaadinWindow).Vaadin);\n const collator = new Intl.Collator('en-US');\n if (!viewsSignal.value) {\n return [];\n }\n\n const views = Object.entries(viewsSignal.value);\n\n return (\n views\n // Filter out the views that are explicitly excluded from the menu.\n .filter(([path, value]) => !isExcluded(value) && !hasVariablePathSegment(path))\n // Map the views to menu items.\n .map(([path, config]) => ({\n to: path,\n icon: config.menu?.icon,\n title: config.menu?.title ?? config.title,\n order: config.menu?.order,\n detail: config.detail as T | undefined,\n }))\n // Sort views according to the order specified in the view configuration.\n .sort((menuA, menuB) => {\n const ordersDiff = (menuA.order ?? Number.MAX_VALUE) - (menuB.order ?? Number.MAX_VALUE);\n return ordersDiff !== 0 ? ordersDiff : collator.compare(menuA.to, menuB.to);\n })\n );\n}\n\nif (import.meta.hot) {\n import.meta.hot.on('fs-route-update', () => {\n fetch('?v-r=routeinfo')\n .then(async (resp) => resp.json())\n .then((json) => {\n viewsSignal.value = json;\n })\n .catch((e: unknown) => {\n console.error('Failed to fetch route info', e);\n });\n });\n}\n"],"version":3}
1
+ {"mappings":"AACA,SAAsB,2CAA4C;AAIlE,OAAO,MAAMA,cAAkF,OAC5F,OAAwB,QAAQ,MAClC;AAED,SAAS,WAAWC,OAA4B;AAC9C,UAAS,MAAM,MAAM;AACtB;AAED,SAAS,uBAAuBC,MAAuB;AACrD,QAAO,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,QAAQ,WAAW,IAAI,CAAC;AAClE;;;;;;;;;AAUD,OAAO,SAAS,kBAA2D;AAGzE,EAAC,CAAC,SAAS,YAAa,WAAW,WAAW,CAAE,MAAM;AACtD,YAAU,kBAAkB,CAAE;AAC9B,YAAU,cAAc,KAAK;GAC3B,IAAI,WAAW,4BAA4B,QAAQ,IAAI;GACvD,SAAS;EACV,EAAC;CACH,GAAE,mBAAoB,OAAwB,OAAO;CACpD,MAAM,WAAW,IAAI,KAAK,SAAS;AACnC,MAAK,YAAY,OAAO;AACtB,SAAO,CAAE;CACV;CAED,MAAM,QAAQ,OAAO,QAAQ,YAAY,MAAM;AAE/C,QACE,MAEG,OAAO,CAAC,CAAC,MAAM,MAAM,MAAM,WAAW,MAAM,KAAK,uBAAuB,KAAK,CAAC,CAE9E,IAAI,CAAC,CAAC,MAAM,OAAO,MAAM;EACxB,IAAI;EACJ,MAAM,OAAO,MAAM;EACnB,OAAO,OAAO,MAAM,SAAS,OAAO;EACpC,OAAO,OAAO,MAAM;EACpB,QAAQ,OAAO;CAChB,GAAE,CAEF,KAAK,CAAC,OAAO,UAAU;EACtB,MAAM,cAAc,MAAM,SAAS,OAAO,cAAc,MAAM,SAAS,OAAO;AAC9E,SAAO,eAAe,IAAI,aAAa,SAAS,QAAQ,MAAM,IAAI,MAAM,GAAG;CAC5E,EAAC;AAEP;AAED,IAAI,OAAO,KAAK,KAAK;AACnB,QAAO,KAAK,IAAI,GAAG,mBAAmB,MAAM;AAC1C,QAAM,iBAAiB,CACpB,KAAK,OAAO,SAAS,KAAK,MAAM,CAAC,CACjC,KAAK,CAAC,SAAS;AACd,eAAY,QAAQ;EACrB,EAAC,CACD,MAAM,CAACC,MAAe;AACrB,WAAQ,MAAM,8BAA8B,EAAE;EAC/C,EAAC;CACL,EAAC;AACH","names":["viewsSignal: Signal<Readonly<Record<string, Readonly<ViewConfig>>> | undefined>","value: ViewConfig","path: string","e: unknown"],"sources":["/opt/agent/work/1af72d8adc613024/hilla/packages/ts/file-router/src/runtime/createMenuItems.ts"],"sourcesContent":["/// <reference types=\"vite/client\" />\nimport { type Signal, signal } from '@vaadin/hilla-react-signals';\nimport type { VaadinWindow } from '../shared/internal.js';\nimport type { MenuItem, ViewConfig } from '../types.js';\n\nexport const viewsSignal: Signal<Readonly<Record<string, Readonly<ViewConfig>>> | undefined> = signal(\n (window as VaadinWindow).Vaadin?.views,\n);\n\nfunction isExcluded(value: ViewConfig): boolean {\n return !!value.menu?.exclude;\n}\n\nfunction hasVariablePathSegment(path: string): boolean {\n return path.split('/').some((segment) => segment.startsWith(':'));\n}\n\n/**\n * Creates menu items from the views provided by the server. The views are sorted according to the\n * {@link ViewConfig.menu.order}, filtered out if they are explicitly excluded via {@link ViewConfig.menu.exclude}.\n * Note that views with no order are put below views with an order. Ties are resolved based on the path string\n * comparison.\n *\n * @returns A list of menu items.\n */\nexport function createMenuItems<T = unknown>(): ReadonlyArray<MenuItem<T>> {\n // @ts-expect-error: esbuild injection\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n ((feature, vaadinObj = (globalThis.Vaadin ??= {})) => {\n vaadinObj.registrations ??= [];\n vaadinObj.registrations.push({\n is: feature ? `@vaadin/hilla-file-router/${feature}` : '@vaadin/hilla-file-router',\n version: '24.9.0-alpha5',\n });\n})('createMenuItems', (window as VaadinWindow).Vaadin);\n const collator = new Intl.Collator('en-US');\n if (!viewsSignal.value) {\n return [];\n }\n\n const views = Object.entries(viewsSignal.value);\n\n return (\n views\n // Filter out the views that are explicitly excluded from the menu.\n .filter(([path, value]) => !isExcluded(value) && !hasVariablePathSegment(path))\n // Map the views to menu items.\n .map(([path, config]) => ({\n to: path,\n icon: config.menu?.icon,\n title: config.menu?.title ?? config.title,\n order: config.menu?.order,\n detail: config.detail as T | undefined,\n }))\n // Sort views according to the order specified in the view configuration.\n .sort((menuA, menuB) => {\n const ordersDiff = (menuA.order ?? Number.MAX_VALUE) - (menuB.order ?? Number.MAX_VALUE);\n return ordersDiff !== 0 ? ordersDiff : collator.compare(menuA.to, menuB.to);\n })\n );\n}\n\nif (import.meta.hot) {\n import.meta.hot.on('fs-route-update', () => {\n fetch('?v-r=routeinfo')\n .then(async (resp) => resp.json())\n .then((json) => {\n viewsSignal.value = json;\n })\n .catch((e: unknown) => {\n console.error('Failed to fetch route info', e);\n });\n });\n}\n"],"version":3}