Write TypeScript as usual.
You write in a scratch file: ordinary TypeScript, checked by your editor. This one holds a shop's cart: a tax rate, some functions, a React component and tests. Its first line names their namespace.
A line on its own is a watch expression: tcm check shows its value, like a REPL in your file.
Add it to the codebase.
Each function, type and constant becomes a definition of its own. The file was only a place to write them; once they're added, you can empty it.
Each definition is stored by its hash.
The hash of a definition's code is its identity, and a name is just a label pointing at it. Formatting and local names aren't hashed, so restyling is never a change.
Renaming is free.
A rename moves a label. No code is edited and nothing breaks: every use refers to the hash, so it just shows the new name.
It knows what uses what.
Definitions refer to each other by hash, not by file, so the codebase has the whole graph.
With no imports to order, there are no circular imports. And an app bundles only what it reaches, so there's no dead code.
Changes carry through.
Change the tax rate and it gets a new hash. cartTotal refers to that hash, so it changes too, and so on up. tcm update re-hashes exactly what depends on the change.
What still typechecks follows along. What doesn't goes on a todo list and keeps its old version, so nothing is half-updated.
Only what changed is tested.
Test and lint results are cached by hash. One test reaches the change, so one test runs. Results travel with tcm push, so CI and your teammates skip it too.
Server and browser, inferred.
tcm works out where each definition runs from what it uses. getCart reads a table, so it runs on the server; CartView renders, so it runs in the browser.
The browser calls the server by importing it. No routes, no fetch, no encoders or decoders, no "use server".
Deploy by moving a name.
Builds are named by hash and kept. Deploying points production at the new one; rolling back points it back, instantly.
Open tabs keep calling the code they loaded, and returning visitors download only the chunk that changed, as a diff.
Deploying →