News for hackers. Stuff that matters.
Re:Why Svelte is our choice for a large web project by dzonga on Tuesday March 10, 2020 @01:55PM (#22537759)
I love svelte. but now resorting to server rendered html pages with sprinkles of JS. shit I work on and I have noticed in the world doesn't really need frameworks like react, svelte, vue etc.
Re:Why Svelte is our choice for a large web project by snapetom on Tuesday March 10, 2020 @02:10PM (#22537916)
Same. I haven't done frontend work for a job for about a decade, but kept up to date with things like Angular/Vue/React. I was recently vountold by my wife to create a reunion site for her class. I looked up "barebones front end frameworks." Anything that began the "Getting Started" page with "npm install" I noped out of there.

I ended up with Skeleton/jQuery for the front end and PHP Slim for the backend. This is a 5 page, 2 forms, site targeted at 100 people. There's no need to SPA this, npm that.

Re:Why Svelte is our choice for a large web project by smt88 on Tuesday March 10, 2020 @02:27PM (#22538066)
You seem to be refuting a straw-man argument here. Why would a hobby site provide a counter example for people talking about work they do for their employers?

No rational person would advocate using Svelte or React for a static, one-off, informational site to be maintained by a single person.

In fact, you didn't even need jQuery at all. Vanilla JS works across browsers in a way that it didn't when you learned web coding 10 years ago.

Where frameworks become useful is for large projects that many people work on over a long period of time. Turnover is an issue for non-standardized code, as is poorly organized code.

And none of that even touches on security, which absolutely requires libraries, packages, and many of the other benefits of reusing the ecosystem that you seem to eschew.

Re:Why Svelte is our choice for a large web project by snapetom on Tuesday March 10, 2020 @03:19PM (#22538615)
> No rational person would advocate using Svelte or React for a static, one-off, informational site to be maintained by a single person.

This is where we disagree, and I think that's the problem. In my use case, I just wanted an HTML template file with at most a few CSS files. There's a dearth of those frameworks/templates compared to bigger packages.

Re:Why Svelte is our choice for a large web project by ComputerGuru on Tuesday March 10, 2020 @02:36PM (#22538153)
Someone on HN recommended it to me before, so I’ll just pass this along: look at intercooler JS for making individual “live widgets” on a well-designed graceful degradation site like you describe.
Re:Why Svelte is our choice for a large web project by sam_goody on Wednesday March 11, 2020 @05:34AM (#22544363)
Also Alpine.js, which has got quite a community behind it (somehow promoted by Laravel, IIRC). It is less than intercooler, but provides timesavers for simple sites like described. A compromise between a framework and none.
Re:Why Svelte is our choice for a large web project by ComputerGuru on Wednesday March 11, 2020 @02:49PM (#22548988)
No, that’s not along the lines of what I’m suggesting at all.
Re:Why Svelte is our choice for a large web project by snapetom on Tuesday March 10, 2020 @03:19PM (#22538625)
Haven't heard of that one. Thanks!
Re:Why Svelte is our choice for a large web project by 1_player on Tuesday March 10, 2020 @10:52PM (#22542505)
Also unpoly, which I prefer to Intercooler and it’s my favourite unknown library since jQuery was first released. It’s an incredible time saver.
Re:Why Svelte is our choice for a large web project by ComputerGuru on Wednesday March 11, 2020 @02:50PM (#22548994)
Thanks for pointing me towards that. Looks like a very nice “graceful ajaxification” library.
Re:Why Svelte is our choice for a large web project by untog on Tuesday March 10, 2020 @02:57PM (#22538405)
> Anything that began the "Getting Started" page with "npm install" I noped out of there.

> I ended up with Skeleton/jQuery for the front end

So rather than install a dependency via a package manager you installed it manually. Okay.

Re:Why Svelte is our choice for a large web project by snapetom on Tuesday March 10, 2020 @03:14PM (#22538568)
Calling Skelton a dependency is ludicrous. It's just an HTML file with a CSS file. Look at every other "lightweight CSS framework" - Specture, Mustard UI, etc. They all have dozens and dozens of files where you need a package manager.

The whole point was that it's simple enough that I don't have to deal with a package manager, and a lot of projects don't need to.

Re:Why Svelte is our choice for a large web project by untog on Tuesday March 10, 2020 @03:19PM (#22538617)
The whole point is that you choose an arbitrary thing to treat as a dealbreaker that doesn't really make a whole lot of sense. "npm install jquery" would have given you the exact same result you have, except it would have violated your dealbreaker. It just doesn't seem particularly logical to me.

To be honest, if you're going for "as simple as possible" there's no reason to use jQuery at all these days, it's a waste. Modern browsers have perfectly capable APIs!

Re:Why Svelte is our choice for a large web project by overtowed on Tuesday March 10, 2020 @02:52PM (#22538336)
Svelte can do server-rendered and static page generation with the near-zero overhead of string concatenation, and with it you gain the component model. Part of the magic of compilers is that you can get most of the best of both worlds. Sapper provides both of these use cases.
Re:Why Svelte is our choice for a large web project by dzonga on Tuesday March 10, 2020 @08:33PM (#22541654)
I worked as a fronted dev, so I know this problem very well. Server rendered pages, I don't mean Sapper. But the ol' rails erb, or flask jinja templates type of rendering.
Re:Why Svelte is our choice for a large web project by viklove on Tuesday March 10, 2020 @04:16PM (#22539214)
Yeah if you're building a relatively simple webpage, a frontend framework really isn't needed.