Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by password54321 on Thursday June 15, 2023 @02:14PM
(#36344455)
A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?
[ Parent
| on HN ]
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by satvikpendem on Thursday June 15, 2023 @02:21PM
(#36344545)
That's all on the backend so it doesn't really matter to me as long as no JS is sent on the frontend. For the benefits NextJS gives me, like TypeScript, I'm fine with that.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by e111077 on Thursday June 15, 2023 @03:29PM
(#36345331)
In that case why not just SSR lit on the backend and send that? It sounds like an unfair criticism otherwise
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by robertoandred on Thursday June 15, 2023 @04:27PM
(#36346042)
It's easy to add interactivity to a NextJS site when you need it.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by e111077 on Thursday June 15, 2023 @06:06PM
(#36347296)
Likewise with Lit, but that is besides the criticism that he was making earlier
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by satvikpendem on Thursday June 15, 2023 @06:25PM
(#36347519)
I have the full React framework and ecosystem if I so choose to use it. For example, I could use something like react-three-fiber to add 3D or Framer Motion to add animations yet fall back to not having those when JS is disabled. Sure you could do the same in Lit but those libraries aren't present or as robust as in React.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by MatthiasPortzel on Friday June 16, 2023 @12:23AM
(#36351208)
NextJS sends all JS to the frontend even if it's static and server rendered. It renders once on the server, sends a React+JS bundle to the client, and re-renders the whole page on the client (which is exactly the same). As far as I could tell, there's no mechanism for Next.JS to say "this isn't dynamic" and send only HTML content. If there's a setting I missed, feel free to let me know.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by lioeters on Friday June 16, 2023 @02:03AM
(#36352081)
> It renders once on the server, sends a React+JS bundle to the client, and re-renders the whole page on the client (which is exactly the same)
The new paradigm in Next.js is to have "server components" by default, which only render static HTML on the server side; and opt-in to "client components", which render on both server and client.
> With Server Components, the initial page load is faster, and the client-side JavaScript bundle size is reduced. The base client-side runtime is cacheable and predictable in size, and does not increase as your application grows. Additional JavaScript is only added as client-side interactivity is used in your application through Client Components.
https://nextjs.org/docs/getting-started/react-essentials#ser...
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by robertoandred on Thursday June 15, 2023 @04:22PM
(#36345977)
Next doesn't ship 150MB of JavaScript to browsers...
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by meowtimemania on Thursday June 15, 2023 @05:17PM
(#36346612)
An installation of chrome is roughly 1,500mb. You realize that's mostly code that all needs to work right?
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by password54321 on Thursday June 15, 2023 @05:54PM
(#36347144)
Yeah and an operating system has 10s of millions of lines of code. Does that mean everything else comes without a cost? Also point here is you got options for a much lighter framework, which you bluntly missed.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by DangitBobby on Thursday June 15, 2023 @10:34PM
(#36350337)
They probably didn't miss it, more likely haven't been impacted by the sheer number of dependencies in Next js. I know I haven't.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by silentprog on Thursday June 15, 2023 @05:57PM
(#36347193)
chrome and nextjs do not share a use case. Whereas chrome is a web browser nextjs is a framework for building web applications.
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by wg0 on Thursday June 15, 2023 @06:03PM
(#36347262)
> A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?
Really??
Re:UnsuckJS: Progressively enhance HTML with lightweight Jav...
by DangitBobby on Thursday June 15, 2023 @10:35PM
(#36350348)
And work it does!