Javascript: The Big Picture - Notes

Paraphrased notes from Pluralsight video course Javascript: The Big Picture by David Tucker and other online resources -

In 1995, Netscape wanted to integrate a dynamic and interactive element into the web, so they tasked Brendan Eich to create a new language for this purpose. This language was first called LiveScript & soon renamed to JavaScript. 

JavaScript is a dynamic interpreted scripting language that can be used to create web applications. It can also be used to create:

  • Desktop applications - Electron 
  • Mobile application on both iOS and Android - React Native,
  • IoT or Internet of Things - Many devices, like a Raspberry Pi, have the ability to install and run Node.js, and packages are available in npm to interact with different sensors and input devices.

When JavaScript in the browser runs, it runs within an engine. There are three primary JavaScript engines:

  • V8 JavaScript Engine - Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome, Microsoft Edge and in Node.js, among others.
  • JavaScriptCore / SquirrelFish is the engine that runs on Safari
  • SpiderMonkey is a descendant of the original JavaScript engine and it is used in the Firefox browser.

JavaScript on the Server - Node.js launched in May 2009 dramatically altered the role JavaScript plays in development outside of the browser.

Node.js was built on the open source V8 JavaScript engine that is used in both Google Chrome & Microsoft Edge.

Its creator, Ryan Dahl, added APIs for things JavaScript couldn't do in the browser. This included reading and writing files, making and receiving network requests, as well as encrypting and decrypting data.

Node.js is a JavaScript environment which executes JavaScript code inside of the V8 JavaScript engine and provides an I/O library to do things that we can't do in the browser environment.

One of the use cases that Node.js is commonly used for is to create web server software for websites and applications.

Package manager is a tool that enables you to install and manage software written by other developers into your own software projects. NuGet is the package manager for the Microsoft development stack, pip is the package manager for Python. 

npm or Node Package Manager is the official package manager for Node.js. 

There are two different parts to a package manager - client & registry.

Since 2020, this registry has been owned by GitHub, which is itself owned by Microsoft.

Express is a minimalist web framework for Node.js

If we have a Node.js project set up, we can install Express by simply typing npm install express.

Other popular Node.js package are Axios to help with making web requests, Socket.IO for creating real‑time apps like chat applications, and Mocha and Jest for testing your JavaScript code.

Many of the modern tools that you will actually use to create JavaScript applications actually run on Node.js:

  • When you create a new React web application, the create‑react‑app tool runs on Node.js. 
  • Visual Studio Code runs on an application framework called Electron that enables you to build desktop apps with JavaScript and Node.js. The same framework also powers the desktop apps for Slack and Microsoft Teams.

Like Node.js, Deno is a JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser and is built on top of Google's V8 JavaScript engine, which compiles JavaScript code to machine code for faster execution.

Both have access to the same core JavaScript language features and syntax.

Both can be used to build server-side applications, command-line tools, and other types of software. 

Deno and Node.js are similar in that they allow developers to run JavaScript code outside of a web browser, but they differ in their security, module system, standard library, and compatibility with the existing Node.js ecosystem.

The technologies we use across all of the tiers of our application is called a stack.

Developers who work on both the front end & back end are called full stack JavaScript developers.

Next.js is a web application framework that enables developers to build both the front end and a portion of the back end in a single project. This framework builds on React.

JSX is an extension for JavaScript most commonly used in the React framework that enables you to write HTML‑like markup directly within JavaScript.

There are tools and web application frameworks that all still build on the core elements of HTML, CSS, and JavaScript:

  • React - maintained by Meta 
  • Angular - maintained by Google
  • Vue.js
  • Svelte

Comments