L
L
lolrofl012018-10-07 08:14:16
Frontend
lolrofl01, 2018-10-07 08:14:16

Is nuxt.js worth learning?

I recently started learning vue, I'm going to make an SSR application in order to get all the advantages of SPA, as well as normal search engine optimization. I accidentally stumbled upon nuxt.js, and the stories that this framework greatly facilitates the work just when developing SSR. But I also encountered negative comments that say that the framework has gone far from vue itself and in the wrong direction, and that, on the contrary, it only complicates everything. Because I could not find anything else useful, I decided to turn to you. Tell me, can anyone have experience with nuxt or experience in developing an SSR application? Can you advise something: is it worth learning nuxt or are there more useful frameworks, or is it even easier to do with one vue than to install something extra? I have a laravel-vue bundle, I really like it so far, so I would not want to use react or angular.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
Ilya, 2019-03-15
@lolrofl01

Worked with Nuxt for a total of about a year. I wrote my blog on it (quite large), here it is on github: https://github.com/iliyaZelenko/blog-frontend
Disadvantages that I noticed:
1) It takes a long time to start on `nuxt dev` (my blog starts in 3-5 minutes) and HMR is updated on average in 1-5 seconds (sometimes longer), even if you just updated the template. This is the most stressful.
2) After changing the code, sometimes the `.nuxt` folder is generated with an error, you have to change any line in the project sources to start the generation again or sometimes completely restart Nuxt. This problem was not seen on all projects.
3) It can be problematic to use modules that do not go on the server and on the client at the same time, but this is more of an SSR problem. Sometimes you also want to get the nuxt context itself where store, router, plugins, but this cannot be done in some places, usually this problem is on the client. For example, on a client in a store where the state does not yet have the window.$nuxt property, you cannot access the cookie-universal-nuxt universal cookie plugin and take the value from the cookies and write it to the state, otherwise the nuxt context will not be accessed. Store is hard to get in the store itself, sometimes you need it.
4) When using TypeScript with it, sometimes nuxt gave out that the type (usually an interface) does not exist or other type errors, but these errors actually did not exist. The only way out is to restart nuxt dev and wait a long time, sometimes this problem occurred several times within 20 minutes, I had to restart several times.
In my blog, I almost always needed Dependecy Injection to inject different modules, but they were not available in `asyncData`, there is no this, I had to get it directly from the container. Code example:
Taken from here .
In general, along with vue-class-component, you cannot use a constructor to inject dependencies there, I used inversify for DI, but in order for it to work, vue-class-component had to use a crutch with vue-inversify-decorator (crutch method from vue-class-component developers fix this problem), write `@Provide(container)` in layouts/default.vue (I didn’t find a better place, unfortunately, this is also a minus). How convenient it would be if you injected dependencies into the constructor and they are immediately available in the entire component and in `asyncData`.
I want to learn next (react) so that I have something to compare.

J
Jekins D&D, 2018-10-07
@Jekins

We have been writing a project on nuxt for half a year now, everything is fine with it. It’s not even clear how it can move away from vue if it’s the usual implementation of ssr according to vue style guides. You can use it and not worry. You will write the project on the usual vue, and nuxt will only help you avoid crap with the ssr setting. And if you see that someone writes as if he is not flexible - do not believe it, everything can be configured and reconfigured there. Even the deepest things. Moreover, this is the most popular ssr implementation for vue with a large community that has already studied everything and wrote all the necessary things that may be needed during development.

B
beduin01, 2018-10-07
@beduin01

Not worth studying. In Vue 3.0 it will be out of the box

K
Klein Maximus, 2018-10-07
@kleinmaximus

It's better to use vue-cli-3 and @vueneue/ssr plugin .
I have used Vue Server Renderer in previous projects as it is more flexible. In nuxt, some things first make life easier, and then they really start to spoil it. Take even that vaunted routing on files. I would understand if it supported all the features of vue-router, but it really cuts off almost everything :( You can, of course, disable this business or even write your own routing template for Nuxt, but why then Nuxt itself?
Then I plan to use a bundle vue-cli-3 + plugins (including the one above).

S
Serzio, 2018-10-07
@Serzio

Nuxt is a very promising thing. Made several projects. I don’t know why they left Vue ... they just hid many routine things under the hood. Project configuration is done in nuxt-config instead of webback. If you need complete flexibility and transparency, it is better to install everything manually without any assemblies. But for most tasks this is not required.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question