one-loaders
Loaders
Official docs: Loaders
Loaders are server-side data fetching functions that run before rendering. They are tree-shaken from the client bundle — database queries, API keys, and server logic never reach the browser.
When to Use
- Fetching data for a page (database, external API, filesystem)
- Server-side authentication checks and redirects
- Setting response headers (caching, cookies)
- File-driven content (MDX, JSON) with hot reload
When NOT to Use
- Client-side interactions (button clicks, form submissions) — use API routes
- Real-time data — use client-side fetching or websockets after initial load
Basic Usage
More from onejs/skills
one-deployment
Deploy One framework apps to Node servers, Vercel, Cloudflare Workers, or as static sites. Covers build, serve, cluster mode, security scanning, and platform-specific configuration.
1one-guides
Guides and recipes for One framework. Covers authentication, images, CSS optimization, dark mode, Tamagui, MDX, OpenGraph images, ISR, skew protection, native iOS builds, EAS, CRA migration, and common issues.
1one-render-modes
Configure render modes (SSG, SSR, SPA, API) in One framework. Use when choosing how pages are rendered, setting up static generation, or mixing render strategies.
1one-api-routes
Create API routes in One framework. Use when building HTTP endpoints, webhooks, REST APIs, or server-side logic with +api.ts files.
1building-with-one
Complete guide for building full-stack React apps with One framework. Covers routing, layouts, navigation, components, hooks, typed routes, styling, configuration, devtools, and cross-platform (web + native) development.
1