
Lesson Description
The "Multi-Root Workspaces" Lesson is part of the full, Become a VS Code Power User course featured in this preview video. Here's what you'd learn in this lesson:
Steve discusses the concept of multi-root workspaces in VS Code, where you can treat multiple projects in different folders as one cohesive workspace. He also shares his opinion on micro front ends and multiple repositories, stating that he believes it is often a bad idea and that a mono repo is preferable for managing code and dependencies.
Transcript from the "Multi-Root Workspaces" Lesson
[00:00:00]
>> Steve Kinney: Real quick, just because this is more of a PSA, which will not apply to most people, but I want to point it out if it's a thing. I am a person whose backend web server, it's not showing my we moved it in. I was a person where the backend web server is in one repo, in one folder the front end is another one.
[00:00:21]
You can create multi-root workspaces, which is instead of right now a folder and a workspace have been synonymous, right? You can also kind of separate that out where you can kind of go new works space from file, right? And if you have a .workspace, you can actually create one, which is hey, I got two projects in two different folders.
[00:00:50]
I wanna act like they're one thing right? And now there's like two repos and you got like, jump back and forth and it works. I'm sure somebody likes it but yeah, they are it's useful if you are treating them like one thing, but I moved it into the repo for a reason.
[00:01:06]
There are clips that frontend masters have put of me on TikTok, where I have hot takes on micro frontends and multiple repos and I think it's always a bad idea. But I know people who inherit bad ideas from other people, and they live in this world regardless. So there's some guidance here on just kind of having a workspace where the projects are in multiple folders.
[00:01:38]
You can open up the workspace. You can set the settings across all of them. I don't do any of it, but I took the notes in case you wanted to.
>> Speaker 2: Do you have instances where you have multiple windows with separate workspaces concurrently?
>> Steve Kinney: Me personally
>> Speaker 2: I mean, it's a thing I've done but.
[00:02:02]
>> Steve Kinney: I mean, it probably happens, right? I also am a pure front end team and I'm spinning up like the backend, but I'm not developing it at the same time.
>> Speaker 3: Sure when you mentioned micro front end, can you elaborate not to get you off track, for the tiny bit more on example.
[00:02:23]
>> Steve Kinney: Yeah, like you will see a lot of times at larger companies where there's a belief system that multiple either front end teams don't wanna halt. If you're at a 1,000, when I was at Twilio by the end it was 7,000 people, and obviously not all of them engineers and not all of them front end engineers, but a lot 200 more than at the company I work at now.
[00:02:50]
And a belief system all of those people in one repo will become a mess. I will remind you that Google is one repo, or was at some point, somebody's going to fact check me like that is no longer true. But last time I talked to one of my friends that worked at Google, it was true, which was not that long ago.
[00:03:07]
So yeah, there's a lot of, well, we need to all control our own destiny and then you end up trying to create one cohesive UI experience out of what is effectively 72 repos. And you end up with 14 different versions of React and you'll be well, you can use module federate, yeah you can do lots of really complicated stuff.
[00:03:25]
No one I've ever seen working on it is happy about it. I cannot wait for the emails.
>> Speaker 3: So you're a mono repo?
>> Steve Kinney: 100% why did I need more than one repo, more than one place to open a pull request? In what world do I need a different configuration for everything?
[00:03:41]
No I am 100% on the give me one monorepo. I don't wanna deal with this anymore.
>> Speaker 3: So the nice thing about that monorepo across different projects is when you upgrade packages, they're always in sync. There's no lot of sync
>> Steve Kinney: Microservices even on the back end exists to solve a scaling problem but you lose all sorts of things like database transactions, shared memory, it's a pain in the butt, right.
[00:04:06]
You do it when you have to do it and you shouldn't do it if you don't have to do it. I think most micro front-ends are front-end engineers trying to cosplay as distributed systems engineers when that's not actually the right solution to building a cohesive front-end experience. You can at me on Twitter, I won't check it, so it's fine.
[00:04:25]
I'm sorry, X, formerly known as Twitter.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops