News for hackers. Stuff that matters.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by mzronek on Monday October 14, 2024 @03:49PM (#41841176)
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.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by vasergen on Monday October 14, 2024 @04:08PM (#41841381)
> React is a library

Can a library have compiler?)

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by robertlagrant on Monday October 14, 2024 @04:28PM (#41841594)
That's an optional step for JSX cross-compilation. It's a language plugin; nothing really to do with frameworks or libraries.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by tmtwhn on Monday October 14, 2024 @07:39PM (#41843393)
They're going further than jsx transpilation[1]

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

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by zdragnar on Tuesday October 15, 2024 @11:22AM (#41849546)
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.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by gloosx on Tuesday October 15, 2024 @07:32AM (#41847417)
Javascript has a compiler called Babel, which plays a huge role in modern web development. It is in fact a transcompiler, meaning it doesn't turn your javascript into bytecode, it is just transpiling stuff without changing the level of abstraction.

React Compiler is just a babel plugin for automatic performance improvement, memoization specifically, for never perfectly memoized React code.

Can library have compiler? Well why can't it? For example stdlib has a compiler, because C does.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by flockonus on Monday October 14, 2024 @04:46PM (#41841800)
React started as a library.. at this point it has server side components, and a world of plugins.

As for anything that has patterns of building with, will argue it's a framework.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by math_dandy on Monday October 14, 2024 @05:15PM (#41842111)
React is a FEBEFUIRT - a FrontEnd/BackEnd-Fluid UI RunTime.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by meiraleal on Monday October 14, 2024 @05:35PM (#41842287)
React was a library before hooks. Now it is a framework and decides when your code runs, not you. And now it is a terrible framework with server components.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by sneek_ on Monday October 14, 2024 @07:40PM (#41843397)
I think server components have been very badly marketed. They're totally opt-in, so I don't see how this would make React instantly a terrible framework. I for one think they represent a lot of value.

If you don't use them, then React is quite literally no different to you.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by gloosx on Tuesday October 15, 2024 @07:40AM (#41847475)
Can you please guide me where this heresy is being spread?
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by _heimdall on Monday October 14, 2024 @07:33PM (#41843339)
React hasn't been a library since they added hooks.

Hooks themselves are just a solution to async code, but the implication was that react was no longer a state-based UI rendering library and became a full blown frontend framework.

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by threetonesun on Monday October 14, 2024 @08:25PM (#41843692)
Hard to call something a full blown front end framework when it doesn’t have routing.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by _heimdall on Monday October 14, 2024 @10:15PM (#41844277)
Routing is only important for a single page applications. Frontend frameworks are applicable to normal websites as well, they don't have to be SPAs with routing, caching, etc.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by gloosx on Tuesday October 15, 2024 @07:39AM (#41847473)
Can you please guide me where this heresy is being spread?
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by _heimdall on Tuesday October 15, 2024 @08:50AM (#41848020)
You heard it here first, I'm officially breaking the story wide open.
Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by gloosx on Wednesday October 16, 2024 @02:52AM (#41856279)
From what you posted in this thread, I can tell with confidence you don't know shit about web development

Hooks solution to async code? Hooks make React full blown forntend framework? Routing only important for single page applications? Yellow gorilla bread butter? Chickity dickity web frontend back single page I understand much

Re:PayloadCMS: Open-Source, Fullstack Next.js Framework by cooperadymas on Monday October 14, 2024 @07:58PM (#41843533)
A sword is also just a knife. And a Tesla truck is just an electric go-kart.