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
IMHO, a thing that gets difficult as the Remix project grows is working with relative/absolute routes. When we modify a route, gets very difficult to know if we broke any redirect.
One option to avoid all the issues would be working only with absolute routes and having a way to pick the route to redirect. Some old frameworks have their own ways.
Of course, maintaining the object requires an effort and it can get unsync. Since the tree is based on the folder structure, I wonder if there could be a way to get that tree automatically from the Remix router.
Another option could be some magic importing the route file:
import { path } from '/app/routes/admin/section1';
const redirectTo = path
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
IMHO, a thing that gets difficult as the Remix project grows is working with relative/absolute routes. When we modify a route, gets very difficult to know if we broke any redirect.
One option to avoid all the issues would be working only with absolute routes and having a way to pick the route to redirect. Some old frameworks have their own ways.
A handmade option is maintaining and object:
Of course, maintaining the object requires an effort and it can get unsync. Since the tree is based on the folder structure, I wonder if there could be a way to get that tree automatically from the Remix router.
Another option could be some magic importing the route file:
Beta Was this translation helpful? Give feedback.
All reactions