I've used Next.js quite a bit, but once I tried SvelteKit, I never looked back. One of the things I built with it is https://landing.gallery/
Well done! From inspecting the html: - sanity for cms - tailwind for css - partytown for running script in web worker - most of the icons on the footer are just unicode emojis, no separate library just for icons....nice! Only feedback I have: - the sticky footer looks like what you would see in a mobile view and looks a little odd in desktop (I am not on a phone atm) - Home page drop down in top left and some footer…
Thoughts on Svelte(Kit), one year and 3B requests later
181–190 of 222 posts
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#182I've used Next.js quite a bit, but once I tried SvelteKit, I never looked back. One of the things I built with it is https://landing.gallery/
Would be interested in seeing how you implemented your filter functionality. So smooth!
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#183Re: Thoughts on Svelte(Kit), one year and 3B requests later
#184I've moved my little hobby website to SvelteKit[1] from react and I am not regretting it.. yet. The only main frustrations I have are: - Library support is pretty lousy. You need to fudge things around to get working. I.e, with leaflet and others I have vendored in the libs and redone them. - Incremental static refresh with svelte kit is not really there. I'd like a web hook or api callback that allows me to refresh…
Cool site! I just looked through your repo. I'm still relatively new to SvelteKit and rewriting a similar content based site from React. What led you to use the SSG adapter vs the node adapter (which uses SSR)? How long does the build take to pre-render all of your content pages like the sea life? Was there a particular reason you didn't want to use Form Actions? Not criticizing your decisions by the way, I'm mostly…
- I am using a rust backend for the static files and didn't want NodeJS part of the request workflow. Most pages aren't changed all that much, like maybe once every few months & so having yet another service as part of the connection flow just adds resources/delay when it's not needed. It's a lot faster/easier/cacheable to serve a static file.
- The prerender doesn't take all that long, maybe a minute or so, it's fast enough for the site as it stands, but if it got super massive it'd be a different story. I throttle how often it happens currently, so that there is a bit of time between pre-renders.
- The frontend communicates to the backend via GraphQL & the backend is not part of svelte kit, it's an entirely separate service, and so things like `page.server.ts` won't apply.
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#185Earlier quoted context omitted.
A beginner suggesting something to try seems fine to me. They have something no amount of study can give, a fresh perspective.
> A beginner suggesting something to try seems fine to me. They have something no amount of study can give, a fresh perspective. When the beginner's critique of the competition is that it felt dirty: Next was my least favorite mostly due to the syntax and how you had to build the application. I really didn't like the whole style of Next and React. Just felt dirty. .... then I don't know that I trust their suggestion.…
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#186Earlier quoted context omitted.
Library support is pretty lousy. Next 13's app directory and React Server Components is killing library support in React, so that's not such a big problem.
I don’t know much about the former, but it’s not clear why React server components are going to kill library support.
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#187Earlier quoted context omitted.
I don’t know much about the former, but it’s not clear why React server components are going to kill library support.
Pretty much every library I have tried to use with Next App Router (and therefore RSC) doesn’t work with RSC. I’m sure it will change but we’ll be sticking for Next Pages for a while yet.
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#188As the author states, ... Svelte Stores are rough. Beyond just missing usage patterns and documentation, we found that several features are lacking, especially when used with native reactivity (`$:`). Another area lacking is TypeScript support. Our frontend codebase at OKcontract is implemented with Svelte, but we had to build some low-level libraries (including a wholly new implementation of Stores) to make it worth…
Can you elaborate on lacking typescript support in stores? interface Book {...} export const selectedBook = writable (null); Works fine.
Namely, unavoidable TS errors in the Svelte parts that require tricks mostly because the full TS syntax is not supported inside components.
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#189Earlier quoted context omitted.
You can just wait for the network request to finish before continuing. Many actions require it anyway. Asynchronous code should be intentional and deliberate in my opinion, but in modern JS/Node it is the default which leads to all kinds of crazy workarounds, callback hell and race conditions. Node has the same issue PHP had now, where green devs will crank out code without realising they need to be watching out for…
What's not deliberate about marking a function as `async`, and marking calls that need to be awaited with `await`? Callback hell? When was the last time you gave an honest effort into JavaScript?
Re: Thoughts on Svelte(Kit), one year and 3B requests later
#190Earlier quoted context omitted.
JSX is, imho, more akin to a macro; the syntax is replaced with simple expressions. Technically, the JSX syntax isn't even necessary to use React, though most people prefer it. Svelte bakes itself fully into your code in a way that you can't do without the compiler and still be using svelte.
So you're saying that svelte does not just transpiles to js/css/html ? Could you expand on that a bit more ?
JSX is an essential, yet entirely optional, concept in React. The output of the transform is incidental to the actual behavior of React, the library.
As such, I wouldn't think it warrants the term "JSXscript" or whatever the post I replied to used.
Depending on how your tool chain is set up, you don't need a custom file extension like ".jsx" for files that need the transform, and React doesn't care about file extensions at all.
Svelte, on the other hand, pushes you to use the ".svelte" extension, mixing and matching tags, changing scoping rules, and so forth. If you were to write by hand what it puts out, you're not really using svelte anymore. It is, in this sense, elevated itself to a language superset.
I'm not arguing one is better or worse, just pointing out why I think they are sufficiently different to quibble over semantics.