News for hackers. Stuff that matters.
Re:Ask HN: What is the best language/framework for getting t... by hunkins on Saturday May 14, 2022 @01:27PM (#31380248)
NextJS is my recommendation. The React ecosystem is incredible, and NextJS brings it to the next level.

Also the documentation is fantastic, you should be up and running in 5 minutes.

Pair it with a good IDE (i.e. WebStorm) and the websites write themselves.

Re:Ask HN: What is the best language/framework for getting t... by webmaven on Saturday May 14, 2022 @01:59PM (#31380570)
React fails the main requirements: “Server rendered web pages, no fancy client side js, just good old websites.”
Re:Ask HN: What is the best language/framework for getting t... by rantallion on Saturday May 14, 2022 @04:32PM (#31382050)
"By default, Next.js pre-renders every page. This means that Next.js generates HTML for each page in advance, instead of having it all done by client-side JavaScript. Pre-rendering can result in better performance and SEO."
Re:Ask HN: What is the best language/framework for getting t... by webmaven on Sunday May 15, 2022 @05:37PM (#31391391)
Good to know. Thanks for correcting my misapprehension!
Re:Ask HN: What is the best language/framework for getting t... by bluefirebrand on Saturday May 14, 2022 @05:44PM (#31382880)
React JSX is hands down the best templating engine for Server Rendered Pages, imo.

Doesn't have to be a SPA or include a bunch of fancy client side JS or anything.

Re:Ask HN: What is the best language/framework for getting t... by webmaven on Sunday May 15, 2022 @05:37PM (#31391386)
Cool, good to know. What makes JSX such a good templating engine?
Re:Ask HN: What is the best language/framework for getting t... by bluefirebrand on Monday May 16, 2022 @02:19PM (#31401356)
It's personal preference of course, but imo JSX is just a very clean way of writing frontends. Easy composability, easy data bindings which don't have to be two-way if you don't want.

My sense with many templating engines is they are trying to crowbar programming functionality into HTML and always comes across clunky. It's usually a separate language from your server code entirely. Inline If statements and For Loops embedded in your HTML. And composing a template with a subtemplate is often clumsy.

With JSX you just write your normal JavaScript or Typescript and output JSX. Then the JSX is turned into HTML and returned to the browser.

But of course I'm not familiar with every HTML templating library out there, but I've used a few and I really love working with JSX.

Re:Ask HN: What is the best language/framework for getting t... by webmaven on Tuesday May 17, 2022 @03:05AM (#31406948)
My own favorite syntax(es) are TAL, TALES, and METAL (Template Attribute Language, TAL Expression Syntax, and Macro Expansion TAL). There are many implementations in various languages. The OG implementation was in Python as part of the Zope:

https://pagetemplates.readthedocs.io/en/latest/tal.html

These days I reach for Chameleon, another Python implementation:

https://chameleon.readthedocs.io/

I'm aware of at least five implementations for JS: template-tal, jstal, Distal, DomTal, ZPT-JS.

Re:Ask HN: What is the best language/framework for getting t... by bluefirebrand on Tuesday May 17, 2022 @10:53AM (#31411594)
Cool, thanks for the recommendations! I don't write a lot of python anymore but I'll check these out.
Re:Ask HN: What is the best language/framework for getting t... by cercatrova on Saturday May 14, 2022 @05:50PM (#31382939)
I guess you've never used NextJS because it basically uses JS as a server side templating language, and since pages are by default server side rendered, there's no client side JS (unless you want to add it).

You can go to a server side NextJS rendered page that worked even when JS is disabled, that uses only HTML and CSS and no JS whatsoever.

Re:Ask HN: What is the best language/framework for getting t... by webmaven on Sunday May 15, 2022 @05:35PM (#31391380)
You're right. As my other comment makes explicit, my wheelhouse is mostly Python. The last time I really dug into JS frameworks was about a decade ago, and was largely jQuery, D3, and friends.

Thanks for bringing to my attention something I didn't know!

Re:Ask HN: What is the best language/framework for getting t... by DimmieMan on Saturday May 14, 2022 @09:02PM (#31384278)
People are getting caught up on ‘no fancy client side JS’ rather than ‘getting stuff done’.

Next will let you use SSR to avoid all those OAuth & async loading headaches but also leverage more complicated components and when you do, handles all the bundling and tree shaking for you.

Re:Ask HN: What is the best language/framework for getting t... by yogini on Sunday May 15, 2022 @02:54AM (#31385752)
Recently moved my app from ReactJS to NextJS to support SSR. The community support and the amount of resources it has is incredible.