Pug 3.0.0

Forbes Lindesay
RollingVersions
Published in
3 min readMay 26, 2020

--

This week I released pug 3.0.0. This release brings a few really exciting new features, as well as a couple of small breaking changes. I also took this opportunity to update the supported versions of node.js to match the official LTS versions. The breaking changes are minimal, and should not impact most users. The highlights include:

  • The new each … of … syntax lets you iterate over Maps and Sets as well as Arrays, and is more efficient than the each … in … syntax. Don’t worry though, the old syntax is still there, and you do not have to do anything to update if you don’t want to.
  • You can now write filters that operate on binary data (e.g. images). This means you can import an image, apply a filter, and output an optimised <img/> tag with the image data inlined as a base64 string. This can improve page load times, and make your web app easier to deploy.

You can check out the full release notes on GitHub to see examples for these features, as well as a list of the (minimal) breaking changes.

Rolling Versions

Ever since I merged Pug’s many separate packages into a “mono repo”, I was frustrated by how difficult it was to do a release. There is a lot that I like about Lerna (the tool I was using to manage this mono repo), but releases were extremely error prone, and involved a lot of nail-bitingly tense work to review the commits and decide what version each package should be released as.

The issue here is the loss of context. I wanted to be able to create and manage the…

--

--

Forbes Lindesay
RollingVersions

JavaScript enthusiast and maintainer of many open source projects.