Live data from Hacker News

Svelte 4

svelte.dev

181–190 of 227 posts

Re: Svelte 4

#181

This is odd timing with Rich Harris just releasing a course on Svelte v3 on Frontend Masters (June 12th 2023). https://frontendmasters.com/courses/svelte-v2/ From the migration there does appear to be some breaking changes, don't know how that aligns with the course which I planned to take. His old course was good as well, but that relied on Sapper.

It does say "Svelte 3+" on the page, although I don't know if the plus was there before.

Re: Svelte 4

#182

Earlier quoted context omitted.

> I keep hearing about Svelte's flavor of JS basically being its own language now and it not playing all that well with Typescript it's a weird habit on HN to refer to random rumours that have discouraged you from trying something, and then explicitly not link to even the source of the random thing you're thinking of. I would guess you're misremembering something about the *developers of Svelte* saying they didn't th…

> it's a weird habit on HN to refer to random rumours that have discouraged you from trying something, and then explicitly not link to even the source of the random thing you're thinking of. I don't know about you, but I don't keep a map of "random thought" to "url" anywhere. It seems totally fine/normal in a discussion forum to say "Hey i heard this thing, any substantiation to it?" without needing a source.

Gonna need a source on why you think that bud.

Re: Svelte 4

#183

Can someone point me to a concise location of getting a development environment setup for Docker. Spent an hour or so after reading this and found conflicting information/out of date documentation. The tutorial[1] on the website is not helpful for actual deployment/development. I found Svelte for New Developers[2] which is slightly better, however, when building according to the instructions what I expect to happen i…

I can't help you with a docker setup, but if I'd highly recommend Vite for standing up a working Svelte dev environment (or Sveltekit, or React, or Next for that matter): https://vitejs.dev/guide/

You'll be up and running in seconds. This is all you need to know:

    # npm 6.x
    npm create vite@latest my-svelte-app --template svelte

    # npm 7+, extra double-dash is needed:
    npm create vite@latest my-svelte-app -- --template svelte
(if you're looking for sveltekit it's the same command, you'll just select sveltekit in the prompt)

Re: Svelte 4

#184
post #89
post #81

Earlier quoted context omitted.

Data-point of one, but I have definitely run into issues where Typescript can't understand what's going on in a reactive expression, and had to aggressively refactor my code to make everything happy. Most of the time it works great, but when it doesn't it can be really annoying. I wouldn't go so far as to say it doesn't play well, but the seams are definitely visible.

Could be the plugin was broken somehow. Happen all the time for me. Even now the syntax highlighting and code formatting feature would break if I write the code the wrong way. from my understanding the plugin does some clever tricks like insert some dummy code or create some dummy files to be consumed by the typescript language server. so it is not guaranteed to be correct 100% of the time.

I mean, that sounds like a data point of two now to me - you're also saying that Typescript and Svelte don't play that nice together if the plug-in breaks "all the time" and you need to be careful how you write code just to get correct syntax highlighting and code formatting, no?

Re: Svelte 4

#185

Can someone point me to a concise location of getting a development environment setup for Docker. Spent an hour or so after reading this and found conflicting information/out of date documentation. The tutorial[1] on the website is not helpful for actual deployment/development. I found Svelte for New Developers[2] which is slightly better, however, when building according to the instructions what I expect to happen i…

I can't help you with a docker setup, but if I'd highly recommend Vite for standing up a working Svelte dev environment (or Sveltekit, or React, or Next for that matter): https://vitejs.dev/guide/ You'll be up and running in seconds. This is all you need to know: # npm 6.x npm create vite@latest my-svelte-app --template svelte # npm 7+, extra double-dash is needed: npm create vite@latest my-svelte-app -- --template s…

I did this - that's part of the 2nd link. Problem is that it didn't work for me. I definitely did something wrong.

Re: Svelte 4

#186
post #13

Could someone give a one or two sentence explanation of why I would want to use Svelte over something like React? I have heard it is "better", but have never understood why.

JS frameworks are like coffee, some people like them milky and full of sugar, some people like them like them lean and black, some are obsessed with making the "worlds best coffee" at home every morning, and some drink whatever brown water comes out of a vending machine. We all like our coffee different, just as we all have favourite features and designs of frameworks. There is no correct, or best, framework, only pe…

Alpine.js is instant coffee that's surprisingly decent?

Disclaimer: I <3 alpine.js

Re: Svelte 4

#187

Anyone have examples of a really impressive or complex real world application built with Svelte on the frontend.

I believe Windmill is all svelte: https://app.windmill.dev/

As well as Bloomberg and the NYT sites, and Brave search.

I'm sure there are more, but for some reason people aren't talking about it a ton yet, and it's definitely not as ubiquitous as React

Re: Svelte 4

#188

I've heard of Svelte but am not sure exactly what it does. So this time I went to their homepage and it doesn't provide any concise summary of what it is. If I had to guess, I'd say it packages Javascript up into an application that runs locally, but... ¯\_(ツ)_/¯

It's just a frontend framework for building fast, interactive frontends.

If you're interested in seeing what all the fuss is about and have 5-10 minutes to spare, you could start https://svelte.dev/tutorial/basics and get a pretty good sense of it in less than 10 minutes

Re: Svelte 4

#189

Earlier quoted context omitted.

I can't help you with a docker setup, but if I'd highly recommend Vite for standing up a working Svelte dev environment (or Sveltekit, or React, or Next for that matter): https://vitejs.dev/guide/ You'll be up and running in seconds. This is all you need to know: # npm 6.x npm create vite@latest my-svelte-app --template svelte # npm 7+, extra double-dash is needed: npm create vite@latest my-svelte-app -- --template s…

I did this - that's part of the 2nd link. Problem is that it didn't work for me. I definitely did something wrong.

Did you use the right command for your npm version? Did the installer work? Or did something go wrong with `npm run dev`?

Re: Svelte 4

#190
post #13

Could someone give a one or two sentence explanation of why I would want to use Svelte over something like React? I have heard it is "better", but have never understood why.

Because you can deliver a better product, faster, with Svelte. The total cost of development goes down, as the productivity is better, bugs per lines less, total lines of code less.
Post reply on HN