News for hackers. Stuff that matters.

chrisfrank

Re:Happy Birthday, Ruby on Thursday January 10, 2019 @01:17PM (#18876373)
I work with Ruby on the web, but rarely with Rails. Apart from the Ruby language itself -- which I love, even though I sympathize with those who don't -- I can't imagine giving up these two libraries by Jeremy Evans:

[Sequel](https://github.com/jeremyevans/sequel) - Sequel is the best ORM I've ever used, in any language. Fast, stable, unbelievably well maintained, and offers great low-level access to the database when you need it.

[Roda](http://roda.jeremyevans.net) - This dynamic routing library is conceptually similar to React Router, in that there is no static list of routes; routing is a function call. But it's faster than React on the server, and has better support for HTTP verb support, database I/O, etc.

As for there being "better tooling" in modern JS, I'm not sure I agree. Babel and ES6 are impressive, and I love writing the code they make possible. But I appreciate being able to write Ruby and know that it will just run. Writing packages for node means choosing one of two incompatible module systems, or adding transpiler bloat.

Re:Tailwind: style your site without writing any CSS on Friday November 02, 2018 @11:06AM (#18363537)
Thanks! I started by just passing props too, and I could see that approach working forever. I just got tired of having to always specify <Button bg="blue" border="ba1" />, when 90% of the buttons in the app were blue with a border.
Re:Tailwind: style your site without writing any CSS on Friday November 02, 2018 @10:39AM (#18363324)
I've also found Tachyons & React to be an amazing combination. The only trouble I've had is extracting common CSS class strings into tweakable components, e.g. a <Button> whose background color you can easily override, or a <Header> with tweakable font weight.

I wrote a tiny (1kb) library to make this easier. For anyone working with React and functional CSS, I hope it's helpful:

https://www.npmjs.com/package/nanostyled

Thanks! It's a tiny library and my team is using it in production, so I plan on maintaining it for a very long time.
Author here. This library aims to be a compromise between the expressive APIs of CSS-in-JS libraries like styled-components, and the extremely low overhead of plain CSS.

Would love feedback on, in particular, whether it seems like a useful compromise, or whether it fails to capture enough of what's good about either CSS-in-JS or plain CSS on their own.

Re:Tailwind: A Utility-First CSS Framework on Thursday September 27, 2018 @08:05PM (#18089946)
Adam, your "Separation of Concerns" article was what sold me on utility-first CSS. Thank you.

For anyone building React apps with Tailwind or Tachyons, I just open-sourced a library that makes it easier to reuse CSS classes in standalone, customizable components:

https://www.npmjs.com/package/nanostyled

(I think this is a React implementation of what the Tailwinds docs call "Extracting Components".)