
PocketJS is a portable application runtime that turns modern component code into native pixels acros
PocketJS is a portable application runtime that turns modern component code into native pixels acros
PocketJS is a portable application runtime that turns modern component code into native pixels across radically different hardware. Solid, Vue Vapor and Octane components compile to one native tree, and a QuickJS guest drives a Rust core that performs flexbox layout and draws every pixel in one thread inside one process. There is no DOM, no CSS engine and no WebView.
Three frameworks compile to the same native tree and run on the same QuickJS guest. The choice changes application code and nothing below it.
| Framework | State and lifecycle | Source forms |
|---|---|---|
| Solid | solid-js |
JSX |
| Vue Vapor | vue |
JSX and <script setup> single-file components |
| Octane | octane |
Compiled hooks and JSX, with no virtual DOM |
Framework primitives are imported directly from solid-js, vue, or octane.
PocketJS owns the runtime, host components, lifecycle wiring, input, animation,
assets, and the native boundary.
…Class literals are compiled into a baked style table at build time. The runtime resolves a class attribute by lookup, so there is no CSS parser, cascade, specificity resolution, or reflow on the device. The accepted vocabulary is a fixed Tailwind subset, enumerated in Styling.
Keyframe timelines and spring curves are baked into the same style table and advanced by the Rust core on its own clock, so a screen can animate with no per-frame JavaScript. Motion Lab runs the yui540 studies in WebAssembly on pocketjs.dev and on the handheld they were written for.
| Baked keyframe timelines · (yui540) | 3D motion pipeline · (yui540) |
|---|---|
One bundle serves machines of different densities. An application declares its
viewport and required APIs in pocket.json, and a target profile must satisfy
that declaration before compilation and packaging proceed. Run from the
application directory:
pocket check --target psp # ok 480x272 · text.glyphs.baked · input.buttons
pocket check --target vita # ok same bundle, density 2, no component editedThe guest emits tree mutations; the core owns layout, the style table, and the draw list; a per-target backend submits that draw list through GE, GXM, Metal, wgpu, software rasterization, e-ink updates, or another declared host.
…PocketJS makes time the frame counter. One frame(buttons) call is a
transaction that nothing outside it can interrupt, and nothing waits on a wall
clock, so tests run as fast as the CPU allows without changing the timing they
measure: a journey that takes six seconds in front of a user is a few dozen
frames in CI.
state n+1 = F(state n, input n)
pixels n = G(state n)after() replaces
setTimeout with a deadline measured in frames.requestAnimationFrame against a wall clock, one awaited confirmation lands
on 22 different frames across 60 runs, and its timing assertion passes
9 times out of 60. On the frame clock it lands on frame 144 in every
run, 60 out of 60.See also: The runtime that can't flake · Time-travel DevTools · Determinism
With no browser engine in the pipeline, the cost of a screen stays close to what the hardware can do. A complete application drawing an animated interface occupies 8 MB on a single 333 MHz core: a quarter of the PSP's 32 MB, one part in 1536 of a 12 GB iPhone 17 Pro Max, on a core clocked 13 times slower than an A19 Pro performance core at 4.26 GHz.
One MIPS core at 333 MHz, 32 MB of RAM, measured against the 16.67 ms budget for 60 fps:
| Measurement | Result |
|---|---|
| OpenStrike frame budget | 2.2 ms of JavaScript, 8.4 ms of total CPU work, worst observed frame 9.7 ms |
| Hero demo, cost of a virtual DOM | Solid 15.15 ms · Vue Vapor 16.74 ms · Vue with a virtual DOM 90.75 ms |
| Hero demo, the three shipped frameworks | Solid 3.66 ms · Vue Vapor 3.61 ms · Octane 6.53 ms |
Seven samples per application. The two hero-demo rows come from separate runs with different toolchain versions, so each row is comparable internally but not against the other.
Historical August 2026 results for the previous gpui host: the same markdown
editor shelled three ways on an Apple M3 Max
(full report, reproduced by
bun tools/bench-desktop.ts):
| Tauri v2 | Electron | ||
|---|---|---|---|
| Processes | 1 | 4 | 5 |
| Cold start to first painted frame | 149 ms | 380 ms | 301 ms |
| Idle resident memory | 83 MB | 193 MB | 382 MB |
| On disk | 10 MB | 9 MB | 242 MB |
In that benchmark, with a document open and no input, the pocket build redraws about twice a second: the caret blinking, and nothing else. The report also records where the pocket build loses. Its storm CPU rises with document length, because the editor re-wraps the whole document through the QuickJS interpreter on every keystroke.
See also: Shipping OpenStrike · Pocket Character · Twice the pixels, zero forks · The first iPhone
The runtime has a game engine's architecture, so a game and an application are built the same way. Cores are independent native modules, loaded the way a kernel loads drivers: an application takes the ones its content needs, and the rest never enters the build. Mounting a module widens what the program may ask for; it does not change how the program is written.
guest program · JavaScript, one frame at a time
ui tree, layout, draw, input, focus
net poll batches
audio pcm mixer
strike bsp, bots, hits
voxel chunks, meshingSee also: Architecture · The runtime family · Pocket3D
PocketJS has booted on every operating system below, on the real machine. What changes between them is one native submission layer, never the application, and each row links to the post or pull request that brought it up. Keeping the hardware bootable is its own work, tracked in Pocket Museum.
| Operating system | Native submission layer | Receipt |
|---|---|---|
| PSP system software | MIPS, 32 MB | Introducing PocketJS |
| PS Vita system software | ARM, GXM | Twice the pixels, zero forks |
| iPhone OS 3.1.3 | ARMv6, GL ES 1.1 | The first iPhone |
| iOS 6.1.3 | ARMv7 | hosts/iphone4s |
| iOS 12.5.8 | arm64 | #278 |
| iOS, current | NativeScript host | #256 |
| macOS | Metal window and widget | #293 |
| Symbian Belle | Qt, GLES2 | Symbian wanted a frame function |
| Windows CE 6 | GDI framebuffer | From message pump to multitouch |
| BlackBerry 10.3 | QNX, native ELF | One square screen, two native stacks |
| Android 4.3 | BlackBerry runtime, JNI | #298 |
| PocketBook e-ink | inkview, partial refresh | #172 |
| ESP-IDF 6.0/6.1 | P4 PPA or S3 software RGB565 | ESP-IDF components |
| The browser | WebAssembly core | Playground |
Devices verified so far: Sony PSP (2004), PS Vita (2011), iPhone (2007), iPhone 4S (2011), iPod touch 6 (2015), Nokia E7 (2011), Meizu M8 (2009), BlackBerry Classic (2014), PocketBook reader (e-ink), ESP32-P4 devkit (microcontroller), and Mac (Apple silicon).
The authoritative host and target inventory is
contracts/spec/platforms.ts; each entry
records what has been verified and how. See
Platform contracts and the
Native contract.
PocketJS carries complete applications on the hardware listed above. Each row links to how it was built.
| Project | Scope |
|---|---|
| OpenStrike | A Counter-Strike-shaped shooter on 2004 hardware: BSP maps, bots, and a HUD written in Solid JSX, at 60 fps with 2.2 ms of JavaScript per frame |
| Pocket Voxel | A creature-RPG town rebuilt as a walking voxel diorama. Game state lives in the JS guest; logic runs at 60 Hz while presentation holds a locked 30 fps beat |
| Pocket Figma | A 14,430-node design file, cooked into streamed tile pyramids and panned with the analog nub at 60 fps on a handheld with 32 MB of RAM |
| Pocket Character | A rigged VRM companion in a transparent always-on-top window, rendering skinned 3D at 60 fps in one process and 118 MB, against 8 processes and 2184 MB for an Electron build of the same idea |
| Pocket YouTube | Search, thumbnails, playback and seeking on a console that predates streaming, where the network is a USB cable and a Mac companion performs the fetching |
| Pocket DevTools | Time-travel debugging over a USB cable at 2 bytes per frame. The inspector highlight is emitted by the core into the draw list, so it renders on the device, on every backend |
| Pocket Launcher | Whole-application lifecycle, target admission, frozen shots, and guest switching on PSP and Vita |
No open issues yet, or sync has not completed.