framesurge / perseus

A state-driven web development framework for Rust with full support for server-side rendering and static generation.
https://framesurge.sh/perseus/en-US
MIT License
2.18k stars 89 forks source link

Ability to derive traits on reactive version of state #319

Open SIGSTACKFAULT opened 8 months ago

SIGSTACKFAULT commented 8 months ago

This issue is requesting an enhancement to Perseus. Details of the scope will be available in issue labels. The user described the problem related to this request as follows:

Ability to derive traits on reactive version of state

The user described the issue as follows:

Just for debugging, I'd like to show the debug representation of my state on the page. Unfortunately #[derive(ReactiveState)] doesn't seem to provie any way to have anything be derived on the reactive version of state. I could implement debug manually but that's lame and boring.

  • The author is willing to attempt an implementation: false
Tribble internal data dHJpYmJsZS1yZXBvcnRlZCxDLWVuaGFuY2VtZW50
arctic-hen7 commented 8 months ago

Hey, sorry for the late reply! This should definitely be possible...not sure what the best pattern is though. I'm happy to create something like #[rx(attr = "#[derive(Debug)]")], which is a bit grotesque but would work very well and mark it as experimental so we can change the pattern if need be? @SIGSTACKFAULT what do you think of that syntax?