Live data from Hacker News

SvelteKit 1.0

svelte.dev

171–180 of 296 posts

Re: SvelteKit 1.0

#171
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…

What is the benefit of tRPC over built-in SvelteKit data loading?

Re: SvelteKit 1.0

#172
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 prefer static types all the way, but my looser rule I've come up with in order to play nicely with others is that you're not allowed to interface something with poor type definitions/enforcement with another thing that's also bad at that. Including transport/wire formats, so if you're presenting JSON you'd better be able to tell me a good story about type safety on both the sender and receiver.

That at least keeps the blast radius of type-related bugs very limited, and makes it easier to figure out where the problem is.

Re: SvelteKit 1.0

#173
post #94

Earlier quoted context omitted.

If it's for your career: React + (Next or Remix). Maybe Angular or Vue if the specific company you want uses it If it's for yourself: Svelte. Amazing community, very likely to be here in 5 years, but I don't think it's been proven to work at large scales yet. If you want to twist everything upside down and see the full potential of what front-end dev work could be: Qwik or Elm (imho)

Svelte will be also the career choice in couple of years, like Angular was the career choice when React launched (although they have only 3 years between them).

and before angular was jquery. But I do think there's quite a big difference between React and Angular. Angular never reached the level of marketshare that React has even if it was close. And even when it was close it was only for a few years. React has been the standard for nearly a decade now. And React has been much more explicit about growing its ecosystem whereas Angular has much fewer 3rd party plugins/tools. In addition to all that, Svelte has technically been around since 2016. Even if we cheat and say it only really started getting attention in 2018-2020, it has still been rising slower than Vue did when it launched. In the latest StackOverflow survey (2022), Svelte still hasn't even surpassed the 5% threshold for how many developers have used it.

By pretty much every metric,[^0] svelte is a tiny community still. A darling of the web dev community for sure, but has not yet gained the confidence of commercial products. Perhaps this has actually been good for Svelte and its development. It definitely seems like it's heading towards much wider adoption so I guess we'll see it tested soon enough

[^0]: https://gist.github.com/tkrotoff/b1caa4c3a185629299ec234d231...

Re: SvelteKit 1.0

#174

Earlier quoted context omitted.

I'd love to browse a sample codebase. Do you know of any non-trivial open source projects using this stack?

https://trpc.io/docs/example-apps

Thanks. Here's the SvelteKit example linked on that page:

https://github.com/icflorescu/trpc-sveltekit-example

Re: SvelteKit 1.0

#175
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…

Might I recommend https://jawj.github.io/zapatos/ to remove the last 3 lines of your stack.

Re: SvelteKit 1.0

#176
post #38

Great news and looking forward to how this goes. I still find it incredible that the frontend javascript ecosystem hasn't found a reliable and productive contender yet, a framework you could be sure would be still relevant without too much changes in 5+ years, something like what Ruby on Rails is for full-stack. Some would say that React/NextJS has this role but I have to disagree. When using React/NextJS you still h…

> When using React/NextJS you still have to rely on third party library for routing, state management, querying etc.

You shouldn’t need react-router or other routing-related third-party libraries because Next’s router (and its file-based navigation system) should be enough(?). I’d also say that React itself has powerful-enough state management options (useState hook plus React context, if needed).

The only annoyance I ran into was getting proper i18n working and integrated with Next (with i18next). There were some issues with Next’s newer releases and a redesigned i18n setup that broke a lot of things for me and I regretted the dependence of multiple libraries and frameworks needing to work together. (Storybook is another library that kept breaking.)

Re: SvelteKit 1.0

#177
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…

Might I recommend https://jawj.github.io/zapatos/ to remove the last 3 lines of your stack.

Nice share!

Re: SvelteKit 1.0

#178
Is Svelte and in extension SvelteKit somehow the next step in the evolution of frontend frameworks? From what I know it has more fine grained reactivity than for example React or Vue and should therefore just run more efficient? Or has the approach of Svelte also drawbacks that I am not aware of?

Re: SvelteKit 1.0

#179
post #124

Earlier quoted context omitted.

Same, but with ASP.NET (which produces an OpenAPI specification) + Entity Framework on the server, React + TypeScript on the client (which consume that specification through openapi-generator). https://github.com/OpenAPITools/openapi-generator I chuckle every time I read claims about Go (or whatever) being amazingly productive. I don't think it's possible to beat this stack with regards to both productivity and ease…

This is very backend-centric. It can't compare to a framework like SvelteKit or NEXT or NUXT, where the primary benefit is also shipping your tightly-integrated frontend code to the browser. .NET apps are old school, full refresh apps unless you are also using a separate frontend framework like React or Vue standalone. And that adds a lot of time and overheard. Everything you described in terms of easy migrations and…

Exactly.

With ASP.NET, a React/Angular project is separate, there's a separate model layer, and you have to keep that in sync with the .NET models.

With Next, there's true code reuse between client and server. Next is smart about shipping your code where it needs to run, server, client, both. You can even mix and match from page to page: Server-side render one page per request; statically generate another at build time.

As much as I like ASP.NET, Next has leapfrogged it for web apps.

Re: SvelteKit 1.0

#180
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…

Curious how you handle `request.formData()` in Form Actions and ensuring type safety there.

Like any user input, you do runtime type-checking and validation. TypeScript is especially great for that because it has type narrowing [0].

[0] - https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...

Post reply on HN