Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor runtime crate into separate templates #863

Closed
OmarTawfik opened this issue Feb 29, 2024 · 0 comments · Fixed by #962
Closed

refactor runtime crate into separate templates #863

OmarTawfik opened this issue Feb 29, 2024 · 0 comments · Fixed by #962
Assignees

Comments

@OmarTawfik
Copy link
Contributor

to allow developing/adding independent modules and types without maintaining a parallel hierarchy/build step in codegen.

@OmarTawfik OmarTawfik self-assigned this Feb 29, 2024
@OmarTawfik OmarTawfik moved this from ⏳ Todo to 🔄 In Progress in Slang - 2024 H1 Feb 29, 2024
@OmarTawfik OmarTawfik moved this from 🔄 In Progress to ⏳ Todo in Slang - 2024 H1 Mar 1, 2024
github-merge-queue bot pushed a commit that referenced this issue May 14, 2024
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.
@github-project-automation github-project-automation bot moved this from ⏳ Todo to ✅ Done in Slang - 2024 H1 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant