Text.js: Build full-stack React apps that render inside console.log
Text.js allows developers to construct full-stack React applications that can render inside a console.log environment. To access the preview, open the page with ⌘⌥JCtrl+Shift+J or Ctrl+Shift+K, then enable developer features and click the preview below. Users can utilize shortcuts such as ↑ ↓ to navigate.
Key features include concurrent rendering, Suspense, and error boundaries. Folders within the app/ directory automatically become routes and layouts. Back, Forward, and deep linking functionality is also supported. The grid accommodates docking to the DevTools panel at any zoom level.
Text.js handles input through a concealed textarea, capturing keys, paste actions, and IME composition. Commits that do not alter any cells do not reach the console, while clearing the console before each frame ensures a clean slate until DevTools renders the subsequent frame. Turbolog appends frames to the console instead.
To render a route and its asynchronous components on the server, set export runtime = server. The browser will load a 21 kB (gzip) frame player in place of the actual app. Turbolog writes each frame as %c spans within a single console.log, enabling text rendering in truecolor ANSI and running route handlers in-process.
Agents can navigate routes, press keys, and read each frame as plain text via MCP. OpenCode Lite, built with Text.js, runs in the browser console and allows scripted agents to answer prompts without installation. Run bunx @textjs/opencode@latest proxy to enter the code displayed by the page. Connect to OpenCode on your machine and engage with models configured on your server.
The interface includes a panel displaying the component tree, a frame inspector, and a per-frame timeline. Preview the frame alongside your code and scaffold App Router files automatically. Test frame assertions using offscreen rendering, key presses, and the lastFrame() method in any test runner. Errors and warnings come with TX code links directing to a page explaining the solution.
Pause, resize, wireframe, and copy the running app directly from the console prompt. The implementation supports the Unicode Bidirectional Algorithm and passes 770,241 BidiTest.txt cases. It also parses .flf files and matches 273 outputs recorded from the figlet binary. A free course with 10 chapters takes approximately 65 minutes to complete.
Rewritten by urgent.news; may contain errors — check the original.