News for hackers. Stuff that matters.
Re:HTMx by The_Colonel on Friday May 26, 2023 @01:19AM (#36080278)
There's actually no need for that anymore. JavaScript as is supported right now in the latest Chrome, Firefox and Safari is already pretty good. You can get quite far without any backend tooling these days.

The only thing which I believe is still needed is a bundler when your project grows to a certain size. Fetching a complex graph of thousands of files will likely never be fast.

Re:HTMx by noduerme on Friday May 26, 2023 @01:35AM (#36080388)
Even bundlers can be pretty stupid and simple. I still just use r.js for even large apps. Webpack isn't hard to set up, either. But my frontend code has almost no dependencies... I refuse to deal with React, Angular, etc etc. I have a very nice, simple component-building / screen scaffolding system that's about 1000 LOC. You extend the component and load up some HTML and just work with it directly in JS when you want to update data, resize it, etc. There's no need for all these frameworks that try to plant logic back into HTML. I love having the HTML templates pure and the logic unbound from them.
Re:HTMx by number6 on Friday May 26, 2023 @01:27AM (#36080332)
Do you still use gulp or is it webpack nowadays?
Re:HTMx by arcanemachiner on Friday May 26, 2023 @01:41AM (#36080424)
It's JavaScript. Everyone is moving on to Turbopack. Or Vite. Or ESBuild. Or Bun.
Re:HTMx by sroussey on Friday May 26, 2023 @02:09AM (#36080621)
I definitely like the batteries included and speed of bun.
Re:HTMx by arcanemachiner on Friday May 26, 2023 @04:58AM (#36081729)
Please don't tempt me.
Re:HTMx by brabel on Friday May 26, 2023 @01:47AM (#36080467)
You're outdated. Everyone is using Parcel now.
Re:HTMx by zelphirkalt on Friday May 26, 2023 @02:14AM (#36080656)
Funny, how even the sibling comment states something different. Maybe there are a lot of bundler bubbles in the JS world?
Re:HTMx by brabel on Friday May 26, 2023 @11:17AM (#36085304)
sorry, I said that 9 hours ago... now we're using Bun actually :D
Re:HTMx by dmix on Friday May 26, 2023 @01:47AM (#36080468)
Gulp is extremely out of date these days.

Using webpack resulted in some of the most painful experiences of supporting serious production software in my career.

The progress and maturity of JS tooling/DX as a result of stuff like esbuild and Vite, or Typescript more generally, can not he understated.

For people not doing frontend it can seem like a neverending series of new stuff but there is a very rational and tangible level of progress being made. Especially for serious JS devs not jumping on hype trains.

I don't miss the days of gulp and webpack at all and I don't blame anyone for hating on JS if they experienced using them professionally.

Re:HTMx by theK on Friday May 26, 2023 @02:05AM (#36080600)
> Using webpack resulted in some of the most painful experiences of supporting serious production software in my career.

I never invested too much time in understanding webpack but it does feel like fighting it a lot of the time when I want to change something in my personal projects.

Care to share some anecdotes of those painful experiences?

Re:HTMx by number6 on Friday May 26, 2023 @01:57AM (#36080536)
Gulp / Babel and then transition to webpack was my introduction to JS.

Now Vite seems to be all the rage? But is it a bundler?

Wepack seems to be very hard to configure. Looks like nginx config vs caddy config.

Re:HTMx by drkstr on Saturday May 27, 2023 @07:15PM (#36099376)
Tools such as babel, webpack, esbuild, postcss, etc. are now considered a bit low-level, and usually do not need to be set up manually these days.

Rather, one would opt for something like vite, the spiritual successor to react-scripts, that bundles all of these tools together with some good defaults/plugins, a means to configure them, and usually also some kind of dev server with hot module reloading, for a complete developer experience using your preferred toolchain.

Check out 'parcel' for something pretty modern, universal, and low effort, IMHO.

Re:HTMx by theK on Friday May 26, 2023 @02:00AM (#36080557)
> The only thing which I believe is still needed is a bundler

And a type system... And maybe a styling system... Oh and let's have some nice Rx data flows!

But, jokes aside, even if you go that Route you still end up with a complex npm project that involves dozens of libraries.

I've been at that point every year since starting doing npm spas in 2014ish (mostly as side projects, my work is typically more serverside). At some point I just decided that the upkeep wasn't worth it any more as you create the same stack every year but with wildly different libs. For me the solution was to switch to an elm+sass+webpack boilerplate that hasn't changed since 2018 or there abouts.