News for hackers. Stuff that matters.
Re:Alpine.js by flanbiscuit on Friday January 13, 2023 @10:09AM (#34368748)
+1 for Preact. And its overall bundle size is smaller. I'd also recommend Svelte as well.

38.2kB Minified, 13.5kB Minified + Gzipped, https://bundlephobia.com/package/[email protected]

10.4kB Minified, 4kB Minified + Gzipped, https://bundlephobia.com/package/[email protected]

Re:Alpine.js by ElFitz on Friday January 13, 2023 @01:56PM (#34372225)
It’s going to sound like a trope, but having discovered Svelte yesterday, I don’t understand how I ever could see React as "fine" anymore.

I’m just waiting for the other shoe to drop. It can’t just be that simple, can it? There has to be a catch.

Re:Alpine.js by jefozabuss on Friday January 13, 2023 @02:37PM (#34372778)
I had the same feeling with Vue2-3 a while ago, I'd say Svelte is relatively similar in feelgood as both eliminate a lot of annoyances to create "leaner" components compared to React.
Re:Alpine.js by zoover2020 on Friday January 13, 2023 @02:20PM (#34372559)
Out of curiosity, and I'm asking this as a curious React dev, what made you change your mind about it?
Re:Alpine.js by ElFitz on Monday January 16, 2023 @06:01PM (#34406692)
So far, everything I’ve had to type in it was code specific to what I was doing. And that feels nice.

The extra boilerplate that doesn’t bring any value to me, as a dev, when needing to update values at runtime. I find two-way binding to just be simpler.

Same thing for the components and their props.

But I also get why some wouldn’t appreciate having things getting "automagically" done for them.

Re:Alpine.js by tjrDL6MjB2Zwwa on Friday January 13, 2023 @03:12PM (#34373235)
Funnily enough, I've avoided react/angular/vue as much as possible specifically because I've _always_ felt it was fundamentally the wrong approach. When I first discovered svelte my reaction was "thank god someone else sees it too".

Over the years I've moved further and further from the web as a result of that belief. I still do web work when needed and as a result I'm familiar with vue and angular but I actively try to avoid knowing any more about them than I absolutely need to for accomplishing the goal.

Re:Alpine.js by ElFitz on Monday January 16, 2023 @06:17PM (#34406862)
Coming from iOS, with their Massive ViewControllers, and the occasional (usually half-baked) MVVM, it didn’t seem that bad at first.

On the contrary; components! Finally reusable pieces of UI! Try doing that when everyone on a team is hell-bent on their One Storyboard to Rule Them Al. Even if you did, @IBDesignable (used to preview components in Storyboards) would just crash anyway.

Instantaneous reloading! Even when it takes a bit of time, it takes less than 3 minutes. Pretty much instantaneous when coming from Xcode.

So, yes, React too was a pleasant surprise at first. The kind you get when you take of shoes that are just a tad too small.

Re:Alpine.js by crucialfelix on Friday January 13, 2023 @03:34PM (#34373517)
The lack of libraries to work at a higher level, with more powerful UI components.

At the moment it's really just Material. (And that looks a bit messy on the inside)

We need a chakra or radix or?

Re:Alpine.js by cageface on Friday January 13, 2023 @04:31PM (#34374166)
I've been using daisyui + svelte and I'm pretty happy with it so far. It may not be as rich as some of the react UI libraries but the basics are all there.

https://daisyui.com/

Re:Alpine.js by crucialfelix on Saturday January 14, 2023 @03:00AM (#34378247)
That looks promising, and not stuck to a single tech (svelte, react).

So it's a tailwind plugin that uses apply to create new css classes for components.

Re:Alpine.js by cageface on Saturday January 14, 2023 @04:16AM (#34378689)
Yeah the framework independence is one thing that drew me to it.
Re:Alpine.js by satvikpendem on Friday January 13, 2023 @05:40PM (#34374905)
You couldn't pay me to write in another HTML template language like in Svelte or Vue.
Re:Alpine.js by heatmiser on Friday January 13, 2023 @06:01PM (#34375116)
Over Preact? I'm a little confused by your comment.
Re:Alpine.js by satvikpendem on Friday January 13, 2023 @06:06PM (#34375161)
Not sure what part is confusing, Svelte and Vue have their own template languages inside HTML, I don't want to write another `v-for` or a `#if :else` instead of JS/TS.
Re:Alpine.js by graftak on Saturday January 14, 2023 @03:48AM (#34378532)
Jsx is just js with a thin layer of sugar.