SvelteKit is really, really great for small to medium sized projects. The amount of stuff you get "for free" (prerendering, ssr, decent SEO) by using SvelteKit is so nice. That being said, I definitely agree with the sentiment here that the file based routing is sub-optimal and I think the hurt goes up exponentially with the size of a project. I've also found that straying off the opinionated path even a little gets…
this is exactly what i am thinking. i ended up building my own router that tries to use an openAPI schema as the sole source of truth but pre-populates the schema based on folder structure so that simple setups behave nearly identical to file based routers. the difference is that you can drop pre-populated routes when the app gets more complex and gradually move to a schema based approach and do things like extract m…
Reflections on Migrating My SaaS to SvelteKit
21–30 of 46 posts
Re: Reflections on Migrating My SaaS to SvelteKit
#22The more I see it the more I'm certain that Rich and the team screwed the pooch with the whole '+page.server.ts' stuff. They should really be using the existing syntax to have a context="server" portion instead of splitting the file out. Heck, it could even just be an import for a server.ts file in the same root directory if people really liked the +whatever style of having the server code separated. It feels especia…
That said… the one bit I can’t stand is every file having the same name. Working on 4 “+page.svelte” files at the same time breaks every dev environment I’ve ever liked (vscode, vim tabs). It seems to be fighting the tools and mental models I have.
Re: Reflections on Migrating My SaaS to SvelteKit
#23Re: Reflections on Migrating My SaaS to SvelteKit
#24Re: Reflections on Migrating My SaaS to SvelteKit
#25SvelteKit is awesome - I wished there were a nice Docusaurus alternative in it. I checked out KitDocs and Sveltepress but both seem like small personal projects that can at anytime stop being maintained.
In the past, I got tasked with an existing Next.js app to play nice with a Docusarus user guide they were building. I found that Docusaurus was very limiting in that environment, and I was forced to launch a separate Docusarus powered docs site under a different sub domain.
I’ve ported over the Docusaurus functionality into an open source Next.js project, complete with Markdown loading, Tailwind CSS, simple .env file configuration, and much more.
I fixed the Docusaurus problems that I mentioned above.
Re: Reflections on Migrating My SaaS to SvelteKit
#26The more I see it the more I'm certain that Rich and the team screwed the pooch with the whole '+page.server.ts' stuff. They should really be using the existing syntax to have a context="server" portion instead of splitting the file out. Heck, it could even just be an import for a server.ts file in the same root directory if people really liked the +whatever style of having the server code separated. It feels especia…
I’ll take the opinionated and enforced structure. Even when they aren’t what I would choose. I like ecosystems with standardization. That said… the one bit I can’t stand is every file having the same name. Working on 4 “+page.svelte” files at the same time breaks every dev environment I’ve ever liked (vscode, vim tabs). It seems to be fighting the tools and mental models I have.
Re: Reflections on Migrating My SaaS to SvelteKit
#27For folks who have used both, how do you feel Svelte + sveltekit compares to React + Next?
Re: Reflections on Migrating My SaaS to SvelteKit
#28> The naming conventions for routes is a little bonkers. Now when I’m working on my app I have like 10 tabs open that all have the name +page.server.ts. Does anyone know how I can make this better in vim? :help setting-tabline Low-level stuff; consolidating with some kind of project root directory concept and patterns would be convenient for such cases.
> :help setting-tabline
For VSCode users: Workbench > Editor: Label Format
Set to short will append the directory name right after the file name on the tabs, making it painless to work with the file structure.Re: Reflections on Migrating My SaaS to SvelteKit
#29https://archive.ph/yYh4J
Re: Reflections on Migrating My SaaS to SvelteKit
#30how does it compare with react?
Very different. Svelte has magic event bindings and compiles `.svelte` files. Their learning material is interactive and worth going through just to see some new ideas.
You can open the compiled svelte output and follow through the entire code path for updates in a few minutes.