A browser already does most of what a modern front-end framework rebuilds:
- it follows links and submits forms;
- it keeps history, restores scroll position and caches pages for the back button;
- it shows a page as soon as its HTML arrives. Client-side routers rebuild all of that in JavaScript, and then spend more code fixing the parts they got wrong (scroll, focus, history, loading states). TradJS takes the other path:
- Every page is HTML from the server. A link is a real link and a form is a real form post. A page that needs no interaction ships no JavaScript.
- Interaction is local. A page that needs a counter, a live list or a drag-and-drop area gets a
page.client.tsxfile next to it. That script mounts into one element. - Navigation is smooth anyway. Cross-document view transitions, a CSS feature in current browsers, animate ordinary page loads, so leaving and arriving feel instant without a client router.
- The back button is the browser's. Pages come back from the back/forward cache. A page script that returns a cleanup function is stopped when the page is hidden and started again when it returns. The same reasoning applies to data. Most apps that run on one machine do not need a database server. SQLite is a file, it is fast, and it runs inside your process. What it lacks is a typed, validated interface, and sqlite-zod-orm adds exactly that. The Zod schema that validates a form also defines the table. And to logging: instead of a logging library plus a tracing SDK plus a dashboard, measure-fn prints one line per measured step, nested under its parent, with its duration. Next: chapters 3 to 5 show each library.