Is Vue Just Overkill for My Project?

TAGS: FRONTEND, VUE

You can use Vue for a very small parts of a single template in your Django app. If there’s a place where you want to create an interactive element, you could use Vue instead of jQuery or vanilla JavaScript. That wouldn’t be overkill, but a sensible and acceptable way to make use of that frontend framework.

With Vue, you don’t have to commit to a too-complicated solution. But depending on the way you choose to setup Vue with your app might lead to an “overkill solution”.

The simplest way to use Vue

Vue can be considered a very light-weight frontend framework options. It was designed to be “incrementally adoptable” - you can start using it without much overhead in any of your Django templates.

Just check out this article for an example on how to get started.

You won’t need to learn Webpack, change the shape of your project or make big changes from the get-go. If you just want a bit of interactivity sprinkled in here and there, Vue is a great way to go.

Do you want a part of your page to be interactive? Then Vue is a good fit. Even more so if the UI is a bit more complex. If all you need are on-click events, you might even have an easier time with jQuery - but Vue pays off as soon as you’re going for a bit more DOM manipulation.

Where “overkill” hides

Now, let’s look at ways to make things more complicated than they need to be. While there are good reasons to use frontend frameworks with Django, that doesn’t mean you need to adopt all of the seemingly-popular patterns around them.

Most of all, there’s usually no need to split your front- and backend into separate projects, or to build a SPA from the get-go.

Each of this decisions is separate and should be well-justified by itself, not as a package deal. You can read on my thoughts regarding SPAs, and reasons to go that route here.

If you’re planning to use Django as your backend, and build an SPA with Vue - you might want to go through the reasoning behind that choice first. Especially if it feels like overkill. There’s probably a well-justified reason why it does.

Being skeptical of complexity is a good thing!

In Conclusion

Vue.js is a pretty cool framework, and there are ways to use it sparingly. I don’t think it’s ever “overkill” to use Vue by itself, and a lot of projects can benefit from using it over something like jQuery.

Building an SPA without the right reasons, or splitting your frontend from your backend completely, are what makes the use of a frontend framework “overkill”.

The good news is: you can use Vue without buying into unnecessary complexity and architectural patterns which are of no use to you! Check out this article for an example on how to get started with Vue in a single template, without having to change your project in a major way.

Subscribe to my newsletter!
You'll get notified via e-mail when new articles are published. I mostly write about Docker, Kubernetes, automation and building stuff on the web. Sometimes other topics sneak in as well.

Your e-mail address will be used to send out summary emails about new articles, at most weekly. You can unsubscribe from the newsletter at any time.

Für den Versand unserer Newsletter nutzen wir rapidmail. Mit Ihrer Anmeldung stimmen Sie zu, dass die eingegebenen Daten an rapidmail übermittelt werden. Beachten Sie bitte auch die AGB und Datenschutzbestimmungen .

vsupalov.com

© 2024 vsupalov.com. All rights reserved.