Kyle sets up the scope for what will be covered in this course. He'll be focusing on three major topics: HTML5, Node.js, and WebRTC.
(upbeat Asian music) - [Instructor] Let's jump into our discussion today about Node.js. Now I promised you yesterday that there's going to be a lot more code, and there will be. It's not that there's no lecturing, there will be some lecturing. We'll have a little bit more here at the beginning I'm going to talk about some HTML5 API some things like that. So we'll talk a little bit more about it but by the time we're at lunch time and certainly this afternoon, it's going to be in almost entirely coding. So you're going to have plenty to get your hands dirty with.
They have no idea what you're talking about with a module and require and the scoping and all of those sorts of things so the goal yesterday was to present the things that were really necessary for you to have confidence in so when you start coding inside of Node.js, those things aren't the things that you're questioning. And your brain can operate at a higher level of abstraction because now we're dealing with, how do we deal with the environment that Node provides to us? How do we optimize ourselves for streaming data and all of those sorts of things. That's a higher level of abstraction and we don't want your brains worrying too much about I don't understand the lexical scope.
So hopefully you do have that confidence. If you have questions, continue to feel free to reach out. That's the goal of this class that's why we did it as a two-day class so we're diving into Node.js and I'm going to focus on three major things today. We're going to focus first on HTML5, not that we're going to spend an awful lot of time with it, I'm going to try to go pretty quickly through it. But I want to expose you to some of the APIs that are provided in HTML5, which will assist us in doing realtime communication things because we're going to get real familiar with Node but we're not going to spend the entire day talking about every kind of like, Browserify and ecosystem thing.
We're going somewhere specifically with our Node interaction and once we're comfortable with Node and how it works, where we're going is to wire ourselves up with some realtime communication things because, I think it's a good way to show off Node's capability, one of it's strongest points is its ability to do high performance communications. So we'll first deal with HTML5 APIs that provide that. Then we're going to talk about Node and we will pair WebSockets with Node and show how WebSockets provide us a really great way of doing realtime communication between client and server.
And finally by the end of the day we're going to start talking about WebRTC which is the next frontier of realtime communications. WebRTC enables peer-to-peer communications. So rather than my laptop and your laptop having to speak through an intermediate server, we can be introduced and they can speak directly. And the fewer people that are in-between us, the more realtime our communications can get. So we'll talk about what some of the capabilities are and do some future thinking about where WebRTC is going to take the web because I think WebRTC is the biggest inflection point that has ever happened in the history of the web platform.
So I want us to be aware of what WebRTC is possible. We're just now starting to dream up what that version of the web is going to look like. So that's where we're headed today, hopefully that'll be exciting and interesting as we go throughout the day. We're going to start again with HTML5. I just want to make sure everybody's aware, hopefully this should be pretty obvious but you definitely do need Node.js. I recommend that you have at least version 10.23 or higher. So, if you go to your command line and type in, wherever your Node instance can run, if you type in Node and then put a space and then do dash dash version, it should print out something for you like 0.10.23 or higher.
So 0.11 is fine. There isn't a 0.12 yet but we're anxiously awaiting the .12 release. If you have something like Node .6 or Node .8 or .7 or 9 or something like that, those are a little bit older and some of the stuff that we try to do may or may not work. So I recommend you being on the 10 branch. The newest version I think is 10.26 or 10.28 or something like that. 10.23 they actually made a bunch of bug-fixes to the HTTP method so that's why I say 10.23 or higher.
If you don't have that, there's plenty of time while I lecture for you to fix that but definitely make sure that you have a good running Node environment. That should also imply that you have a good running NPM environment. If you're not aware of what NPM is we'll teach you about NPM, but it's the package manager that allows you to install Node modules really easily. So you're going to want to have that up and running. I say that specifically for the few of you that may have Windows machines because I have seen in the past, some people have, they can get Node running just fine but there have been times where certain sorts of plugins that they try to install with NPM on Windows, they require a compilation like Socket.IO, for instance.
And compilations on Windows can be a little bit dicey. I've had people have problems where it required the .net SDK that they didn't have installed or whatever so just be aware of that, kind of take a look at that. You've got plenty of time but make sure you do have a fully-functioning NPM environment. Okay, what we're going to talk about today will be HTML5, Node.js, WebSockets and finally WebRTC. So let's jump in to HTML5.
- HTML5 facades
- Using APIs
- File I/O
- The asynquence library
- Publishing npm modules
- Grunt and Gulp
- Node as a web server
- Simulating asynchronicity
- Making a socket connection
- User-triggered messaging
- Signaling and data channels