Create a Simple WebSocket Server to Distribute Patches from Immer
lessonDuration 2m 42s
In this lesson we will send patches over a WebSocket to our server, and distribute them again from there.
Browse
Find courses, lessons, articles, talks, and podcasts.
7,176 resources
Showing 4,201–4,224 · Page 176 of 299
lessonDuration 2m 42s
In this lesson we will send patches over a WebSocket to our server, and distribute them again from there.
lessonDuration 5m 32sFree
In this lesson, we will learn how to model data relationships with Prisma Schema. We will be using a social network as our example, create data models such as users, posts, likes, comments, and model the relations between them. After this lesson, you should be able to model common relations like *one-to-one* (1:1), *one-to-many* (1:n), *many-to-many* (n:m) with Prisma. At the time of recording this lesson, *Prisma Migrate* is in an experimental state, so the extra flag `--experimental` is needed to perform the `save` and `up` commands.
lessonDuration 4m 23s
The `useContext` hook allows you to leverage the React Context API within your function components. This lets your components provide data to their descendants in the component tree while avoiding "prop drilling" (i.e. passing props through components that are not concerned with the data). When instantiating the hook, it takes one argument: a React context. This subscribes the component to the context and any updated values being provided by the `Context.Provider`. Then, any data being provided by the parent component will be accessible in this component via the `context.current` field. ```jsx // Create a context const SearchContext = React.createContext(); // Subscribe to SearchContext const context = useContext(SearchContext); ```
lessonDuration 1m 33sFree
In cases where a `Link` doesn’t make sense, but you still need to navigate to a new page — such as a form submission — Gatsby provides a `navigate` helper for programmatic navigation. In this video, learn how to: - Programmatically navigate to a new page using Gatsby’s `navigate` helper - Send state information along with the navigation request
lessonDuration 3m 52s
Learn how to setup your [Cypress development environment](https://docs.cypress.io/guides/tooling/intelligent-code-completion.html#Reference-type-declarations-via-tsconfig) with Intellisense, custom Cypress configuration in cypress.json, and [get settings autocompletion in VSCode](https://docs.cypress.io/guides/tooling/intelligent-code-completion.html#Set-up-in-your-Dev-Environment-1). Recommended Homework: - Setup your Cypress dev environment
lessonDuration 5m 30s
In this lesson, we'll learn what CSP is and how it can be used to prevent inline scripts from being executed on our vulnerable website. First, we'll deploy CSP in "report only" mode, which will send violations to the endpoint you specify without blocking execution. Then, we'll run CSP in regular mode, which we'll use to completely block inline scripts from executing.
lessonDuration 5m 52sFree
As a user, it can be very disorienting when the "wrong" UI is briefly shown to the user: a login link is shown to an authenticated user, or a 404 error flashes before the page loads correctly. This issue is common in Gatsby applications, because of how Gatsby pre-builds HTML files. In this video, we show how issues like this can slip through, and how we can solve the problem by skipping user-specific state during the build. Instead, we'll leave that spot blank, and fill it in later on the client, when we know what should go there. While this tutorial uses Gatsby, the same lesson can be applied to Next.js, or any server-rendered React application. [Learn more about the nitty-gritty in this blog post](https://joshwcomeau.com/react/the-perils-of-rehydration)
lessonDuration 1m 13sFree
Learn how to query multiple local images so they can easily be displayed on a Gatsby site side-by-side. - [Written steps](https://www.gatsbyjs.org/docs/recipes/#optimizing-and-querying-local-images-with-gatsby-image) related to this video - [Working with images in Gatsby](https://www.gatsbyjs.org/docs/working-with-images/)
lessonDuration 4m 54sFree
This code at this point in the React Terminal Dashboard series is minimal, but as code starts to accumulate it'll be helpful to statically analyze the validity of our code going forward with ESLint and several plugins that are specific to React.
lessonDuration 3m 23sFree
Creating Markdown files from a template is a straightforward process with Node.js and Mustache. You can define a template, load it into your script, then push whatever data you have into your template, then write the files back out. Node.js built-in filesystem tools allow you to read and write the files while Mustache helps you to push the data into the template.
lessonDuration 1m 44sFree
[README](https://github.com/ChristopherBiscardi/rustlings/blob/egghead/exercises/standard_library_types/README.md) for this exercise.
lessonDuration 9m 30sFree
[Finite State Machines](https://statecharts.github.io/what-is-a-state-machine.html) are an old concept in computer science that help you remain bug-free while you manage complex state interactions in your application. In this lesson, I'll show you how to implement one so you have an understanding of the fundamentals of what they do. This is based on my blog post: [Implementing a simple state machine library in JavaScript](https://kentcdodds.com/blog/implementing-a-simple-state-machine-library-in-javascript)
lessonDuration 3m 17s
Images must have text alternatives that describe the information or function represented by them so they can be read and understood by those using screen readers. ## Alternative text for images * All `<img>` elements should have an `alt` attribute provided * When not provided many screen readers will fallback to reading the file name instead * The `alt` value should not include words like _“image”_, _“picture”_ or _“icon”_ * Screen readers are already announcing that the element is an image * Images that are decorative only and provide no information or function to the page should be hidden from Assistive Technologies by providing an empty `alt` attribute (`alt=””`) ## References * https://www.w3.org/WAI/tutorials/images/ * https://www.w3.org/WAI/tutorials/images/decision-tree/ * https://www.w3.org/WAI/tutorials/images/tips/ * https://www.w3.org/WAI/tutorials/images/informative/ * https://www.w3.org/WAI/tutorials/images/functional/ * https://www.w3.org/WAI/tutorials/images/textual/
lessonDuration 7m 43sFree
Almost every UI app I've seen has an `isLoading` boolean somewhere in the code. And if it's not that, it's some variation of a boolean that's intended to represent some state. Unfortunately, very often this leads to states that exist in the real world that are unrepresentable in the code, or states in the code that are impossible in the real world. In either case, you've got yourself a bug. From this lesson you'll learn how to avoid this by using a `status` enum instead of an `isLoading` boolean in a React custom hook for retrieving the user's position via [the geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API). This is based on my blog post: [Stop using isLoading booleans](https://kentcdodds.com/blog/stop-using-isloading-booleans).
lessonDuration 7m 30s
CLI's gain an extra level of power when you realize they can start and manage other CLI's and run multiple concurrent child processes (great for farming out work on multi-core machines!). You can even use it to improve developer experience in really small ways. For example, create-react-app famously scaffolds out a React app for you, and *also* installs the relevant node_modules. We'll learn how to do this two ways: with execa and with a dedicated yarn-or-npm utility, because this is such a common usecase. But before all that - we must learn and be comfortable with the raw Node.js child_process and I/O Stream API's. So that's where we begin.
lessonDuration 59sFree
*Go ^1.12, Node ^12.14.0* Compiling Go programs to WebAssembly does not require Emscripten, and the process is pretty straight forward. In this lesson, we will learn how to compile a simple Go program to a WebAssembly binary, then execute it with Node.js.
lessonDuration 1m 12s
Occasionally, you might want to write a producer that doesn’t change the draft, but rather returns a completely new data set. This can be achieved by using the return keyword.
lessonDuration 1m 6sFree
*Go ^1.12, TinyGo ^0.12.0, Node ^12.14.0* The WebAssembly binaries generated by the standard Go compiler are often unnecessarily large. In this lesson, we will learn techniques to optimize Go Wasm binary size with an alternative compiler that is designed for microcontrollers - TinyGo.
lessonDuration 3m 40sFree
This lesson shows how the Serbet server library for ReasonML and Node.js makes handling JSON request bodies, and responding with JSON request bodies a simple task.
lessonDuration 1m 15sFree
In this lesson, you will learn how to add a Marker and Popup component to a Map when using React Leaflet. We'll walk you through importing the components and adding each one to the Map. Additionally, we'll resolve an issue with loading marker images that's inherent to creating a new React Leaflet map in Create React App, which we'll fix by manually importing the image from Leaflet and configuring those images to the marker.
lessonDuration 5m 9sFree
This lesson will demonstrate how to replace common uses of [lodash.get](https://lodash.com/docs/4.17.15#get) with [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) syntax. `_.get` is by far my favorite lodash method. I've been on so many projects where the results of a network call was a large and often unreliable blob of data. After countless attempts to reign in errors caused by trying to access non-existent properties I've come to rely on _.get as a simple & safe way to retrieve data from those objects. However, as is always the case in web development, times are changing and the tools we need to safely access properties of complex objects are now being built into the platform. [Optional chaining syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) gives us the power of _.get without several of the tradeoffs. It doesn't require an extra library to use, it plays nicely with TypeScript and it can be used when calling methods as well as when accessing properties. This lesson covers 4 common use cases of `lodash.get` and converts them to using optional chaining syntax. 1. Nested Object and Array Access 2. String and Variable Property Access 3. Calling a Method on an Object that may Not Exist 4. Providing a Default Value when a Property does Not Exist --- ### Resources - [Nullish coalescing operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator)
lessonDuration 1m 5sFree
A common best practice is to provide a visual indication for which page is currently being viewed. This video will show you how to take advantage of the `activeStyle` prop of Gatsby’s `Link` component to customize the look of the currently active link.
lessonDuration 2m 24sFree
Learn how to create and use the Ionic Floating Action Button (FAB) in your Ionic 4 application.
lessonDuration 8m 3s
Welcome! We're going to have a great time exploring React's experimental Concurrent Mode. Concurrent Mode is an exciting leap forward in user interface development. It allows us to describe user interface transitions in beautiful detail. Apps aren't static. They move — responding to user input as they dart back and forth to the internet for data. Concurrent Mode and Suspense give us a language for those movements. In this video we talk project setup, how to find help, and what to expect from this very exciting, very experimental feature. This course is narrowly focused on Concurrent Mode and Suspense. We will not cover adjacent topics like styling or code organization.