Skip to content

Feature: Hot-reload / Runtime interpretor for debug mode #392

@wrapperup

Description

@wrapperup

Love the library, it's really nice!

This would add an optional feature that allows maud to embed a runtime parser/interpreter that can read its own macro block from Rust source code. This runtime templating is limited in scope, meaning that changes to data, bindings, etc will require a recompile, but other changes could be done by interpreting the macro block at runtime (which IMO covers a lot of iteration time). This is definitely a bigger task with multiple steps, but I think it can be a really useful feature.

This is something Dioxus has implemented as a CLI tool, and I made a proof-of-concept implementation html_hotreload! (renamed to html! in the video) macro that uses maud's parser to generate a runtime instead that also parses itself at runtime (inception...).

maud_hotreload.mp4

Is this something you'd be interested in including with maud as an optional feature, or is it out of scope for maud? I think it could be it's own crate with a small refactor to expose maud's proc-macro/parser internals.

Either way, thanks for the useful library!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions