The idea is for page configs to include tasks for resolving flags, extract the instructions for how to do those tasks, then do those tasks on the server and include the data as a variable in the served html file.
- Page config includes a ResolverTask - the task to be resolved
- Elm codegen creates an elm worker which outputs a stringified description of the task to be resolved for each page via a port
- The build bash script wraps the worker in a js file, runs it and writes the output to a file.
The server serving the html files can then do the task(s) and provide the page with the data via flags. Alternatively it could be turned into a CGI type thing.
bash ./build.sh dev
bash ./build.sh prod
node server.mjs