We came from the AngularJS world and previously, Crisp used to be an AngularJS app. So, we relied a lot on filters and we had around 200 filters. So, we had to find a solution, an elegant way to move all those features to View3.
So, what we did is moving all the filters to native JavaScript methods. So, here is an example with a ColorForValue filter. So, it's a native JavaScript function. And now, what we're going to do is to import this function as a global method in Vue. So, what we did is a global $Filter object, so we can access to all our filters in every component. So, here is an example with an uppercase filter.
And then, so we can find all the filters we were using inside components, we've been using a regex. So, using this regex, you can basically find all your different filters. And this way you can move all the filters to a new method syntax. Also, we discovered that it's not possible anymore using a VIF with V4 with Vue 3. And I do agree, it's not a good idea using the two each other. But anyway, we've been using this, so we had to replace this behavior with computed properties. Also, an important task was updating some third-party libraries.
We had to fork some libraries, so for instance, Vue Chartist. So nothing very complicated, as you can see, moving an external library from Vue 2 to Vue 3 is not very complicated. Basically most of the stuff is related to the Vue Global API. So you just basically need to replace the constructor and some APIs. And we had to do that for around 5 different libraries. We relied on Trello to manage all the tasks while moving to Vue 3. And it was important to us to not miss anything. So, you should use something like GitHub, GitLab, JIRA or Trello to note down everything, so you don't miss any bugs or library.
We've been able to release this Vue 3 migration after almost 2 weeks. And so far, it's been great, no one noticed anything. To be honest, we had some bugs, but nothing very important. The good news has been performances. From Vue 2 to Vue 3, we've been able to cut the Jira heap from health. And so far, the app feels faster and more responsive.
Comments