Concepts (2)
The contract
server/contract.ts is the one place where the server's side of each view is declared:
- state: a tree of paths with typed leaves (text(), money(), collection(…)…);
- events: every event the view can send, each with its authorization policy;
- messages: the templates the server sends as compiled references, with {0}…{9}.
The compiler checks every bind and every event of your views against it, and generates the handler types from it. Only the message templates are public text; paths and event handlers stay on the server.