Documentation and Migration: From Vue 2 to Vue 3 (with Natalia Tepluhina) - podcast episode cover

Documentation and Migration: From Vue 2 to Vue 3 (with Natalia Tepluhina)

Aug 08, 20241 hr 22 minEp. 20
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

For the 20th episode we surprise you with a "in-person" podcast episode! 

Alex is joined by Principal Engineer and Vue Core Team Member Natalia Tepluhina to talk about two important topics - Documentation and the Migration from Vue 2 to Vue 3. 

Learn in this episode what Natalia does in the core team, how difficult writing docs is and how to improve your doc writing skills. Also, gain insights in how GitLab's migration from Vue 2 to Vue 3 is going and get invaluable tips if you also have to migrate a project over!

Enjoy the episode!

Chapters

  • (00:00) - Welcome to DejaVue!
  • (01:32) - When did you start using Vue.js?
  • (02:42) - How could you introduce Vue at work?
  • (04:43) - Joining GitLab
  • (07:15) - Getting into public speaking
  • (10:05) - Memorable moments as a speaker
  • (16:22) - Moving to Amsterdam
  • (18:22) - Being part of the Vue.js Core Team
  • (20:27) - (Not) Documenting Vue Methods
  • (22:21) - $parent in Vue 2
  • (22:59) - AI as the new docs?
  • (25:00) - Regular Contributors to the Vue docs
  • (26:14) - Is writing docs is easy?
  • (31:45) - Documenting Vue 3 at release
  • (34:04) - Documentation as a garden
  • (37:00) - Separating Options and Composition API docs
  • (38:20) - Preferring the Options API for huge teams?
  • (41:49) - Inline Composables and other architectural patterns
  • (45:35) - Overusing Watchers
  • (46:57) - People - Share your thoughts and patterns!
  • (48:39) - Vue.js DE Conference
  • (49:14) - Migration from Vue 2 to Vue 3
  • (50:10) - How the component library blocks migration
  • (54:10) - Updating Unit tests during migration
  • (55:16) - No CAPI during migration
  • (57:13) - Migration of big old projects
  • (58:45) - Responsibility of library authors
  • (01:05:01) - Vue 3 Breaking changes
  • (01:06:31) - Will the migration ever end?
  • (01:07:48) - Other tips for migrating
  • (01:09:19) - Migrating without tests
  • (01:10:45) - Rewrite vs Migration?
  • (01:11:35) - Not migrating at all?
  • (01:13:54) - No CAPI during migration?
  • (01:15:58) - New questions with CAPI
  • (01:16:58) - Natalia back on stage at a conference?
  • (01:18:16) - What could the Vue team have done better?
  • (01:20:21) - Nuxt Tips Collection
  • (01:21:00) - Wrapping up


Links and Resources




Links marked with * are affiliate links. We get a small commission when you register for the service through our link. This helps us to keep the podcast running. We only include affiliate links for services mentioned in the episode or that we use ourselves.

Transcript

Welcome to DejaVue!

Alexander LichterAlexander Lichter

Hey, everybody. Welcome back to a new episode of DejaVue. It's your favorite Vue podcast, you just don't know it yet or maybe you do because that's already one of our famous episodes. We do quite some, maybe we've seen some of Daniel Roe, Evan You, lots of other amazing guests, and today it's it's a different setting, right? You don't see Michael here, unfortunately, we can't fly him over from, Canada real quick, but maybe another time, like, a live episode, we'll see.

But today, we're here in in Amsterdam, and I'm joined by a wonderful guest, give a warm welcome to Natalia Tepluhina. How are you doing?

Natalia TepluhinaNatalia Tepluhina

Thank you, Alex. I'm doing good. How about you?

Alexander LichterAlexander Lichter

Fine. Yeah. Can't complain. Had a little bit of, work to do in the mornings, had everything up here, maybe get some behind the scenes footage on some social media, we'll see. But, yeah, happy that, everyone found out that you're here, as we only live, like, 20:30 minutes,

Natalia TepluhinaNatalia Tepluhina

by the way. Yeah. Just so you know, we don't measure distance in Amsterdam in kilometers. It's not practical. We measure in minutes by bike.

Alexander LichterAlexander Lichter

Yep. That's very important. So, yeah, it's great. And, for everybody who might not know you, probably not that many people, but so you're a principal engineer at GitLab by day,

Natalia TepluhinaNatalia Tepluhina

yes, that's correct.

Alexander LichterAlexander Lichter

So, we'll all talk a little bit about that as well and, as someone who MC ed for you at at Vue.js Amsterdam sadly forgot to announce last time you're also a Vue.js core team member for for how long by now?

Natalia TepluhinaNatalia Tepluhina

Since 2018.

Alexander LichterAlexander Lichter

2018. Wow. It's awesome.

Natalia TepluhinaNatalia Tepluhina

Like, 6 years.

Alexander LichterAlexander Lichter

Quite some time.

When did you start using Vue.js?

And do you remember, like, when you started using for the Vue for the first time? Was it, like, couple years before that?

Natalia TepluhinaNatalia Tepluhina

Yes. It was a couple years before that. It was, in early 2016. I think Vue two was in beta at this point.

Alexander LichterAlexander Lichter

Wow. Okay.

Natalia TepluhinaNatalia Tepluhina

Was released, again, if I'm not mistaken, in September 2016. So we started using it first for I started using it for pet pet projects, then brought it to my workplace at the time Mhmm. Just when it was released because management was pretty critical about having something in beta. But it worked super nice for us. Before that, it was mostly Angular JS.

Alexander LichterAlexander Lichter

Oh. Like Angular 1?

Natalia TepluhinaNatalia Tepluhina

Yeah. Uh-huh. Yeah. Not not the cool Angular. And Vue was really, like, a fresh air there. So, yeah, after the after this, I think I only used Vue at my workplaces. Yeah. Vue and then a bit of Angular again.

Alexander LichterAlexander Lichter

Interesting. Okay. So how does it came at you? Like, said, okay. Let's introduce Vue 2. Let's bring a bit of fresh air in there when you were using AngularJS.

Natalia TepluhinaNatalia Tepluhina

So that was a small company doing project work. It wasn't one big thing. It wasn't a product that you work on. You didn't need to do a migration. We just had a new project coming on, and we just decided to give it a try with Vue.

How could you introduce Vue at work?

Again, we were not super proficient in AngularJS. I think nobody was at this point. It was all new for everyone. Maybe in React, it was a bit older. And we tried to do it, and we saw that it actually sped up the development quite a lot. Mhmm. Documentation was amazing right from the start.

Alexander LichterAlexander Lichter

It still is.

Natalia TepluhinaNatalia Tepluhina

I didn't write it back in time, so don't take it as a compliment. It was Chris Fritz mostly working on the docs. Everything was quite intuitive. And, again, coming from AngularJS, it's quite easy to have the same directives. Right? It was ng-if to v-if and so on and so on. But much better work on the script part, and it just came very simple. The project was done super fast, and we decided to just go with it because it allowed us the speed of development.

Alexander LichterAlexander Lichter

Yeah. Makes sense. I also, like, I heard some people, like, using Angular than going to just, like, a bit of, like, baby Angular. It's like it's more lightweight. It's a bit easier to grasp.

So, yeah, that was also often argument, like, okay, not, like, using something more heavyweight or, like, so strict as in, like, okay, you have use the Angular HTTP client everywhere and this and that. Yeah. A little bit of flexibility. But also there, we like, if people want that, if people want that strong guidance for every single part, like, this is the way to do it, then Angular might make sense.

Natalia TepluhinaNatalia Tepluhina

Maybe also for bigger teams back in time, it was a good idea again because it's very straightforward. You cannot do step left or right. But if we look into the learning curve and, again, small company, many new engineers, we were just curious about things. The learning curve for Vue 2 back in time was super, super smooth.

Alexander LichterAlexander Lichter

Yep. That's true. Like, if you know HTML, JavaScript, and CSS, and even if you don't have, like, experience in in the framework before, like Angular, it's, it was it goes pretty well. And Yep. I think today, it's, still the case, even though there there are, like, some hiccups in there in the the learning path, let's say, but, I think we'll we'll come to that, also when we talk about documentation.

Joining GitLab

Yes. So okay. You you start using Vue introducing it, then at some point, you you joined GitLab.

Natalia TepluhinaNatalia Tepluhina

It was one of the things why I joined GitLab was because of Vue and, particularly thanks to Vue conferences because at one of the conferences, what is beauty as London, I think? I met a few people from GateLab. I talked with them. One of them was Filipa. She was also a Vue speaker. I probably remember her

Alexander LichterAlexander Lichter

I remember. Yes. Yes.

Natalia TepluhinaNatalia Tepluhina

From Vue, Amsterdam. And then

Alexander LichterAlexander Lichter

2019 or something. Yeah.

Natalia TepluhinaNatalia Tepluhina

17, 18, 19, maybe. I think she was in 18 19. And we talked a little. We they were solving a few problems. Again, it was fresh for GitLab as well, to start with you. I gave a few suggestions, and she said, why why why don't you join the company? It looked like a good fit. I looked at their 5 interviews pro like, 5 stage interview.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Like, I'm not going to pass. You know? That's that's a bit too much.

Alexander LichterAlexander Lichter

I mean, 5 step 5 steps are a lot. Right? So

Natalia TepluhinaNatalia Tepluhina

It's like the Google level of interviews, and she convinced me to try, and, apparently, it was done in 7 days. Like, all the 5 interviews.

Alexander LichterAlexander Lichter

That's fast. Yeah.

Natalia TepluhinaNatalia Tepluhina

Still the fastest hire.

Alexander LichterAlexander Lichter

Congrats to that. Thank you. So, VGS core team member, principal engineer, and fastest hire at GitLab. Yeah. Pretty amazing. And, yeah, you're still at GitLab. You, didn't, change companies for for quite a while.

Natalia TepluhinaNatalia Tepluhina

No. No. Part of the reasons, again, we are using Vue and we are open source. I think part. Yeah. That's one of the biggest companies using Vue in the as an open source. We know that many other big players do use it, but we don't see the code.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Right? Everyone can

Alexander LichterAlexander Lichter

Probably for better.

Natalia TepluhinaNatalia Tepluhina

Everyone can see how bad our code is. Maybe you are not. But and overall, the company culture is pretty cool, so not planning to change this anytime soon.

Alexander LichterAlexander Lichter

Perfect. Yeah. I I also heard, like, lots of good things from, newly joined GitLab hires as well. We had Vanessa on also

Natalia TepluhinaNatalia Tepluhina

And now, yeah, we're still in people from Vue community. Like, we have Marina. And if you watch few master recourses, you probably know who she is. Vanessa, like, picking people from the Vue community.

Alexander LichterAlexander Lichter

That makes sense. I mean, you as you said, you're using Vue for for all your projects, or, like, for all the product as well. So it's important to have people with some expertise and never hurts to have, like, well educated, employees.

Natalia TepluhinaNatalia Tepluhina

Especially for migration, but I think we're also going to talk about GitLab.

Alexander LichterAlexander Lichter

100 Percent. Yeah.

Natalia TepluhinaNatalia Tepluhina

A bit later.

Alexander LichterAlexander Lichter

That will be that will be a big part. So, yeah, GitLab using Vue and, like, you said you found out about GitLab at conferences. How how did you come to public speaking?

Getting into public speaking

Natalia TepluhinaNatalia Tepluhina

Oh, that's that's a fun part because, I never planned to be a speaker. It was nice to see speakers on stage when you come to the conference, but you feel like they are a bit on a different level. Right? When you're on the stage, you're figuratively on the stage, you're a bit above Mhmm. The audience. And, back in times, you remember there was an organization called Vue Vixens.

Alexander LichterAlexander Lichter

Yes.

Natalia TepluhinaNatalia Tepluhina

They were, like, if you don't know it, that's normal because I think they are not active anymore. They were giving free workshops in view for women, and they were coming with these workshops to the conferences. The first workshop was in Barcelona in 2018, and the second was in Paris.

Alexander LichterAlexander Lichter

Okay.

Natalia TepluhinaNatalia Tepluhina

They were both quite small conferences. They were organized by the same team that organizes through Amsterdam. But this maybe a 100, 150 people.

Alexander LichterAlexander Lichter

I think, like, the was it, like, Vue.js road trip, something like that?

Natalia TepluhinaNatalia Tepluhina

Yeah. It's called road trip, but it's, like it feels like a big meetup, and the whole vibe is a bit different from Amsterdam. It's just really a meetup with the companies, with, like, a bit of drinks, a bit of food, lots of, enthusiastic people. So workshops were held at these conferences. And after the first one, I was coming to Paris and organizers were, like, wanna give a talk? We have one slot. We don't have speakers for this conference. And, okay. Why not?

Alexander LichterAlexander Lichter

Yeah. Just do it.

Natalia TepluhinaNatalia Tepluhina

I have no idea what I'm going to speak about, but let's just breathe something and try to speak. It was the worst talk ever.

Alexander LichterAlexander Lichter

What did you talk about?

Natalia TepluhinaNatalia Tepluhina

I talked about, RxJS and Vue. Vue RX.

Alexander LichterAlexander Lichter

Oh, interesting.

Natalia TepluhinaNatalia Tepluhina

That was a library by Evan. And it's interesting to use it for a few things, especially if you build, super heavy things in terms of user interaction, like lots of drag and drop and, some simultaneous, things on top of that.

So I I gave it a try. It was cool to talk about and, actually, that gave an idea for one of the further talks, not about you, about RxJS in general. I can tell that was really the worst talk. I was absolutely scared, stressed, stuck on the stage. You just stay like this with eyes wide open. Like, why did why did I agree on that? You come with your laptop, look at that, people, like, freeze. Mhmm. Then you finish your talk. Like, yeah, that's cool. I should do it again.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

And I think that that's still true to this day. Like, first, I think, why why why are you doing this? That's so stressful. That's so scary. But then you see people come in with the questions and been being interested in their talks, and that's pretty cool.

Memorable moments as a speaker

I remember the best one, if I may share from the conference, is when you have the feedback from the people. That was one of the VueConf US in Austin.

Alexander LichterAlexander Lichter

Oh, yeah. In Austin. But we also went together. Yeah.

Natalia TepluhinaNatalia Tepluhina

Yes. We also bear that

Alexander LichterAlexander Lichter

4 years ago. It was, like, shortly before COVID. Yeah.

Natalia TepluhinaNatalia Tepluhina

Yes. Yes. That's correct. It was in 2020. And, I gave my talk on the 1st day of the conference. Now the second day, I want to grab some coffee. I need to walk for a few kilometers away from the conference venue because finding decent coffee in Austin was a challenge. By European measures, maybe. Find a nice coffee place, grabbing my coffee, and heading to the exit. And there is a man sitting at his laptop, like, oh, can I say something to you?

Okay. I've been to your talk yesterday. And he turns his laptop to me, like, I'm building an experimental project using VueApollo, and it works already.

Alexander LichterAlexander Lichter

That's super cool.

Natalia TepluhinaNatalia Tepluhina

That's the best moment you can have as a speaker. Like, literally. Someone listened to you, do your rambles from the stage, put it to test, and it's working for them, and they're happy. Yeah.

Alexander LichterAlexander Lichter

What else do you want?

Natalia TepluhinaNatalia Tepluhina

What else do you want? Exactly.

Alexander LichterAlexander Lichter

I 100% agree. Like, I also just like all the the questions, the conversation with people, like, as you said, people showing interest, that's that's always the best if you're, like, getting in touch with the people. And, luckily, like, now with content creation, like, a little bit of YouTube also streams, because I always like like the interaction. And even if it's, like, a super unrelated question, you get, like, sidetracked and jam it to something else, like, still, sometimes it's, just super helpful. And I think usually for maybe the one person asking a question, there will be, like, tens or 100, even 1,000 maybe having a similar question.

Yeah.

Natalia TepluhinaNatalia Tepluhina

Just maybe afraid to ask, maybe waiting for someone else to ask. And in your case, it's more public. It's not 1 on 1. You're interacting on public platforms on YouTube, on Reddit. I saw you on Reddit by now.

Alexander LichterAlexander Lichter

Yeah. Yeah.

Natalia TepluhinaNatalia Tepluhina

And interacted, just in case. And, yes, in this case, people just can read you answers. Okay. Now now I know.

Alexander LichterAlexander Lichter

And I I think, like, that's also, like, sharing in public, beats conference when talks are also recorded, like, in the comments on the YouTube. That's sometimes hard to catch because, like, different accounts, so on, but still, but, yeah, also the people just come in there, it's, like, hey, or even just saying, hey, good talk. Hey, you liked it. It's it's amazing.

Natalia TepluhinaNatalia Tepluhina

Or even when they come with a constructive criticism

Alexander LichterAlexander Lichter

Even better.

Natalia TepluhinaNatalia Tepluhina

Those are the best. If you see the talk, you disagree. You have some additional information that speaker forgot to tell, or you have con like, completely opposite view on the same topic. Like, don't hesitate to come and tell us. Yep. It's great. It means you listened, internalized the information. And when you give the feedback, we can incorporate it because sometimes we do speak on the same topics several times. It's pretty okay talks evolve. Right?

It's like a not like you come in and talk about Vue router or Nuxt or whatever, and it's the same. They always evolve and your feedback actually helps to shape the or even change it, like, maybe completely. The testing I mean, I remember I was given a talk about unit test and was the best discussions after because we have we all have slightly different approaches to unit tests. And just to listen to people to see about their experiences, that's super cool.

Alexander LichterAlexander Lichter

Yeah. And, I mean, you also maybe learn a thing or 2. Like, even if you say, okay. We have that specific use case, and we do it differently. Even if it's like, oh, don't do it like that. There might be good reasons for people doing it at

Natalia TepluhinaNatalia Tepluhina

the way. Yeah.

Alexander LichterAlexander Lichter

So, yeah, I also like also constructive criticism in terms of, hey. That was great, but I don't know. It would be nice if you have the font size a bit bigger. Just, like, shout it while it's like, hey. Like, make it bigger or whatever. It's it's super helpful. Yes. Because, like, you are on stage. You don't have to see if the person in the last row can see that. And I don't know.

For me, it's usually, like, when I I go to meet ups, or, like, things with daylight, it's usually okay to turn in light mode just because it's better progress. But, I mean, I know that you know it as well. Like, we we do talks a bit more often than probably the the average person, especially, like, as first time speaker. It's also just, like, nice to know, okay. Hey.

Can you, like, do that? Just, like, have just people, like, criticizing in a as I said in a constructive way. I think that's that's really, really important. Also, yeah, to grow, to learn more because you're nobody's the perfect speaker. So and it also that also helped me a lot. Even so, like, when you gave me feedback, for example, also after my my talk in Austin. It's, yeah, there were things that, like, I I was thinking about then eventually and, yeah, try to, improve.

Natalia TepluhinaNatalia Tepluhina

I didn't start this tradition. I think the first, it was Chris Fritz who offered to give the feedback about the talk. And it's really nice to offer. Like, if you don't want to hear anything, it's okay.

Alexander LichterAlexander Lichter

But if you want to

Natalia TepluhinaNatalia Tepluhina

But if you want to, I can listen to your talk from constructive criticism point of view and then provide it to you as a pause point. And that was super, super helpful. Because you never know how it's taken to how audience takes you talk. Right? You're on the stage. You're on the opposite side of things. And, like, hearing things about font size or your presentation skills or, even slide theme

Alexander LichterAlexander Lichter

Yep. Structure as well.

Natalia TepluhinaNatalia Tepluhina

Yeah. The flow of the conversation I remember the best advice from Chris was make it a story. Like, very, very simple. It sounds super simple, but try to make a story about unit testing. Testing.

Alexander LichterAlexander Lichter

Yeah. I mean, that's that's always, like, I I also like the very simple, like, you need something catchy in the beginning or, like, okay, get some attention, then show the problem the solution. It's, like, usually my flow as well. Like, okay. Because I don't have to show a solution when people don't know, okay.

What what does it do? What solves the problem? So, I I tried to adhere it a little bit, and that kinda works also for, like, content in general. So, yeah, that's that's very valuable feedback.

Natalia TepluhinaNatalia Tepluhina

For docs too, by the way.

Alexander LichterAlexander Lichter

For docs too. That's good. And so so we met in Vue.js Amsterdam in 2019, I think.

Natalia TepluhinaNatalia Tepluhina

Yes.

Alexander LichterAlexander Lichter

So I think you were also at, Vue.js London in 2018. So we probably also briefly went there, though my memories are a bit bit vague. Back then, it was it's quite some time ago, but still, like and that was, yeah, 6 or, like, 5 years ago if you take me to Amsterdam.

Moving to Amsterdam

And, back then, you already mentioned it before, we were talking. We, like, we both didn't live in Amsterdam.

Natalia TepluhinaNatalia Tepluhina

In Amsterdam. No.

Alexander LichterAlexander Lichter

No. Now that's the case, but what made you move here?

Natalia TepluhinaNatalia Tepluhina

Well, I really like the city even on the first visit. I just walked around and, you know, sometimes it just clicks with you. It's like looking for apartments, sometimes looking for the city. It just, like, feels so nice being here. And, yes, visiting and living is diff different story.

Don't mix tourism with immigration, we say. But it felt super, super good. And, back in time also, GitLab offered the package, the relocation package, specifically only to the Netherlands in the whole year. That's two factors that I already have. Why not give it a try?

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

And apparently, it was a good move because I moved from Ukraine way before the war, but still. And there are no regrets. Honestly, it's such a grace great place to live. Amsterdam in general, the in the Netherlands too. So

Alexander LichterAlexander Lichter

Yeah. I I also think so.

Natalia TepluhinaNatalia Tepluhina

What about you? What made you move to?

Alexander LichterAlexander Lichter

What made you so the the person behind that camera right now made me made me move.

So but yeah, I mean, I I lived in Germany before. It's also a very livable country and, like, haven't had plans for a while to move out of the country for, like, ever or at least a longer, longer time. I mean, I've been abroad for long, but, yeah, eventually, I mean, I can work from everywhere. Like, having my own company, then it's, was the decision either moving to Germany, but it's a bit difficult. This one has permanent job here, contract.

So I thought, yeah, why not give them a go? I was commuting a lot between, East Germany and Amsterdam by train, so it took, like, 8 to 10 hours depending on

Natalia TepluhinaNatalia Tepluhina

On Deutsche Bahn.

Alexander LichterAlexander Lichter

Yeah. Exactly. They, by the way, also use Vue here and there, at a couple of the engineers' conferences. And, yeah, now, I'm living here for a year and a couple months, and it's pretty great.

Natalia TepluhinaNatalia Tepluhina

Totally.

Being part of the Vue.js Core Team

Alexander LichterAlexander Lichter

So, yeah, we're we're both here, and maybe let's come to the part of the Vue. Js core team. So you you said you joined in 2018, and you you're still on the core team, obviously. So for people who maybe have seen you on the list of people on the core team or maybe a talk of yours, how would you describe your role in the core team, maybe also your duties?

Natalia TepluhinaNatalia Tepluhina

They are very simple. Most people in the core team are responsible for a certain part of the Vue ecosystem besides Evan. Like, Evan is everywhere, and he kind of takes part in maybe maybe besides Nuxt, but Nuxt is not a part of the Vue Core. Right?

Alexander LichterAlexander Lichter

That's

Natalia TepluhinaNatalia Tepluhina

true. So for example, Eduardo Posva, he's responsible for the router and pinia, Right? And there are people who work on the view itself. I know source then comes to mind first And so on and so on. Like, my part is documentation. I do work the most to on the docs. I have a few pull requests that were merged to core, but they are mostly coming from the documentation. Because you try to document something, and you just turn and twist it. And it's, like, it's not right.

It doesn't feel okay to write a documentation for this. It's need to write really long explanation, and it still doesn't make sense to you. You come back and try to fix it in the core or bring it back to Evan. Okay. Why we do even have this? Yeah. I remember we had a discussion about v model not even modifiers. What was that? I think it was about something about v model modifiers, but not the name. Mhmm.

Like, specifically, the custom modifiers you can pass to v model. Yeah. Because it didn't make sense to me to have it as as a user facing thing, but it was required for libraries. Now I know it was required for libraries. So yeah. Okay. I can see why. So that's part of it. Yeah. Mostly, it's Vue documentation, and this work comes in spikes because you do not write documentation every single day two hours.

(Not) Documenting Vue Methods

Nope. And even triaging and fixing pull requests and issues. It's still just a very minor point. It comes on the major releases, it's, like, huge spike of things, of course. On the minor releases, just a few things you need to fix, you need to add, you need to move around.

Alexander LichterAlexander Lichter

Like some new features to document

Natalia TepluhinaNatalia Tepluhina

Yes. And sometimes not document. That is quite frequent request on Vue docs. Where the hell is, getCurrentInstance?

Alexander LichterAlexander Lichter

Oh, like internal methods. Mhmm.

Natalia TepluhinaNatalia Tepluhina

This is internal methods. Like, but we use that's your problem. Yeah.

Alexander LichterAlexander Lichter

If it breaks, up to you. Yeah.

Natalia TepluhinaNatalia Tepluhina

That was a conscious decision from the team not to document internal things because we did document them in the past, and then library authors did use them. Even so, there was a huge warning on the page. Nobody reads warnings.

Alexander LichterAlexander Lichter

Nobody it's even worse. People might not even read the docs. They're like, okay. Yeah. This Stack Overflow. So it was like, getCurrentInstance the way using it.

Natalia TepluhinaNatalia Tepluhina

That's what's happening right now. And they they come from Stack Overflow, like at least. Unfortunately, they did cause issues with migration, which we will talk about after.

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

So, yeah, right now we decide not to document things we don't want people to use. Like, getCurrentInstance used frequently in the libraries, but library authors are usually very conscious about using it. Like, we know why we need it. We know why we use it, and it's not exposed to the users. If you just have a product, don't. Like, do not touch getCurrentInstance, please.

Alexander LichterAlexander Lichter

I mean, why would you? Like, what's what's usually the case where people would Oh,

Natalia TepluhinaNatalia Tepluhina

people have lots of imagination.

Alexander LichterAlexander Lichter

Fair. Yeah. That's that's true. But sometimes also it feels like, okay, I need some kind of workaround. Well, usually there should be, like, a built in or a better way. Often there is, or what you're trying to do might not really work. Like, you might have to shift your mental model around.

$parent in Vue 2

Natalia TepluhinaNatalia Tepluhina

That's a really good point because we had this in Vue 2 back in times where we had, for example, dollar sign parent or dollar sign children exposed. Yeah. And while you should honestly have communicated with props in the midst people who can't, I will just trigger the parent method. So I know what is the good way. On one thing, it's a good, a baby idea to add kind of a guide to the cookbook because we had cookbook in the past.

Like, okay. If you need to use getCurrentInstance, one of those cases, and use this or that instead. From my experience, people always find the ways to use the things you don't want them to use.

AI as the new docs?

Alexander LichterAlexander Lichter

Yeah. Somehow, it's also the same with, like like, okay, they do something wrong even though in the docs it's exactly listed how it works. I think also nowadays with AI, it got a bit worse. Like, I see very often, oh, why does that code doesn't work? And then, like, ok. Why did

Natalia TepluhinaNatalia Tepluhina

Why did you write it in the first place?

Alexander LichterAlexander Lichter

And, like, what like, okay. Yeah. What's your goal? Describe your goal. Like, the code doesn't do any of these. Not even close. Like, yeah, but chat GPT sent that to Yeah.

Natalia TepluhinaNatalia Tepluhina

Okay. Yeah. That's good for chat GPT.

Alexander LichterAlexander Lichter

Yeah. So I I also think, like, the reliance on AI to be, like Always right, Quote in quote. It's, especially for people learning, it's really tricky.

Natalia TepluhinaNatalia Tepluhina

I have an anecdotal story for that. Like, before you start coding with ChatGPT, try to ask it a question about, like, I have a boat, a man, and a goat. Only this. Only this. Because there is a common story about boat, goat, cabbage cabbage, wolf, and and the man. Right? And probably you all know it because it's simplest algorithmic task. Like, how do you cross the river if you cannot combine certain things in the boat. But ask it about only man, goat, and boat. And look at the answers.

It's funny. I can promise.

Alexander LichterAlexander Lichter

Yeah. That's true. Different try it out also. I've I've seen that, I think also on Twitter, someone was like, wow. That that was really mind blowing in a way. But, yeah, I really think especially the the more bleeding edge the tools become, like, I don't know, lots of things popping up, in Nuxt every month, like new features. And it doesn't really work with Copilot, ChatGPT and so on because they just hallucinate. It's like, use this method. It doesn't exist at all. Like, it's not there.

They just don't know enough about it.

Natalia TepluhinaNatalia Tepluhina

Yeah. There is not enough data for them to actually generate the correct answer because we forget that chat GPT cannot think, analyze, write logical code. It works with a big, like, big amount of data. And sometimes it's just not enough data to generate your answer. Yeah.

Alexander LichterAlexander Lichter

Or it's not recent enough. And so on. But coming back to docs, so you're responsible for the for the Vue docs mainly, usually. Probably, like, more contributors to them. Like, do you have more regular contributors as well?

Regular Contributors to the Vue docs

Or

Natalia TepluhinaNatalia Tepluhina

There are at least a few. Some of them from the core team, some of them outside. Some of them became Vue core team members. You remember we had a contributor with a nickname Skirtle. Oh, yeah. We don't know his real name, by the way. He was always going by Skirtle, and he insisted. So I think it's he it's he. I'm sorry, Skirtle, if you identify as anything else. But in general, he came.

He joined the core the core team, and then he left because there was a little disagreement within the team about I think it was about certification.

Alexander LichterAlexander Lichter

Oh, mhmm.

Natalia TepluhinaNatalia Tepluhina

And he decided he still contributes to the core and sometimes to the docs, just not as a core team member. And, yes, there are multiple irregular contributors that just come and want to fix something. And huge thanks for to everyone who actually contributed to the docs.

Alexander LichterAlexander Lichter

100%. Even if it's, quote in quote, just a typo fix, it's still, like, it's valuable contribution.

Natalia TepluhinaNatalia Tepluhina

Even if you put something as a capitalization Yeah. That is more consistent now or fix one minor example somewhere in the guide, that's that's already amazing.

Is writing docs is easy?

Alexander LichterAlexander Lichter

It's valuable contribution. I mean, that's the quality of the docs. And that's also, like, I feel doc contributions is, like, in a way, it's not really grateful, like, job or, like, duty because if it's great, amazing, people are like, yeah. Cool. That's, like, they they expect it in a way. But if it's shitty, then people will complain. So it's either people complain or they select, okay, that's how

Natalia TepluhinaNatalia Tepluhina

they do it. Yeah. That's default, but and also there is one additional note. People think sometimes it's just docs. It's not real work on the framework. It's just docs. To write the code, you need to how to you need to know how to write the code. To write the docs, you need to understand the code and how to document it. So, yeah, this this is very wrong part, honestly. If people think that the docs are easy, good luck. Write the docs for your own product and look how it goes.

Alexander LichterAlexander Lichter

And I mean, that there's also a reason why lots of codebases don't have own documentation because, yeah, it is need to have, like, vast knowledge about what you're talking there. And that's and it's not enough. Like, we can't read the code and understand that it's just like, okay, edge cases covered. Why is it even there? Why was it introduced? Some goals, some what you should not do. Like, so

Natalia TepluhinaNatalia Tepluhina

How do you use it? When do you use it? I remember I was super proud when in the new docs, in view 3 docs, we put a few diagrams about scoped slots.

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Because in the old docs, we found it's pretty complicated topic for the newcomers. Like, slots in general are easy. Scoped slots, slots with passing slot props. For you, it's easy. Yeah. I can see, like, what's what's wrong about this.

Alexander LichterAlexander Lichter

Yeah. But I also learned it at some point, and I remember it was a topic that I like, it had a hard time learning in the beginning because it doesn't come natural back then at least.

Natalia TepluhinaNatalia Tepluhina

It's kind of like inversion in the normal flow of passing props. It feels like it's inverted, you know? It's like it passes props in a different direction. It's it's getting out. So we drove drew a few diagrams, Maybe not the most beautiful diagrams, but I have no talent for drawing.

But diagrams were extremely helpful. Like, we had feedback about them and way, way less questions about props in the slots pop up since we have this, like, little arrow thing. And you always need the way to find to explain something.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Sometimes it's with a code. Sometimes it's with a diagram. Sometimes it's with text and code, and it's really hard to find the balance.

Alexander LichterAlexander Lichter

Yeah. It's also, like, from the the size, like, the the length of documentation. It's also tricky. Like, you don't wanna keep it too short because then you lack information, but too long, nobody could read it. And Yep.

For example, also one reason why lots of content I do in in the Nuxt ecosystem. They could also probably go to the docs, but then the docs would be super long. Instead, I write a link to the video of, like, if you want more context than this, feel free to have a look. But if that's enough for you, that's fine. So, like, finding a good cutting point is, yeah, it's tricky too.

Natalia TepluhinaNatalia Tepluhina

It's very tricky. And you want also to read documentation sometime as a book. So you are super careful about not to put some knowledge in the earlier chapters because people will be like, the more you add the more cross links you add in the docs, the harder it is to read.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

You want people to come to some chapter knowing exactly what was the previous one. Sometimes they just need the API reference. Right? That's also completely fine. Like, I forgot what is the signature for this particular method. I just want to jump to API reference. But in the main guide, like, writing it as a story from the simplest to the most complicated, it's quite a challenge. And I remember also talking about this with, Dan Abramov

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

About new React docs. And it's not only the challenge for Vue. For React, I think it's even more challenging, for advanced concepts for their hooks. Like use use state is maybe simple, but when you go from this, it gets harder. So it's quite a common problem in terms of writing documentation for for the tool for the development tool.

Alexander LichterAlexander Lichter

Yeah. I think, like, every framework struggles with this. And I think for for Nuxt, I can also add knowledge comes from that space, of course, a lot. It's even worse talking about, okay, you have a framework on top of a framework, then you have Nitro and there's other packages and it's really difficult to figure out, okay, first, what method you use might be from underlying packages, either like exposed again or auto imported And where do I have to search? In worst case, I have to search for 4 documentation pages to find something and maybe also for repositories and issues and so on.

So, that's one of the downsides of, like, nicely coupling everything to an own package is you have to understand the whole waterfall to, like, fully grasp something sometimes. Or, like, make

Natalia TepluhinaNatalia Tepluhina

The level of the knowledge you assume. Like, for Vue documentation, we assume that people are familiar with at least HTML and JavaScript. For Nuxt, do you need to assume they are familiar with Vue? Mhmm. And then to what extent?

Alexander LichterAlexander Lichter

Yes. And also, like, depending on what what feature you use

Natalia TepluhinaNatalia Tepluhina

Feature you're

Alexander LichterAlexander Lichter

using. Yeah. So we also, like, we have common reasons, like, hey, can we search through the Nitro docs together? Because some feature on the server are speaking Nitro, so and on the other hand, I was also talking with a few people, for example, also with Rachel, Neighbors, and it's like combining, might not make the most sense because then it's also confusing jumping to another doc set and so there, like, yeah, there's a lot of work in docs and probably there was also a lot of work when Vue 3 was on the horizon. You said major releases

Natalia TepluhinaNatalia Tepluhina

Oh, yes.

Documenting Vue 3 at release

Alexander LichterAlexander Lichter

Are a big thing. So, how how was that, like, writing docs for for Vue three and keeping the balance and basically getting having a good journey for new users, for Vue 2 users, for everyone.

Natalia TepluhinaNatalia Tepluhina

Complicated. There were so many decisions that were made and then overridden. Like, we were writing first with options API in mind and adding composition as more advanced. But when the framework progressed, the documentation was changed into having 2 styles simultaneously. You can switch right now.

It wasn't like this from the beginning. Some chapters were removed. Some chapters were like, we we were reading completely everything. And then once again, there was an additional rewrite after that. And Evan also participated in this additional rewrite quite a lot.

And then we're fixing things after Evan because, there are a few things still in the docs that break our own style guide. Like, if you're watching this and you want to contribute, go to the docs and search for foo and bar and replace them with something meaningful, because I'm tired of doing that already.

Alexander LichterAlexander Lichter

Good point. They're also good contributions. Yeah.

Natalia TepluhinaNatalia Tepluhina

Because we don't want just variable names. We want to have more real life examples. Right? So this was huge project. We had the whole planning board, and everything was like, okay.

Who is working on what? There were a few people working on the docs. Like, how do we write this? And lots of reviews too. Because when you write something important, critical, like, part about reactivity, It needs to go through multiple reviews because back in times also, we didn't have a clear understanding about what is preferable between reactive and refs.

Alexander LichterAlexander Lichter

Now we know.

Natalia TepluhinaNatalia Tepluhina

Right. Now we know. But that's also the evolution of the framework, causes the evolution of docs. Yeah. You see how your user base is working with a framework. What do they prefer? Framework evolves, like, we and we write different recommendations as well.

Alexander LichterAlexander Lichter

And, like, best best practices, patterns you see in

Natalia TepluhinaNatalia Tepluhina

TypeScript too. Like, we had pretty minor TypeScript guide at the beginning of Vue 3 at the release moment. And I think it grew maybe 5 times in size, which means people use a lot of TypeScript with Vue 3, which is logical. It wasn't this easy with Vue 2. So now, like, everyone who loves TypeScript is happy to start with it.

Documentation as a garden

So yes. And documentation is ever evolving. Sometimes you also need to do what I call a cleanup. When you have multiple contributions, all of them make sense. You add them and add them and add them. But when you read that chapter after this, it's not that nice. There is no user flow. It looks like it was combined from random pieces here and there. And you need to rewrite it again to make it smooth, remove warnings. People like adding warnings.

I don't know why. But they just want to put the warning, and we try not to. They break readers' attention. Like, imagine you're reading the text, like, warning, like, about something else. Tip. Yeah. Again, warning, like, don't use it. It's really hard to follow. So, yes, it's like you need to track things because it's like a garden. You turn away, you come back, and it's all in weeds.

Alexander LichterAlexander Lichter

Clean up again.

Natalia TepluhinaNatalia Tepluhina

And weeds will be growing all the time.

Alexander LichterAlexander Lichter

Yeah. And if you have too many plants, those are not gonna look nice.

Natalia TepluhinaNatalia Tepluhina

Nope. And you need to always think about it and work on it, but that's never stopping.

Alexander LichterAlexander Lichter

Fair. Yeah. It's like a code as well. It's never never ending process. And it's also interesting, like, for example, the reference reactive part. I mean, I guess we all set it on ref nowadays.

Natalia TepluhinaNatalia Tepluhina

Oh, I I still can see reactive in some cases where it makes sense, which is fine. That's part of the API. But, yes, we did set on it, and the docs also changed accordingly. You can see that examples are with refs now. And you also need to track kinda measure the temperature of what what is going there and come back to docs.

And it's quite easy when people make contributions. So, again, thanks to everyone who created issues or pull requests, because this is how you can see what is the mood of the most active part

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Of the users. They come, like, it doesn't make sense.

Alexander LichterAlexander Lichter

Absolutely. And I I think it's also, like, it's especially if, like, 2 ways of doing something with reactivity, each might having their own purpose. Like, I don't know if you have, for example, form state and reactive can be pretty nice.

Natalia TepluhinaNatalia Tepluhina

That was a good example. Yes. Reactivity forms.

Alexander LichterAlexander Lichter

I I, like, I always use the performance. They just, like, okay. I have it all together. It's good. But then, like, exactly, like, educating the users about that, seeing, like, okay.

Usually, use ref, but for form state, that might be a good case. But but commonly, you should maybe settle on on one way of doing things except you have a good reason to not to do it. So, yeah, it's a good idea to educate users about it as well and then sticking with what works. But it's also a problem if you have too many things to do like composition API, options API. It's also a big part, like, how right now, like, we have to toggle in Yes.

In documentation. We can, like, say, okay, for an Options API, composition API. We also talked about that, beforehand, like, various times. That that might be a bit tricky. Also, Evan agreed that, like, the the learning story for people coming to Vue is not okay. We have these 2 APIs, and then you could technically even use, like, composition API without script setup, which is probably not in the docs anymore, but still we could just use a setup function also for migration and so on.

Separating Options and Composition API docs

So what do you think could be, like, a solution to a a better learning path for for the users?

Natalia TepluhinaNatalia Tepluhina

So I still think that it might be a good idea to separate it not with a toggle, but with separate subdomains maybe or even completely separate documentation where you choose and go this way. Because we honestly, nobody wants people to combine two API styles of the same component. That's the worst outcome you can have unless it's migration. And even for migration, I would recommend, okay, you want to use certain API in this you rewrite it all.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Don't do part options, part composition because that's the best way to get lost in this component forever and for viewers too. So maybe separating and maybe I remember the discussion about eventually deprecating one of the things, but the point is there are many people around who like options API.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

And, well, you remember this huge thread on Reddit Oh, yeah. All that?

Alexander LichterAlexander Lichter

The also the the video, the proposal of Justin, like, everywhere, people, had very strong opinions about other things. And in a way, like, options API is some part of use identity. Like, it started with it. It's like it is easy if you just use it as, like, maybe not a fully proficient front end. You just need tiny pieces of front end. Why not going for that?

Preferring the Options API for huge teams?

Natalia TepluhinaNatalia Tepluhina

And it's also easy on the huge teams. Like, when you have a bigger team, 100, few 100 engineer, it's a good idea to to use options because you can look at the component and you have no idea who wrote it. But all the things are at the same places. It might sound as a really stupid argument, But trust me, when you have multiple merge requests to review every single day, you want to find things in the same places. So just quickly understand what's going on in someone else's code.

That's the biggest problem. Like, composition is amazing, and it also gives you a lot of freedom, which is a benefit if you're developing your own project or you have a few colleagues and you all agreed on like this. For bigger ones, you will need to invent your own convention. Otherwise, it will be really hard, and those conventions can be as silly as you want. I saw people grouping composition API, just like the options API. They literally have data, like, methods Yeah. Computed commands.

Alexander LichterAlexander Lichter

I also made a video about that saying, like, hey, folks. If you use composition API,

Natalia TepluhinaNatalia Tepluhina

maybe It's not the way, but

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

Like, it works for them. And if you want them to use something better, you need to propose the alternative convention because no convention is the worst. People will be looking at each other's code and, like, what is happening here? Yeah. So I think maybe the best way forward, maybe I'm just a bit too optimistic, is to actually offer this kind of convention very well explained.

I'm sure not in the Vue docs because this is not the responsibility. Yep. It should be adapted adapted to the project. But there should be some kind of the guide, like, okay. You have this kind of how do you decide on your conventions? How do you shape your code so that everyone can understand? So composition API is the way to go. Like, I think we all understand that it's it's kind of the future. There are libraries that only work with composition API.

Alexander LichterAlexander Lichter

Vapor mode coming up, also only for composition API.

Natalia TepluhinaNatalia Tepluhina

Makes me a bit sad in terms because I will be behind. We still use Vue 2, and we will talk about that. But and, yes, that will be additional headache for me as principal engineer to invent the convention and agree this convention with everyone because we have developer democracy, and this this will be problematic. We'll fight for 6 months probably over the convention only. But this is I think that it was the main point in regular discussions too.

Yes. People want predictability from the code. Yeah. Options give them this predictability with some price. And this price being not the flexible code, like, very opinionated grouping.

Alexander LichterAlexander Lichter

Yeah. I mean, like, if you have a really big component in options API, it's super tough to read. You might know where you find, like, your your variables and, like, your computers, your methods.

Natalia TepluhinaNatalia Tepluhina

And that's a problem of architecture too. Right? You will need to split this component with composition API or at least move logic to composables. It's easier.

Alexander LichterAlexander Lichter

Exactly.

Natalia TepluhinaNatalia Tepluhina

But, again, that's I think that we will need to answer this question in the documentation outside of it for the people who love options API for its predictability and rigid structure? Like, how what can we offer them instead? How can they use the composition API and still keep the convention in place so they feel more comfortable with the code of the bigger team. So, yeah, that's the problem to solve.

Alexander LichterAlexander Lichter

I mean, technically, as you said, you can structure, like, the options API eventually. Like If

Natalia TepluhinaNatalia Tepluhina

you don't want to, you lose the flexibility again.

Inline Composables and other architectural patterns

Alexander LichterAlexander Lichter

Exactly. But I also think if you like the composition API, like, there are certain concepts that people were not aware of. Like, what I what I was also showing in the video about inline composables. Like, Evan did it in his first draft of, like, moving the the Vue CLI thing over, but I still I have seen lots of projects in my day job and I have seen no one using inline composables that way. Now consulting is not you don't see the most glamorous projects usually, of course.

Otherwise, you probably wouldn't be asked to help out. But still, it's it's super interesting that not that many people are like, okay, like in normal JavaScript, script, you write a function to, like, encapsulate your code.

Natalia TepluhinaNatalia Tepluhina

And it's weird to me because how many times did you write a method?

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

A method that is used in this component multiple times, not only for the side effects. Sometimes it's a method that does some calculation. Right?

Alexander LichterAlexander Lichter

Okay.

Natalia TepluhinaNatalia Tepluhina

You pass a parameter. You do some data mapping. You return the value that you want. And that's exactly what composable can be doing too if you work on more advanced level with reactive state.

Alexander LichterAlexander Lichter

Yep.

Natalia TepluhinaNatalia Tepluhina

Just put it there and use it. It you don't need to create an additional file, put it there, and import it to your component and just

Alexander LichterAlexander Lichter

I think that the problem is a bit that, like, with the composition API, everybody praised, okay, you can now, like, share logic. And sharing is common, like, okay, I put in the file. I can use it everywhere. It's really cool. But it's a bit like overcorrecting. Right? And I I did the same, like, in the beginning of the conversation. I was like, okay. Cool. I can, like, add a composables folder, put my composable in there, and then I use it in one component.

Wow. But just leaving it in there, and then, like, Okay, I call my composables and reusable functions for that component just on the top. Maybe I pass in some state I get from other composables in there, or like, Okay, I have my v model bound to something that I passed in there. That totally makes sense. But making that connection, that took a little bit.

And I hope that something like this, like more architectural patterns, like how to deal with certain scenarios, maybe there will be somewhere documented to have, like, a bit of maybe something like a cookbook or best practices because then

Natalia TepluhinaNatalia Tepluhina

But it all also takes the evolution of the framework. That's the point. You cannot try them from the start because it's really just your opinion.

Alexander LichterAlexander Lichter

Yeah. I don't know if people like it or use it, if it makes sense in the project. You need a feedback, of course.

Natalia TepluhinaNatalia Tepluhina

It comes naturally. The more people use vue 3, the more they come up with the same problem and some solutions.

Alexander LichterAlexander Lichter

Yes.

Natalia TepluhinaNatalia Tepluhina

The more it's natural to then put it in the documentation or guideline of the book because now we know. Like, people used it, tried this way, tried that way. Now we know what is better, and we can bring it back to the documentation.

Alexander LichterAlexander Lichter

Yeah. Yeah. I also like this, like, symbiosis, like, hey. It's always a feedback loop. Right? You you do something. People use it. People complain about certain things. They, hey. We can improve this or we use it that way.

Does it make sense? For example, I also seen people saying they use, like, IIFEs, like, immediately invoked function expressions just in, the script part. So, like, okay, I don't want to reuse it. I just want to use it straightaway there to encapsulate things. So there are lots of interesting patterns, let's say, But, of course, they're also keeping misusing composables for other things or, like, don't know the difference between what a composable is and what a function is.

So, like or why do we even have to separate them? It doesn't matter. So, of course, talked about lots of these things, but, yeah, these these patterns and these practices, I think if we would see more of them contributed by by many people, like, suggesting suggested by many people, I think that would help the whole community.

Natalia TepluhinaNatalia Tepluhina

Yes. Yes. Absolutely. That's why it's extremely valuable, the work that you do with videos, the people who write articles, people who bring this to the public discussion so it's more visible, and we can shape the patterns. People can test the pattern. Right? Okay. And now I learned about in line composables, they will test it, bring it back, and this is how it goes. Yeah.

Overusing Watchers

And I think it's natural process because at the beginning of Vue 2, I remembered there were so many people overusing watchers. Oh, yeah. I don't know if you remember, like

Alexander LichterAlexander Lichter

Still people doing. I've seen I've seen it very often. Yep.

Natalia TepluhinaNatalia Tepluhina

Like, put everything in the watcher. You and computers just slowly evolved to be a norm, and, like, watch your strength to, like, yeah. I really need this side effect. I really need this side effect from this particular prop changing. Like, I'm watching it. But this is what is happening with composables too. People try many different things. Sometimes, some of them are very wrong.

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

And then we have some best practices crystallizing.

Alexander LichterAlexander Lichter

Yeah. I mean, it's the same with composition API and server side rendering, which, also wasn't easy for the Nuxt team. It wasn't easy because at least from my point of view, composition API wasn't really written with service side rendering in mind. It's like sharing a ref between the server and client is not that straightforward when you just, like, have plain Vue with SSR. I mean, that's why we have, like, useState in in Nuxt.

So, also, that's like, okay. People have to come up with with ways dealing with that. Everything in terms of server side rendering, it's fine. Just like meta frameworks to deal with it. That's I understand the reason behind that because there's enough to deal in the the view core itself. But, yeah, same applies there.

Natalia TepluhinaNatalia Tepluhina

And you need to find a way again, find the best practices and trying to figure out. But, yeah, this is the evolution we're dealing with.

People - Share your thoughts and patterns!

Alexander LichterAlexander Lichter

Absolutely. And, as you said, everybody creating content or maybe someone is like, hey, I've I've had a really cool method. Please write it down, share it with the community, be ready for some constructive criticism, but, like, that's the best way to do it even if somebody's like, oh, okay. Not my jam, but I see the point there. Doesn't hurt. So, like, sharing knowledge even, like, you don't have to be the the best in in Vue. Js or, like

Natalia TepluhinaNatalia Tepluhina

Absolutely not.

Alexander LichterAlexander Lichter

Don't. Just like, hey. ok. We do this in our company. This was useful. So in our use case, yeah, wanna try it out. Here, this is how we do it. Why not? I think it's

Natalia TepluhinaNatalia Tepluhina

Creating issues, asking questions, bringing things up, like sharing your little tips. That's all important. And I can understand it can feel a bit scary

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

To just bring something to the public. But if you even try to do this, you're already helping the whole community. And Vue is not the biggest framework. It's one of big three. Yes. And we have very active and nice community as you know.

Alexander LichterAlexander Lichter

Absolutely.

Natalia TepluhinaNatalia Tepluhina

But the more content you produce and because it's also content. Creating an issue is a content. Yeah. Creating pull request to docs is a content. Like, the more content you create this way, it's the better is for everyone.

Alexander LichterAlexander Lichter

Yeah. People searching, finding issues, like, I mean, I've searched so many times in land and issue on my own because, like, oh, yeah. I wrote that. Or I answered it. I was like, damn. That was not a very satisfying answer. But

Natalia TepluhinaNatalia Tepluhina

I'm still using some of my articles to set up my Vue apollo client.

Alexander LichterAlexander Lichter

Yeah. I mean, that's, like, sometimes it's just self documentation and then if you'd write it anyway, why not sharing it? Like, it doesn't hurt. But also doesn't hurt, of course, that we talked about public speaking before is coming to the Vue.js DE conference in Bonn in Germany.

Vue.js DE Conference

So we from DejaVue got a little 10% discount here. Link in the show notes. So if you wanna join, Natalia, you were in Berlin, the same conference, just one day. This this year is 2 days, 2 years ago, and, had a blast. I remember we, talked about there also.

Natalia TepluhinaNatalia Tepluhina

It's a really nice event. Totally recommend it.

Alexander LichterAlexander Lichter

Yeah. So, hope, to see you there. I'll be there. Vanessa will

Natalia TepluhinaNatalia Tepluhina

Vanessa will be there.

Alexander LichterAlexander Lichter

Daniel. There will be Evan, you, not, like, in place, but with a remote live q and a. So if you have a question, want to ask Evan, then, don't write him a DM but, come around and and ask it there straight away.

Migration from Vue 2 to Vue 3

But, yeah, now let's talk about, what we already started a little bit. You said, like, okay, composition API, options API, and the same component. I've seen it countless times people using composables and, like, the options API part and, like, uh-oh.

Natalia TepluhinaNatalia Tepluhina

It's go it's going to bite them back.

Alexander LichterAlexander Lichter

Yes. Yes. Vue 2 to Vue 3 migration. Yeah. That that's how lots of people felt, and we don't even talk about, like, not knocked on top. It's also hold up like, that's once again another level. Yeah. How how did and do you experience that

Natalia TepluhinaNatalia Tepluhina

I'm sweating already. So, yes. First of all, disclaimer. We're still on Vue 2.

Alexander LichterAlexander Lichter

In GitLab.

Natalia TepluhinaNatalia Tepluhina

At GitLab. Trying to move to Vue compat mode 3. We started with at GitLab.

Alexander LichterAlexander Lichter

So, like, the Vue 3 3 build with Vue 2 functionalities.

How the component library blocks migration

Natalia TepluhinaNatalia Tepluhina

Yes. Currently, like, what we have in place is Vue 2 with Vue compat in mode 2, because otherwise we just break it completely. And we slowly trying to get to Vue compat mode 3. Not even to Vue 3, not possible at the moment because it happened that we use bootstrap Vue And unfortunately for us, we use it in our component library.

And even more unfortunate, and here people are going to blame GitLab a lot, what happened with the GitLab's component library is that we wanted first to build it as a beta, like, just to try things. And as a beta, we wrapped bootstrap view components with our own components, passing everything with the bind address. And then the idea was that when we have it in place, we exclude bootstrap view from the main codebase as dependency. We use our only our own component library, and then we can rewrite components. This step never happened.

Alexander LichterAlexander Lichter

Yeah. What a surprise. Like, oh, yeah. The MVP we will clean it up later. Yeah.

Natalia TepluhinaNatalia Tepluhina

Later.

Alexander LichterAlexander Lichter

Never. Mhmm. Yeah.

Natalia TepluhinaNatalia Tepluhina

Now those components use bootstrap here under the hood. And before we even move the main code base to mode 3, we need to move the component library to mode 3. Makes sense. Right? We cannot just move use the dependency that doesn't work with mode 3.

And here comes the problem. Boodstrap never migrated to Vue three. There was a valiant effort from one of our team members, also super active in the Vue community, Ilya. Mhmm. He worked he took over the Bootstrap Vue and tried to at least make it work with compat, which is already a huge step. Unfortunately, making it work with Vue 3 is not possible. It will be literally the rewrite, and the rewrite is already happening in the other library. It will bootstrap Vue next.

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Now you can use this one for the Vue 3. So we were stuck, and now we are trying to solve this problem. And on top of this, we have bunch of tests passing. We were using Vue from the very start, from 2016. We were using Vuex. It didn't exist, so we brought our own state management back in time.

Alexander LichterAlexander Lichter

Still in the code?

Natalia TepluhinaNatalia Tepluhina

In a few places, unfortunately. Yes. Now we have 4 state managers.

Alexander LichterAlexander Lichter

So Vuex, Pina?

Natalia TepluhinaNatalia Tepluhina

Vuex, Pina, Apollo, and the old one. Yeah. Wow.

Alexander LichterAlexander Lichter

I I've seen a lot, but everything go okay.

Natalia TepluhinaNatalia Tepluhina

But, yeah, it's a pretty big

Alexander LichterAlexander Lichter

project.

Natalia TepluhinaNatalia Tepluhina

And it's big. Yeah. And it's also we don't use it as an SPA. That's also one of the things. We do mount Vue applications on different pages. On some pages, multiple Vue applications don't do these kids. On some pages, it's up to 20 Vue applications.

Alexander LichterAlexander Lichter

Because you use rails under the hood. So everything is server and by rails, and Vue is basically for progressive enhancement, let's say.

Natalia TepluhinaNatalia Tepluhina

That's the good point because we do say in Vue 2, you remember we did say that you can just drop Vue at some little place of your page to make it more interactive, and that's what they did and let it grow uncontrollably. And now we are slowly moving to the idea of cluster, SPAs cluster, because we cannot just realistically move this to one big SPA, but to multiple SPAs. So at least on the when you're on the issue list, you go into the issue and back. That's one app dot page flow. But, yeah, that's a bit of an off topic, which has given an idea that it's not a monolith application.

That's why we can tweak different parts a bit differently. But, yes, lots of tests failing, lots of old practices being used. It took some time to clean it even from old slot syntax.

Alexander LichterAlexander Lichter

Oh, okay. You remember when

Natalia TepluhinaNatalia Tepluhina

I had slot scope? Mhmm. Not scope, slot. And I think the last occurrence of Vue dollar sign delete was only removed 2 weeks ago.

Alexander LichterAlexander Lichter

Oh, wow. I haven't heard that in long, long time.

Natalia TepluhinaNatalia Tepluhina

The Vue site is still there, by the way. But

Alexander LichterAlexander Lichter

Yeah. Okay.

Natalia TepluhinaNatalia Tepluhina

So you you can think about how bad and old it is. And there are lots of problems with the migration even outside of bootstrap Vue. Bootstrap Vue is a big problem, obviously. But I would say one of the biggest one is unit testing. Unit tests do fail in mode 3 a lot.

Updating Unit tests during migration

And sometimes it takes a lot of time to even understand why why it's happening, why the node is rendered not right now in a different way. Yeah. Like, with binary attributes, like disabled. A few of them. Right?

They disabled and checked and whatnot. It's very different between Vue 2 and Vue 3. Sometimes it goes about the testing practices. Like, I had to talk why we use why why shouldn't you should use shallow mount and had lots of discussion with people who love mount. But now try to imagine that you have a component tree with a depth of 12 at the maximum from root to the child component, and you mount the root one in the test. And it fails. I have no idea why.

Alexander LichterAlexander Lichter

Yeah. Fun that's it'll be fun finding the problem.

Natalia TepluhinaNatalia Tepluhina

Yeah. Just even trying to figure out what exactly from the tree causes the problem is already not a good thing.

No CAPI during migration

And we migrated to Vue 2.7. And just to give you an idea, we prohibited people to use composition API in Vue 2.7 because we don't want to deal with more problems during migration. And inevitably, we would just because the people that never wrote composables, starting with composables is going to have some learning curve. So

Alexander LichterAlexander Lichter

So it's not about that the composition API that was back toward 2.7 2.7 has a problem with the Vue three implementation. It's more like this is that learning curve architecture structure.

Natalia TepluhinaNatalia Tepluhina

It's like we already have a lot right now to deal with, and we don't want to add more problems right now with the migration. So let's port it as it is with an options API. Some sometimes really bad options API, I have to say. Sometimes you figure that, well, that people mutated computed properties, object. You put an object in it that returns in the computed, and you can mutate it. I learned. I didn't know that you can the property.

Alexander LichterAlexander Lichter

That sounds interesting. Okay.

Natalia TepluhinaNatalia Tepluhina

That's the point. And Vue 3 what what is cool about Vue 3 tests? They're way more strict. Vue 2 is very forgiving in tests. So for example, quick thing. You access some property in some of the methods. Methods, not template important. In Vue 2, that doesn't exist. It you forgot to declare a property in data, and you use it somewhere in the method. If the method is involved, probably you will have end of undefined thing.

But Vue 2 basically says this is undefined. It's okay. If it's not directly preventing the method from the execution, you will never see it, which you just called with undefined. Defined. In Vue 3, in tests, if you miss the property, the test will be like, this is missing. I found the component that is missing 6 properties. I have no idea how this past the review.

Alexander LichterAlexander Lichter

But it's perfect. Like, you catch some bug just

Natalia TepluhinaNatalia Tepluhina

by when you have 3,000 tests failing.

Alexander LichterAlexander Lichter

It's not fun anymore.

Migration of big old projects

Natalia TepluhinaNatalia Tepluhina

That's not fun. Like, you understand how much you need to fix, and some of them are very unclear because of the moment. Right? And, honestly, our pipeline that tries to run the test in mode 3 is out constantly out of memory. My laptop is out of memory when I try to run all the tests as well.

So this just gives you an idea that migration of the old big project is a bit different from migrating the small personal one or the one that was more modern. At least, we're getting after view 2.6. At least slow scope is doesn't require cleaning, or you don't or you don't use view delete because you know it's bad now. Or you don't mutate your commuted properties. Don't do this again.

And I think that, unfortunately, this scope of old big projects with massive teams was not the target audience when, we as a core team developed a migration path. Because there is a helper, it doesn't help. There is testing library that unfortunately is very problematic when you start dealing with the migration. There are many things with dependencies. It's not exclusive to Bootstrap View.

Vuetify took really long time and lots of effort to just get there. And imagine that were there were project dependent on Beautify. Nuxt took some time.

Alexander LichterAlexander Lichter

Really? I can't remember. Nuxt

Natalia TepluhinaNatalia Tepluhina

bridge took some time.

Alexander LichterAlexander Lichter

Yeah. I mean, Nuxt bridge got feature, like, feature Nuxt bridge got released, like, couple months ago. So and also that the whole Nuxt journey is is once again very difficult.

Responsibility of library authors

Natalia TepluhinaNatalia Tepluhina

And you cannot blame library authors because they were all already building something on top of the framework. Not only on the language, on the framework. And the framework suddenly changes, and I need to adopt. Some libraries are quick and easier to adopt. They didn't use some particular rendering mechanism, especially rendering mechanism. That was a big, big, big shift. Right? Like, if a library were just calculating some things, I think form validation libraries moved faster

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Just because the logic was easier to move. Things like component libraries, though, they were digging deep into the internal methods of you. And lots of things like dollar sign parent, dollar sign root puts the fewer list. Like, lots of dollar sign root.

Alexander LichterAlexander Lichter

All gone. Yeah.

Natalia TepluhinaNatalia Tepluhina

It's all gone, and you need to deal with it. And the project depend on you also.

Alexander LichterAlexander Lichter

And there's also on top of figuring out how to, like, rearchitecture everything working with composables because now you have that. And, okay, Vue 3 is out or, like, beta and composition API, but still the best practices aren't there. So you have to put really lots of thoughts into it because you also don't wanna, like, put another version 4 or 5, 6 of the library, like, another major after major. I was like, okay, we tweaked the composables. They work differently now.

So, yeah, that's all in addition to, like, updating the library with the internals. And as you said for a project, I've seen lots of, like, migrations, and they usually often have, like, a big, big table library and then not needed or there's a replacement or, well, we have a problem.

Natalia TepluhinaNatalia Tepluhina

Yes. And, again, that's one of the things that, unfortunately, when we talk about Vue 3, which is pretty standard right now, it's not even new. It's a standard. Right? The people who have those big teams and big code base, we do feel forgotten, honestly. It's like it's cool. Like, all the cool kids are using this new toy. Right? And you cannot realistically and it's a problem for the company too. Like, during the hiring process, we did have a few candidates. Like, oh, you're using Vue two.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

No. Thanks. Mhmm. Which is, I think, completely fine because you would need to deal with the code base. Maybe not legacy legacy right now, but slowly getting to this stage.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

It's not supported anymore, and it's it reached end of life. So, yes, like but the efforts for this migration, like, if we finish I'm not saying I'm not saying when. If we finish it one day, I swear I will write a book about this.

Alexander LichterAlexander Lichter

Vue Two to Three migration.

Natalia TepluhinaNatalia Tepluhina

Like, story of my life.

Alexander LichterAlexander Lichter

Though, I I think, like, lots of things that you also mentioned here and, like, that you tackled during migration, I think they would also be very helpful, like blog posts or, like, even in that podcast, obviously. So other people on the same boat that like, okay, we have to migrate over. We don't have to rewrite everything. Big bang doesn't work. We can't just do that. They might also, like, get some teeny tiny points with, like, okay, we can try this. We can do this.

Natalia TepluhinaNatalia Tepluhina

Yeah. Especially, we already identified some cases. Like, okay. If you see this cryptic error, probably this is what happening, and this is how you need to restructure. There are already the guidelines, and I think they're not even internal guidelines. We document everything as public. Yep. So people can just, take right now, it's not super public. You just need to look into epics and see what we decided to go with.

Alexander LichterAlexander Lichter

Maybe you can, like, put an example link in the show notes so people know what to look for.

Natalia TepluhinaNatalia Tepluhina

But a few things were super helpful. You identify some cases and you bring them back. And, like, in test, for example, don't use native methods with bootstrap few components. Like, never. Don't do click. Do emit click because this is going to break the test, or this is going to break the test. And also this is snapshots. Yeah. At this point, I'm like, never test with snapshots, which is pretty strong statement. Yeah.

I understand many people will disagree, like, I like snapshots. But, lord, the snapshots testing is every snapshot is different between Vue 2 and Vue 3.

Alexander LichterAlexander Lichter

You have to update them all, but also check that they're

Natalia TepluhinaNatalia Tepluhina

But you need to check that it's updated for a reason. Like, okay, this there is no break then there is no breaking or there is no white space there. Yeah.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

It's okay. But if it has different apparently, part of half of the componentry is gone sometimes.

Alexander LichterAlexander Lichter

Yeah. That's, it will be tricky. And I also like the typical, like, okay, just click on update the step, but it's fine.

Natalia TepluhinaNatalia Tepluhina

It's fine.

Alexander LichterAlexander Lichter

Like, that's, like, you also wanna deal with, I said, 2,000 test failings, and, like, all the snapshots taking each of them. It's tedious work, but it's it's necessary. But I I I see the point where it's like, okay. Snatch for testing. At least not the whole tree, that's

Natalia TepluhinaNatalia Tepluhina

Yeah. Mount, maybe just a little thing from the tree, not the whole component. And, god forbid, not the whole component tree, not the whole component in general. So, yeah, at this point, it's fixing the test, trying to bring things. On the good side of things, main core libraries were good to migrate.

Mhmm. Like, we I think we didn't have any problem back with Vuex or VueRouter. A few fixes here and there, but Yeah. Not nothing major, neither with, not core, but important for us was Vue Apollo. Mhmm. Pretty good, pretty well compatible with View. Yep. Compat mode as well. So, like, I cannot blame anything from the core, honestly.

Alexander LichterAlexander Lichter

Just the others.

Natalia TepluhinaNatalia Tepluhina

I mean, bootstrap-vue was the biggest problem. Yeah. Maybe view test details to some extent, but we also put a lot of work to fixing them, contributing to the Vue test utils upstream.

Alexander LichterAlexander Lichter

That's also really nice that you like and we we also had a countless time stamp. So, like, okay, fixing a bug internally versus, like, actually pushing it up being making that extra effort to do the PR. That's that's also very helpful. So if anyone ever encountered a bug, fixed it locally, maybe patched it, like, hey, come. Do do at least a little work. Write an issue. Write the, hey, here's a try.

Natalia TepluhinaNatalia Tepluhina

It was also, multiple contributions to Vue compat

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

And to Vue core just to fix a few things that were not working for us. I think the last one was merged last week.

Alexander LichterAlexander Lichter

Oh, well.

Natalia TepluhinaNatalia Tepluhina

Yeah. So if you also if you encounter that issues, at least try. Sometimes it's not merged from a while saying, like, fine. I'll patch it on my side, and we'll work with it on our code base. Yeah. But maybe it will merge later and you can just update and remove your patch. So

Vue 3 Breaking changes

Alexander LichterAlexander Lichter

Everybody will benefit as well. So that's good. And how about the Vue 3 breaking changes themselves in the core? Was that a bigger problem for you?

Natalia TepluhinaNatalia Tepluhina

No. We will still need, like, when slash if, we will move to exactly view 3 Yeah. Outside of the compat. Updating model values mostly. I think that will be the biggest one. We use v model quite a lot. Removing all the reactivity caveats like hello Vue set because we use it we use it. It'd be

Alexander LichterAlexander Lichter

so nice to just, like, have properties everywhere.

Natalia TepluhinaNatalia Tepluhina

That's the point. And I think that's about it. It will look pretty okay in most cases if you don't mutate your computed properties of props. By the way, Vue three allows you still to mutate props Oh. If it's an object. Don't do this.

Alexander LichterAlexander Lichter

It should probably be a warning or something if you actually do that.

Natalia TepluhinaNatalia Tepluhina

That's the problem with detection.

Alexander LichterAlexander Lichter

Yeah. It's not that. Yeah.

Natalia TepluhinaNatalia Tepluhina

It's easy. It gives you a warning. If it was a primitive value, you you would immediately have a warning. When it's an object, it's a bit more problematic because JavaScript allows you.

Alexander LichterAlexander Lichter

Yeah. Yeah.

Natalia TepluhinaNatalia Tepluhina

So, like, you cannot just go against the language and just do this detection properly.

Alexander LichterAlexander Lichter

No. I see.

Natalia TepluhinaNatalia Tepluhina

Un unref them.

Alexander LichterAlexander Lichter

It's it's it's definitely it's definitely interesting. I was, like, cases that you would never think about people doing it, but it's it's kinda

Natalia TepluhinaNatalia Tepluhina

That's why I told you people have the wildest imagination possible.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

And they will do things you would never expected them to do. And need to deal with it both as a team member and as documentation co author.

Will the migration ever end?

Alexander LichterAlexander Lichter

So you said if for the future distribution. Like, but you you are you certain that you'll finish it one day, ever? Not stuck forever on Vue 2?

Natalia TepluhinaNatalia Tepluhina

Well, right now, there is a huge effort to vendor bootstrap you and rewrite the only use the parts of it that we have in our components and rewrite them in the compatible way. So that's that's going on

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Right now, but it will take lots of time. And there are components that are super, super complicated, like a booster view table. This one breaks all the laws of physics in terms of Vue. It just uses everything it shouldn't. Yes. If if you look at the source code of bootstrap Vue table, you will see what I mean. So, yeah, this will take some time to migrate. And, see, I'm already on the pessimistic side because we've been there for a few years

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Trying to migrate, trying to move. Probably, we didn't make a good step. We should have decided to render the library from the start instead of just trying to fix it. It's is just trying to get it to compact mode, but we didn't realize we are not able to bring it to vue 3. Yeah. So our best best possible for right now is get to compat mod 3, which will give us headache with tests. But

Other tips for migrating

Alexander LichterAlexander Lichter

That's how it's going. And is there any fails in terms of Vue 2 to Vue 3 integration that you like to tell the audience, the listeners, everybody, you out there everywhere, that also, like, suffering from that? Maybe some tips like, hey, Don't worry. It will be fine. Just a few more years.

Natalia TepluhinaNatalia Tepluhina

Just wait for 5 more years to ???. The main point is you will find root causes for your problems. At first, you should think like, okay. There are 33,000 failing tests. Not all 3,000 have the the same issue, but it's not 3,000 problems too. Normally, it will boil down to maybe 10 cases. And then you will be solving problems in chunks. Like, okay, this is different. This causes a bunch of tests to fail. And now you have an idea what to fix exactly in the components.

Sometimes it's in the components, not the or in the tests, how you manage your tests to fix them. So, like, if in the beginning, it feels like, yeah. Oh my god. How how I'm fixing those? It will be it will get easier as you go. So this this is a good part. And some of the things are still fixable with the compatibility tool. You can just or your own. Like, you can really write code modes. It will fix things for you with some human inspection after.

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

So some of them them is automatable. That's that's a good part too.

Alexander LichterAlexander Lichter

Great. So, basically, don't give up.

Natalia TepluhinaNatalia Tepluhina

It's Yeah. Keep keep trying. One day, you'll get there.

Migrating without tests

Alexander LichterAlexander Lichter

You also mentioned this, this thing maybe some people are not familiar with, a test. So Oh. What so what would you recommend people saying, like, okay, we have this big view to code base and we we maybe don't really have tests.

Natalia TepluhinaNatalia Tepluhina

At

Alexander LichterAlexander Lichter

all. Like, maybe an end to end test for, like, some

Natalia TepluhinaNatalia Tepluhina

And turn's already good.

Alexander LichterAlexander Lichter

For, like, the mission critical part, like, the app is starting.

Natalia TepluhinaNatalia Tepluhina

Well, it's it's good and bad for you. Good, because you don't need to fix tests. No tests, no problems, right? The pipeline is we do have a pipeline too. Okay. The CI is green, but at the same time, you might miss issues. Compat gives you lots of warnings. That's a good point. When you enable the compat mode 3, it gives gives you a bunch of warnings you can fix. So in this particular case, I would never recommend going migrating in bunch.

You will need to enable mode 3 component per component. If you don't have tests, definitely don't enable it for the whole application. There will be places it will break, and you will have no idea. Go component per component. Check the warnings that you have in the dev mode. Try to reduce the number of warnings to 0, move on to the next component, and start writing tests.

Alexander LichterAlexander Lichter

In the same time, if you've mixed things, like

Natalia TepluhinaNatalia Tepluhina

I mean, you can start with tests and then go you can you can start with tests after, but at some point, write the test, please.

Rewrite vs Migration?

Alexander LichterAlexander Lichter

Yeah. That make that totally makes sense. And then would you say, like, is there a chance that people would be better off with a rewrite than migrating things over? Are the scenarios like, Yeah, let's just just rewriting an application would be the better choice.

Natalia TepluhinaNatalia Tepluhina

This is this really depends on the size of the application and complexity of the application. Some of them can accept as burn this to the ground, write it from scratch thing. Some of them, unfortunately, are too big, too old, and too complicated. Sometimes, yeah, I can just try this. Well, no.

You cannot because, apparently, now it's a system where you touch one place and everything's ruined immediately. So you will need to decide for yourself, honestly. Sometimes, yes, it makes sense to burn it in the right. Sometimes

Alexander LichterAlexander Lichter

it's not possible. Yeah.

Not migrating at all?

And there's also a third way we didn't really touch. Or, well, you kinda did a little bit. What if we don't migrate at all? What if people just, like, okay. We stay on v 2 till the end of day.

Natalia TepluhinaNatalia Tepluhina

It's also a valid point, honestly, even though the Vue 3, Vue 2 is end of life. But I don't remember super major bugs fixed even from Vue to point 6 to Vue to point 7. It's pretty mature product. Right? There wasn't anything super critical. The problem is, though, with the is with the libraries. I doubt that there is any product that is not evolving at all. If it's not, like, what are you even doing? I mean, you're lucky. You just need to maintain it.

If you just need to maintain it and you're not adding any new features at all

Alexander LichterAlexander Lichter

Don't touch it.

Natalia TepluhinaNatalia Tepluhina

Let it be. It works. Yeah. Right? It works. Don't touch it.

Alexander LichterAlexander Lichter

Like petite view. Like, okay. It's it's feature complete. It's done.

Natalia TepluhinaNatalia Tepluhina

Like, it's fine. But when you add new features, you have new drag and drop library. And, apparently, there is one old forgotten super buggy library for Vue 2, and all the new ones are for Vue 3. They're not compatible with you. And, again, product evolves, you discover new things, you discover, I don't know, VueQuery, TanStack Query now. I'm not even sure it's compatible with Vue 2, honestly.

Alexander LichterAlexander Lichter

Right now, I don't think so.

Natalia TepluhinaNatalia Tepluhina

I think I don't think so. It's composables. It's built on composables. Yeah. Like, Vue Apollo still supports both, but you want now to be cool and use Tan Stack Query, and you cannot. So enjoy axios.

Alexander LichterAlexander Lichter

Not even fetch API. But, yeah, in the end, as you said, it's a lot lots of big decisions, and it's also not only on the depth. It's like, okay. The whole business in the end needs to decide on that. But if you can't move forward, if that's like blocking his head, like using the newest libraries, not just because they're trendy, just because they actually make you more productive.

Natalia TepluhinaNatalia Tepluhina

You will have to at some point, that's that's the point of your productivity. Yes. You will need to use dependencies. You want maybe you want more performance for some parts of the application. We do have this case where the rendering performance is critical. It's diffs. When you render 10,000 components, the difference is there.

Alexander LichterAlexander Lichter

Yeah. And with Vapor Mode, we'll even go better. And for that, you need composition API.

No CAPI during migration?

And you mentioned, like, with migrations, stick to the options API first, and then when everything works, move forward?

Natalia TepluhinaNatalia Tepluhina

For us, the idea was we move from there. And then we can afford writing composition API. We don't want this in the same component because there was an idea there that just bring Apollo composables to the options API component. No. Thank you. It's it will help us abstract things, but it's also super complicated things on the component. So after this, the idea is we develop composition? Not not how we use composition. Not on how we use composition API.

We have Vue docs for that. Yeah. But how do we use composition API?

Alexander LichterAlexander Lichter

At GitLab.

Natalia TepluhinaNatalia Tepluhina

At GitLab. Yeah. That's that's how we want to write it. And, again, from my experience with big team, literally any opinionated convention is still better than no convention at all.

Alexander LichterAlexander Lichter

100%.

Natalia TepluhinaNatalia Tepluhina

On the scale, it just it just easier.

Alexander LichterAlexander Lichter

I mean, you then at least know what you expect in certain scenarios. Right? And for example, like, what Vue use is doing, they also have, like, some best practices for their composables and just, like, adapting them and say, hey. Look. In our in our code base, this is the guideline.

All composables, they should handle refs if you put them in also normal values. Like, there there are some things, like, providing composables, and we mentioned also when we talked about VueUse in a previous podcast episode, like, they're super helpful, and companies can adopt them already. Like, there's a really good page on that. So probably you also at GitHub adapt some of them. And at least developer developer says, no. It's not a good idea. But in in most cases, it might be.

Natalia TepluhinaNatalia Tepluhina

And we do have one project in Vue 3. I need to say this, GitLab dedicated, where we already put some things to test, right, like, in terms of convention. So this is a little playground where other people, even from the main product, who don't work on the dedicated, we are reviewing the code. And, like, okay. This part, we want to be okay. Now we see there are a few problems already here. So we probably will go this way. We'll go that way.

New questions with CAPI

Alexander LichterAlexander Lichter

Mhmm.

Natalia TepluhinaNatalia Tepluhina

Like, there are questions that come up naturally. Like, do you create reactive values in tests? In tests? Like, do you ever feel that this was later on my question today in the morning because in v two tests, you don't have the way to create oh, you do have the way. You have your observable, but I didn't say this.

But I never felt the need to create an observable in tests as a mock value. Yeah. But, apparently, now you have the test where you use use a router, and you don't mock it away. Or you use some terms of the composables, and you want to mock the value composable returns. This also happens. Do you even mock the composable returns or not? That's also the question. True. If you do like, for me, seeing computed or have been imported in test file, for example, was new, and this sparks discussions.

Alexander LichterAlexander Lichter

Yeah. Absolutely. I mean, once again, that can also influence the the greater discussion community. So, like, whenever you settled on some things, you you write why you settled on these because there there will be a reason. And then

Natalia TepluhinaNatalia Tepluhina

Then you write a conference talk, and you come to the conference, and you bring this to the wider audience. And

Natalia back on stage at a conference?

Alexander LichterAlexander Lichter

So people will have you back at the stage? Is that what you're saying?

Natalia TepluhinaNatalia Tepluhina

Well, if if there is more material. That's also the point where right now, I'm not even sure that it's a good idea to speak about something that is view 3 centered if you don't work on it every day. Right? Documentation, you know the source code. But knowing the source code and knowing how the source code, this this of this library is actually used in the product is is very different.

And, like, without this experience, I use this every day. I stepped on this Lego a million times. Now I can tell you how not to step on it. That's the point where you want this experience.

Alexander LichterAlexander Lichter

That makes sense. So it might take a little bit longer until tiny tiny Yes.

Natalia TepluhinaNatalia Tepluhina

For sure. Or finding the topics that are common for everyone, like test testing is not very different. If you think about the concepts of unit testing you can adapt it even to a different framework. But, like, for vue 3 specific development, yeah, it will take time.

Alexander LichterAlexander Lichter

Makes sense. Is there anything else that we, should talk about in terms of Vue two Vue 3 migration? Anything that we haven't covered yet?

Natalia TepluhinaNatalia Tepluhina

Besides crying, no.

Alexander LichterAlexander Lichter

Oh, we don't do that here. We're we're happy podcasts. Lots of laughter. I mean, tears of joy when it's done. But, yeah. No. Fair. It's it is a tedious process. That's, fair to admit. Maybe on that note, there is there is one more question.

What could the Vue team have done better?

What do you think could the Vue team have done better to, like, more incorporate these, like, bigger projects in terms of migration?

Natalia TepluhinaNatalia Tepluhina

The point is it would be nice to involve engineers from those to maybe some kind of the early access. If you remember the documentation and the product itself, the project, the Vue 3 project, was private for a long time. We allowed, developers from the libraries in Nuxt, Vuetify. I remember for sure Nuxt and Vuetify and a few more. But then it was pretty new for everyone.

So involving this communication a bit earlier would be super nice. But it's also not only with Vuetim. It's also about what we talked earlier. People should be more vocal about their feelings, and they should be more vocal publicly. Being open to this. That's constructive criticism being brought to the higher level.

Alexander LichterAlexander Lichter

Yeah.

Natalia TepluhinaNatalia Tepluhina

How many at the View conferences have you heard a talk that criticizes some parts of you?

Alexander LichterAlexander Lichter

Really. Yeah.

Natalia TepluhinaNatalia Tepluhina

It almost never happens because it's like, it doesn't feel okay to come there on the stage, see the audience, and, like, say, okay. We do have a problem. Let's talk about it. But, honestly, we should. I think, like, if you have something that you want to criticize constructively, you don't go on stage like, this sucks. No.

Alexander LichterAlexander Lichter

That gives no value to anybody. Of course not. No.

Natalia TepluhinaNatalia Tepluhina

But you go to we suffered here a lot. This is things we did. This is what probably could have done better from us and from the team side, but this is our story. That's an amazing story. I would be happy to hear more of those at the conferences.

That's a very cool idea. Gives me some food for thoughts and talks. If you if you have any experience saying, like, wanna share a story, why not submit it? Local meetups, conferences. There are quite some cool conferences coming on that we already talked about.

Alexander LichterAlexander Lichter

Also, something with open CFPs from Vue Toronto are still up, for for CFP. And And

Natalia TepluhinaNatalia Tepluhina

there will be more to come after. Right?

Alexander LichterAlexander Lichter

Indeed. Indeed. There will always be more. Great. And I think, in terms of migration, in terms of docs, we we talked a lot.

Nuxt Tips Collection

Maybe one last tip before we wrap it up. I have to mention, Michael is not here today, but he released, when this podcast, will come out, it's already out, on the August 5th. His Nuxt Tips collections with, more than 100 tips available at with the code deja view awesome show notes. You get $10 off. It's more than 10% discount. So, if you're interested in that and, Nuxt developer, they'll have to get you more involved into using Nuxt a bit more, entirely.

Natalia TepluhinaNatalia Tepluhina

We do have the part of the documentation, Nuxt.

Alexander LichterAlexander Lichter

That's true. GitLab is using Nuxt.

Natalia TepluhinaNatalia Tepluhina

Yeah. We do.

Alexander LichterAlexander Lichter

Very important.

Natalia TepluhinaNatalia Tepluhina

Nuxt two. So

Alexander LichterAlexander Lichter

Well, maybe, it will be already migrated, but, no, probably not. But we will we'll get there at some point. So, yeah, definitely check it out.

Wrapping up

And, then my last question is, any any other things, the other topics that you

Natalia TepluhinaNatalia Tepluhina

Any like, my last last question is meta. Any questions, steaming questions? No. I think I think we covered pretty much everything. And, yeah, it was a pleasure. Thank you for inviting me.

Alexander LichterAlexander Lichter

Likewise. You can, follow Natalia, pretty much everywhere, question mark. Like, Twitter, mastodon or mastodon?

Natalia TepluhinaNatalia Tepluhina

No. Not mastodon. Twitter. Yeah. Like, LinkedIn?

Alexander LichterAlexander Lichter

LinkedIn. Oh, very important as well. Yeah. That's also all in the show notes, so, definitely, check it out. And, of course, watch all the other older or maybe newer episodes of Deja View. Also looking forward to have you back on, the show for another time because it was Thank you. Lots of fun. So, folks, stay tuned. Let us know what you think. Write everywhere in the comments, on social media.

Write all the migration questions, and Natalia should answer all of them. We promise. No. But we'll we'll reach for all of them anyway. And, yeah, see you soon, folks.

Transcript source: Provided by creator in RSS feed: download file
For the best experience, listen in Metacast app for iOS or Android