←back to thread

214 points stefankuehnel | 4 comments | | HN request time: 0s | source
Show context
attah_ ◴[] No.41840608[source]
So let me get this straight... PayloadCMS is a framework, for Next.js which is a framework for the React framework.

Yo dawg, i heard you like frameworks!

replies(4): >>41840780 #>>41840997 #>>41841176 #>>41842441 #
mzronek ◴[] No.41841176[source]
A common misconception. React is a library.

These are examples for React frameworks: https://react.dev/learn/start-a-new-react-project#production...

Next.js is a React framework.

If Payload is a framework or not is debatable. I think it's more like a data layer around a database for a any js app and an Admin Panel (that uses Next.js now). It might be called a framework for your own Headless CMS, because it is code first. So you basically code the panel and the data structure yourself.

replies(5): >>41841381 #>>41841800 #>>41842287 #>>41843339 #>>41843533 #
vasergen ◴[] No.41841381[source]
> React is a library

Can a library have compiler?)

replies(2): >>41841594 #>>41847417 #
1. robertlagrant ◴[] No.41841594[source]
That's an optional step for JSX cross-compilation. It's a language plugin; nothing really to do with frameworks or libraries.
replies(2): >>41842274 #>>41843393 #
2. ◴[] No.41842274[source]
3. tmtwhn ◴[] No.41843393[source]
They're going further than jsx transpilation[1]

[1] https://react.dev/learn/react-compiler

replies(1): >>41849546 #
4. zdragnar ◴[] No.41849546[source]
Nothing in that is actually doing what a compiler does above and beyond what babel, swc and esbuild are capable of.

What they've added is wrapping your code in more memoization functions, basically. All stuff that doesn't fundamentally transform the code, aside from inserting more `useMemo` and the like.

The JSX macro - which is itself already optional but everyone uses it - is just that, a handy macro with implementations available in every common bundler and transpiler out there.