News for hackers. Stuff that matters.
Re:Migrating from Vue 2 to Svelte by swyx on Friday December 02, 2022 @01:12AM (#33827398)
echos many of the same things i loved about svelte when i got involved in 2019: https://www.swyx.io/svelte-why

people always call out the small community to be a downside, so a few of us started Svelte Society to fix that (very humble numbers compared to react, Rethinking Reactivity is probably the best starting point for most https://youtu.be/AdNJ3fydeao). i actually think theres a “be careful what you wish for” aspect to this, svelte’s community is super enjoyable now BECAUSE it is small and many come to it as a second framework; so are less religious and more intentional about their tech choices.

notable companies now using svelte not just for internal apps but customer facing, critical stuff: huggingface (for everything, including gradio), alaska airlines (entire customer flow), razorpay (payment dialogs), schneider electric (many things), ikea (ecomm experience), riot games (league of legends client), Brave (search page), Square (developer portal), several YC startups, and basically every notable data journalism outlet on the planet (Bloomberg, the Economist, Reuters, Les Echos, german and japanese publications, pudding.cool, and of course the NYT) https://twitter.com/sveltesociety/status/1260209026563858432

sveltekit 1.0 is also frequently called out as an adoption barrier but.. well.. stay tuned (on the order of weeks not years)

Re:Migrating from Vue 2 to Svelte by esperent on Friday December 02, 2022 @03:56AM (#33828301)
> so are less religious and more intentional about their tech choices.

The sentence I would use is "less pragmatic and more interested in hacking than being productive".

I know people like to dump React devs for being fanatics and I have encountered some of those people... Like, 2 maybe. The rest of us use React because we want a battle tested framework with a huge community.

I don't want to hack around with the cool new framework. I don't find frameworks exciting. I want to build stuff that I do find exciting and I want the framework to be in the background supporting that. I want to be able to find support when I need it and high quality prebuilt extensions for as much of the functionality my app needs as possible so that I'm not spending my days rebuilding basic components. That's why I choose React.

Re:Migrating from Vue 2 to Svelte by richeyryan on Friday December 02, 2022 @05:25AM (#33828776)
I find a lot of Svelte users are pretty religious and hysterically anti-React. When the first version of Svelte Query was announced, people were trashing the API because it looked like hooks and "you don't need those in Svelte", concluding the library must be useless. There's a lot of the "Svelte is the one true way" talk, similar to when Vue was the main alternative to React. The core team seem very reasonable but I think the community has some maturing to do.
Re:Migrating from Vue 2 to Svelte by pcthrowaway on Friday December 02, 2022 @09:09AM (#33830554)
I was looking at the svelte-query PRs recently, and I didn't see anything that looked like "trashing".

I agree that if you want to keep the patterns that make React-query so amazing, but apply them in Svelte, you should use idioms that make sense in Svelte. The exact syntax (`useQuery` and friends) isn't the point, and the `use[A-Z].*` naming convention actually communicates that you're hooking into the React lifecycle... which obviously doesn't make sense in Svelte.

Re:Migrating from Vue 2 to Svelte by richeyryan on Friday December 02, 2022 @10:01AM (#33831339)
This could have been a year ago at this stage. It was on r/svelte, if I recall correctly. Svelte doesn't have idioms for reusable reactive logic. The $ sign is used to drive functionality in Svelte, so you can't use it to signify something observable like with RXJS. For Solid, they use createQuery because that is the convention in Solid. For Vue and Svelte, they stick with useQuery. I think the idea is that useX is just a shorthand for "here is some abstracted reactive functionality". Ultimately it has nothing to do with how the reactivity works, it just says, "this function will tie into your reactivity". They could have just called it query, but it seems arbitrary to change the name.
Re:Migrating from Vue 2 to Svelte by kevinak on Friday December 02, 2022 @10:57AM (#33832213)
You can absolutely make reusable reactive logic in Svelte, custom stores work great for this.

The problem with "useX" isn't an anti-react one, it's that "use" is an actual thing in Svelte, it's called an action! https://svelte.dev/docs#template-syntax-element-directives-u... :)

Re:Migrating from Vue 2 to Svelte by swyx on Friday December 02, 2022 @09:24AM (#33830757)
> I find a lot of Svelte users are pretty religious and hysterically anti-React.

yes this does happen too, i do acknowledge that. just making very subjective generalizations based on my exp

Re:Migrating from Vue 2 to Svelte by dhucerbin on Friday December 02, 2022 @10:52AM (#33832131)
I'd consider myself part of the community. I advocated for Svelte and lead two projects in my company, I spoke about Svelte at meet-ups and I did some mentoring around svelte and data visualisation.

And I agree with you. Rich has strong opinions and he likes to stir some discussion. And that's fine, he always responds with nuance and mutual respect. Problem is when community parrots his one liners. If I had a nickel for everytime I got yelled with "vdom is pure overhead!" or "jsx is an abomination, my templates are pure html".

In the end I'm not even sure if it is something specific about Svelte, or just any non-react solution has to bash React loudly.