Live data from Hacker News

Nuxt.js over Vue.js: when should you use it and why

bornfight.com

71–80 of 80 posts

Re: Nuxt.js over Vue.js: when should you use it and why

#71
post #14

Earlier quoted context omitted.

what makes you say it failed? Flutter is growing strong.

Is there a way around the nested mess in Flutter widgets? I took a stab at a small app but it was basically a new div hell. Besides that however, it was quite neat.

haha idk im just going off of what others say, i dont use it myself

Re: Nuxt.js over Vue.js: when should you use it and why

#72
As others pointed out nuxt can be very restrictive when you're trying to build something that doesn't fit their mould. What I end up using is vanilla vue.js and a cli plugin to statically generate the pages that need to be SEO friendly during build. Best of both worlds.

Re: Nuxt.js over Vue.js: when should you use it and why

#73

There are people over on reddit who say that EVERY project should use nuxt. from the lowly todo app, to huge erp projects... Yet, especially for ERP projects, most of those features are problematic. Like SEO. I don't want a search engine to ever see my content. In fact, my robots.txt says not to index it. SSR is a non starter, since everything would vary based on the user, we're just shifting the rendering back to th…

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

Re: Nuxt.js over Vue.js: when should you use it and why

#74
post #59
post #26

Earlier quoted context omitted.

I'm trying to imagine what browser is so outdated that it struggles to parse 100kb of javascript

It's not the browser, it's the processor that's in most non-iPhones.

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

Re: Nuxt.js over Vue.js: when should you use it and why

#75
post #61
post #17

Earlier quoted context omitted.

It runs just fine for my site, across browsers and OSes.

You're probably getting down-ranked by Google, they use performance as a metric.

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.

Re: Nuxt.js over Vue.js: when should you use it and why

#76

My biggest thing with Nuxt is that only the first page load is server side rendered. Everything else is client side. So doing complex search and re-render is done client side.

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

Re: Nuxt.js over Vue.js: when should you use it and why

#77
post #13

I admit I don't know the space that well, but I find it interesting that you get static site generators for SPA frameworks, and the companies behind them get really significant VC funding. Naively it seems a trivial problem, but I guess that SEO for SPA is not as trivial as I imagine?

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.

Re: Nuxt.js over Vue.js: when should you use it and why

#78
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 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

Re: Nuxt.js over Vue.js: when should you use it and why

#79

Earlier quoted context omitted.

My understanding was that it just added to the existing generated list, I can’t work out how you’d tell it to ignore all your current pages and then manually write them all out?

you can use router-module if you want to do everything yourself ( https://github.com/nuxt-community/router-module )

Ah that’s perfect, I don’t know why I haven’t found it before. Thanks.

Re: Nuxt.js over Vue.js: when should you use it and why

#80
post #61

Earlier quoted context omitted.

You're probably getting down-ranked by Google, they use performance as a metric.

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.

Post reply on HN