Write PHP Code Within Next.js Components
71–80 of 107 posts
Re: Write PHP Code Within Next.js Components
#72Any way I can remove the Next.js part? That would be perfect! Haha.
Yes it's called Livewire Volt. https://livewire.laravel.com/docs/volt
Re: Write PHP Code Within Next.js Components
#73Earlier quoted context omitted.
Pretty much the same as dealing with traditional API versioning. You can version the functions themselves, or put a version in they payload and return an error telling the user to refresh.
How do you version the functions? How does the server determine which function to call? Does it use the name of the function, or its source code file, or something else? If I rename the old version and call it `actionOld` while the new version is `action` will it know how to call the old one, or do I need to do the opposite (call it `actionNew`)? What if I move the old one to a different file?
Re: Write PHP Code Within Next.js Components
#74Re: Write PHP Code Within Next.js Components
#75Earlier quoted context omitted.
What do you think is fundamentally bad about PHP exactly? It powers a large percentage of the web and does it quite well.
I installed wp with a theme a few years ago and the box was turned into a zombie file dump. Modern php is still not there.
Re: Write PHP Code Within Next.js Components
#76Earlier quoted context omitted.
> Not sure why it's being compared to PHP probably just because PHP is now recognized widely as fundamentally bad design. Its just that many people who came late to the party never really knew why, so they think to themselves, no this is actually great "no API boilerplate, fetch, tRPC anything.. You just define a function and call it, very nice.". And so the cycle continues...
I'm still yet to see something as productive as PHP for web apps, ecommerce etc. You ask for a customised e-commerce shop with many standard features out of the box. How long will the Java or Rust engineers quote you? A year? Php? A week?
It's just all so frustrating, and I'm not even refactoring old code! It's two years old and already so brittle.
I feel like you need to have extreme patience and foresight to correctly build maintainable JS apps. Libraries people recommend today will die out very quickly. It never really felt like this in python or ruby, but I could be having a selective memory.
Re: Write PHP Code Within Next.js Components
#77Earlier quoted context omitted.
I'm still yet to see something as productive as PHP for web apps, ecommerce etc. You ask for a customised e-commerce shop with many standard features out of the box. How long will the Java or Rust engineers quote you? A year? Php? A week?
I've been working exclusively in javascript/node since 2015 and nothing in the JS ecosystem has ever felt as productive as rails or django or laravel. Maybe it's rose tinted glasses when working on those select few projects but compared to the node ecosystem I'm bashing my head against the wall updating libraries that provide no migration docs seeing alternative solutions saying "we don't support X, sorry." It's just…
Re: Write PHP Code Within Next.js Components
#78> 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.
Re: Write PHP Code Within Next.js Components
#79It's funny, but all you see here and on Twitter are cheap shot one liners, many of these people have never even used Next.js. I find server actions combined with RSC to be incredibly useful and powerful. Easily define and call a type safe function from client to server with zero overhead. No API boilerplate, fetch, tRPC anything.. You just define a function and call it, very nice. Type safety, code completion, refact…
Re: Write PHP Code Within Next.js Components
#80Can confirm that it works with shell_exec as well.