News for hackers. Stuff that matters.
Re:Ask HN: What tools are you using to quickly build website... by wruza on Tuesday July 02, 2024 @06:16AM (#40855134)
Not sure if this counts, but my toolkit is: tsc -w + vite, tsc -w + tsx and vim + ale. The stack is bootstrap, mithril, express, postgres.

It’s not “quickly”, and I’d like to learn about faster ways too.

Re:Ask HN: What tools are you using to quickly build website... by 1GZ0 on Tuesday July 02, 2024 @07:28AM (#40855569)
Its not too bad. You could take a look at something like "BunJS + HTMX", its pretty killer.
Re:Ask HN: What tools are you using to quickly build website... by fi_investor on Tuesday July 02, 2024 @07:47AM (#40855687)
htmx looks very useful! Can you share your personal experience in using it? Pros and cons?
Re:Ask HN: What tools are you using to quickly build website... by 1GZ0 on Tuesday July 02, 2024 @09:23AM (#40856392)
I haven't used it much. (don't use it for work) But I'll say its different. Very "backend first", so there's a bit of setup required server-side, setting up end-points and such. But not having to manage state or unpack json in the frontend is probably the best thing about HTMX.

You send a request to a server from frontend, the backend responds with html and places it on the page where specified. Its much more intuitive and lower mental load than something like react or vue.

Re:Ask HN: What tools are you using to quickly build website... by wruza on Tuesday July 02, 2024 @12:36PM (#40858242)
I had this thread https://news.ycombinator.com/item?id=40710782

But the thing gp suggested looks much better, at least here: https://github.com/danawoodman/bun-htmx (see src/components, they use react-dom/server renderer to template-render tsx (also note that “tsx” I’m using is not a file format, but `npm i -d tsx`)). I guess I can try that in node too.

That said, I don’t see the “quicker” part here tbh, imagining my mithril code in htmx templating code doesn’t make a big difference, unless I am missing something. It’s the same parametrized html but on server. Not even a glimpse of RAD-like paradigm shift.

I guess htmx looks better if you’re using react but never allowed yourself a thought that it’s a useless esoteric bullshit everyone agrees to out of fear of being ostracized, which htmx removes silently (and it’s server-side). Mithril is just a vdom-based templater with simple autoredraw and doesn’t implement esoteric bs already.

I somewhat agree with gp’s “unpack json” part, although it’s not a big deal with types shared across ends. I just re-new Date’s after fetch and that’s it.