| 1 | /**
|
| 2 | * react-router v8.4.0
|
| 3 | *
|
| 4 | * Copyright (c) Remix Software Inc.
|
| 5 | *
|
| 6 | * This source code is licensed under the MIT license found in the
|
| 7 | * LICENSE.md file in the root directory of this source tree.
|
| 8 | *
|
| 9 | * @license MIT
|
| 10 | */
|
| 11 | import { RoutePatternDataRouteMatcher } from "./matcher-route-pattern.js";
|
| 12 | //#region lib/router/matcher-route-pattern.preload.ts
|
| 13 | let RoutePatternMatcher;
|
| 14 | function getRoutePatternMatcher() {
|
| 15 | return RoutePatternMatcher;
|
| 16 | }
|
| 17 | /**
|
| 18 | * Initialize the route-pattern matcher before creating a Data Router or static
|
| 19 | * handler with `future.unstable_routePatternMatching` enabled. Import from
|
| 20 | * `react-router/route-pattern` and call this once during application startup.
|
| 21 | * Server and browser applications must each preload their own matcher.
|
| 22 | *
|
| 23 | * The matcher is statically imported by this module. Tree-shaking bundlers can
|
| 24 | * remove it from applications that do not use this function. Initialization is
|
| 25 | * synchronous, and repeated calls are safe.
|
| 26 | *
|
| 27 | * @public
|
| 28 | * @category Data Routers
|
| 29 | * @mode data
|
| 30 | * @returns {void}
|
| 31 | */
|
| 32 | function unstable_preloadRoutePattern() {
|
| 33 | RoutePatternMatcher = RoutePatternDataRouteMatcher;
|
| 34 | }
|
| 35 | //#endregion
|
| 36 | export { getRoutePatternMatcher, unstable_preloadRoutePattern };
|