CHART/DOCS/FAQ

FAQ

The tradeoffs, in writing, so the tradeoffs stay deliberate.

Why is everything so strict?

Every restriction in the spec maps to a class of real bugs - missing keys, falsy rendering, stale closures, hidden execution order. When a pattern is banned, the bug class is banned with it. The cost is flexibility; the payoff is that build errors are the only errors.

Is every valid marisjs file valid TypeScript?

Yes. marisjs is a subset of real TSX, parsed by a standard parser. The compiler adds a validation pass on top - it never changes what the parser accepts as syntax, only what the framework considers legal.

How do I share a theme or locale?

Create a signal at the nearest common parent and pass it down through props. This is more typing than context - deliberately so. Data flow stays visible in every file.

What about CSS?

Client components import .css files with a bare side-effect import. The compiler walks each page's component tree, collects every imported stylesheet, copies it to dist/, and injects the tags automatically. For a site-wide stylesheet, import it from a shared client component that every page renders - a Layout. This site's stylesheet is wired exactly that way. Styles are globally scoped - prefix class names with your component name to avoid collisions, and the build will warn you anyway (CSS_CLASS_COLLISION) when two stylesheets on the same page define the same class.

Where do secrets live?

Server-side only. env() reads .env at build time and bakes a snapshot into the private dist/_server/ tree; session() reads an HMAC-signed cookie. Both are hard validation errors in @runsOn client files, so secrets cannot reach a client bundle by construction.

How do I protect routes?

One middleware.ts at the project root gates every matching request - pages, API routes, and static files. Return next(), redirect(), or respond(); the matcher is a small, exact path language (/admin/* and friends).

Is marisjs production ready?

marisjs is v0.1. It is a careful, working implementation of a deliberately small language - best suited for small apps, prototypes, and learning how frameworks actually work. The spec is the contract; the compiler is the enforcement.