Text.js: Build full-stack React apps that render inside console.log
Hacker News 热议:Text.js: Build full-stack React apps that render inside console.log(70 赞 / 40 评论,来源 textjs.org)
一句话概要
Text.js is the React framework for apps that render inside the DevTools console.
原文开头节选
This page is running in your console. Open it with ⌘⌥J Ctrl+Shift+J ⌘⌥K Ctrl+Shift+K ⌘⌥C ( turn on developer features first) , click the preview below and press ↑ ↓ .
1 import { useState } from “react” ; 2 import { AsciiFont , Box , Text , useInput } from “@textjs/app” ; 3 4 export default function Page ( ) { 5 const [ count , setCount ] = useState ( 0 ) ; 6 useInput ( ( e ) => { 7 if ( e . key === “up” ) setCount ( ( c ) => c + 1 ) ; 8 if ( e . key === “down” ) setCount ( ( c ) => c - 1 ) ; 9 } ) ; 10 11 return ( 12 < Box className = “flex-col gap-1 p-2” > 13 < AsciiFont text = ”▼ TEXT.JS” /> 14 < Text color = “muted” > React 19 in console .
Folders in app/ become routes and layouts, and Back, Forward and deep links work.
Elements Console Sources Network Performance Memory Application top ▾ -url:preview://table Default levels ▾ No Issues preview://table:1 ⌨ Click to focus › ↑ ↓ move · s sort · Space select Run in console Docs Layout
Charts …
(以上为原文节选,完整内容见下方”原文来源”)
这条动态今日登上 Hacker News 首页(70 赞 / 40 评论,来源 textjs.org)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。
原文来源: Hacker News