A cool thing that could be done in Rust is enumerate all valid properties for DOM elements, and front it with and html!() macro (for convenience). Would allow compile-time validation of the markup that's written, which is a level of trust that I haven't seen anywhere else yet.
-
Show this thread
-
This would probably be a lot of work to generate by hand though. I wonder if there's WebIDL specs for DOM elements available.
4 replies 0 retweets 1 likeShow this thread -
Could probably extend this to CSS too. I haven't thought this through yet, but I wonder if there's something to be said for a mapping of CSS classes to Rust structs (instances). Type safety around class usage could have some fun implications. Also could help w/ critical styles.
1 reply 0 retweets 2 likesShow this thread -
By the way, if someone wants to run with this idea and give it a shot, please do! I won't have time to try this out until at least January.
2 replies 0 retweets 1 likeShow this thread -
Replying to @yoshuawuyts
Elm and elm-css were built with this in mind! (Not sure if you already knew and were only excited about the idea of having this in Rust)
1 reply 0 retweets 0 likes
Oh, that's nice to know! -- Yeah mostly excited about having this in Rust because of interop, but it's great to have prior art to reference! :D
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.