Now, we do reserve the right to keep some of them for specific reasons, but I'm going to get into that later. Technologically speaking, we are fully using TypeScript. We are using VUEX, and it has become quite loaded with time. We have a dozen or so modules. They don't really feel well-designed anymore, because we've been a startup for a good period so we've been, like, iteratively adding to it without an amazing sense of direction. You know, startups make mistakes.
Because we are using... Well, first, we decided to use Vue class components. This was very early in the product development cycle, three and a half years or so, years ago or so, and we decided to go with that because, first of all, we didn't really have many front-end engineers. A lot of us were full-stack and classes are something we were kind of more familiar with. It seemed like the way to go back then, and at that time it also seemed like a way, an approach that has better TypeScript support because of the class decorators and the Vue X class decorators, which we also use as a library. But yeah. That was a decision made back then.
For testing, we, of course, used Jest with Vue test utils, and we do have a storybook setup, which we use as a component catalog, but not within the context of writing tests or anything like that. So clearly, for migrating 3D3, the number one problem is the fact that we use class components. That means there's more work to migrate a component than it would be with options API, and that means that right off the bat, we can't really start off with Vite config to the front-end build in Vite because class components don't really run in Vite or in Vue 3. Now, right now, there are, as far as I know, some PRs being reviewed for the Vue class components and Vue X Class libraries, potentially even a release candidate or something like that, where this support will be added. So it might be that by the time we're done with migration, it will also be possible to run class components in Vite, but we are still switching to Composition API just because this is a new standard and we prefer to use the standard rather than a third-party alternative. Well, we do now.
So our list of goals to consider this migration done is to switch all the components to Composition API, at least those that we're keeping, and maybe a few more, and again, I'll get into that a bit later, switch from UX to Binia, because that's the new standard, have both our app and storybook run on Vite, and have Jest switch to Vitest, meaning it also uses the same Vite configuration, which is a big advantage with Vitest or Jest.
So we need a strategy for this, and very early on we decided that a single big effort for us is a bad idea. We can't be doing one major push of just migrating, migrating, migrating until we're done, and then move on to something else. First of all, our team is reasonably big now, we have about 30 engineers, and even with that size it's still gonna take weeks, probably, to migrate all those components, especially because we'll be stepping on each other's toes. We are guaranteed to create bugs this way, there's just too much code being changed for that not to happen. And there will be way too many delays in our product work, so yeah, we're just not okay with that. To improve our process, we decided it needs to be something that gives us benefits as we go, and not when we're done, and it needs to be as non-disruptive as possible.
So the basic approach we went with is to have one engineer convert two components in a sprint, and our sprint is two weeks, for us, and this conversion of a single component is timeboxed to two hours. That means that if it looks like it's gonna take more than two hours, that ticket is immediately put on hold and we grab the next one. The reasoning is, as we get experience doing these conversions, we get to wrap up in speed, maybe change the rules to pick more components, and then we get to revisit those tickets that we put on hold, to see, maybe, it's gonna be faster this time because we know more. And then, as part of this whole effort, there's the additional rule that any new code that we write, any new component that we add to the codebase, needs to be Composition API, So no more, like no introduction of additional class components to the codebase.
Comments