Posted by Zeke
Last week we released a new version of our node buildpack that features dependency caching, faster downloads of the node binary, and support for any recent version of node. This new build process is now the default for all node apps on Heroku, so keep deploying your apps as you normally would and you should start to notice the speed improvements.
The new buildpack makes use of a build cache to store the
node_modules directory between builds. This caching can mean dramatically reduced build times, particularly in cases where your modules include binary dependencies like
We've also shaved time off the build process by caching precompiled node binaries on our own S3-backed proxy of nodejs.org/dist.
Some observant users noticed the performance improvements right away:
More Versions of Node
Your apps can now run any recent version of Node.js on Heroku, including unstable pre-release versions. As of this writing, that includes all versions from
0.8.6 up to
To automate the process of version discovery, we created semver.io, an open-source webservice that aggregates version information from nodejs.org/dist and makes it queryable by the buildpack. This eliminates the need for manual intervention each time a new version of node is released.
Custom Registry Support
The public npm registry has seen immense growth in recent years, and with that has come occasional instability. As a result, many node users are seeking alternatives to the public registry, either for the sake of speed and stability in the development and build cycle, or as a means to host private node modules.
As of today, you can include a
.npmrc file in the root directory of your node app and the new buildpack will honor it when running
npm install. The
.npmrc file lets you configure npm to download modules from your own private registry, a European mirror, or otherwise.
A Cleaner Codebase
Clean, commented code is key to the success of any open-source project. A tidy codebase lowers the barrier to understanding, and increases the likelyhood of useful community contributions. With nearly 600 forks on GitHub, clean code is of paramount importance to the buildpack's future success and adoption. The new buildpack has a lighter footprint, fewer dependencies, and lots of comments.
About 3 months ago, we announced the beta version of the buildpack on the new Heroku Discussion Forum, asking node developers to try the new buildpack and give feedback. The forum proved to be a great tool for collecting insight from users, and soliciting feedback in a public forum meant fewer redundant bug reports and feature requests from users.
The beta period is now over, but we'd still love to hear your thoughts.
- If you're having issues that are specific to your app, file a support ticket at help.heroku.com.
- If you'd like to discuss node development in general, start a thread on discussion.heroku.com.
- If you have build issues or ideas that are not specific to your app(s), create a GitHub issue.
Thanks to all the brave hackers who tested the new buildpack on their apps, found bugs, provided useful feedback, and submitted pull requests. Here's to the future of Node.js!