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.
-
-
Okay, yeah so this is more or less what I think this would look like syntactically when used. Everything under it would be strongly typed, and exposing methods like `.as_bytes()` for sending it over the wire.pic.twitter.com/Boh4h33hRM
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I've wanted something like this for ages, basically an HTML-aware templating engine. The real power comes from using parser state to determine what variables are expected. E.g. if I output `<img src="{{myurl}}">` the engine should enforce that `myurl` is a Url.
-
If done right this is a major protection against XSS, since you can forbid javascript: URLs at the type level, and ensure all interpolated strings are of type EscapedString (or autoconverted at the boundary).
- 1 more reply
New conversation -
-
-
elm-css seems to export type aliases or functions for like every css thing. Not sure if they did it by hand or whathttps://github.com/rtfeldman/elm-css …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.