Live data from Hacker News

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

bornfight.com

21–30 of 80 posts

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

#23

So the point is to improve SEO of Vue apps Perhaps useful to some sites. Assuming Google has issues with Vue. Not useful for someone doing content behind a sign-in that isn’t going to ever be SEOed anyway?

I've found the dev experience with nuxt to be more enjoyable overall than it is with vue-cli. The main reason for that I would say is that you don't have to bother with routes and the generator can set up Tailwind (or other CSS frameworks/tools)

Generally, it feels like it strikes a good balance between being fully configurable boilerplate and opinionated framework.

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

#24
I've used Nuxt.js when I started rewriting a membership site from WordPress to Vue.js. But at that time, the routing options were limited so I opted for a hand crafted Vue.js + server side rendering setup. Maybe today, I would try out Nuxt.js again. Or maybe not, the drawbacks are another layer of abstraction on top of Vue.js. That being said, their community is great and the development is very active. When I did a project in React, and tried Next.js, I expected to find much more info and plugins for this combination, but found this to not be the case.

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

#25
I'm pretty happy with Nuxt. I built a project with a custom SSR server based on Vue's guide (https://ssr.vuejs.org/), and maintaining it/tweaking it wasn't too bad, but moving all that complexity to Nuxt was nice. If you'd like to see a realistic codebase, warts and all, it's here: https://github.com/thomasboyt/jam-buds/tree/master/app (powers the jambuds.club frontend).

They do have a kind of weird plugin/module system that I worry is an overly complicated layer of abstraction - basically, stuff that would normally be manually hooked up in your server or client entry point script now gets called automatically by Nuxt at various points. Still, it is useful for setting up things like authentication (e.g. parse cookies on server and set auth headers in Axios).

They're also still iterating on the public API, though they've been pretty careful to deprecate without breaking things. Like, the fetch() hook that used to be used to load data at a page level (e.g. "before transitioning to this route, load this set of data") was totally overhauled to now be "load data for this component," with no "pre-transition await" available anymore (https://nuxtjs.org/blog/understanding-how-fetch-works-in-nux...). This is a good change, but an example of the complex problems that come up in these SSR frameworks, and why they end up being a lot more complex than just simple wrappers around the ecosystem. You really have to buy in when you use a framework like this, more than just buying into Vue itself.

I did see that they just raised a seed round (https://nuxtjs.org/blog/seed-round), which is surprising to me. I don't see a lot in that announcement about how they're going to make money, which is a bit scary. Over in React-land, of course, Next.js is nominally owned by Vercel (formerly Zeit), which is also venture-backed, but Next is related to their primary revenue stream while not being at all the main focus of the company, which is probably the right spot for this sort of thing.

Moving to Vue 3 will be a problem for Nuxt, I think, because of the abstractions they've built on top of Vue.

(also, glad this post came up because while double-checking to see how big Nuxt is in my app, I realized I was failing to gzip my client assets because I misconfigured Caddy, gah!)

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

#26
post #19
post #5

Earlier quoted context omitted.

Depending on what you're building, I don't find 100k to be that much .

It's not only filesize it's also what the browser must parse. Parsing huge files is not a great experience on mobile.

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

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

#27

So the point is to improve SEO of Vue apps Perhaps useful to some sites. Assuming Google has issues with Vue. Not useful for someone doing content behind a sign-in that isn’t going to ever be SEOed anyway?

> So the point is to improve SEO of Vue apps

There are other points in favor of doing SSR + hydration besides SEO:

1) Reducing the amount of JS you are sending to the client.

2) Not making a SPA and keep the native functionality of back/forward behavior (scroll behavior, cached pages, forms are filled when going back).

3) Simplifying development. You don't need to manage central state anymore as you're dealing with one page at a time. You might not need an API as you're rendering the page from the server. Etc.

I've been making SPAs for years and for my current project I'm doing SSR + hydration (not using Vue) and loving it.

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

#28
post #5
post #2

Warning that Nuxt.js is almost 100k out of the box, making it unsuitable for mobile usage.

Depending on what you're building, I don't find 100k to be that much .

For low end android devices on a network in rural areas, that's a lot.

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

#29

Oh good, another .js. Throw it in the pile. The quagmire of subtly different JavaScript frameworks is definitely the leading reason I avoid front end work like the plague.

If you just said the first two sentences and we could have inferred that you don't work in frontend. Every technology has tradeoffs, and frankly I'd like to hear about this mystical backend panacea you're implying.

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

#30

Earlier quoted context omitted.

probably because there are so many js “frameworks” that they are running out names

Sort of makes me bummed out that the Dart project failed. If there was one time when we could have escaped the client side hell that is JavaScript it would have been then, when chrome had astonishing market share, and Dart could compile down to JS to ease the transition until native support became standardized. But nope, here we are with anotherone.js every week.

Dart wouldn't stop the relentless cycle of frameworks coming and going.

Case in point: Angular has an alternative Dart implementation which is AFAIK used by Google internally, but it didn't take the web by storm and currently the TS flavour is by far the dominant one.

Post reply on HN