Introducing Photon
Today, we are thrilled to introduce Photon — a next-generation infrastructure for deploying any JavaScript server (Hono, Express.js, Fastify, ...) anywhere (self-hosting, Cloudflare, Vercel, Netlify, ...).
We've also released vike-photon which replaces vike-server.
If you use
vike-server, we recommend migrating tovike-photon.
Photon is a step towards the future of JavaScript server integration and deployment. See Why Photon?
As a user, the most notable improvement over vike-server is the Cloudflare integration.
Features
Photon is jam-packed with features:
- Any server: Hono, Express.js, Fastify, Elysia, H3, Srvx, Hattip.
- Any deployment: Cloudflare, Vercel, self-hosted, and more.
- HMR: No more full server reload required.
- Vite Environment API: Develop against production runtimes (e.g. Cloudflare's
workerd). - Code-splitting: Per-route deployment to separate edge workers.
- Zero-config: Integrate your server and deployment with minimal configuration.
- Built-in server: Photon comes with a built-in server for zero-config use (users can use their own instead).
Learn more at
photonjs.dev> Why Photon > Features.
Cloudflare
When using @photonjs/cloudflare, the development environment runs inside Cloudflare's workerd runtime (instead of Node.js). It's the same runtime Cloudflare uses in production, making the development environment a much more faithful representation of production.
Vike is among the first frameworks to support this.
It's powered by Vite's Environment API, which enables Vite to run in a Node.js process while running the user's server code in another (non-Node.js) process such as
workerd.
It also allows you to directly use Cloudflare's APIs in development. (This was already possible with getPlatformProxy() but it was clunky to set up.)
// This works in production, as well as in development!
import { env } from 'cloudflare:workers'
// Key-value store
env.KV.get('my-key')
// Environment Variable
env.LOG_LEVEL
// ...Learn more at Deploy > Cloudflare > Cloudflare APIs.
With Miniflare, discrepancies between development and production led to poor DX, code duplication, and complicated architecture — integrating applications with Cloudflare was notoriously hard. These issues are now solved.
Why Photon?
Vite has become the de-facto standard infrastructure shared across many frameworks, and we believe the same will happen for JavaScript server deployment — in one form or another.
Photon aims to be open and collaborative, which is paramount for the community as a whole to move in the right direction (see also photonjs.dev > Why Photon > Philosophy).
While developing
vike-serverwe realized most code is agnostic to Vike. So we decided to make Vike's deployment infrastructure fully agnostic.That's what Photon is: it's everything we learned while developing
vike-server,vike-cloudflare, andvite-plugin-vercelbundled in one cohesive and agnostic tool with improved DX and new features.
Other than Photon, there are two projects working towards a unified infrastructure:
We are eager to collaborate with Nitro as well as with Netlify's RFC — the more we collaborate the better!
These collaboration efforts will take time to come to fruition. In the meantime, Photon is our answer to the shared deployment infrastructure problem and provides a concrete solution for our users.
The future
We don't know how shared deployment infrastructures will evolve. In our opinion, the best outcome is that we move some — ideally most — of Photon's logic to Vite and its ecosystem (see Netlify's RFC).

