# Fluixi > Fluixi is a TypeScript framework for the web: fine-grained signals, JSX components that run once, and @fluixi/start for file routes, server rendering, server functions and static output. Fluixi is experimental: APIs change between alpha releases. Code remembered from an older alpha may no longer compile; check it against these rules and the installed version, and pin exact versions. The guide, page by page: https://docs.fluixi.com/llms.txt. Every page is also Markdown at its address plus `.md`, and the whole guide is at https://docs.fluixi.com/llms-full.txt. For the component library (buttons, forms, layout, skins), read https://ui.fluixi.com/llms.txt as well: an app using it follows its rules too. For forms (`@fluixi/forms`: fields, validation, schemas, submitting), read https://unpkg.com/@fluixi/forms@alpha/llms.txt, which ships in the package. ## Rules for writing Fluixi code Fluixi looks like React and works like Solid. Code written from React habits compiles and then fails to update. Read these before writing a component. ### Components run once - A component function runs one time. There is no re-render. Reactivity updates only the text, attribute or branch that reads a value. - No early `return` on a condition: it is decided once. Use ``. - No `cond() && ` for anything with state: it rebuilds `X`. Use ``. - No `.map()` for a list that changes. Use ``, with `by={(x) => x.id}` when the objects are recreated (refetched data). With `by`, the item is an accessor: `item().name`. Without `by`, the item is the value and the index an accessor: `i()`. - `` for primitives or fixed slots: item is an accessor, index a number. - Never call a component as a function. Write ``. - `class`, not `className`. ### State - In an app built by `@fluixi/start`, use the intrinsics with no import: `$signal`, `$memo`, `$effect`, `$store`, `$resource`, `$untrack`, `$batch`. In a package or library, import `signal`, `memo`, `effect`, `resource` from `@fluixi/reactive/signal`. - A signal is one handle: read `count()`, write `count.set(1)` or `count.set((n) => n + 1)`. There is no `.get()`. No `useState`, no tuple in new code. - Derive with `$memo(() => ...)`. No dependency arrays anywhere: reads are tracked. - Never write a signal from an effect to derive a value. Never create a signal or effect inside an effect or memo. - Set a new array or object; changing one in place and setting it again does not notify. - `$store({...})` for nested state: read `cart.lines`, write `cart.set('lines', 0, 'qty', 2)`. Assigning a store property does nothing. Stores wrap plain objects and arrays only. ### Effects and lifecycle - `$effect` runs on the server too. Browser APIs (`document`, `window`, `localStorage`) go in `onMount`, which runs only in the browser. - `onMount` does not track: a signal read inside it subscribes nothing. - Every listener, timer and subscription gets `onCleanup(() => ...)` next to it. - Refs: `let el!: HTMLInputElement;` then ``. Use the element in `onMount`. ### Props - Props are getters. Read `props.name` where it is used. `function C({ name })` is rewritten by the compiler to `props.name`; a destructure inside a nested block is not, and reads once. - Defaults: `mergeProps({ size: 'md' }, props)`. Forwarding: `splitProps`. - Read `props.children` once, or resolve it with `readChildren(() => props.children)`. ### Data and routing (apps built by `@fluixi/start`) - Routes are files in `src/routes`. Page data: `export const routeData = ...` returning a promise, read with `useRouteData()`. Not a resource and not `fetch` in `onMount`. - Shared cached reads: `cache(fn, 'name')`, invalidated with `revalidate('name')`. - Writes: `'use server'` functions and `action(fn, 'name')`. Every action has a name. - Navigation: `` and `useNavigate()` from `@fluixi/start/router`, not `` or `window.location` for in-app routes. - A resource read while loading suspends the nearest ``; failures go to the nearest ` ...}>`. `resource.latest` never suspends. - Server-only code lives in `*.server.ts` files, API routes, middleware and `'use server'` functions. Browser code may read only variables listed in `env.public`. ### Server render and hydration - The server and the browser must render the same markup. No `Date.now()`, `Math.random()` or browser checks during render: take the value from data, set it in `onMount`, or wrap the part in `` (imported from `@fluixi/core`). - Create resources unconditionally, in the same order on both sides. ## Getting started - [Introduction](https://docs.fluixi.com/v1/en/introduction.md): Fluixi is a **compiler-native reactive framework**. Its compiler understands reactive values as values, not as a naming convention, and carries that understanding through JSX and `` html`` `` templates, DOM generation, SSR, hydration, routing and the meta-framework as one model. - [Quick start](https://docs.fluixi.com/v1/en/quickstart.md): The fastest way to a running app is the `create-fluixi` scaffolder: - [Coming from React, Solid or Next.js](https://docs.fluixi.com/v1/en/coming-from.md): What carries over, what changes, and the habits to drop. Each section maps what you know to its Fluixi equivalent and links to the page that explains it. - [CDN & bundles](https://docs.fluixi.com/v1/en/cdn.md): Every Fluixi runtime package ships a self-contained **IIFE global build** you can drop into a page with a single `