When I started working on my current commercial project, I noticed that we’re using Vuetify as a component library for our Vue.js app.
There was loads of tech debt to solve, and Vuetify’s implementation was just one of them.
At first, we needed to upgrade the version — it was on the v1.5, and support for it ended in July 2020. Yes, the v2.x has many breaking changes.
Because of not using Vuetify correctly, this update took weeks.
However, after the upgrade as well as refactoring the implementation, we’ve found a way for making any breaking update sleek; a few hours top.
I want to share the best patterns with you so you don’t repeat the same mistakes. The examples here will be in Vuetify — but the theory behind it applies to all component libraries.
The Biggest Problem With Our Implementation
To be honest, I don’t like these libraries. I just love doing everything from scratch. But I’m probably just a pure HTML/CSS/JS enthusiast.
Still, after doing that many times, the process is so sleek and simple. And you have complete control of your code, without any pressure from the external dependencies.
But there was no choice here at first. Our app is massive, it uses Vuetify, and we need to upgrade it. We use many components like v-btn
, v-dialog
, v-checkbox
, v-select
, etc.
Let’s use v-btn
as an example.
Like any web application these days, our app has many buttons. To implement them, we just need to check the Vuetify’s (or any other library’s) docs and reveal the magic.
Oh, cool. So after initial setup, I only need to do:
<v-btn>Some text</v-btn>
And it renders a button with all of its perks!
Hmm, but I want to change its background color and make it rounded. Let me check the docs again. Amazing, so I just need to do this:
<v-btn
color="#232323"
rounded
>
Some text
</v-btn>
And I can get my styled button without CSS, woohoo!
I also need a button in some other places, but it will be styled a bit differently. Let me render <v-btn …props />
again.
There are many places in the app where we use this component. The last time I checked, it was 423.
That means — if Vuetify rolls out an update with breaking changes for v-btn, we’ll have to change its implementation on 423 places across the app.
But we don’t use just buttons. We use many of its components; 3200+ times across the codebase.
To update this historic version of Vuetify, we needed to manually update each component.
And of course, we needed to test everything. That’s why it took us weeks and cost the company a hell of a lot of money.
Lesson 1. Use v-btn Only Once
Hmm, how’s that possible? I have 423 places with buttons in the app, why am I allowed to do it just on one?
To use this pattern, create a component. Let’s call it app-btn
.
In that component, you’ll render v-btn
. That’s the only place in the codebase where you can find it.
app-btn
accept many props to manipulate its style. After you agree with your designer about the button versions, you can convert app-btn
props to v-btn
props.
For simplicity, let’s say that you agreed on two styles: primary
and secondary
.
primary
button style has a blue background color. secondary
has a transparent background.
If your app-btn
gets primary as a prop, you’ll pass color="blue"
to v-btn
.
If your app-btn
gets secondary as a prop, you’ll pass text
to v-btn
.
Why would you do that?
Well, if Vuetify introduces any breaking changes on the v-btn
API and let’s say, renames color
to background-color
, or text
to flat
, you’ll have to refactor it just in one place.
This saves weeks.
I assume that you write tests for your app too. Do you use data-test attributes? Their placement is sometimes changed when Vuetify upgrades.
That means — refactoring the tests as well.
That could mean — loads of unexpected bugs.
Extra Bonus: Consistency
Let’s check the v-btn
API. Currently, it accepts 47 different props. Some of them are booleans, some numbers, some strings.
That means that you can have hundreds and thousands of different styles for your button by combining all of them.
But you don’t want that — your app will look terrible!
You just want to have a few button variants, and that’s it.
By using app-btn
‘s limited props, you can achieve exactly that. You don’t need all 47 of them.
Lesson 2. Useless Components
I agree that some of the components in the library can be pretty useful — especially if you don’t have a lot of HTML/CSS knowledge.
Implementing a dialog can be tricky.
Some of you won’t agree with me on this one — but many components are just nonsense.
v-flex
is a div
with display: flex;
. Isn’t it easier just to write exactly that, with the pure CSS/SCSS and HTML?
By doing that, you learn the core of the web. Frontend frameworks and libraries get replaced and updated every day.
To keep up the race, you need to know the basics about HTML/CSS/JS and Web in general. In that way, you’ll adapt incredibly fast.
v-flex
API will be forgotten. But your CSS knowledge won’t.
Don’t remember the v-flex API. Remember the CSS. display: flex;
and justify-content: space-between;
will solve so many of your problems.
Don’t let those 2 simple lines remain hidden behind the magic of a component library.
The Magical Benefits
After refactoring, we have 10 custom components that wrap around Vuetify’s.
That means if Vuetify changes anything, we’ll need to make the updates only on 10 places!
The upgrade time is shortened from a few weeks to just a few hours, or even less.
Besides that, we focus on the “real” knowledge here, the basics of the browser. That matters so much in the everyday changing Frontend world.
I hope that this article will save you weeks or even months of refactoring.
Remember, you can apply this knowledge to any library out there if that makes sense.
Don’t import the same packages across the whole codebase. You’ll end up in an external dependencies hell.
Don’t even use those packages if they are pretty simple. Do it on your own, and learn something that will stay with you for years.
Not just for months, until there’s another breaking change.
Top comments (40)
Having an edge in pool games is always exciting, and Snake 8 Ball Pool Unlimited Coins makes that possible with extra in-game benefits. Instead of worrying about running out of resources, players can enjoy unlimited access to coins for a seamless experience. This allows users to unlock better cues, participate in higher-stake matches, and improve their overall performance. With enhanced aiming assistance and trajectory predictions, every shot becomes more precise. The game becomes more enjoyable when you have all the tools to win effortlessly.
New home towns in Canada are transforming the way people live by combining affordable, energy-efficient housing with thoughtfully planned amenities and green spaces. These vibrant communities are designed to provide residents with comfort, accessibility, and a strong sense of community. With features like schools, parks, shopping centers, and efficient transportation links, they offer a balanced lifestyle and attract families, professionals, and retirees alike. Found across provinces like Ontario, British Columbia, and Alberta, these towns are a popular alternative to urban centers, promising quality housing and opportunities for growth in rapidly developing neighborhoods.
Key Features of New Home Towns:
Affordable Housing: Modern homes at competitive prices compared to urban centers.
Sustainability Focus: Energy-efficient designs and eco-friendly infrastructure.
Integrated Amenities: Access to schools, parks, healthcare, and shopping.
Accessibility: Well-planned transportation systems, including public transit.
Community Building: Spaces and events that foster a sense of belonging.
New home towns are shaping the future of Canadian living, offering a unique blend of modernity, sustainability, and community spirit.
Using frontend UI component libraries effectively starts with choosing the right one that fits your tech stack, design preferences, and project needs. Once you've selected the appropriate library, it’s important to follow the proper installation process and utilize the library’s pre-built components rather than modifying them unnecessarily. Customizations should be made using the library’s theming tools to keep your design consistent and avoid conflicts. Instead of rewriting components from scratch, it’s better to compose reusable elements that suit your needs. Maintaining a clear folder structure for your components and adhering to the library’s guidelines ensures your project remains organized and scalable. Additionally, taking the time to understand the documentation, ensuring accessibility features are in place, and testing across various devices and browsers are essential to getting the most out of these libraries. In specialized fields like Obstetrics, where user-friendly and precise digital interfaces are essential, using well-structured UI libraries can enhance communication with patients, simplify data management, and improve overall workflow efficiency in medical applications.
We will explore the Claim Checker Form, how it works, and why it is essential for anyone who is looking to file a claim or determine eligibility for compensation. Whether you are new to the claims process or have been down this road before, our detailed guide will provide the clarity you need to make informed decisions.
our strategy of encapsulating Vuetify components within custom ones is a game-changer. It streamlines updates, enhances consistency, and fosters long-term maintainability. Emphasizing core web technologies like HTML and CSS is crucial for adaptability. Thanks for sharing these invaluable insights and practical tips!
Explore our azure auto detailing for top-notch services tailored to your needs. From expert consultations to seamless solutions, we prioritize excellence in every aspect. Elevate your experience with our trusted expertise
While working on a Vue.js project using Vuetify, we faced major issues upgrading from version 1.5 due to directly using components like v-btn in hundreds of places. The update took weeks because we had to manually refactor over 3,200 component instances. To solve this, we created wrapper components like app-btn, where v-btn is used only once. This made future upgrades simple, requiring changes in just one place.
By limiting prop combinations and defining consistent button variants, we improved design consistency and maintainability. We also avoided using overly simple Vuetify components like v-flex, opting instead for native CSS to deepen our core web skills.
After refactoring, only 10 wrapper components interact with Vuetify directly. This reduced upgrade time from weeks to hours and made our codebase cleaner and more resilient. The key is to abstract dependencies and focus on solid HTML/CSS/JS knowledge that doesn't become obsolete — the kind of knowledge that will outlast the last price of any popular computer framework.
Love is in the air, and valentines nails captions are here to make your posts shine! Pair your perfect manicure with a cute, clever caption. Thoughtful words always complete the look. Share the love this Valentine’s Day.
Great insights. The challenges you're facing with implementing component libraries like Vuetify are so relatable, especially when it comes to dealing with tech debt and frequent updates. I love the solution you provided using a single wrapper component like app-btn to centralize changes and avoid repetitive updates across the codebase. It really streamlines the process and saves so much time in the long run. It's a bit like how we handle design consistency in projects like Year 6 leavers hoodies centralizing design elements ensures that changes can be made efficiently across all products without compromising quality.
MoviesFlix is your ultimate destination for discovering and streaming the latest movies and TV shows. Enjoy a diverse collection of films across genres, with high-quality streaming and a user-friendly experience. Dive into your next cinematic adventure with MoviesFlix!
When working on large projects like boulevard Riyadh managing dependencies can be a challenge, especially with outdated component libraries. I completely relate to your experience with Vuetify. The idea of wrapping library components in custom ones, like your app-btn approach, is a fantastic way to reduce future headaches. Not only does it streamline updates, but it also enforces design consistency across the entire project. This pattern of isolating third party libraries into controlled, manageable components is something every developer should consider. It’s a huge time saver and ensures a more maintainable codebase.
This article really resonated with me — especially the part about wrapping components like v-btn into reusable custom ones. It’s such a smart way to future-proof a project and keep the codebase organized and maintainable. I’ve also experienced how difficult it can be to update apps that rely too heavily on third-party libraries without any abstraction.
What stood out to me most is the reminder to focus on core web fundamentals like HTML and CSS. It’s a lot like handcrafted work — for example, I recently saw a Bead Bag made by Tillie Beads, and the attention to detail and durability in the design really stuck with me. Just like with good frontend practices, it's the solid foundation and thoughtful structure that truly last. Thanks for sharing these insights!
Some comments may only be visible to logged-in visitors. Sign in to view all comments.