Replies: 38 comments 154 replies
-
I'll give you my point of view I have about 15 websites with SvelteKit and the truth is that it has been great to build each site using it, this update broke almost all my knowledge and mental structure that I had of SvelteKit so I have to relearn many things, although it is much more confusing than before, but everything has a reason. I would love to see all this with the old Router (or with some changes that make it easier to understand) but this has been planned and studied by professionals like @Rich-Harris who are brutally active in the development world and know the problems that can arise that even we mortals don't fully know/understand. Yes, it is a drastic change, but I agree with all the reasons I read for all these changes. You gotta break a few eggs to make an omelette. So cheer up, good things will come! |
Beta Was this translation helpful? Give feedback.
-
I do agree that it can be frustrating relearning something, especially if time is of concern. But with that said, there are tons of warning that the Kit version is still in Beta and we should expect breaking changes. All in all, we must expect big changes like this while in Beta. I'm sure they aren't far from a stable release. |
Beta Was this translation helpful? Give feedback.
-
Well I feel you, but the thing is.. that.. when you are updating a beta software, you should first look for the commits first. SvelteKit is in beta, it is changing and continue to change until 1.0. Till then always look for breaking commits in main branch. |
Beta Was this translation helpful? Give feedback.
-
I also can't imagine how hard and frustrating it is to attempt to build consensus via community discussions on how to redesign a framework used in production by some cowboys/girls like the SvelteKit community. I share some of OP's sadness and I have the deepest respect for the Kit team. I've slowed way way down on my Kit adoption after seeing the divergence away from Next.js directory-based routing spec. That alone wasn't terrible, but when the rationale behind new "runes" in filenames, e.g. I'll probably wait till 1.5 to jump back into using Kit on new projects. I really really liked the original Kit as of maybe 3 months ago. It had some warts, but they weren't deal breakers. I'm more of a backend dev who was finally able to build amazing frontend apps using Kit. But the learning curve is eating up too much of my time now. |
Beta Was this translation helpful? Give feedback.
-
I totally understand that it is frustrating to having to relearn some of the concepts. It looks scary at first, but actually conceptually not much has changed. The new About the I'm genuinely curious: If you would start from scratch and not have the previous knowledge you have to unlearn to some extent - wouldn't these things be easier to understand? One way of doing things, special files immediately jump out because of the |
Beta Was this translation helpful? Give feedback.
-
I'm not sure the argument about file based routing being simpler that directory based holds much water. Granted see all these new special characters and filenames is a bit overwealming, but compared with the equivalent filebased I would argue that it's not so different . E.g.
vs
|
Beta Was this translation helpful? Give feedback.
-
I would like to reply as another non-professional dev that only works in SK every couple of days. I've been chipping away at an application for a while that has ~20 routes so far, and since I'm not working on it 40+ hours a week and routinely have to set it down for days at a time, it's expected that I'll loose some context in the interim and have to grok it again when I get back into the codebase. Probably pretty similar to the OP's situation. All that said, I think the new routing is a huge step in the right direction. As much as it sucks to deal with the migration and learn a new syntax and structure, it also clears many things up. I find the new structure much easier to navigate, and when I'm thinking "I need to load some data on the server before this page renders" I know which file identifier to look for with zero fuss. I'm finding things faster and as a result, developing faster. A few things to point out from my perspective:
Something I grappled with as a single dev building something to help me do my (no-tech) job, was the realistic expectation of what I needed the app to do, which in turn drove my needs in a framework and other tech choices. At first I got this step wrong. I had several false starts because I was looking to build a solution for all current and future use cases. I started with a fastify server running Graphql, code generation, Graphql clients in svelte, then those clients in SK, then merged it all into SK and got rid of the server but kept Graphql, then realized what I really needed was just what SK is offering. In the meantime I ended up with about 6 abandoned repos and a lot of wasted time. I came to realize that I needed to start as small as possible and build up later, which has been advised by virtually every seasoned dev ever. When it's time for the ba-billoin user scale-up, dedicated mobile app, and swanky offices, I can address it then. Right now I just need to build the thing, and the fastest way to do it is using Sveltekit. So my thought is to closely scrutinize what you really need and address it that way. If everything you are doing could run as a SPA, then SK is probably overkill. Go with vanilla svelte and use a client side router and you're in business. (and the API will be stable) On the other hand, having a clear location to load data that hydrates a page and having that secure is huge for me, and I love building things with Svelte. So SK is the way to go. As far as the migration was concerned, running the script and then working through my routes to adjust things took ~45 minutes, including a few interruptions and some time spent in the new docs making sure I understood what was going on. Virtually all of the heavy lifting was done by the script, and I just had to adjust a few things that shouldn't have been where they were anyway, remove the throw statements, and fire it up again. Getting through my couple dozen routes to review files only took about 10 minutes of that. |
Beta Was this translation helpful? Give feedback.
-
I understand that migrations are painful and unfun - even more so when you run into speed bumps. We've been dogfooding our own tools to try and make the experience seamless. I've migrated three or four sites of fairly decent complexity pretty smoothly. I did run into one site last night where the migration tool failed, but there's already a fix out for it (#6096) and I haven't seen that happen to anyone else. We'd like to make it as smooth as possible, so are watching for feedback. The big PR changed about 900 files if my memory serves me, so it would be expected that there are a few bugs or regressions, but those are getting ironed out quickly. I'd also like to say I understand how some of these changes may look worse at first glance. Engineering is about tradeoffs. Any decision we make will make some things worse and some things better. However, the things that jump out at us might not always be the most important in the long-run even if they feel the most visceral. E.g. @CaptainCodeman points out that E.g. here's the Svelte.dev site right now pre-migration: https://github.com/sveltejs/sites/tree/1c83a81d3957812a2986c6c50667d3cfca790980/sites/svelte.dev/src/routes Here's the Svelte.dev site in my migration PR: The latter is much clearer to me. E.g. it's much more obvious that there's an Similarly, the We care a lot about aesthetics, developer experience, etc. These are highly subjective, different in the short-term and long-term, etc. As we gain a lot more experience with the changes, we'll have a better sense of what's good and not about them. I'm still trying to figure out my own feelings about all the changes just as everyone else is. There are things I obviously like and others where my feelings have flip flopped back and forth. While it's just one measure, one nice thing I noticed is that I ended having less code after migrating svelte.dev: Some of the rough edges will continue to be ironed out as we fix bugs or introduce new functionality to address things that could be easier with the latest version. Some of this will also happen via the community and tooling (e.g. someone's already created |
Beta Was this translation helpful? Give feedback.
-
(Here is my experience, so far, as a amateur frontend programmer:)
Now, I'm planning to re-read the doc (https://kit.svelte.dev/docs/introduction) later when necessary & got the time. Before that, without a deep understanding of the changes, I can't confidently judge how good or bad this change is yet. For the big picture, Svelte has earned great trust from me, I finally find something I can enjoy in frontend, just like jquery (though svelte disencourage use jquery with svelte, and I kinda agree after using svelte for a while). As you see the pace of svelte development, and the great community response time & support, I do believe svelte will get better in long term, even there may be some unexpected in the middle. It's beta now anyway, changes should be expected. Trial & improve. |
Beta Was this translation helpful? Give feedback.
-
What’s the thoughts on retaining the optional ability to have the load
function within the context=module script block ?
…On Sat, 20 Aug 2022 at 19:18, Simon Green ***@***.***> wrote:
Lots of pages on that original version that are a folder + single index
page *could* have just been a single file, which would have simplified it
even further and made the contrast even more dramatic (e.g. /faq.svelte
instead of /faq/index.svelte) but even so this:
[image: Screen Shot 8]
<https://user-images.githubusercontent.com/304910/185758366-a50dbb13-7649-44d5-afaf-a14c4da3b3ba.png>
is *much* simpler and clearer IMO than this:
[image: Screen Shot 9]
<https://user-images.githubusercontent.com/304910/185758375-839f10f9-2445-4978-86d5-422e23c0d0c1.png>
For me, SvelteKit was perfect when there were just pages and endpoints.
Load always made more sense as part of the view (and was ideally optional /
not required anyway). Everything was more optimal for the most common
cases. Now it feels more complex even for simple cases based on the idea
that it will make the exceptional cases easier (even though they are far
less common).
—
Reply to this email directly, view it on GitHub
<#6005 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGNH6SUDB3YJBEXFUFSTV2EHNZANCNFSM563G2BCA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I think if it were up to me in a vacuum I'd come up with: /+about.svelte // equivalent of /about/+page.svelte
/+about.js // equivalent of /about/page.js
/+about.server.js // equivalent of /about/page.sever.js
/__layout.svelte
/__layout.js
/randomfile.js // note the lack of +
|
Beta Was this translation helpful? Give feedback.
-
This started off as a reply to a comment, but felt it was better just as separate comment. I agree with @CaptainCodeman (this reply) as well. I don't care that there's changes nor do I mind having to re-learn stuff. As many have pointed out, it's in beta. But using SvelteKit after the update hasn't been a great experience. I think bloat best describes my experience. The folder-based routing system just does not work with me. Navigating through the sea of There's no doubt many good things came out of the update, but I feel a lot of it could've been added without introducing a whole new system. To me, it feels SvelteKit is attempting to do too much. It tries to be the solution to everything, from simple to complex apps, but it also tries to make everything simple by abstracting it. That usually leads to a bloated solution. For me, the old SvelteKit with just pages and endpoints (and load function) was just perfect (Svelte too). They had just the right amount of abstraction and complexity. I'm an author of an auth library for SvelteKit. Before that, I found a Next.js auth library called NextAuth that handles everything, from oauth to email verification. I never used it before but thought I might make a similar library for SvelteKit. But, the more I developed it, the more complicated it became. Customization became impossible without a janky solution. And NextAuth never really had a solution to the complexity either. And I feel SvelteKit suffers from a similar problem. |
Beta Was this translation helpful? Give feedback.
-
trying to put myself in the shoes of a new user, if I were to look at the file structure of this current svelte routing architecture I would think that this framework is over engineered. It gives me tingly over-engineered spidey sense vibes seeing all the folders and +pages... Reminds me of early OOP class organization |
Beta Was this translation helpful? Give feedback.
-
If I was a significant contributor to this project I would be absolutely raging at this post. You used an early beta version of a product (0.3!!!) not yet intended for production usage and are shocked pikachu when there are major breaking changes in a multi version update? This is 100% on you and nobody else. |
Beta Was this translation helpful? Give feedback.
-
Looking more like java file structure by the day. Seems completely over engineered. These changes are so small they almost don't make sense to implement, but break absolutely everything. This means we all have to re-learn sveltekit routing. I understand this is beta software and we should expect breaking changes, but the reality is that many people, including myself already have quite large codebases in sveltekit. Looking forward to 1.0 so I can use the framework I love without having to change my entire codebase every few months! |
Beta Was this translation helpful? Give feedback.
-
I do have some projects and it didn't take that much time. About routing i was using directory as route always so it didn't effect me that much. I use WebStorm and i don't have any issue in finding file and directory. I might be little bit disappointed how sessions changed. But we all knew that before v1 there will be few breaking changes and we all have to accept that. Kit fairly warned all of us for breaking changes. |
Beta Was this translation helpful? Give feedback.
-
I feel the same way existo does. I don't like writing frontends with JS frameworks, yet I learned Svelte. I replaced my mostly-static website from plain HTML with Svelte because it brings me joy. Svelte is what HTML should have been. It feels right On the other hand, SvelteKit feels terrible. Is bloated and complex, difficult to understand and reason about. I've spent a couple of weeks reading a lot of discussions on how to solve problems they have created by their own design decisions. I can name a few that stood to me The layout system that nobody asked for: #6124Why do we need layouts? Create a component and wrap your component on each page you want that layout to appear. You are making SvelteKit more difficult to understand, when this is something that already works on plain Svelte <script>
import MainLayout from '$lib/layouts/MainLayout.svelte'
</script>
<MainLayout>
<span>My code</span>
</MainLayout> This is the same thing that Astro is doing, and nobody is complaining about it Weird forms proposal that is more than thousand lines long: #5875I simply don't understand why you need such difficult forms design. This would feel "Sveltic" <script>
export let username = ''
export let password = ''
</script>
<form method="POST" >
<!-- Reactive on form submit, different from `bind:value` -->
<input type="text" bind:form={username} />
<input type="text" bind:form={password} />
<input type="submit" />
</form> I think it's self explanatory. Svelte is a compiler. It should be able to compile this component to some request handler that extracts extracts the form for me. Why am i doing extra work? The confusing routing system: #5815
Svelte Kit is confusing, and shocks against Svelte philosophy. I don't like Svelte Kit |
Beta Was this translation helpful? Give feedback.
-
Just getting back from a 2 week trip, I've had a bunch of time to think about how I would recommend the Kit team proceeds. Here are some more/new thoughts. Various ppl have quoted the "The 2 hard problems in computer science..." quote in this discussion and others for this project. But no-one has offered a rationale as to why naming things is hard. I argue that naming is hard because it is deeply personal.And as such, a framework or library that would like to see mass adoption should side-step as many personal decisions as possible. Another thing that I've noticed is that Kit is attempting to build an API by way of file and directory naming conventions. This seems like a good idea at first, but quickly becomes untenable once more and more functionality is stuffed into the "API". Here's an example evolution of functionality for filename-based API:
Can we take a step back and ask ourselves, is this really worth it? We added filesystem-based routing to make it easier to build web apps. But then we overloaded the filesystem naming conventions with so much extra functionality it makes the imperative approach look downright simple. Suggestions for the team:
If I had to choose just 1 of the above suggestions to be implemented, I'd say we should remove Layouts. They are straight up unnecessary and can be implemented in "user-land." My second choice would be to expose the route config via a programmatic API so I can put my routes wherever I please. Also, this would open up the ability for folks to package their routes to be distributed via NPM. Imagine building an OAuth handler like Passport for Kit... :) Respectfully, P.s. Beware the sunk cost fallacy! It's not too late to undo some of the recent contentious and unnecessary complexity. The community will support Kit as long as Kit is making good decisions with a focus on DX. :) P.p.s. I'd recommend the Kit team define "done" for the framework. What should go in and what should be left to the community to build? Hopefully, you'll see things like Forms don't belong in the framework while things like Security do. |
Beta Was this translation helpful? Give feedback.
-
(about)/about/+page.svelte stuff kinda killed sveltekit for me too, elegant/intuitive part was just wiped away... |
Beta Was this translation helpful? Give feedback.
-
I silently dream of something similar: That is, a router would be something that has a But just giving up the Write down about such a possibility, somewhere in "Advanced routing", so that no one would cling to the fact that the documentation is then too complicated. |
Beta Was this translation helpful? Give feedback.
-
I have a strange idea. Then such custom routing, would even have support for load and the rest of the module properties. Check this out: But as if to use So in // src/routes/blog/[...rest]/+page.js
export async function load({ params }) {
const load = await import(`./${params.rest}.js`);
const {data} = await doLoad(load);
const mod = await import(`./${params.rest}.svelte.md`);
return {
post: mod.default,
data
};
} <script>
export let data;
</script>
<svelte:component this={data.post}, data={data.data}/> Eventually, in the I'm assuming my example has errors, doesn't include something, but it's meant to convey the general idea, ok? What do you think? All you need is O! Yet to be able to add such a file of your own routing, using a package, without Adder. So that this file does not litter the |
Beta Was this translation helpful? Give feedback.
-
I think it'd be wise to hold judgment until 1.0; and trust (and maybe help) the team to do the right thing. |
Beta Was this translation helpful? Give feedback.
-
Not trying to beat a dead horse here, but in case anyone is looking for simpler routing, less magic, and more flexibility without sacrificing performance: astro looks like it is going to fit the bill.
If/when SK goes back to simpler routing and removes layouts and undoes a bunch of the complexity thats been added, I'd be happy to switch back. But for now I'm gonna give astro a shot. |
Beta Was this translation helpful? Give feedback.
-
There have been previous discussions on this one before - #5748 When I first caught sight of the changes my first reaction was yeeesh. Ultimately you won't find a one size fits all. Personally I think one way to get around this and avoid a lot of the problems. That way you'd leave the end choice up to the end developer as to which option to go for. Personally I've kind of moved away from sveltekit for now, it looks as if the future might be Vue 3.3 In response to the original dog meme that was posted in the other thread I couldn't resist but post my own :) |
Beta Was this translation helpful? Give feedback.
-
I had been writing a fairly large app with the beta version and was hoping that this migration would not be too difficult. I have no problem with the file-based router and actually like it, but the props data and also the fact that sessions are gone is going to require quite a bit of re-factoring. The reason I started developing with Sveltekit in the first place was that it was easy to work with and, well, svelte. It seems to have gotten a little over-complicated. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Old threat but had to weigh in. Built some fairly large apps, worked on two enterprise apps, still do. From Backbone to Angular to React and everything in between. SvelteKit was pretty clear that things may change. It wasn't a production release. While many had that ahhh crap moment as they realized there would be refactoring, it really wasn't all that difficult and I believe it's for the best. So if you find this, just bear down and make it happen. It won't be that tough once you set your mind to it. That all said I can't think of another frontend framework that's as much of a joy to work with. It really is great IMO. While there are a few other promising frameworks out there Svelte is a top three frontend kit in my book. |
Beta Was this translation helpful? Give feedback.
-
I feel the same way. My goal was to move away from the cumbersome nature of React/Next and my mind went to Sveltekit. However after trying it out I have the same reaction as you do |
Beta Was this translation helpful? Give feedback.
-
Svelte is good framework but sveltekit is bummer to me. After tryng to fitted with my need i just can't bear my self with routing folder decision, it's so cumbersome, the way that sveltekit flow feels is same as remix but not with route model, for me why svelte doesn't take that remix do with flatfile, it's more readable, configurable and organized. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Let me first say that I am very grateful about everyone who dedicates their time and effort in this project. Being a co-maintainer for a large Go library myself, I know how much time, weird issues and discussion and other things strain the life of a maintainer and open source developer.
Now this is probably going to be an emotional rather than an objective post, but I somehow have the urge to at least voice my opinion on this. For a little bit of a back story, let me share that basically though-out 2020/2021 I was very frustrated with web development per-se. At work and in my "GitHub life" I basically started out with angular1, and made the journey until angular 10ish at which point I was totally frustrated and looking for opinions. I basically tried to "learn them all" vue.js, react, and so on. Finally, somehow in beginning of 2021 I stumbled across this "svelte" project and I was blown away. Finally, I got joy back in actually programming web applications and when I found out that svelte kit offered a nice way to wrap everything up in an "application", I was basically through the roof. Just create some
.svelte
files here in a nice, clean folder/file structure and BAM, you have yourself a nice web application.Now, I am not a professional frontend developer, nor do I work on my web apps everyday. I do not need any "enterprise-grade" frontend library, otherwise I would have probably stuck with angular.
I tried to update my svelte kit App today after a while (from 0.3xxx) and I was sort of in shock what happened. First I though ok some things changed with the vite config fair enough. But the biggest "shock" was the new routing system and the way "data" props are handled now. I scrolled through the discussion (which I all completely missed because of the lack of time lately) and while I understand that some things make sense from a technical point of view, as a user (albeit, "non-professional"), I cannot understand them at all. svelte kit was a good, clean way to design (maybe a smaller) web application with simple routing and simple template props and that is basically gone now. I tried running the migration scripts and I gave up after about an hour, somehow my simple application with 8 routes was too complicated for it, maybe I am also just too emotionally tired to try it at the moment.
I understand that I have no right to "demand" anything here. I suspect that this post is probably going to be locked, since you also locked the discussion on the original design thread. I just wanted to voice the option of the "little guy" web developer that was actually quite happy with this very nice lean, easy web framework that now seems to be gone.
Beta Was this translation helpful? Give feedback.
All reactions