oedotme / generouted

Generated file-based routes for Vite
https://stackblitz.com/github.com/oedotme/generouted/tree/main/explorer
MIT License
1.04k stars 49 forks source link

[Feature]Some expected features. #66

Closed binghuis closed 1 year ago

binghuis commented 1 year ago
  1. <Suspense fallback={null} children={<New />} /> Expecting the ability to customize settings for fallback,The use case is to set a loading component when switching between routes.
  2. Routes supports configuring the handle property. The use case is for customizing page authentication (auth) and breadcrumb (crumb).
  3. Exporting a more user-friendly configuration that supports dynamically generating route menus.
  4. Creating separate files for Link, Navigate, Path, Params, useNavigate, etc., in order to avoid circular dependency caused by their use in _app.

The above are some expected features for current use. Since routing is often used in conjunction with sidebar menus, page authentication, and breadcrumbs, it is expected to configure related properties for better compatibility with these scenarios.

If there are better ways to integrate with these scenarios, it would be great if the author could share and communicate them.

oedotme commented 1 year ago

Hey @binghuis, thanks for the suggestion.

I believe the first three points and more can be handled via having a custom integration based on the available ones. generouted core was exported for this purpose at some moment. Here's a related issue https://github.com/oedotme/generouted/issues/28#issuecomment-1344011149 with an example - but would make sense to use an up-to-date integration code.

For 4, the latest plugin release includes a change that would address the circular dependency. You can check v1.9.0 for more details. I believe also it the experience and HMR are improved after this release.

binghuis commented 1 year ago

I'm glad that I could be of help.