$ show onejs/one
The One framework (onejs/one) is a production-grade, cross-platform React framework that unifies web and native (iOS/Android) development under a single file-system router. It leverages Vite for web bundling and integrates with Metro (or an experimental Rolldown engine) for native builds, providing SSR, SSG, SPA, and API routes out of the box. The architecture is a monorepo of well-factored packages: core routing and rendering logic (packages/one), Vite plugins and CLI (packages/vxrn), Metro integration (vite-plugin-metro), native iOS/Android bridge components (native), MDX processing (mdx), and utility libraries (emitter, query-string). Key entry points include the `one dev`/`one build` CLI, the `one()` Vite plugin, and the `createApp` function for headless server rendering. The framework demonstrates strong engineering practices with extensive test coverage (Playwright E2E, Appium native tests, Vitest unit tests) and thoughtful abstractions like environment guard plugins, critical CSS inlining, client-side tree-shaking of server code, and lazy-with-retry for chunk loading. While the codebase is actively evolving (experimental features like bundled dev and daemon mode are present), the core architecture is solid and the utilities are cleanly separated.
The LLM identified 5 files worth highlighting for reuse:
A tiny, type-safe event emitter with React hooks (`use`, `useValue`). Isolated from the rest of the framework; could be published as a standalone npm package. Demonstrates solid TypeScript generics and clean hook design.
A utility to attach static properties (e.g., `Tabs.Screen`) to a React component while preserving existing ones. Self-contained, uses only standard React patterns. Easily extractable for any component library.
A concurrency limiter that runs async functions with a maximum concurrency, queueing excess tasks. Clean implementation with no external dependencies. Reusable in any Node.js or browser project.
Implements mouse trajectory prediction to prefetch links before the user clicks. Self-contained, uses only DOM events and a simple algorithm. Could be extracted as a standalone prefetch library.
Applies content patches to files in node_modules with deduplication, version constraints, and stale-patch detection. Reusable pattern for any project that needs to hotfix third-party dependencies without forking them.