• While the speed with which JavaScript was adding new UI frameworks to build interactive web applications has slowed down in recent years, we have seen new interesting frameworks in 2020 that focus on simplicity and performance
  • Brahmos strives to implement the known React APIs with a different and potentially faster method that also leverages a standard feature of JavaScript: template literals. Brahmos thus strives to implement React’s hooks, context, concurrent mode, and more
  • Brahmos is among the very few UI frameworks that implements the experimental concurrent mode API sponsored by React. Other frameworks may be waiting out, or discarding the feature entirely.
  • While the bar for new JavaScript frameworks is continually raised by the dominant actors in that space (e.g. by partnering with browser vendors to add APIs favoring a given approach, renderers for other output devices, baking UX practices into the framework), the newcomers show that there is still space to innovate

Sudhanshu Yadav created Brahmos, a new front-end framework for writing interactive web applications. Brahmos strives to comply with the latest React APIs but with a different implementation that eschews virtual DOM entirely. Brahmos leverages instead template literals, a modern feature of the JavaScript language introduced in the ES6/ES2015 iteration of the language. Purported benefits are better performance driven by a smaller framework codebase and a faster computation of the DOM parts to update.

The current version of Brahmos implements a large portion of React APIs, including functional components, hookscontextrefsforward refssuspenseconcurrent mode, and more. Example code using the previous APIs is available in a code playground.

Brahmos is another front-end framework that seeks to improve React’s performance. Preact strives to do so with a smaller codebase that targets DOM rendering. Unlike React, and like Preact, Brahmos cannot target non-DOM-based output devices (mobile, pdf, webGL, and more).

One interesting aspect of Brahmos is its implementation of concurrent mode, a feature React has introduced and worked on for several years and that is still pending an official release.

Brahmos has the reuse of existing React components as a short-term objective (this is not yet implemented). A performance benchmark that would validate Brahmos’ approach is also pending.

InfoQ interviewed Sudhanshu Yadav on the framework fundamental ideas, goals, value added and roadmap. Readers that are interested to go deeper can also review an introductory talk online.

InfoQ: Can you tell our readers about yourself?

Sudhanshu Yadav: I work at HackerRank as a Front-end Architect. I have a deep interest in understanding the internals of the tech I use and I like making theories about how things work. I also organize a meetup group to discuss the internals of different technologies. Apart from this, I keep exploring architecture, patterns, tooling, and design systems.

I am a strong believer in open source software and have authored Brahmos, react-number-format (which has ~1M/month npm installs), packagebind, and other OSS tools and libraries

#web development #javascript libraries #react #user interface #javascript #architecture & design #development #article

Brahmos, a New, Small, React-like UI Framework with Concurrent Rendering
1.15 GEEK