PocketPages is now built into PocketOne
PocketPages v1 ships inside PocketOne. No npm install, no boot file, JSX and TypeScript pages, and 11 to 17 times the requests per second.
PocketPages used to be an npm package you installed next to PocketBase and booted from a hook file. As of today it's
part of PocketOne, a community fork of PocketBase that
PocketHost maintains. Put a pb_pages folder next to pb_data and it's served.
brew install pocketonehq/tap/pocketone
pocketone pages create myapp --starter daisyui-docs
cd myapp
pocketone serve --dir ./pb_data
What's new in v1
- Nothing to install. No
node_modules, nopocketpages.pb.js, no plugin packages. Routing, static files and templates run in Go; your page code runs in PocketBase's JS VM, as before. - JSX and TSX pages. Write
.tsxpages, layouts and components next to your.ejsones. esbuild is built in, so there's still no build step.+page.tsand the rest of your page code can be TypeScript too. - A cleaner
ctxAPI. Onectxobject for requests, responses, data, sessions and helpers.ctx.pb()gives you the PocketBase JS SDK in-process, as the visitor, so API rules apply. - Auth built in. Password, OTP, OAuth2, anonymous sign-in and the email flows, with cookie sessions.
- Faster. On the same starter kit pages, v1 serves about 17 times the requests per second of the npm package on a simple page and 11 times on a docs page, and a single request takes 0.2 to 0.4 ms instead of 6 ms.
This site runs on v1 now, on a PocketHost edge in Los Angeles.
Coming from 0.x
v1 keeps the ideas (a folder of files that become routes, EJS, layouts, partials, middleware) and changes the API. Moving from PocketPages 0.x lists every difference.
The npm package is retiring: v1 is where new work happens. Apps on 0.x keep running where they run today.