1. Buildpack Adventure

  2. This is one hacker’s quixotic journey through the magical open-source world of Heroku buildpacks.
  3. Herok-who?

  4. Heroku is a web hosting company that doesn't suck. We provide a platform that lets developers focus on apps instead of infrastructure.
  5. Developers are our customers, and everything we do is about promoting developer happiness.
  6. All the Languages

  7. In the early days, Ruby was Heroku’s only supported language, but in 2011 the Cedar Stack was launched, making Heroku a true polyglot platform.
  8. What is Cedar?

  9. Cedar is Heroku’s general-purpose stack, with no native support for any language. New languages or frameworks are supported by creating new buildpacks.
  10. There are currently nine official buildpacks, with support for Ruby, Node.js, Python, and various JVM languages.
  11. There are over 1500 third-party buildpacks in use on the platform today.
  12. How Do Buildpacks Work?

  13. A buildpack is simply a collection of scripts that prepare your app for execution on the Heroku platform. They're typically written in bash, but can be written in higher-level lanuages like ruby, python, or javascript.
  14. Heroku Buildpacks are open source. We like to expose platform primitives wherever possible, giving developers the power to bend the platform to fit their needs.
  15. There is no spoon.
  16. The Node.js Buildpack

  17. The Node.js buildpack was created by David Dollar, a prolific hacker known for such tools as Foreman, Heroku Fork, composable buildpacks and a grip of Heroku CLI plugins.
  18. David is a busy man, building the Internets and whatnot. So I've stepped in to help maintain the Node builpack, dutifully adding support for new versions of Node.js and npm, merging pull requests, and handling support tickets.
  19. The Node.js buildpack has a ton of forks. I wonder what all those hackers are up to...
  20. The roles of a product manager are many and varied, but the most important one is to figure out what customers want and/or need, then distill that information into something actionable by designers and engineers.
  21. Having a large community of open source contributors means we don't always have to ask what our customers want. They're already building what they want.
  22. So... maybe we can use GitHub to get a sense of what people are doing with all those forks.
  23. GitHub's Network Graph Viewer doesn't really tell us much. Fortunately, we're hackers...
  24. dotjs is a Google Chrome extension and local webrick webserver that serves up files in your ~/.js directory. When you view foo.com in your browser, ~/.js/foo.com.js is eval'd against the current page.
  25. dotjs is like Greasemonkey for introverts. It's great for quickly prototyping browser extensions and making small tweaks to sites, but there's no centralized registry of dotjs scripts, so you can't easily share or distribute your creations with others.
  26. If only there was a painless way to write browser extensions...
  27. Crossrider!

  28. Crossrider is a cloud-based development framework for creating browser extensions that work in Chrome, Firefox, IE and Safari. It even lets you develop locally.
  29. Crossrider provides a good baseline for writing extensions, but it's not so easy to bring in dependencies. Luckily we have a Vanilla Javascript cheatsheet.
  30. Forkie is a browser extension (written in Crossrider) that replaces GitHub's network page with something useful.
  31. Writing extensions is fun. Let's make another one for viewing npm dependencies of github repos!
  32. I digress...
  33. So, Forkie surfaces forks that are theoretically popular, but stargazer and fork counts are merely popularity proxies. Time to look at real usage...
  34. Deep Divin’ in Deploy Data

  35. Every time an app is deployed on Heroku, God creates a row in a Postgres table.
  36. App metadata, including buildpack URL, is stored in an hstore column.
  37. select attributes->'buildpack_url' as buildpack, count(*) as deploys from all_events where attributes ? 'buildpack_url' group by buildpack order by deploys desc;
  38. Buildpack Trends

  39. Developers are doing all kinds of crazy stuff with buildpacks, but some definite patterns seem to be emerging.
  40. Build Tools

    grunt, bower, and hem.
  41. Headless Browsers

    PhantomJS and Casper.
  42. Meteor

    Meteor, Meteor, Meteor, Meteor, Meteor, and Meteor.
  43. Binary Dependencies

    Cairo, FFMpeg, Taglib, EXIFTool, and Vendor Binaries.
  44. Weird Stuff

    Dart and null-buildpack.
  45. Language Promiscuity

    ruby+node and python+node.
  46. Composability

    heroku-buildpack-multi, heroku-multi-buildpack, and heroku-buildpack-compose.
  47. What is Composability?

  48. Composability is simply the ability to build useful systems out of smaller pieces.
  49. echo "foo" | pbcopy
  50. The Node community has been instrumental in reviving this important bit of Unix philoshopy, bringing it into the consciousness of a new generation of hackers.
  51. “by releasing small modules, you leave open the question of their larger utility. they may yet solve problems that you have not dreamt of” - @isntitvacant
  52. “Create a single, general-purpose tool which is simple to understand but can be applied to many problems. It's like the product version of Occam's Razor.” - Adam Wiggins
  53. So, What's Next?

  54. Make the Node.js buildpack even smaller.
  55. Look inside all the .buildpacks files, where the composability magic is really happening.
  56. Keep listening to users.
  57. And keep on hacking!
  58. I'm zeke on Twitter and zeke on GitHub. Hit me up if you want to paint bike sheds, drop science, design by committee, or wax philoshophical.
  59. buildpack-adventure.heroku.com