Earlier quoted context omitted.
I guess my main gripes are not with the libraries for state management themselves, but how managing rendering after state mutations occur. Pinia and Vue/Nuxt just do this effortlessly. Having to deal with hooks and useEffect in React is just a pain... in my opinion.
You shouldn't use useEffect just to bring state mutations from the store into the component or to calculate "view model" from your state. Have a look at the new react docs. https://react.dev/learn/you-might-not-need-an-effect
Thoughts on Svelte
131–140 of 194 posts
Re: Thoughts on Svelte
#132Earlier quoted context omitted.
Is xstate something like redux or mobx?
it's like a much more structured, and observable version of redux. observable in the sense that not only can you tell what has happened, you can also tell (and visualise) what can happen next
Re: Thoughts on Svelte
#133I used Vue in the past and decided to use Svelte early this year, I do not need SEO or anything SSR, just the original SPA with CSR. then I found out Sveltekit is really a SSR-first design, and Svelte itself has no client side routing etc. While Vercel sells Sveltekit(and Next.js) to be CSR ready, I don't buy it, I don't need the complexity of SSR in the code when I just need a clean CSR, however you paint the SSR-is…
This is a pretty bizarre comment, given svelte isn’t intended to be a web framework and sveltekit makes it extremely simple to do client side rendering.
If Svelte provides a built-in client side router, and do not try to point everyone who wants to use Svelte to Sveltekit, I may reconsider, for now, Svelte is no longer in my projects.
Re: Thoughts on Svelte
#134Earlier quoted context omitted.
> what if you only want to perform a side effect when a particular value changes? https://react.dev/reference/react/useEffect That is literally what useEffect is for! Describe your side effect, provide a list of values that you want the hook to watch for when they change. `useEffect(someEffect, [value1, value2, value3])` > the very natural, and often inevitable, concept of side effects React uses a functional program…
> That is literally what useEffect is for! No, sorry; for useEffect to fire, a prop or a state needs to change; which means that the component is going to re-render. My point is that sometimes we want to observe properties passed to the component for side-effect purposes without re-rendering the component. > Functional programmers believe in minimizing side effects. In order to do something — anything — in the real w…
Re: Thoughts on Svelte
#135I switched my game's UI from Vue2 to Svelte maybe a year ago, and I agree with almost all of the article. One thing I think the author overlooks: the appeal of Svelte's built-in animations and transitions is that they work correctly when the element's lifecycle is being managed by Svelte. E.g. with code like this: {#if showFoo} Foo! {/if} When `showFoo` changes to false, Svelte will first play a flyout transition and…
Re: Thoughts on Svelte
#136Earlier quoted context omitted.
You shouldn't use useEffect just to bring state mutations from the store into the component or to calculate "view model" from your state. Have a look at the new react docs. https://react.dev/learn/you-might-not-need-an-effect
But then again, you might need an effect. The behind the scenes (or behind the hooks) complexity that react adds in order to the make DOM thing work then makes it difficult when you do need an effect. Things like WebRTC or sockets or some such. useRef? useState? I have found this to be extremely difficult. If someone knows a good resource for doing things like this in React (and not a one page file, but with multiple…
Re: Thoughts on Svelte
#137> I'd use it again for personal projects, maybe not for large company projects if I was the architect. Questions about large projects always arise when talking about Svelte. Did you / would you use it and why not? I would certainly NOT suggest using Svelte on enterprise projects. Why not? Because other people don’t do it, and that means that it is very likely that there are no (not many anyway ) experienced Svelte de…
When talking about other frameworks (sorry, "libraries"), React folks should really avoid throwing stones from their glass house.
I'm not fan of Angular by any means, but I totally respect how opinionated it is and how that translates out to development teams in the wild.
Re: Thoughts on Svelte
#138Re: Thoughts on Svelte
#139> I'd use it again for personal projects, maybe not for large company projects if I was the architect. Questions about large projects always arise when talking about Svelte. Did you / would you use it and why not? I would certainly NOT suggest using Svelte on enterprise projects. Why not? Because other people don’t do it, and that means that it is very likely that there are no (not many anyway ) experienced Svelte de…
> React and Angular are safe bets in THAT space. But they weren't always. And a lot of people that 'know' React don't feel entirety comfortable using React because of complexity - ever seen someone want to know how to store a variable and watched the life drain out their eyes as they read a Dan Abramov essay on what true reactivity means?
https://legacy.reactjs.org/docs/design-principles.html#sched...
Re: Thoughts on Svelte
#140Earlier quoted context omitted.
We had the same problem. Svelte would have been perfect if it only had a true SPA router. SvelteKit is too complicated for a simple SPA.
I used https://github.com/EmilTholin/svelte-routing with great success, though it looks like the maintainer has recently stopped maintaining it, and recommending sveltekit. Still, I'd give try, it looks like people are still using it, and perhaps someone else will pick up the burden of maintenance, since there's clearly a ton of demand: https://github.com/EmilTholin/svelte-routing/issues/236
but it's not official, and Svelte project seems careless for client routing, instead it tries to convince everyone use its SSR-first kit, that "can do CSR too", which means you have to carry the whole SSR code base and its documentation into your CSR project totally unnecessarily.
I get it Vercel needs SSR for its business, I don't get it why it keeps selling everyone that "my SSR-first framework is great for CSR SPA too", it is NOT, not at all.