(Web/View) Components: Should everything be a component?

An article, posted more than 2 years ago filed in WebComponents, components, design system, structure, todo, programming, development, front-end & html.

Recently I was reviewing a merge request of some front-end code, and a simple div, that changed a bit of the custom appearance of a block of text through a few custom classes, was changed in a call to a view component that then applied the same classes, passed onto the component through a more deeply nested hash.

- <div class="custom-class">
+ <%= TextComponent.new(html: {class: "custom-class"}) do

I’m not sure why people would like to do it, but some ideas:

  • No more HTML / Everything is a component! (reminds me of l’art pour l’art)
  • Ability to analyse the way components are used (we’re not doing this right now)

The drawbacks:

  • Less readable code (perhaps an opinion)
  • Slower execution, instead of rendering a static snippet, code needs to be executed
  • Instead of <div>’itis you get ‘TextComponent’-itis.. we don’t add better semantic or structural informa…

Continue reading...

TL/DW: .css_day#ui-special

An article, posted more than 6 years ago filed in ui, ux, user experience, web, css, frontend, front-end, interaction, user, ai, sniffles, hakimel, jmspool, brad_frost & mrjoe.

Yesterday I attended the CSS Day conference. This year only the first day, that focussed on designing user interfaces, less the building of it. Here are the key take aways for those who thought going through all slides is too long, or didn’t went.

Josh Clark - A.I. is your New Design Material

Josh urged designers to get feeling for the new design material called AI, the next big thing. We need to know what makes it different, the grain, and also know how we can use it for good. Design might have a seat at the board table, but they need to know how to align user considerations with business goals. More on AI and design by Josh Clark and more.

Steph Troeth - Behind the story

Storytelling used to be all the rage before mobile entered the scene, Steph recalls. Nevertheless, people prefer stories over plain lists of…

Continue reading...

Try not using Javascript first

An article, posted more than 9 years ago filed in javascript, web, front-end, development, html, css, internet, rest & kiss.

My guiding principle in web-development is (still): Always make things work without (client side) JavaScript first.

Aside from offering a graceful degradation of the experience by progressively enhancing it leads to better code. Three reasons why:

  1. it forces you as a developer to think about logical endpoints for your form submits, your data requests etc. Typically this leads to fewer cases of overloading a resource with all kinds of unrelated functionality (yep, I’m a big REST-first advocate).
  2. your application will probably be more web-native, and hence more future proof, more easily cache-able, etc.
  3. the front-end JavaScript to enrich the experience will typically also be less complex and can be generalized more easily.

Yes, I do shiver when I hear things like CSS in JS, KISS!

Photo by [Dmitry Baranovskiy](https://www.flickr.com/photos/dmitry-ba…

Continue reading...