Brutal.js

Languages and libraries

javascript library

SHOW HN2018

Brutal.js

a small framework for building brutalist web applications

github.com

#javascript#brutalist web#html templates#tagged templates#xss

62points
54comments
#681of 2,155 in 2018
Top 32%of 2018 by points

How HN took it

RoastedHalf or more of the comments are critical

0 positive, 9 neutral or asking, 0 mixed, 15 critical, out of 24 comments about the project. Thread score -0.54.

Idea: 0 for, 12 againstExecution: 0 for, 2 againstPerformance: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Tagged template approach is interesting and a good learning example

    From 1 comment
    • I was wondering how they pulled of the R`` expressions because I didn't realize that JS added "tagged templates" like this [1]. So if nothing I learned something new by reading…
      wybiral on HN

Objections

  • Brutalism does not need a framework; the concept is a poor fit for JS frameworks

    From 4 comments
    • Might just be me, but it feels a little weird that brutalist design needs a framework. But perhaps I'm misconstruing the design/look of it to how it is actually built, in which…
      b_b on HN
    • Agreed. Not to sound too harsh, but this "framework" (actually a library) smells very strongly of bandwagon. Why should I use this when I could use something like Hyperapp or…
      warent on HN
    • Yes, could not agree more, Brutalism is quite hot right now (although HN seems to hold a bit of an alternative definition about what Brutalism entails) which really seems like…
      rutierut on HN
    • Let's beat that dead horse. Part of the pillars of brutalist web design is "no framework". Sugarless sweetener now made from sugar cane!
      corodra on HN
  • Possible XSS vulnerability from unescaped template interpolation

    From 2 comments
    • I tried making something like this (JSX with Template Literals) few times, they are languishing in unfinished JSFiddles. The main issue was making it XSS-safe by default, which…
      franciscop on HN
    • Demo 2 seems to be a problem with jsfiddle: https://jsfiddle.net/hegLkz4s/22/ It's also already been reported: https://github.com/jsfiddle/jsfiddle-issues/issues/963 You're right…
      jamescostian on HN
  • Not true to the brutalist web philosophy of plain HTML and CSS

    From 2 comments
    • A brutalist website - by definition - should hardly contain any JS/CSS.
      tzahola on HN
    • I think this is kind of missing the point. The movement toward brutalism tries to bring back the uniqueness of sites on the early web in all their bizarre diversity. It's also…
      tarboreus on HN

Requests

  • Make template interpolation escape by default, or throw on unsafe strings

    From 2 comments
    • Does it throw if a template returns a string? While it's a cool feature to be able to do this, it's also quite dangerous (specially when dealing with beginners for this library)…
      franciscop on HN
    • Ah cool, that works as well from a security point of view. I slightly prefer throwing, but that is highly opinionated.
      franciscop on HN

Questions

  • What is the XSS attack vector?

    From 1 comment

Alternatives named

  • lit-html

    From 2 comments
    • Lit-html seems like a more fleshed-out version of this: https://github.com/Polymer/lit-html
      numtel on HN
    • lit-html, a similar HTML templating with template literals library, achieves /mostly/ XSS-safe by default by never interpolating dynamic data before parsing, but interpolating…
      spankalee on HN
  • React

    From 2 comments
    • I tried making something like this (JSX with Template Literals) few times, they are languishing in unfinished JSFiddles. The main issue was making it XSS-safe by default, which…
      franciscop on HN
    • I don't get the example code. It is possible to write even simpler code in React than it is showed in the documentation. const ButtonWidget = ({name}) => (<button onClick={() =>…
      kvczor on HN
  • Hyperapp or Preact

    From 1 comment
    • Agreed. Not to sound too harsh, but this "framework" (actually a library) smells very strongly of bandwagon. Why should I use this when I could use something like Hyperapp or…
      warent on HN
  • Stimulus JS

    From 1 comment
    • Reminds me in an odd way of Stimulus JS. (https://stimulusjs.org/) Actually, in the current project I am working on, I have been using Stimulus JS and VanillaJS™ exclusively and…
      richjdsmith on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/17484253)