Announcing PowerBoot: Server-side Rendering With Headless Chromium

I wanted a complete server-side rendering solution for Ember.js, so I married FastBoot with the Chromium browser.

Anyone familiar with FastBoot probably knows the limitations in using it. FastBoot simulates the DOM by using a library called SimpleDOM which provides a minimal DOM API necessary to allow Ember.js apps to run on the backend in Node.js.

For very simple apps, FastBoot should work great and is indeed fast like the name suggests.

Unfortunately, we can't always avoid using DOM and browser APIs directly in our apps. Sometimes we have no choice, such as in the case of importing 3rd party packages and web components. In these cases, Ember apps that use FastBoot need guards to prevent exceptions from being thrown on the backend. This results in a lot of if (!this.fastboot.isFastboot) { ... } sprinkled throughout an app. It means a extra thought when making an app support FastBoot, especially with older apps.

I hate thinking too much, which is why I've decided to build and release PowerBoot, a hard-fork of FastBoot that uses headless Chromium and is compatible with FastBoot tooling such as ember-cli-fastboot, FastBoot App Server, and Prember.

Because it uses Chromium, Ember apps can be exposed to a full set of browser APIs on the backend. This means that nearly any Ember app should just work with PowerBoot out of the box.

Unlike FastBoot, PowerBoot supports the component lifecycle hooks didInsertElement and willInsertElement. On top of that, it supports Web Components, meaning any custom elements that manipulate the DOM will do so on the backend as expected.

In fact, this blog is prerendered using PowerBoot! I was motivated to create PowerBoot because I wanted to do some fancy things with the DOM and custom elements but didn't want to constantly have to think about supporting FastBoot in doing so.

Is it production-ready? I dunno, you tell me. I welcome anyone interested to check out the code, give it a try, and contribute where improvements and security fixes can be made.