Tag

javascript

Svelte REPL, Part 1

From Svelte and Sapper in Action by Mark Volkmann

This article delves into the Svelte REPL.

What is the Jamstack and What Can It Do for You?

The Jamstack is more of an architecture or methodology for building web applications than a prescriptive stack of technologies. Jamstack was formed in response to dynamic web page development that many felt had become cumbersome, slow and insecure. The Jamstack architecture offers a number of benefits including page speed, security and cost.

Generating Code with Template Functions

From Domain-Specific Languages Made Easy by Meinte Boersma This article shows you how to use modern JavaScript in a smart way to comfortably implement templates for text/code generation, instead of using a template engine. The following article is a standalone… Continue Reading →

Writing Good Assertions

From Testing JavaScript Applications by Lucas da Costa

In this article, I will teach you techniques to help you write better assertions. You will learn how to make them catch as many bugs as possible, without having to update tests too often, lessening your maintenance burden.

The What and Why of Domain-Specific Languages

From Domain-Specific Languages Made Easy by Meinte Boersma A domain-specific language is a software language that allows domain experts to capture their knowledge in a precise enough way to make that executable. The following article is a standalone excerpt from… Continue Reading →

Testing with Node, Jest, and JSDOM

From Testing JavaScript Applications by Lucas da Costa

In this article, you’ll learn how to use Node and Jest to test code written to run in a browser.

Creating DSLs has never been easier

From Domain-Specific Languages Made Easy by Meinte Boersma

The Value of Concurrency in Tests

From Testing JavaScript Applications by Lucas da Costa

This article explains what parallelism is and how Jest can help you run your tests faster.

Managing Component State with the useState Hook

From React Hooks in Action by John Larsen

If you’re building React apps, then you’re expecting the data your app uses to change over time. Whether it’s fully server-rendered, a mobile app or all in a browser, your application’s user interface should represent the current data or state at the time of rendering. Sometimes multiple components throughout the app will use the data, and sometimes a component doesn’t need to share its secrets and can manage its own state without the help of mammoth, application-wide state-store behemoths. In this article, we’ll keep it personal and concentrate on components taking care of themselves, without regard for other components around them.

Exploring the useEffect API with Easy Examples

From React Hooks in Action by John Larsen

Some of our React components are super-friendly, reaching out to say “hi” to APIs and services outside of React. Although they’re eternally optimistic and like to think the best of all those they meet, there are some safeguards to be followed. In this article, we’ll look at setting up side effects in ways that won’t get out of hand. In particular, we’ll explore these four scenarios:

§ Running side effects after every render

§ Running an effect only when a component mounts

§ Cleaning up side effects by returning a function

§ Controlling when an effect runs by specifying dependencies

To focus on the API we’ll create some easy component examples. First up, let’s say “Bonjour, les side-effects.”

© 2021 Manning — Design Credits