Open LorisSigrist opened 6 months ago
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