Choo Weekly #3 2018: Routing Changes, Sheetify 7.0.0 & Parallel Nanostate

Yoshua Wuyts
choo
Published in
4 min readJan 17, 2018

Happy Wednesday everyone! Another week, another round of updates. This time around we’ll be talking about a few (internal) routing changes for Choo, a new version of Sheetify, and some production applications that were in the news recently. Let’s dig in!

If this is your first time you’re hearing about Choo: we’re the tiny frontend framework you’ve always wanted to use. True story. Check out create-choo-app to have your first application working 5 minutes from now.

Choo Routing Changes

One of the main appeals of Choo is that you understand how it works, you can implement it yourself from scratch in a couple of hours. After all: our main source is about 200 lines.

One of the hardest parts at the moment is the way our router interacts with the rest of the app. Luckily, thanks to the efforts of Marc Bachmann the last little bits of complexity will soon be ironed out.

A minor release with these changes should be landing this week!

Sheetify 7.0.0

Sheetify has been the way we figured people might want to use CSS. Being able to import stylesheets from npm, defining them inline, but also in local .css files: Sheetify does it all!

Our latest release is 7.0.0 which brings the configuration in line with browserify and documentify. Instead of --use, you can now do --transform. A small breaking change that warranted a major bump, but an important one at that!

Sheetify 7.0.0 should be landing in Bankai soon too. So keep an eye out for updates!

Bankai 9.2.0

Speaking of Bankai: we mentioned last week we’d be releasing a new Bankai version, and we did! Bankai 9.2.0 comes with all sorts of goodies!

We’ve improved our source map logic, making source maps more reliable. And we’ve improved our installation times using rust-brotli — so no more compilation times when installing!

Go ahead and install Bankai 9.2.0 today!

$ npm install bankai@9.2.0

If you’re never heard about Bankai: it’s the easiest way to compile your frontend projects. With two commands it takes care of all tooling for both production & development. Check out https://github.com/choojs/bankai to learn more.

Parallel Nanostate

Thanks to the work of konrad.min.js, Nanostate now has parallel support! You can now hook up multiple state machines into a single interface, making it easier to interact with.

var nanostate = require('nanostate')

var machine = nanostate.parallel({
bold: nanostate('off', {
on: { 'toggle': 'off' },
off: { 'toggle': 'on' },
}),
underline: nanostate('off', {
on: { 'toggle': 'off' },
off: { 'toggle': 'on' },
}),
italics: nanostate('off', {
on: { 'toggle': 'off' },
off: { 'toggle': 'on' },
}),
list: nanostate('none', {
none: { bullets: 'bullets', numbers: 'numbers' },
bullets: { none: 'none', numbers: 'numbers' },
numbers: { bullets: 'bullets', none: 'none' }
})
})

machine.emit('bold:toggle')
console.log(machine.state)
// => {
// bold: 'on',
// italics: 'off',
// underline: 'off',
// list: 'none'
// }

Install nanostate@1.1.0 to get started today!

Composable Views Documentation

We’re trying our best to write documentation for Choo. This not only means covering the basics, we also want to provide people with patterns & modules to use. After all: this is how people work on a day-to-day basis, and we want to make this available for everyone.

One of the patterns people have been wondering about in Choo, is how to reuse large parts of a view when you have a lot of similar views. We made a PR exactly to address this!

We’re thrilled that we’re able to put out more docs. We’d love to hear from you if you had trouble doing something, because there should be docs for that!

United Nations Website

code and conspire made a website for the United Nations using Choo. They’ve also committed to sponsoring Choo on OpenCollective! We couldn’t be more grateful.

Check out the website for the United Nation’s 2030 sustainability goals!

Scripto in the New Yorker

Last week Scripto got a feature in the New Yorker about how they’re transforming the way late night shows are made in the US. We’re really excited for them!

Scripto have been using Choo since the beginning. Their challenges have helped shape Choo into what it is today — shout out to a pile of moss, Scripto’s CTO!

Components Progress

Seth Thompson made a nanolru, a small module to keep track of component instances with garbage-collection built-in. This should help us progress components nicely.

More updates to follow soon!

Wrapping Up

Thanks a lot for making it this far. Hope you’re catching enough sleep and are staying hydrated. We hope you have a great rest of the week! Catch you next time!

If you’re working on something cool using Choo, let us know on @4kilobytes or Freenode#choo ✌️.

--

--