Hacker Newsnew | past | comments | ask | show | jobs | submit | kangoo1707's commentslogin

I always use Nuxt by default for new projects, and it's a correct decision every time. People who choose to do Client Side Rendering (SPA) finally struggling on SEO and other tasks.

1. Nuxt can runs in SPA mode just like using Vue CLI. The opposite is not true

2. SEO is the winning feature of Nuxt, no doubt.

3. Real server status code: especially useful for redirections and 404 pages. For example if you do `curl -I /some-page-that-does-not-exist`, you will get back 404 status code, which is critical for sitemaps and uptime tools. (Instead in SPA you always get 200 for all the pages).

4. Pages written in Nuxt seems to display faster, because the HTML is sent immediately. I say "display" here, not necessarily "load" faster.

5. Real Express middleware helps a lot when doing route validations and authorizations. You can also make calls to private API without exposing them on the client side.

6. Can adjust the amount of HTML sent to client by wrapping client-side-only components in a <client-only> component. Which means that on the server you don't need to generate giant HTML for a simple datepicker, and let the browser does that


Why are people slapping Static Site Generators to all the problems?

Imagine you build an e-commerce website that has ten thousands of products, that can be accessed by example.com/products/{product-slug}. Now what is making more sense: 1. Generating ten thousands of .html file for each products in the DB 2. Use routing in Nuxt like this "/products/$productSlug" and query for $productSlug in the database

To me the (2) approach is a clear winner here. And the performance only depends on how fast your API can query a single product from the database, which is pretty fast 99% of the time.


When dealing with large tables with searching + sorting + paginating capabilities, I always use query params and let the API do the heavy lifting


And what is the best solution? Client Side Rendering is worse, because users see a blank page until the script is parsed. 100KB is actually desirable, because it's included Vue and Vuex out of the box.


The best solution is to not have as much JavaScript. Use a smaller framework. Use fewer dependencies. Lazy load things when you can.

The solution is to have a performance budget at the start of your project so things never get so bad.


All browser processes 100KB of scripts just fine. And they process the scripts in the background. The HTML is already parsed and displayed.


Nuxt works fine for all the uses case that I have come across, even for ERP projects. With Nuxt you can have real redirects, real 404 pages, and a well-established project structure. The only hard thing is that server-side error is more difficult to inspect


Phoenix too


still, no proper multithreading, in comparison with Java, C#, Elixir...


Define proper please.


No native support for concurrency operators, no real event loop implementation, lack built-in support for non-blocking IO... I do Elixir regularly and Actor Model is not something PHP developers know


> I do Elixir regularly and Actor Model is not something PHP developers know

/me clutches pearls

What a travesty! I wish, I, a lowly, stupid PHP developer was smart enough to know about the Actor model!

/s


Look into ReactPHP, Swoole and Spatie


Is this just a long way of saying it doesn’t have “async” because threads are a perfectly fine concurrency primitive that you can build event loops on top of.


There is async in PHP


Not being a BEAM language is not unique to PHP or it's relevant peer languages.


"No true Scotsman," I'd wager.


no PHP framework is similar to the thing that NextJS/Reactis doing. The output is the same (well, isn’t the point of web framework is to spit out HTML?) but the methodology is totally different.


And about 100x more complex and fragile.


Not at all. I have worked with both for a long time and I can clearly see the differences. They are used for different purposes. The people comparing any PHP frameworks to NextJS have not been very experienced with frontend development, IMO.


Comparing strictly SSR yes. Though if one needs a lot of dynamic client side behavior a JS framework can be easier to reason about.

Lately modern PHP frameworks have so a lot of dependencies too. So both stacks are getting fatter as their capabilities grow.


Not necessarily. I recently rewrote an old web application written in php and jquery with django, react and typescript. The new application has roughly the same LoC count while having more features and better interactivity.


Please take a look at my CV. I'm a fullstack developer (Elixir, Node, PHP, React, Vue, Flutter...)

https://www.dropbox.com/s/kqkm467cb9ay65f/Lam%20Huynh.pdf?dl...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: