LuanRoger / electron-shadcn

:electron: Electron Forge with shadcn-ui (Vite + Typescript)
MIT License
151 stars 25 forks source link

feat: Integrate TanStack Router with React and refactor routing structure #59

Closed MehekFatima closed 3 weeks ago

MehekFatima commented 1 month ago

Implement TanStack Router with Opinionated Structure

Summary

This PR integrates TanStack Router into the React application, refactoring the routing implementation for improved maintainability and clarity.

Changes

Details

Opinionated Structure

Steps to Add a New Route

  1. Create a new page component in ../pages/ (e.g., NewPage.tsx).
  2. Import the new component at the top of the router file.
  3. Define a new route with createRoute().
  4. Add the route to routeTree using RootRoute.addChildren([...]).
  5. Update RootRoute navigation if needed.
LuanRoger commented 1 month ago

Hello, it's a good implementation overall. I've separated the router and routes into separated files, but the implementation it's the same.

I found a problem with the generate executable, due to some routing problem, here's a screenshot:

image This made the tests field as well. Can you solve it?

MehekFatima commented 1 month ago

Hi, thanks for the feedback!

I’ll work on resolving the routing issue by adjusting the base path in TanStack Router for the packaged Electron app. This should prevent navigation issues and get the tests passing again.

LuanRoger commented 3 weeks ago

Hey @MehekFatima, I've solved the issue, thanks for yours contribution overall.