Live data from Hacker News

SvelteKit 1.0

svelte.dev

291–296 of 296 posts

Re: SvelteKit 1.0

#291

What would be the best route to upgrade a medium sized project from say `1.0.0-next.263`? There's 327 intermediate versions up to this one and a considerable amount of breaking changes.

just start a new project and port each route over one by one. it doesnt take that long once you figured out the 4-5 api breaks you do have

Re: SvelteKit 1.0

#292
post #27

This is how I move fast and break nothing. By having fullstack type-safety from database all the way to the frontend with auto-completion. My current stack: + SvelteKit (could be Next, Nuxt, Solid or any other TypeScript framework) + tRPC (typed calls between frontend and backend, https://trpc.io ) + trpc-sveltekit (glues SvelteKit and tRPC, https://github.com/icflorescu/trpc-sveltekit ) + Prisma (ORM, https://www.pr…

I use the same, but with Hasura and Next.js with GraphQL + Next.js + GraphQL Zeus / GraphQL Code Generator (typed calls between frontend/backend) + Hasura (generates GraphQL API for database)

Same here. I use Apollo Client. React. Hasura

Re: SvelteKit 1.0

#293

While I like Svelte, I fear it looses some of the flexible API-building enabled by React. Specifically: since it uses a templating system, you can't pass around interface definitions easily: - https://github.com/sveltejs/svelte/issues/3480 (no dynamic slots) - https://github.com/sveltejs/svelte/issues/5381 (can't wrap children) You can always find workarounds for these cases, often using ` `, but React's Javascript/T…

Jsx is expressive but it comes with a deviation from html. And loses optimization opportunities.

Templates are closer to html, can be better optimized but lack expressiveness.

Is there a third option which has both? Not yet for sure. Right now, you need to compromise somewhere.

The only pragmatic option is to support both template and jsx (Vue approach) but then people complain about "complexity" and "multiple ways to do same thing"

Re: SvelteKit 1.0

#294
post #293

While I like Svelte, I fear it looses some of the flexible API-building enabled by React. Specifically: since it uses a templating system, you can't pass around interface definitions easily: - https://github.com/sveltejs/svelte/issues/3480 (no dynamic slots) - https://github.com/sveltejs/svelte/issues/5381 (can't wrap children) You can always find workarounds for these cases, often using ` `, but React's Javascript/T…

Jsx is expressive but it comes with a deviation from html. And loses optimization opportunities. Templates are closer to html, can be better optimized but lack expressiveness. Is there a third option which has both? Not yet for sure. Right now, you need to compromise somewhere. The only pragmatic option is to support both template and jsx (Vue approach) but then people complain about "complexity" and "multiple ways t…

Reacts performance problems don't come from JSX, but rather how single updates can affect the entire tree below it.

Solid uses fine-grained observability like Svelte and achieves similar performance [1]. SwiftUI uses static diffing, fine-grained observability, and avoids re-renders by comparing view dependencies [2]. It is performant even on watches.

[1]: https://krausest.github.io/js-framework-benchmark/current.ht...

[2]: https://developer.apple.com/videos/play/wwdc2021/10022/

Re: SvelteKit 1.0

#295
post #275

Earlier quoted context omitted.

That's amazing. Out of curiosity, how does one get to work for companies that use Svelte? I'm based in the UK and the only companies I've heard of using Svelte are Decathlon, Apple and Spotify.

A couple of spots I'm aware of that are Svelte specific .. https://sveltejobs.com Jobs channel on the Svelte Discord https://discord.com/channels/457912077277855764/640884695890...

that's amazing, thanks a lot

Re: SvelteKit 1.0

#296

Earlier quoted context omitted.

How are you liking Prisma compared to a pure SQL approach?

I'm using prisma with postgres. It's pretty nice. You define all your tables in their custom schema format which has VS Code integration and lots of type checks so it will tell you if there's a problem with the schema. You can generate types from the schema file automatically and also a statically typed ORM layer that will let you write queries against those tables with full code completion. It also will generate mig…

Very interesting to hear some feedback on how Prisma is compared to like EF. Perhaps better to use EF + graphql layer?
Post reply on HN