DailyJS

Paperclip.js, bem-react

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

templates reactive react

Paperclip.js, bem-react

Posted by Alex R. Young on .
Featured

templates reactive react

Paperclip.js, bem-react

Posted by Alex R. Young on .

Paperclip.js

Paperclip (GitHub: mojo-js/paperclip.js, License: MIT, npm: paperclip) by Craig Condon is a template engine that's a bit like React, except it translates HTML templates into JavaScript document fragments rather than using a virtual DOM. The template is then cloned when it's used, and requestAnimationFrame is used to prevent unnecessary DOM operations.

Craig provided some examples so you can see how it compares to other projects:

Paperclip has been used for two years in production at ClassDojo, so it sounds battle tested. It has unit tests that run in browsers and Node, and you can also use the module itself in Node.

bem-react

bem-react (GitHub: dfilatov/bem-react, License: MIT, Bower: bem-react, npm: bem-react) is a module for React that provides features to support the BEM methodology which was developed by Yandex.

BEM is a methodology of web projects development, that allows you to divide an interface into logically independent blocks. At the same time BEM contains specific tools for the typical web developers' tasks automatization. And finally BEM gives us opportunity to create libraries of web-components for fast and efficient web-development.

With this module, you can use "bemjson" in templates instead of jsx or JavaScript, and manipulate CSS classes based on BEM.

I noticed there's a demo app in bem-react/example that highlights the bemjson special fields, component use, and component composition.