You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's currently not possible to access the param-matcher-functions that are available in an App from inside a library. They need to be passed into the library by reference, one-by-one.
I have a library that requires access to the matcher-functions as it operates on routeIDs.
Having to pass matchers to the library one-by-one is cumbersome and error-prone since you're likely to forget to add new matchers
vite-glob-imports don't work since they don't respect kit.files.params
A way to access the matcher-functions that are present in an app. For example an $app/matchers module where we can import the matcher functions from. Given that matchers are already shipped to the client this wouldn't make a meaningful bundle-size difference, it's just about exposing them.
Require library users to pass in matcher-functions one by one. This is awkward since they'er all exported as "match" and the matcher name is implicit from the filename.
You can use globs here, but not in your library. The lib user has to glob all matchers and pass them into your entry function. Thats what im doing in such cases.
Its not the optimal solution, but still better than manually having to add all matchers one by one.
Describe the problem
It's currently not possible to access the param-matcher-functions that are available in an App from inside a library. They need to be passed into the library by reference, one-by-one.
I have a library that requires access to the matcher-functions as it operates on routeIDs.
kit.files.params
As discussed in: https://discord.com/channels/457912077277855764/1226858732223205497/1226858732223205497
Describe the proposed solution
A way to access the matcher-functions that are present in an app. For example an
$app/matchers
module where we can import the matcher functions from. Given that matchers are already shipped to the client this wouldn't make a meaningful bundle-size difference, it's just about exposing them.Example:
Alternatives considered
Require library users to pass in matcher-functions one by one. This is awkward since they'er all exported as "match" and the matcher name is implicit from the filename.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: