|
| 1 | +export const metadata = { |
| 2 | + title: "Core-Concepts", |
| 3 | + alternates: { |
| 4 | + canonical: '/docs/core-concepts/no-dependencies', |
| 5 | + } |
| 6 | + |
| 7 | +} |
| 8 | + |
| 9 | +# No Dependencies |
| 10 | + |
| 11 | +Devup UI converts pure React source code without additional UI runtime code. |
| 12 | + |
| 13 | +This section explains what “No Dependencies” means in practice, why it matters, and how Devup UI achieves it without requiring client-side style engines, extra plugins, or manual pre-generation steps. |
| 14 | + |
| 15 | +## Motivation |
| 16 | + |
| 17 | +- Many CSS-in-JS libraries rely on JavaScript at runtime to compute styles, inject `<style>` tags, or resolve variables. |
| 18 | +- When dynamic values (e.g., variables, expressions) are used, these solutions often fall back to runtime dependencies—a partial solution that reintroduces costs. |
| 19 | +- In frameworks like Next.js, such runtime-style systems frequently cannot be used inside RSC (React Server Components). |
| 20 | + |
| 21 | +We asked: Can we deliver truly zero-runtime CSS that also works in RSC—without extra UI runtime code? |
| 22 | + |
| 23 | +Our approach is grounded in static analysis. Once code is built and shipped, it should contain the definitive answer—no further computation required on the client. |
| 24 | + |
| 25 | +## What “No Dependencies” Means |
| 26 | + |
| 27 | +- No UI runtime code is added to your bundle for styling. |
| 28 | +- No extra plugins, pre-generation scripts, or PostCSS configs are required. |
| 29 | +- Pure React remains your source of truth; styles are compiled at build time into static CSS. |
| 30 | +- Works in RSC and the edge/runtime contexts where client-side style engines are unavailable or undesired. |
| 31 | + |
| 32 | +## How It Works? |
| 33 | + |
| 34 | +1. Parse your React source into an AST using Rust-based tooling. |
| 35 | +2. Perform static analysis to extract all style semantics from components and props. |
| 36 | +3. Resolve and de-duplicate styles, generating compact, atomic class names. |
| 37 | +4. Emit a new AST with class names applied and a CSS virtual file populated with the minimal rule set. |
| 38 | +5. Bundle emits static CSS and class-applied markup—no client-side style engine. |
| 39 | + |
| 40 | +## Compatibility |
| 41 | + |
| 42 | +- Next.js (including RSC): Safe to use without runtime style engines. |
| 43 | +- Vite, Rsbuild, Webpack: Supported via official plugins. |
| 44 | +- Works with server-first and edge contexts that restrict DOM/JS-based style injection. |
| 45 | + |
| 46 | +## Class Naming Policy |
| 47 | + |
| 48 | +- Class names never start with a digit (to satisfy CSS constraints). |
| 49 | +- We minimize class name length while maintaining safety. |
| 50 | + For example, tokens like `ad` may be flagged by content blockers; we emit `a-d` instead to break filter matches. |
| 51 | +- To avoid common ad-blocker heuristics, we segment suspicious tokens by inserting a hyphen(`-`). |
| 52 | +- Example mappings: |
| 53 | + - `ad` → `a-d` |
| 54 | +- Scope: applied to Devup UI–generated atomic class tokens only; user-supplied `className` strings are not rewritten. |
| 55 | +- Allowed characters include `a`–`z`, combinations like `az`, `a0`, and safe hyphen/underscore placements. |
| 56 | + |
| 57 | +## Advantages if Using |
| 58 | + |
| 59 | +Devup UI brings the convenience of CSS-in-JS together with the performance of static CSS—delivering the best of both worlds with no extra UI runtime dependencies. |
| 60 | + |
| 61 | +1. **Zero runtime**: All styles are compiled to static CSS at build time. |
| 62 | +2. **De-duplication**: Identical styles are generated once and reused globally. |
| 63 | +3. **Performance**: Rust-powered pipeline provides fast, scalable builds. |
| 64 | +4. **Smaller bundles**: No redundant classes, no UI runtime styling code. |
0 commit comments