Rename pages
to routes
now that Api Routes are a thing
#17511
ashconnell
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request
Is your feature request related to a problem? Please describe.
Two overarching related issues:
pages
no longer makes sense now that it contains Api Routes. These aren't pages.pages
is a convention generally used in other frameworks to denote a place where top level UI components and accompanying files such as styles, tests, stores or state live.Describe the solution you'd like
With the addition of Api Routes, it makes much more sense to consider renaming this from
pages
toroutes
. This has been requested multiple times before but mostly this was before Api Routes were introduced.Consequently, this also allows developers to continue using the
pages
convention to contain top level UI components and related files all in one place.src/routes/api/**/*.js
: api routessrc/routes/**/*.js
: exports the relevent page component fromsrc/pages
src/pages
: contains one folder per page component along with it's store/state and stylessrc/components
: re-usable componentsDescribe alternatives you've considered
src/pages/api/**/*.js
: api routessrc/pages/**/*.js
: exports the relevent screen component fromsrc/screens
src/screens
: contains one folder per screen component with state and style filessrc/components
: re-usable componentsThis structure trips me and other developers up every single time:
pages
orscreens
? None seem relevent to "Api Routes".pages
orscreens
? Pages seems most relevent but this is wrong.Beta Was this translation helpful? Give feedback.
All reactions