gridEdit5x5
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This folder contains code and types that are needed on both the frontend and the backend. It's important that you write this code in a particularly defensive way because it's limited by what both environments support:
For example, you cannot use the Deno keyword. For imports, you can't use npm: specifiers, so we recommend https://esm.sh because it works on the server & client. You can use TypeScript because that is transpiled in /backend/index.ts for the frontend. Most code that works on the frontend tends to work in Deno, because Deno is designed to support "web-standards", but there are definitely edge cases to look out for.
This folder contains:
Gridinterface: TypeScript type for grid objectsGRID_SIZEandTOTAL_CELLSconstantsgridToText(): Converts grid state to textual representationcreateEmptyGrid(): Creates a new empty (all white) grid
These utilities are used by both the frontend React components and the backend API handlers.