Live data from Hacker News

Write PHP Code Within Next.js Components

github.com

31–40 of 107 posts

Re: Write PHP Code Within Next.js Components

#36
post #16

I think part of what makes these recent gags so funny to me is that it illustrates how perilous mixing RSC with client code feels in practice. Worrying about teammates accidentally exposing environment variables was already bad enough. Debugging is now even more troublesome, and for what? So we can use some XML-like syntax everywhere? React serves a purpose but this doesn't feel like it. All these directives, the loo…

I get what you’re saying, but you can use React without RSC just fine. Next.js might be pushing RSC, but using Vite and normal React is fine. Hell, even the pages directory still works in Next.js and it has no RSC.

I would argue that unless your need SEO there is no reason to reach for Next.js or any other react framework.

The default should be vite and client only. Everything else only serves corporate interests.

Re: Write PHP Code Within Next.js Components

#37
post #13

I hope with enough joking around the Next.js team realizes they've made a horrible mistake. What they should have done was include a convenient RPC framework in Next - not magic code-splitting and magic RPC code-gen built specifically for people that are too lazy to write two files for code ran in completely different environments.

The Next team's core use case is a serverless framework for Vercel. Anyone looking to use it as a long-running server is just a second-class citizen.

If you aren’t deploying to vercel for the duration of the project, use something other than next.js. It has become a vercel only product at this point.

Re: Write PHP Code Within Next.js Components

#38
post #36

Earlier quoted context omitted.

I get what you’re saying, but you can use React without RSC just fine. Next.js might be pushing RSC, but using Vite and normal React is fine. Hell, even the pages directory still works in Next.js and it has no RSC.

I would argue that unless your need SEO there is no reason to reach for Next.js or any other react framework. The default should be vite and client only. Everything else only serves corporate interests.

Very true, but React is extensively used for landing pages and e-commerce where SEO is vital. If you’re using Next for those sort of apps in your company, why not use it for the dashboard? It’s seems like the natural progression instead of running Vite on internal apps and Next on external ones.

Re: Write PHP Code Within Next.js Components

#39
post #20

> I hope I don't have to say this but: If you even in the slightest consider to use this in any application at all you are an absolute madman and and should be locked out of the internet for the rest of your life, I hope you find some other fun activity, maybe gardening or woodwork.

I know. The Next.js part should definitely be removed first. /s

The JS part should be removed first. No sarcasm... :)

Re: Write PHP Code Within Next.js Components

#40
post #36

Earlier quoted context omitted.

I would argue that unless your need SEO there is no reason to reach for Next.js or any other react framework. The default should be vite and client only. Everything else only serves corporate interests.

Very true, but React is extensively used for landing pages and e-commerce where SEO is vital. If you’re using Next for those sort of apps in your company, why not use it for the dashboard? It’s seems like the natural progression instead of running Vite on internal apps and Next on external ones.

Yea I disagree. You’ll be fighting nextjs the entire time. It’s a tool for e-commerce sites. And honestly at this point you’d be better served with Astro.
Post reply on HN