Break stuff. Now.

July Learning Spree

Keeping up with the latest and greatest in web technologies

July 31, 2018

Late July post! Better late than later I guess. Wasn't slacking off though. First off, I have a dozen-ish drafts living on my machine, maybe a few more on my workstation that I forgot to move over. Plus I've spent most of my July trying out all sorts of JavaScript weirdness. From tools to libraries, bundlers and more. Here are a few of them.

TypeScript - you don't really know TypeScript

TypeScript not only consumes TypeScript. It also consumes straigh up vanilla JavaScript via the --allowJs compiler option. It comes with basic compilation errors, not as thorough as TypeScript. It's a good alternative if you find Babel too cumbersome, Buble too restrictive, and Sucrase too new and shiny.

In other news, the official UMD definition includes CJS, AMD and global. Most JavaScript tools like Rollup emit a header that exports all three. However, TypeScript's UMD fomat only emits CJS and AMD. It's effectively saying no to globals, yes to modules, and telling you to use a module system regardless of what runtime you're on.

Parcel - the bundler of my dreams

Parcel takes a different approach to bundling, one that takes configuration away from you. Parcel starts of by parsing an index.html for processable assets, effectively making it your app's entry point. Then it compiles discovered assets and serves them. It's the closest thing to the old-school "just put a script and style on an HTML". You can just run Parcel in the background, forget about it, and pretend you're writing directly for the browser.

Unfortunately, Parcel has a lingering issue with bundling circular dependencies, a valid ES6 feature. Had to ditch Parcel for now since I just happen to work on something that relies on circular dependencies being possible (it's a long story, but it's perfectly valid usage).

Tachyons and BassCSS - never write CSS again!

About a year ago I wrote about contextual vs context-free CSS. In a gist, contextual CSS relies heavily on the surrounding HTML structure and other defined styles while context-free CSS is written in a very atomic, standalone manner that it doesn't care where it ends up in HTML or what other styles may have already been defined or applied.

Enter Tachyons and BassCSS which takes atomically-written CSS to a whole new level. The libraries are fairly small. You simply compose your styles out of pre-defined classes. It pushes away design repeatability to the component system. And the list of benefits goes on. Bottom line, you pop in the library, and you never have to write (structural) CSS ever again. And for what its worth, Bootstrap 4 started adopting this with its utility classes.


One does not find what one does not seek

And if one does not seek, one does not find, and one will become forever enslaved doing service class plumbing for CRUD apps. I hope that scared you enough to get out of your boxes/bushes/shells/whatever you're hiding in. Get out there, build an app that you can be proud of, and keep on learning!