John: If you could share your screen?
Burke Holland: Let me share my screen.
John: You're a champ, Burke. Thanks for jumping on.
Burke: Let's start with the theming and the appearance. I think that's a great place to start. I use a light theme in my editor. Actually, interestingly enough, I don't know if you know this, but it's really bad for your eyes, apparently according to science, to use a light editor theme. inaudible says it's like staring at a lamp.
It's 2018, and I don't need facts or science. I use a light editor theme, but if you do happen to care about laughs those two things. There are a couple of things that...
John: I'm not touching that. I'm sorry.
Burke: There are a couple of things I'd like to recommend for the dark, for the Mr. Robots out there. One of them is a theme called Cobalt2 from a guy named Wes Bos. You probably have never heard of him. Not very well-known at all. That's a joke. laughs
John: We're familiar with Wes and his wonderful work.
It's just easier for your eyes to take that in. His theme gets closest to that. The problem with that general combination inaudible gaudy. It doesn't look good. His looks pretty, pretty good. That's a cool one. That's called Cobalt2. Another one that I like, a lot of people like, is Sarah Drasner's Night Owl. This is a phenomenal theme.
John: That's my go-to.
Burke: This is one is just beautiful. There are some really striking color themes. If you get the really good ones, as you can see, this one really pops the code. It's just right out there. I don't use a dark theme. If I did, it would definitely be this one. Of course, I got to stick with my light theme. I got to be contrarian.
Joel: We won't get a Night Owl with the light theme, because she specifically built that to be an accessible coding theme, and not blast your retinas.
Burke: Exactly. She doesn't want to hurt people, so she's not going to make a light theme.
Joel: Sarah doesn't hurt people.
John: We have to switch to Night Owl, then invert your monitor colors?
Burke: Right. laughs She wants to respect your eyeballs, so she's probably going to stick with dark there, but that's a great one. Another one is, you can modify the little icons in the sidebar. Those are controlled by a different set of themes.
John: I'm going to write Pug now, Pug files now, just for that icon.
Burke: Yeah, just so you can get the Pug? Does it work when I zoom? Do you see that?
John: No, I'm not seeing zooming.
Burke: Zoom doesn't respect the zoom. That's super ironic.
John: That is ironic. We're a deep now. I think if you just CTRL+space, command+space, whatever that'll be, make it bigger.
Burke: It liked this, I guess. Let's see, how big can I make VS Code? There we go. It makes you want to use Pug or Jade so you can get the Pug. This one is called material icons. You know you have the right one because it's got, I don't know, so many hundreds of millions of downloads right here by Phillip, and four million. That's a cool one.
Another one that people like a lot, or not theme-wise, but another visual tweak is font ligatures. Can we talk about font ligatures, or is that a hackneyed subject?
John: I don't know. What are they?
Joel: I don't know.
Burke: We're good. This is good. Font ligatures, the default font in Visual Studio Code, I don't know what it is. You can supplant it with a different font and replace it. There's a couple of different ones, but there are some that support something called font ligatures.
There's one called Fira Code. If we were to go out to the web and you look for Fira Code, it's right here. You can download this, there's a TTF file, you just double-click it, pray to God there's no virus there, let it install on your machine, and then you have it installed. Then, you can use it inside of VS Code.
You can then set your font family to Fira Code, and then you turn this font ligatures option on. When you do that, the font changed slightly. I don't know if you can see that, but that's not where it shows up. Where it shows up is in your code, if you have something like, let's go here.
You'll see it in places like this, where you normally would have a fat arrow which is the equal sign and an arrow. You get an actual fat arrow. If you were to do something like an if statement or if you were checking for equality and you have an equals, equals, then you get a double equals. If you have three equals, then you get an actual triple equals or a not equals.
Font ligatures are characters that replace the compound characters that we have in programming. There's a lot of them where we use multiple characters together to represent what's could be one character. That's what font ligatures are, very cool. A small thing, but it's the little things, John, that bring me joy.
Joel: A lot of people talk about them in a negative way in terms of one, accessibility, and then, confusing for newcomers where if it's what you're used to and it's yours to customize. That's why, generally speaking, you won't see them in an Egghead video, because people get bewildered.
Burke: For the font ligatures?
Burke: One of the things I love about coding is that there's never any controversy.
John: Everybody agrees.
John: There's no new framework.
Burke: You can safely do something and know that everybody will be on your side. Use font ligatures or don't, if you don't.
John: Tell me what one you use for snippets in your pop-up snippet.
Burke: I'm using an application called Snippets which doesn't work, so I can't recommend it. laughs
Joel: Good kit.
Burke: It's not working. It's not often you get a testimonial of what not to get.
Joel: That's a different one, but all right. laughs
Burke: I know. Let's talk about this sidebar on the right for a second, because you did ask about that, because by default, it's on the left. Toggle sidebar position. My default's over here, but if you Command or Control B collapses the sidebar. If you watch the screen, you'll notice that it's pretty jarring.
Joel: They toss it out.
Burke: Actually, moving the whole screen over and back, but if we move it to the other side, now watch. See that?
Joel: Yeah, no jumping.
Burke: Does it make a difference? I don't know. Someone once told me that it's better for your eyeballs. I think it does. I've gotten used to it on the right now, but everybody usually points out and says, "What the heck are you doing?"
Joel: That's cool, though. I like that. I've never even thought about it that way, but that jumping is annoying.
Burke: Let's talk about inaudible for just a second.
John: In development, I've always put the bar on the right, but in presentations and what not, I've put it on the left because that's where people expect it. That's where they expect it to be. It's nice not having to bump it over, because your eyes remember where they were looking. At least, that's my thoughts on it.
Burke: There's some scientific, probably the same person who studied editor theme and system study on sidebar positions. Maybe I should do this, get a government-funded scientific study for editor.
John: Can you detach the sidebar now?
Burke: Can I what?
John: Detach, as in you can drag new tabs out into new windows. Can you detach the sidebar then?
Burke: No, you can't. The sidebar is where it is, cannot be removed.
Joel: Just randomly floating sidebars.
Burke: You can toggle this thing right here. I don't know if you knew that. You can turn this off all together. There's shortcuts to switch between the different parts of it, so once you get those down, you don't really need it. Then, you lose your cool icons over here.
Let's talk about Emmet for a second because there's always a few folks who don't know what Emmet is. That's totally fine. It's a faster way to write HTML even up to and including creating whole pages like that. You can do div with a class of main with an idea of main, because why not? Then, you get that, and then you can do complex HTML expansions this way.
There's a whole Emmet cheat sheet you can look at. You don't need to memorize all that, just know that it does that. It also does some other cool stuff inside of HTML that you should probably be aware of.
One of them is if you have an image, so VS Code gives you this nice IntelliSense. Usually when you have an image in an image tag, you want to give it a width and a height, because if you don't, then the page is going to jump around when the image is actually loaded because the browser doesn't know how much room to reserve on the page for the image.
A lot of times, we don't do that because we're lazy. What is the width and height of this image? I don't know. One way to know is to go to the image and then look down here at the bottom. Emmet has this cool feature where you can do update image size, and it automatically brings it in for you. That is nifty.
Another place where this works is in...
Joel: Does it do image analysis to put in the alt tag? Come on...
Burke: No, but Sarah and I actually talked about that because Sarah's written something that does that that actually analyzes the image. She's got a code pin project for that. We talked about making a Visual Studio Code extension to do that, too. We haven't yet.
Joel: Sorry, I'm throwing in distractions.
Burke: That was good. Emmet also works in Sass. Again, I don't know, say if you have a background or margin, you type willy-nilly and inaudible background BKG, and it knows enough to try to help you out there.
Joel: I think my favorites on that are like W100 or P10 where you can expand, padding 10, and even skipping. You don't even have to type the colon.
Burke: Like that right there. That's pretty cool. I didn't know you could do that.
Joel: We're all learning today.
Burke: Here's a cool thing. Check this out. There's two things happening here that are interesting. One of them is if you mouse over this main, it will actually start to expand even in Sass and show you what your CSS actually looks like. It's trying to help you out, like this is what you're actually targeting.
Another cool thing is that it's highlighted this, and it's telling you, "Property is ignored because you set display:inline." This margin bottom is going to have no effect whatsoever. That's a very interesting feature that VS Code provides, is that it's looking at the spec and telling you ahead of time, "Hey, you're going to have a really hard time making this margin work, because that is not going to work in this layout."
I make this mistake all the time, and then I sit around, tweaking that margin, trying to figure out what the heck's going on.
John: Is that VS Code, or is that an extension?
Burke: That's VS Code doing that.
John: Oh, cool.
Burke: You get that for free. Another cool thing that Emmet does that people always ask about is, it has this, sometimes you want to get a whole tag of text. Like, I just want to select this entire div. People will do this right here. It doesn't make sense.
Burke: You can do this thing called balance. It won't select the inward tag, but you can do balance inward, balance outward, which are Emmet things. That will select the whole tag.
Burke: You can just map that to keyboard shortcuts. I think I do control. It's like CTRL+shift+down. Yeah, CTRL+shift+down, CTRL+shift+up. Then it's just a nice way to select your tags that's cool.
John: I'd always used the expand selection and collapse selection, or whatever that's called.
Burke: Does that work? What do you mean?
John: I believe so. I don't think it's a plugin. If you search for the command, AI expand selection, that's the one. I'll have to try Emmet and see how it behaves.
Burke: That's interesting. I don't know if the Emmet is the preferred way to do that. It's just the only way that I've found to select big chunks of HTML that's been embedded.
Burke: Cool, that's Emmet. There's a lot of other cool stuff it does. It does math. It can do image sizes on even remote images, even images that aren't even in your project. That's all built in. Let's talk about Prettier. Prettier is great, because it's solving semantic, pedantic developer debates for you.
John: We haven't had a style debate. I haven't had one in years, because of just automatically formatting. Who cares?
Burke: Exactly, exactly. A good example of this, there's an extension you have to install for VS Code called Prettier. Everybody knows over here on the side, you just find a VS Code extension, and you install it. Then here's just an example.
You have a long line like this, and you're like, "Well, I'll break this here. Maybe I'll put that there. No, wait, I'll put this here. No, that there. OK, that there," and then everybody does it differently. Then it gets super annoying. What Prettier does is it just solves this debate. What you can do is just do format document, and it will automatically format that for you.
Now, you can tweak this. I've got mine tweaked for single quotes, for instance. I don't know if this'll come through. If I have double quotes here, first of all, it's going to get linted, because of ESLint. When I go to the format the document, it's going to change those to single quotes. It's just a nice thing to have, especially if you're like me, and you copy-paste from Stack Overflow a lot.
Joel: Oh, yeah, 24/7.
Burke: Right. I need that code formatted, so it looks like I wrote it. Prettier does that for me.
Joel: Tricks of the trade.
Burke: Also, with Prettier, you don't want to do format document all the time. You can toggle on format on save, format on save. Now, I've already got this setting in here, but there's another extension that you should check out called format toggle.
turned me onto this extension. Toggle format on save, and all this does is, exactly what you would think it would do. If you toggle format on save, it turns on format on save. If I go back, put this back, and then save, it goes ahead and formats it every time I save.
Sometimes, you check out a project, or you work on a project that doesn't use Prettier. If you have your format turned on, and you do that, it just ta-da, jacks up the whole document. It's just a quick toggle format on save, turns it off. Then when you save, it won't do that anymore.
Joel: Jacks it up, or makes it correct? laughs
Burke: That's right, thank you, Joel. It fixes it.
John: Fun fact, it says Rick Astley there. On Egghead, if you get banned for being a jerk -- which happens occasionally -- every video turns into Rick Astley's "Never Gonna Give You Up."
Burke: Wait a minute, how does that work?
John: If we ban you, usually because it's jerks.
Burke: That's what you get? I actually wouldn't be too sad about that.
John: There'll be tweets. We get tweets like, "I don't understand why every video on Egghead is Rick Astley's Never Gonna Give You Up," which makes us laugh internally, and then block the individual.
Burke: Can you guys do that to me? I actually want that experience.
Joel: Yes, it's done.
John: You want that experience?
Joel: It was done last week.
Burke: VS Code also does some cool stuff with telling you...Of course, this is ESLint, but this brings up a good point, because VS Code also does this. I'm going to go to type checking for a second, because VS Code actually does some stuff above and beyond what ESLint's going to do for you.
In this case, there's a lot of problems with this code, not the least of which is, I wrote it. It's telling us here, we have unused variables, and things like that. That's good, but there's other problems here that ESLint cannot help with, because they're type errors.
Even though we're not writing TypeScript, we can use the TypeScript compiler to check the code. The TypeScript compiler will lint your code, and it will type check it. Because it has type checking, it knows about methods and method properties.
If it doesn't know, it won't say anything. If it does know, it will tell you. In this case, we can add a @tscheck at the top. I don't know if you saw that, but these things are still highlighted. If we hit F8 now, we can just move through our errors here. We'll just do that. Then you can see, it's picking up this one, "Property blog does not exist on type console."
John: It should, it should.
Burke: Exactly. My job would be a whole lot easier. This is the TypeScript compiler in action. It has more information on these things, and so it can fix that stuff for you. Then you can hit command-. or control-. and change spelling to log. It will automatically fix it for you, too.
Joel: Can you have that run automatically, without the comments, like globally with your project, or do you have to do it individually?
Joel: That's cool. TIO.
Joel: Do messages, bracket-zero-dot-something, then dot-name or something. It's going to know that's a string because TypeScript would know.
Burke: These are all the different things you can do with it. You can do concat, and then it gives us hints. IntelliSense. IntelliSense is cool.
John: That's where people get bit so much. TypeScript is inferring the types in that array right there.
Joel: I wonder how aggravating that would be, if turned on. That's like in practice, right? If you just had that turned on all the time, what that would be like.
John: "It's messy, deal with it."
Burke: Right. laughs "It's supposed to be garbage. Just leave me alone."
Joel: It's wrong, whatever."
Burke: Talking about IntelliSense, some people don't know that IntelliSense works in weird places in VS Code. Let's go to a file that has a project with a package.json. Not that one.
John: Just npm init right where you are.
Burke: This'll work. Can you still see my screen?
Burke: Got my package.json?
Burke: Let me turn this off. One of the places that IntelliSense works is in package files. You can see, it knows these are the different things that you can add in, but it also works on your dependencies. I don't know, maybe you want to use something like CoffeeScript.
You can see that it automatically pulls in all of these things from npm. This is actually pulling from the npm API. Then your next problem, of course, is that you don't know...
John: The version number. What's it going to be?
Burke: CTRL+space, and it will automatically go out and get that for you as well. Not that you ever hand-edit your package.json file -- it doesn't happen a lot -- but it does happen on occasion.
John: Hey, don't tell me how to live my life.
Burke: Exactly. I'll hand-edit the whole thing, if I want to.
Burke: While we're talking about npm, let's just keep going here. There's a plugin called Version Lims? Yeah, Version Lims. That's the right one. Version Lims, this is another Elijah Manner tip. I've got to give credit where credit's due.
You can install that, and that gives you some extra niceness. I'm going to click up here to enable it. It's running, and you see here, it's annotating. It's basically telling me, "You got a new version," so I can update that, update body parser. It's pretty cool.
John: That is fascinating, yeah.
Burke: You can also do a...
John: I love this trend of having hints and information inline in the file. Traditionally in tools, this has always been done in a separate window or some sort of GUI. Bringing things right to where the information is, I'm loving this trend. I think VS Code has pioneered a lot of that stuff.
Burke: It's very nifty. Microsoft is really good at building developer tools.
John: They are.
Burke: It's one of the things they do really well. It's fun to work with VS Code. There's another cool thing you can do with npm. If you go to your user settings...Where did I just go? Oh, I went to my user settings.
There's an npm enable script explorer. If you set that to true, you get this little explorer right here. It shows you all of your commands. Then you can just run the start command right from there. That's just a cool way to visualize all your npm scripts in your package.json.
John: I think those show up in the command window, too, right, or the command pop-up?
Burke: Here, let's npm...
John: Like the actual, when you enable that npm script or something?
Burke: I don't know. What are you talking about, John?
John: Isn't there an npm scripts, like you can pop it up through the drop down?
Burke: There may, npm scripts? No, there's just these. Run script, which one? Oh, OK. It's right here.
John: Oh, there it is.
Burke: I don't know if that's the npm. There's an npm package that Erich Gamma wrote that I also have installed. I don't know if that's doing that, or VS Code's doing that. Either way. You can install both of those, Version Lims, and the npm package from Erich Gamma.
Let's go back over here for a second. Oh, let's talk about snippets. Snippets are fun. There's a lot of snippet packages for VS Code. Any editor probably has a lot of these. The best one is one called Simple React Snippets, probably. I think that's the fan favorite, mostly because I wrote it. You can see how quickly and gracefully I can...
John: It's got my vote.
Burke: Right? Exactly. Everybody should download it now. I only know how to make one component, apparently. Also, Emmet works inside of JSX and via React, or Angular, rather, which is nice.
John: It respects the class name stuff and the differences between.
Burke: It does, that's right. Actually, you can do componentDidMount, componentWillUpdate. We put a nice warning in there, telling you, "Don't do that."
Burke: Also, check this out. Speaking of controversy, let's say you're going to build an app, and you need a Bootstrap nav bar. Scientifically speaking, you cannot build a web app without Bootstrap. I don't know if you knew that.
John: I'm learning a lot about science.
Burke: Yeah, exactly. Let's bring in, I don't know. This one looks good. Let's just grab this. You could pull this in. Cool, here's my nav bar. Copy it in, boom.
John: It's not going to reformat the JSX?
Burke: Bam. Oh, it doesn't like that at all. Sometimes, you pull in stuff over here, and it's like the HTML is malformed. Let's try that again. Anyway, it doesn't like my...It's linting for me. Oh, that class does not exist, because it's React, so you have to use class name.
You have a simple React snippet, so you can just do class, a class to class name. Boom. All your classes get changed to ES, right? Solving developer problems, John, that's what I do.
John: I love that you're enabling the copy and paste rituals.
Burke: Right, exactly, yeah. I'm looking out for the people that are copying and pasting in Bootstrap. Look at, that's you, inaudible . That's me, too.
John: That's the use case, right?
Burke: Exactly, I'm not going to write that.
John: I've done it. I've done it.
Burke: I'm not going to hand-code all that nav bar. Are you kidding me? No way, I've got better things to do. Let's talk about Vue. Sarah's got some. I keep mentioning Sarah. I guess I'm the biggest Sarah Drasner fan.
She did some stuff for Vue. She has a Vue extensions snippets that you should install. You can do stuff like this, where you can just type vbase, and get a nice Vue component. John, you probably use the Vue snippets a lot.
John: I know my Vue. I still hand-roll a lot of my own snippets. I use the create snippet -- I'm not sure if that's it -- extension.
Burke: Yeah, create your own snippets, yeah.
John: I'll start from nothing, and then as I'm going through, I'll create snippets. After I've created something twice or something, I'll create...
Burke: You configure your own user snippets, which you can do.
John: I think it's an extension where you can select text, run a createSnippet command from that.
Burke: Yes. There is an extension for that. What's it called? Snippet, create snippet?
John: Yeah, something like that.
Burke: X snippet, create snippet? Create snippet from paste, something. Anyway, snippet creator, something like that. I don't know. You brought it up, John. You'll have to put it in the show notes.
Burke: I can't find it.
John: You just select something you've already written. You can say create snippet, it pops it up, and you can fill in the different values you'd want to change in the future. Then you can invoke it just like you're doing with these other snippets.
Burke: That's nifty.
John: That's my go-to.
Burke: You have handcrafted, artisanal snippets?
Burke: Do you also drink a lot of craft beer, John? Are you that person at the bar that...? What kind of inaudible do you have?
John: What's that?
Burke: Turn up the Arcade Fire, inaudible snippets over here. laughs This is in Angular, so it works in Angular. John Papa did the Angular snippets, again, just making your life easier. That's pretty cool.
John: That is nice.
Burke: Let's talk about debugging. We had the vscodecandothat.com, and the number one most-watched video on that site by far is the one where we showed debugging. People are very interested in debugging.
Let's go to, here's a site that is kind of complicated. It's an Express application, but it's written in TypeScript. It doesn't look like stock Express. The folders are not the same. You can see here, there's source maps. There's a lot going on.
When you debug it, you have to start it from VS Code's launch configuration here. You can see, when you debug, you have launch configurations. I'm pointing it at my startup point. I'm providing an environment variables file for Node environment variables, and then enabling source maps.
Then when I do this -- Joel, your face is in there -- Oh, there it is. I can run, and oh, it's not going to work, because I'm already started over here. Let's try that again. It's going to fail. There we go. We're running. Go to our debug console, grab that, and pull this over to our browser window. Also, did you see what just happened? I tweeted about this a minute ago. Did you see what that just did?
John: I missed something.
Burke: I pasted a URL into Chrome, and I never hit enter. I never touched the enter key, and it requested...
John: Oh, the pre-fetch?
Burke: Yeah, the pre-fetch. At first, I was like, "That's so cool." Then about 10 seconds later, I thought, "That's terrifying," because it's requesting a page that you never requested. You never asked for that page, and you got it, anyway.
Joel: It knows what you need.
Burke: I guess so. I should stop worrying. I was going to enter. I don't know why I'm complaining. Anyway, laughs once you get into the debugger, we get the source maps working inside of VS Code, which is cool. Of course, you get your inline debugging and your watches. You're going to get the call stack. You can look at the context right inside of your debug console, execute your commands here.
John: You can just hover over the variables, the parameters, and everything, right?
John: They just pop up.
Burke: Yeah, information there, too.
John: Again, the inline stuff, to me, just I love it.
Burke: It's awesome. That's not really that impressive. What would be really impressive is if you could debug browser applications inside of VS Code.
John: That would be. I doubt that's possible, though.
Burke: Would you believe it, John, it is possible?
Joel: Another thing.
Burke: Yeah, laughs it's crazy. Here's an Angular application. I'm going to launch this. The way that this works is, this is already running in the terminal. I ran NG serve, or whatever you run in Angular to make things work. I don't know.
John: That's correct.
Burke: Then I have a launch configuration that launches a Chrome window and attaches a debugger. You can see, I have dropped a...That's a log point. Let's get that out of here. Yeah, remove that. We'll talk about log points. Let's just drop a break point in there, and then what's your favorite song, John?
John: Wow, "Row, Row, Row Your Boat."
Burke: Row, Row, Row Your Boat? Like actual music. What's your favorite band?
Joel: We keep this wholesome, Burke.
Burke: Oh, OK.
John: Massive Attack.
Burke: Massive Attack? I should have guessed that, with your...
John: There we go.
You can see, it's broken in the same place. Then when we step through, it'll go through over here as well.
Burke: Really? I actually can get on board with that music.
John: I'm not familiar with that.
Burke: People always ask me, they're like, "Why would I want to debug inside of Visual Studio Code when I can use the Chrome dev tools?" My answer to that is, maybe you would, maybe you wouldn't. One of the reasons why you would is that, I'd just like to propose, that it's easier to debug your code in the same place that you write your code, than it is to constantly switch contexts.
This is all powered by launch configurations. They can get a little bit verbose. We have great docs that show you how to set up launch configs for React, for Angular, for Vue, so that you can do those.
John: Is the call stack showing up right now?
Burke: The what?
John: The call stack. Like when it breaks, you're able to navigate back through, and it's navigating through your code? It looked like it just gets into the framework code straight from...I'm just saying, in the call stack, a reason to do it in the editor is, you can navigate around your own code and find where it is, versus trying to...
Burke: I see what you're saying, yeah.
John: It looks like it goes straight into framework code.
Burke: It does. While we're in here talking about...
Burke: Yeah, still not a fan. While we're in here talking...
John: That's my jam, man.
Burke: I know. A lot of times, we do stuff like this, where we're debugging, then we stop, and we'll come here and say, "What the heck is this new URL?" You go back out, and because you need to get the value, there's something that you can do called log points in VS Code.
You can right-click, and instead of adding a break point, add a log point. Then you can look for the preview URL, like this. We'll open up the debug console here. Let's go to debug, and we should be able to see...Let's go to just do Joel's favorite band, the Goo Goo Dolls, right, Joel?
Joel: I do enjoy the Goo Goo Dolls.
Burke: I can't stop it now. OK, jeez. My log point actually isn't being here hit, and I'm not so sure why. Let's try one more time. Preview URL. Maybe my syntax is wrong.
Burke: Ah, so there it is. Now, it's logging out the plain text. We need the value. Let's edit the log point. Let's remember, this is the syntax. Now, it's actually giving us the URL of that track that's coming back. It's just a cool way to log out values from your app without having to stop-start, add in a console statement that you really don't want in there.
Then you're going to leave it, it's going to go to production. Then people are going to open the dev tools on your app, and wonder why it's logging out...
John: Then they mock you.
Burke: Yeah. Cool, a couple other things. Who wants to talk about Docker, anybody?
Burke: Docker, anybody? Bueller? Let's talk about Docker for a second. I don't know a lot about Docker. When people talk about Docker, my ends to kind of roll back in my head.
John: I can pick Docker out of the icons on the right.
Burke: Exactly, I know that it looks like a whale carrying some boxes. What I do know about Docker is that it magically encapsulates your whole project, and all its dependencies, including Node. Then you can just throw it up into the cloud, and it runs.
I don't know how it works. I just know that it does, and I'm thankful for that. In order to Dockerize an application, you need a lot of different things. You need a Docker file. If you're going to compose, you need a compose file.
You don't know anything about any of that stuff, so that's why it's hard to get started. VS Code makes this easier by adding in a Docker extension here, which I've got over on the right-hand side. Then I can say add Docker files to work space, select Node.
John: Oh, nice. I haven't used that yet.
Burke: It automatically detects my port. Then I get a Docker file, a Docker ignore, a Docker compose, a Docker compose debug. We can actually come in here, and I'm going to copy in some of my environment files. If you're watching this, don't look at these. Don't look at these values. Close your eyes.
John: CQI0, and dang it. Bring it back.
Burke: Let me just move these over here, because this won't work without my environment variables. We'll pull these in here, this one here, and this one here. What we can do now is go to our launch file. We can actually add in a configuration for Docker, docker attach to Node.
Look at all these configurations that I otherwise would just not know to do. Then we can say Docker compose up, and select the debug file. This will build us a Docker container in debug mode. It's running npm-install, step five of eight. It's a long npm-install for Express.
John: That's my favorite step.
John: No, step five of eight. Step six is...
Burke: Oh, yeah. It is undoubtedly the best.
John: If I had to rank my steps one through eight, five would be number one.
Burke: That's really weird. Arrays start at one.
John: Just killing time during, yeah, go ahead.
Burke: This container's running, and if we went to it on port 3,000 -- I think, let's see here, I think -- come one, Chrome. Come back to me. If we go to localhost:3000, this is our container is now running.
You know that, because you can see it running here. This is the container. Let's put a break point in here. Now, let's see here. Let's go back and debug, start our debugger, attach to Node, and refresh. Now, we're debugging our Docker container. We're actually debugging with VS Code inside of a Docker container, we know virtually nothing about Docker, and we made virtually no changes.
John: That's actually amazing.
Burke: That is pretty cool. Then the other stuff that it does that's really nice is, sometimes you want to look inside your container, but you can't remember what the goofy Docker command is. You can just do attach shell, and then just look inside your container.
John: Oh, nice.
Burke: It takes all the flags, having to remember all the command line...All it's doing is executing the commands for you under the covers, but it's giving you a visual interface on top of that. Then you could take this, and you can push it, or take your image and push it.
Then you could run it. You could run it anywhere, John. You could run it places like Azure, Azure. You can also run it on Azure. All three of those places will work.
John: What about Azure?
Burke: Actually, Azure works, too.
John: OK. I heard that was supported.
Burke: You can put your container in any of those places, so it's pretty cool. I'm not logged into Docker Hub, so I'm getting the access denied.
John: That's awesome. I use Docker just rarely enough to forget every command each time I try and use it.
Burke: Exactly. That's one of the best extensions people can get. Do you have an Egghead course on Docker?
John: Yes, we do.
Burke: People should check that out. Docker is really cool stuff. Man, it's powerful.
Joel: What I enjoy with VS Code is that it makes a pretty decent Git client, a GUI for Git. I think most people us Git, and they might have another client. I think you can actually ditch them, for the most part, and just use VS Code.
Burke: Yeah, you can. The built-in Git configuration or features are good. There is the standard, where you basically have all of your files. You can open the file and look at the changes. You can do diffs. Of course, you can check into commits, push, pull.
There is an extension called Git Lens, by Eric Amodio, I think is his last name. It really amps up your Git. If you're missing features, this is probably the crème de la crème of extensions. This thing is the real deal. He's a brilliant guy. Another thing that they just added was this pull requests.
John: This is really awesome, yeah.
Burke: Yeah, nobody's made any pull requests, because nobody cares about me.
Joel: It gives you a full, interactive GUI to GitHub PRs. I spend a lot of time in PRs, and it's really been nice to just be able to come and do my reviews here.
Burke: Yeah, it's very cool. That's why when Microsoft acquired GitHub, and people were like, "Oh, I don't know if that's good." I'm like, "Yeah, but now, we have a pull request extension for VS Code. That's pretty cool."
John: That's pretty cool.
Burke: That's good.
John: GitHub is notably better since the acquisition.
Joel: Two weeks later.
Burke: It's faster.
John: No, like the diff files, and the numbers, where you couldn't select code in there without selecting the numbers. A bunch of little tweaks they've made, based on developer complaints, that they didn't get around to until...
Burke: Now, they have Microsoft's army of engineers to come in and help out.
John: Yeah, probably people who use it every day, who complain.
Burke: Like, "I'm just doing this. I'm fixing it right now."
Burke: Merge to master."
John: That's the best, yeah, the best way.
Burke: That's true. That's a good point, I hadn't thought of that. Can we do one last one, and then I think I'm done?
Joel: Sounds good.
Burke: There is one called Cosmos DB, an extension. Cosmos DB is a no-SQL database in Azure, but you don't have to be using Cosmos DB to get some use out of this. Cosmos DB has a Mongo support for those. Cosmos DB is weird in and of itself, because it's a global-scale database, but it's multi-API. You can choose to use different APIs against it.
You can choose to the use the Mongo API, or the Gremlin API, which is Graph, for Cassandra, or the SQL one, which is the one we provide. What's interesting about the extension is that it also provides access to any Mongo DB that is accessible via mongodb://. Then it turns that into a database admin tool for Mongo. You can see your collection here. These are my different documents I put in.
Then it comes with these things called scrapbooks, Mongo scrapbooks. Once you connect, I think we're connected. Let's connect.
John: This is going to be cool, huh?
Burke: You can do DB, and then it has IntelliSense for all your stuffs.
John: That's cool.
Burke: You can do find, then you can execute, and get your data back. It's just, if you're working with Mongo DB, particularly, obviously Cosmos DB. Beyond that, if you're working with a Mongo DB, this is just a really great way to put your data in your editor, so it's right there, where you need it. Very cool feature.
John: Very, very cool.
Burke: I think that's all I had.
Joel: I'm sold.
Burke: You going to move? Making the move?
Joel: I really like it a lot.
Burke: There's also live share, but that's a whole other thing that we did not get into.
John: Oh, yeah?
Burke: Yeah, I did an article on live share for "Smashing" magazine. It came out last week. People should probably check out if they want to learn more about that, but that's a whole other level of developer collaboration, kind of like Google Docs for your code.
You can also share your local host. You can share your local database. You can share your terminal. You can share all sorts of stuff with anybody else using VS Code, or Visual Studio, if you're a Visual Studio user.
John: I didn't know any of that.
Burke: Pretty nifty.
John: Let's see, there's a comment in chat. "Anything else Vue-related you suggest?"
Burke: Vue? I would suggest Sarah's Vue extensions. What's it called, Vue?
Joel: Sarah also releases her entire Vue setup that you can go, and it's a Vue developer package.
John: That one.
Joel: There you go. You can just basically get everything that she uses for Vue.
Burke: Yeah, this one has V Tour, Vue Snippets, Prettier, formatting toggle, bracket pair colorizer. That's another cool one we didn't talk about, bookmarks, Jumpy, npm, Intellus. Golly, there's a lot of cool stuff, and Night Owl, of course. She snuck Night Owl in here. I like that. That's a cool one, yeah. I would check that out for Vue.
Joel: There's an extensions marketplace, which is just fun to explore, ruin your editor with bad ones, find good ones, and do all that kind of stuff.
Joel: People are very aggressively adding new content to support.
Burke: It's endless. Endless, endless, endless. There's even some that are, laughs there's one called -- I think I have it installed, hold on -- it's called Power Mode. Have you seen this?
John: Oh, yeah, where it gets shaky?
Burke: Yeah, Power Mode enabled.
Joel: Oh, as you type?
Burke: Every time you type.
Joel: That's cool for five or six seconds.
Burke: I know. It's cool for a demo. That's about it.
Joel: It's when you're doing hate-driven development that you need to break that one. I would love to continue talking to you all afternoon about developing extensions, because that would be an interesting thing to get into.
There's all sorts of fun stuff. Maybe we'll get together again in the future, so we can deep dive into some of these.
Burke: Yeah, like building your own extensions. That would be another good one.
Joel: Yeah, cool stuff. Thanks, Burke. This was pretty great.
Burke: Yeah, thanks for having me on. I appreciate it.
Joel: It was good talking to you.
John: You're welcome.
Burke: Thank you, John. Thank you, Joel.
John: You're the best, Burke. See you.
Burke: Bye, guys.