Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.

NextJS on FABs

This is a proof of concept getting Frontend Application Bundles (FABs, see more at

FABs are designed to compile any frontend project and deploy them anywhere that can run JS:

FAB diagram

It lives!

Cloudflare Workers

Cloudflare workers console screenshot

Amazon Lambda@Edge


Docker on AWS EC2

Some background

NextJS is a tricky target for FABs, as it, like a lot of NodeJS server-side JS projects, assumes a fair bit about the environment it runs on. Since version 8, Next has offered two build targets: NodeJS & Serverless. The serverless build has stripped out a lot of the old assumptions and generates a single file per "route" for NextJS. Each of these files shares a lot with each other, and @fab/nextjs isn't very smart about things at the moment, but it's possible to create a FAB with all of these files inlined and generate a router from the filesystem.

Definitely a proof-of-concept at this stage, but look, it works, and for a while I didn't think it would be able to, so I'm calling that a win!

Some caveats

The Cloudflare Workers and Amazon Lambda@Edge deployers aren't fully open-sourced yet. They're in the process of being extracted from the Linc codebase.

An aside, FAB development is sponsored by (and makes possible) the Linc product, so if you like the idea of FABs, come and sign up! You can see this repo's recent builds on Linc here.

The and Heroku deployments haven't been generalised—they're hard-coded into this repo's npm scripts. But they both use the generated by npm run build:fab, rather than doing anything with the sourcecode.

You can’t perform that action at this time.