#Migrating my routes to the current convention

1 messages · Page 1 of 1 (latest)

sacred marten
#

Hi there I started a project recently based on this:
https://github.com/vendure-ecommerce/storefront-remix-starter

I already migrated to use vite. My problem now is that it seems that the current folder structure for the routes does not work with the current remix version anymore.

Can someone tell me how I would need to rename/move the files to adhere to the current standard?

Let's take this example:

/app/routes/account/adresses.tsx
/app/routes/account/history.tsx
/app/routes/account/addresses/$adressId.tsx

Should it be like this?

/app/routes/account.adresses/route.tsx
/app/routes/account.history/route.tsx
/app/routes/account.adresses.$adressId/route.tsx

I appreciate your help

bitter meadow
#

but yes, your example is one of the two ways you can do it. Those folders could also be files if you don't have anything else to put in them

/app/routes/account.addresses.tsx

sacred marten
#

Ah perfect! Thank you very much for your response.
This helps me going into the right direction.

#

Ah one more question:
What do i do with index.tsx files in those route folders?

#

Nevermind i switched to the flat wile approach as this is fine for me in this project

bitter meadow
#

one thing it makes really easy to see is that layouts are exact substring matches

#
account.tsx
account._index.tsx
account.addresses.tsx
sacred marten
#

It's also kinda easy to scan for the correct route I'm searching for

bitter meadow
#

since account.tsx matches a whole segment exactly, you know that's the layout for _index and addresses

#

An underscore at the end of the segment is ignored, like account_.tsx, but now that busts the exact layout match

account.tsx
account_._index.tsx
account_.addresses.tsx