-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename src/routes
to src/app
#3021
Rename src/routes
to src/app
#3021
Comments
And an images folder, if added, could be Would the I also personally want to rename |
This is my "routes" folder and you can see that "routes" doesn't really capture the essence of the folder. So you have this random person on the internet vote. I would also petition to change "static" to "assets" as that folder contains images, robot.txt & wasm files. Static doesn't really capture it's essence either as the .wasm files can and do change often. |
This is my ...where Just fun to share 😁 |
I personally still prefer |
I'm slightly against this. This directory doesn't contain your app - the whole src directory contains your app. If we are still looking for another name so we can avoid saying route root, that's fine, but I don't think that name should be app. |
To me
Nevertheless, also the current folder structure is not a problem to me. It is well described in the docs, so I don't see the problem with
There will always be someone who doesn't read the docs, doesn't understand the current naming folder and asks somewhere the meaning..... |
|
|
This comment has been minimized.
This comment has been minimized.
I like When we think of an app's different "routes" we never think, "What routes does this app have?" No, we ask, "What does this app do?" A web app might have "pages", and a phone app might have "tabs" that "do" different things, but each of these pages and tabs ultimately comprises what we and users think not of as "routes" but as the "app."
I don't think that the names of things are childish or trivial either. SvelteKit exists, at least in part, to make turning ideas into real apps...easier and faster...for professional developers...and for novices alike. If naming directories more concisely makes SvelteKit even only a little bit more accessible...I honestly can't think of a cheaper way of making an improvement. |
I feel like this could ultimately lead to more confusion. "app" terminology, at least with the Svelte SPA template describes an entire project, components included. Without diving too far into semantics, I think that app is too ambiguous of a term to assign to a folder that's only purpose is to store routes. |
As for what |
Throwing my hat in: routes is the perfect name. The point of file routing a website is that you have a 1:1 map between the file and the web page. Each page has a route, if you want to rename anything then maybe rename |
I'm personally quite ok with |
I quite like the idea of calling it There's a bit of an overlap with regards to mounting components however. |
IMO, |
I am fine with
This would mean I would expect to be able to do |
routes sound good for me,... I would say even better, as it's meaning say exactly what it is... app doesn't give me information that files in that folder are mapped to specific path/url in browser. I want |
Continuing with @Mlocik97, SvelteKit has |
might be way off here, but it makes more sense in my head that the |
I use it this way |
I have an opinion on this. I have always viewed the
All of these directories are categorized items that are part of my "application". So changing
Now it looks like the I don't think |
Has anybody considered changing then it's:
Just throwing that out there XD |
for me, as it's now, it's good... renaming src to app sounds as weird as renaming routes to app... src is src, and it's defacto standard name for folder that contains main logic (source code), for project, and normally that makes app. But app is actually whole project, not just src... you execute build folder, not src, so, also src doesn't contain static assets that are part of app as well.... on other hand naming routes as app is also bad, because again, routes are not only thing that makes your app. Not only that, but folder routes contain layout, pages and endpoints (and private modules), ok, ok, it's weird to have layout inside routes folder, but it's still better as it is... or move layouts to new folder (not good idea))? I think:
makes biggest sense src, static and config all makes app... src contains main logic (source code), and in it you have lib, routes, hooks... What's wrong with that? Now look how it feel to make it renamed:
is telling me that static files, lib, hooks.js, service-worker, etc, is not part of app.
is telling me that static files, config, build doesn't make app. |
Throwing my two cents into this discussion, I'm putting my vote on keeping it as This does bring up the wider topic of SvelteKit structure patterns, and it's interesting to see the patterns that others use. Personally, I don't put anything directly inside of |
I don't like using My final thought is, keep things as they are... I love Sveltekit as it is (I'm looking forward to version 1 being released to start my projects in production) and I think that doing things in a unique way will facilitate a community consensus and unification and reduce the learning curve for many. |
If we are brainstorming new names for |
|
@Mlocik97 Speaking as an experienced dev, but new to SvelteKit, I found |
@gotofritz
|
Instead of Name taken from URL object.
Minus that the name is long. |
definitelly not... What ideas you have... this will make mess in project folder (yeah, VS Code has that option, but what other IDEs??? Some people use even gedit or nano and terminal for programming)... writing 3 words long name for folder seems as anoying as writing |
@Mlocik97 If this is spam then sorry. :D You can consider it as an inspiration. After all, just
|
I just think as it's now, it's ok... ofc, it's fine to give some ideas, but I think your idea of having everything in root folder is messy... we use folders exactly for purpose of organizing structure of project... now imagine you have folder for tests, build folder, .svelte-kit, some other stuff and folders and files, eslint, prettier other config files, some other scripts. And well, your root folder contain 30 or even more items... that's really not good. Hard to find what is src you write, and what are generated files or configs or kit unrelated things,... mainly as src are not in together, but it would be something like this:
and this is messy. you have one generated folder, under it you have something you should modify as developer (routes), under it you have unrelated stuff to kit, under it you have again src folder, under it you have tests folder... you can see how horrible it is... how it would show in IDE's file structure. Now add all ESlint config, Prettier config, TypeScript config, eh, will it fit on screen? Or would you need to scroll 2 kilometers to get to specific folder?
|
This comment was marked as off-topic.
This comment was marked as off-topic.
You're very unpleasant. :/ And besides, you have no sense of harmony. :D Here subfolders are literally displayed flat, folders have an even line with tabs (arrows are built into the folder icons).
That too, but it's its own way. In my VSCode the folders are displayed flush with the icons and there are no arrows distorting the line. And I showed this to confirm that there are some people who don't like the tree structure. :D |
Guys if your aim is to make the conversation go on and on in circles so that people are put off and decide to keep the status quo, it's probably working by now 😄 |
@gotofritz Shhh, because it will come out. ;) |
Shhh everyone. |
The maintainers discussed this over the weekend as part of the routing and load redesign and decided to stick with |
Describe the problem
Have come to the view that
src/routes
is suboptimal naming. It downplays the centrality of that folder, and makes you think about 'routing' even if your app has no routes (or e.g. you're brand new to web dev and are tinkering with Svelte for the first time, and don't yet even know what that word means in this context).By contrast,
src/app/index.svelte
almost announces itself as the root of your app.It has appealing aesthetic qualities as well:
app
andlib
have a pleasing symmetry — both three letters, withapp
coming first, andlib
coming later when you need it$lib
points to the contents of yourlib
folder, the$app/*
imports are essentially a reification of your app. it makes sense that$app -> src/app
and$lib -> src/lib
Describe the proposed solution
We'd need to
src/routes
directory and invite people to either a) change the defaultkit.files.app
tosrc/routes
or b) preferably movesrc/routes
tosrc/app
Alternatives considered
Keeping things as they are
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: