Github Releases Catalyst to Ease the Development of Web Components

Github Releases Catalyst to Ease the Development of Web Components

GitHub recently released the first major iteration of Catalyst, a set of patterns and techniques for developing with web components in complex applications. Catalyst strives to be small and is used for the GitHub website that is entirely written in vanilla JavaScript and web components.

GitHub recently released the first major iteration of Catalyst, a set of patterns and techniques for developing with web components in complex applications. Catalyst strives to be small and is used for the GitHub website that is entirely written in vanilla JavaScript and web components.

The GitHub Catalyst documentation explains:

Catalyst is a set of patterns and techniques for developing components within a complex application. At its core, Catalyst simply provides a small library of functions to make developing Web Components easier. The library is an implementation detail, though. The concepts are what we’re most interested in.

In the early days of jQuery, web applications would be written without the indirection proposed by frameworks. Developers would put event handlers on interactive DOM elements (direct event binding) or anchoring ancestor elements (event delegation). Those handlers would do some work and possibly update the DOM. That meant querying the DOM to find the elements to update. In a talk at the Web Component SF Meetup earlier this year, Kristján Oddsson, core contributor of Catalyst, illustrated how a simple behavior would be implemented in vanilla JavaScript at GitHub:

// Direct event binding
on('click', 'js-hello-world-button', function (event) {
  const button = event.currentTarget;
  // DOM Querying
  const container = button.closest('js-hello-world');

  const input = container.querySelector('js-hello-world-input');
  const output = container.querySelector('js-hello-world-output');

  output.textContent = `Hello, ${input.value}`
}

with the corresponding HTML on the page:

<div class="js-hello-world">
  <input class="js-hello-world-input" type="text">
  <button class="js-hello-world-button">
    Greet
  </button>


</div>

web components javascript development news

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

Exposing Most Common Web Development Myths | ByteCipher

Are you looking for the best Web and Mobile App Development Company in India? We at ByteCipher are offering creative & custom web and mobile app development services worldwide

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

Web Components at Github

Kristján Oddsson detailed at the Web Components SF meetup how GitHub uses Web Components and the patterns GitHub identified to foster readable, performant, and accessible front end components.

Important Reasons to Hire a Professional Web Development Company

    You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...