So, what did we do? We typed this particular thing to jsx.intrinsic elements. But do you know what? jsx.intrinsic element actually includes all possible HTML tags in the universe. And because of this, whenever we are running TypeScript Compilation, all the stacks was again being compiled, was being included in the build, which is actually a waste. Thanks to AI. Here, I mean, with this, what we finally got, AI doesn't just help us to ship new products, but also can help us in fixing the bugs, whatever we had. With AI, we were running this TypeScript compilation and we did find out that this particular jsx.intrinsic element was causing a big issue. That was one particular part.
The next particular part is barrel files. Of course, since you're using a monorepo, having multiple packages, we would define multiple barrel files for the ease of export and import. But that was also causing a huge issue silently. So, because of this, I changed in one of the micro frontend. When we compiled that micro frontend, it was taking around 60 to 70 seconds. Imagine a compile on a micro frontend taking around 60 to 70 seconds. So, what did we do? We restricted the first one, type explosion. We restricted our type so that, say for example, for typography, the use case what I explained for typography, we don't need all possible HTML tags to be included over here. Because in general, typography, it could be div, span, paragraph, section, main or whatever possible tags that could help us for formatting the text. But we don't want image tag, SVG tag and all these things.
So, we made this type to be much restrictive. And barrel files. Yeah, this is something which we are doing it now. There are a lot of barrel files in our monorepo, which we are trying to kill a lot one by one by one. We are still with it. But yes, both together did help us to reduce the compile time. For one MFV before it took around 60 to 70 seconds. But now it just takes 30 to 30 seconds. So, as an overall for a commit in the PR, the CI, the compilation part, which was taking around 35 minutes, now got reduced to 10 to 15 minutes. See a great improvement what we have. So, this actually helped us in reducing our compile time by over 60%. So, these three things did help us to improve our CSV a lot.
Comments