Simple, beautiful publishing.

Moving to Node.js

The first version of Postleaf was written in PHP and lives on as Leafpub. It's a beautiful piece of software that I'm very proud of, but I decided to move the project to Node.js for a few important reasons. This is by no means a knock on PHP, which will always have a special place in my heart, but more of a changing with the times realization.

If you've ever worked with Node.js before, you'll know that it's fast. Very fast. While PHP did get a nice performance boost in version 7, it still remains bloated with a huge number of core functions and extensions that seem to weight it down.

Solving the Search Problem

I recently wrote about using an ORM and how it allowed me to support five different database platforms with minimal effort. There is, however, one feature that even Sequelize couldn't tackle for me: full-text search.

A full-text search is typically a database feature that lets you locate content just like you would in a search engine. Ideally, the results are ranked by some sort of relevancy score.

Using an ORM

I've never really bothered with ORMs before, as feelings for them tend to be mixed. I've heard that you can spend twice as long learning an ORM as you can coding raw SQL. 🤷🏻‍♂️

I figured it was time to see for myself. For the Postleaf rebuild, I decided to try out Sequelize. I discovered it some time ago and really liked what I saw, but never had a chance to use it. I'm glad I finally did.

From Handlebars to Dust.js

The first version of Postleaf used templates powered by a PHP variation of Handlebars. I chose Handlebars because the syntax is very simple to learn and understand.

There is, however, one fundamental feature of Handlebars that users tend to find confusing: helpers can have both parameters and arguments.

Getting it Right

To my awesome users:

I've been taking some time to reimagine what Postleaf should have been. Yes, the betas were pretty awesome, but they weren't what I wanted them to be in terms of design, code, and function. I can do better, and you deserve nothing less than my very best.