Generation Phase
The generation phase is the source of the “magic” that allows you to access functionality without writing routing code.
All the “magic” of automatic type safety and creating routes just by creating files is done during the generation phase.
When you save a file, Milkio’s VS Code Extension quietly enters the generation phase in the background. It reads your code and generates the generated
directory and everything you need. This is also the secret behind Milkio’s ability to easily work across runtimes.
Details
The generation phase consists of two parts: significant and insignificant. When the significant part ends, it means that the important parts have been generated, and you can then run code or start a server, among other operations. The insignificant part continues to execute asynchronously in the background.
By modifying the milkio.toml
file, you can freely add tasks to be performed during these phases. You can add the commands to be executed in the generate
section.
You can find detailed output during the generation phase in the Milkio dropdown option in the output panel of VS Code.
You can also generate using commands, which is useful for workflows like GitHub Actions.