-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
render runtime crates from templates dynamically (#962)
Closes #863 - The entirety of "runtime" codegen is now following a strict MVC model, and the source code is rendered from the same model object. We should be able to further improve/refactor this model object in #638 - Complex model construction can be strongly-typed in Rust, while rendering is left to templates, as they are much easier to read and modify, and also have powerful macros/imports/callbacks, etc... - I also (partially) improved the DX when working with templates in terminal, by rendering their errors as an `ariadne` report, with best-guess source location in the template. A temporary workaround waiting for Keats/tera#885 - Now both stubs and output crates are rendered from the same source templates, removing a few internal hacks and the need for `![allow(dead_code)]` and `![allow(unused)]` everywhere (will follow up on this cleanup separately). - We no longer have to maintain explicit paths and copy files around in the code generator. All templates generate their output file relative to their location, which means we can split and refactor code into as many templates/sub-modules as needed, following standard rust idioms.
- Loading branch information
1 parent
66ed102
commit 874039b
Showing
193 changed files
with
3,273 additions
and
1,805 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
crates/codegen/parser/generator/src/typescript_generator.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
crates/codegen/parser/runtime/src/napi_interface/ast_selectors.rs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.