Replies: 6 comments 2 replies
-
I have no problem with files names or “+”. |
Beta Was this translation helpful? Give feedback.
-
I think the new layout system is a significant improvement, it clearly separates each architectural piece; allows you to understand what's running only on the server and what will run in the client as well and it also allows you to create complex layout inheritance without encountering occasional issues (too hard and long to explain, but I had one of these and the new layout system fixed it). It may be a little bit more complex than before, but sveltekit is growing, and it allows us to do more every day while still being the easiest solution out there. Fairly speaking, I think that Astro is much harder, especially when you want to make different components/pages communicate between them, which is kind of the price to pay if you want to do "islands" and multiple frameworks in the same project. |
Beta Was this translation helpful? Give feedback.
-
I love Svelte and I love SvelteKit generally, but every single file being called +page.svelte and not being able to arbitrarily pick a layout for a file that isn't based on folder hierarchy is a really bad developer experience. I keep having to squint at my folder structure to try and figure out what file I'm working on and every single tab in my editor is the same file name is terrible. There has got to be a better way. |
Beta Was this translation helpful? Give feedback.
-
The big problem for me is vim considers the + to be a token when you open a file that starts with it, so you need to be in the source directory. Further, using hidden URI routes, (directory names wrapped in brackets) can't be pathed without wrapping the path in quotes: I'm digging this convention for route layouts, but we DO need some sort of resolution to bash navigation. |
Beta Was this translation helpful? Give feedback.
-
As much as I enjoy creating websites with Svelte Kit and I really think the file based routing is a great idea in theory. But the naming conventions are so bad I couldn't believe it at first. Been using Linux and CLI for 20 something years and I have never even once come remotely close to something as bat shit crazy as using +()@[] in filenames. I'm not even exaggerating when I tell you it breaks my workflow once an hour. Just now, which brought me here, inside vim:
|
Beta Was this translation helpful? Give feedback.
-
This can even happen when you use fish shell on macOS. One particular issue I have with layout groups (using I suspect that there is a bit of a Microsoft VS Code bias here, which can be seen in other tools surrounding the svelte "ecosystem" as well that offer first class VS Code support. Don't get me wrong. SvelteKit is preferable for me over next.js, and Svelte over React, but some developers might be better served with getting picked up from where they are right now. When using fully integrated development tools, they hide away all the dirty OS and shell behavior from you quite well. It's inconvenient, but not bad enough to make me stop using SvelteKit. The ship for a change to folder structure has probably sailed now. A configuration flag for path syntax would mean that I will stray from the happy path, and it might break in weird ways, as experience tells me. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thanks for Svelte and for SvelteKit. Using these in the past 1.5 years simplified by web development activity, enabled me to deliver quality software with super easy way to maintain and modify the app.
I recently upgraded past @1.0.0-next.405 and went through the migration and adaptation to new routing system and new layouts.
I've read a fair share of some of the discussions content about both of these, and feel the need to add the perspective of a linux user not using the same tooling as the majority, as the new design forces me to consider other options than SvelteKit, regretably.
A bit of background
As a user of svelteKit, I wish to:
VSCode
,terminator
on linux) while keep using the same git workflow I am used to with svelteKit as with all other technology projects I work on,The recent changes seem to prevent these expectations from being respected, and force me to consider other solutions.
Issues
Summary:
+
Here are details about the issues encountered. The proposed solutions are just naive ideas on the top of my head, without much knowledge about Svelte kit's internals, and I understand that they might not be acceptable or suitable.
The new layout system brings extra un-necessary boilerplate
Situation
A website contains pages with two distinct layouts.
For example:
Previous situation
Current situation
Because the visual layout should not inherit from the default layout, it is necessary to wrap the whole website in an layout group, so that a
root
layout only contains<slot></slot>
(this corresponds touse case 2
in the layout migration guide #6174).Why is it a big deal?
An extra level of nesting isn't the end of the world. However, in this specific case, this is problematic because of the file naming convention, preventing to navigate through the directory tree naturally in a terminal, using Tab for path completion (c.f. next issue).
Proposed solution
Include a layout reset mechanism not requiring to wrap the whole website under an extra directory.
Layout groups: route files not usable in the terminal in git commands anymore
Each time a file inside
src/routes
is modified, it is not possible anymore to use usual terminal features to stage and commit the file in git.Workflow
git stat
+ Tab + Enter to show the git statusgit add
Previous situation
Result: the desired file is staged for commit
Current situation
Two issues:
Workflow adapted to the new layout groups syntax
git stat
+ Tab + Enter to show the git statusgit add "
(notice the extra double-quote sign)"
+ EnterProposed solution
Either rollback to previous layout system, or switch to a terminal-friendly naming convention.
Side-note: terminal's auto-completion is also broken, e.g. with command
ls
. path needs to be escaped with a double-quote character in order to navigate through paths containing parenthesis. Affects,terminator
,xterm
andurxvt
on Debian at least.New routing system: route files not usable in the terminal in git commands anymore
Similarly as in the previous issue, the
+
character prevents a double-click to select the whole file path + name from agit status
output.The stated reason for using this prefix is to simplify a regex in place to match the files:
Source: this comment.
What is the problem with the longer regex? Once it is in place and working, it is not likely to require maintenance. Is it causing any significant performance issues?
Proposed solution
It is again a very naive approach, not knowing about constraints, but I thought I would present it, perhaps to hint on a solution involving more simplicity:
As pages, endpoints and server endpoints are the norm, and colocated files (component code stored inside the routing directory) are the exception:
.svelte
--> route file.server.js
--> server endpoint (not sure of the current terminology for this type of files).js
--> endpointall files have the same name
This has been debated a lot, but I did not see feedback from the perspective of developers not using
vsCode
, and for which a workaround to display directory name instead of file name is not available.The
+
prefix and the forcedpage
file name really look redundant.Question: If a
+
prefix is required to the file names, then why not allowing them to be called anything rather thanpage
? Routes would then look something like this:Questions
Thanks for your patience, and thanks again to the Svelte Kit creators and contributors for the wonderful work you have done.
Edits:
Beta Was this translation helpful? Give feedback.
All reactions