kentonv changed the topic of #sandstorm to: Welcome to #sandstorm: home of all things sandstorm.io. Say hi! | Have a question but no one is here? Try asking in the discussion group: https://groups.google.com/group/sandstorm-dev
<isd>
What needs getting around?
<JacobWeisz[m]>
I get the error message added by that commit, unknown hostname.
<isd>
Unfortunately there's no single static value we can hand it... Open an issue? For our purposes being able to turn it off would be fine.
<isd>
An alternative would be to put a reverse proxy in front of it, but that seems sad just to work around this.
michaeln3 has joined #sandstorm
<JacobWeisz[m]>
I've opened an issue to ask.
frigginglorious has quit [Read error: Connection reset by peer]
michaeln3 has quit [Remote host closed the connection]
XgF has quit [Remote host closed the connection]
XgF has joined #sandstorm
frigginglorious has joined #sandstorm
frigginglorious has quit [Ping timeout: 240 seconds]
frigginglorious has quit [Ping timeout: 272 seconds]
frigginglorious1 is now known as frigginglorious
frigginglorious has quit [Read error: Connection reset by peer]
frigginglorious has joined #sandstorm
frigginglorious1 has joined #sandstorm
frigginglorious has quit [Ping timeout: 240 seconds]
frigginglorious1 is now known as frigginglorious
frigginglorious has quit [Read error: Connection reset by peer]
frigginglorious has joined #sandstorm
michaeln3 has joined #sandstorm
michaeln3 has quit [Remote host closed the connection]
michaeln3 has joined #sandstorm
frigginglorious1 has joined #sandstorm
frigginglorious has quit [Ping timeout: 272 seconds]
frigginglorious1 is now known as frigginglorious
<isd>
I still don't have a great handle on how to hack on Sandstorm's templates -- it seems like they're some of the messiest code we have. I've been staring at how to trigger a notification like "grains are backing up" from the bulk save backup button, and it's really not clear to me what the right approach is...
<kentonv>
yeah blaze template state management is bizarre and we never figured out how to use it without creating a dumpster fire
<isd>
I'm vaguely skeptical of template languages as a general concept. You're giving up programmability for some minor (and very subjective) syntax nicities. That doesn't strike me as a great bargain.
<isd>
Like, sandstormTopbarItem is the kind of thing that is excessively hacky and difficult with a template language, which seems like it would be way, way easier to deal with with a proper programming language.
<kentonv>
I guess the problem that templates are trying to solve is that specifying HTML DOM in code is cumbersome... but if the template is in a separate file then you end up tempted to extend the syntax to support programming constructs there, which maybe you shouldn't have
<kentonv>
probably the right way to use blaze templates is to have many small templates that do one thing, whereas we have a lot of big monster templates
<kentonv>
of course, react has their approach of merging HTML into the language, which is nice
<kentonv>
but I think, ironically, Blaze did a better job at actual reactivity than React
<TimMc>
Any language with data literals has a leg up, here. (Clojure, Javascript, some others.)
<TimMc>
The ideal templating library would need a way to manage and merge small chunks of template in a fluent way.
<isd>
Yeah, I'm dubious of the idea that doig dom manipulation in code is materially worse than what a template language gives you. a({href: ..}, ...) instead of <a href="..">..</a> ... I don't see the downside.
<kentonv>
I mean, try writing out a longer example where the HTML contains text and elements
<isd>
Eh, I think once you start putting i18n in the mix even the text bit ends up not being that meaningful.
<isd>
Though I'll grant if you're splicing English right into the templates it scans a bit better.
<kentonv>
{a: {href: "..."}, body: [{cdata: "my link text"}, {b: {}, body: [{cdata: "this is bold"}]}]}
<kentonv>
vs <a href="...">my link text<b>this is bold</b></a>
<kentonv>
agreed that i18n means you don't actually what the text inline, but a11y means you don't actually want the layout inline either
<kentonv>
really in code you want to be specifying logical components with properties specific to that component's purpose
<isd>
You can do better than that. Something like a({href: "..."}, "my linked text", b("this is bold"))
<TimMc>
I believe in Clojure's Hiccup syntax that would be [:a {:href "..."} "my link text" [:b "this is bold"]]
<TimMc>
Any strings are automatically text to be escaped, not HTML.
<isd>
(And my experience with Elm is that doing this in code is pretty ergonomic actually -- and it means everything is type checked)
<kentonv>
and then you want to be able to convert that component structure into HTML or gtk or mobile UI or screenreader-optimized UI in different ways
<isd>
Sure. But that just means factoring the rendering out into a separate set of functions.
<TimMc>
(I mention Enlive not because it's necessarily a great idea, but because I think it shows how little we've collectively explored the solution space.)
<kentonv>
isd, well, I'm saying that ideally the purpose of the template language is to map logical components to HTML. I do think it makes sense to use a DSL for that purpose.
<kentonv>
that said, the way we actually used templates in Sandstorm mixes lots of business logic into the templates
<kentonv>
unfortunately
<TimMc>
I've fallen out of love with the idea of components that can be rendered to different platforms (desktop, HTML, etc.) and feel at this point like just having separate clients might be better.
<isd>
I just don't really see the point; I don't buy the syntactic argument, and I don't see what else templates buy you vs. just using functions.
<isd>
(jsx is a better solution to the syntax issue on its own)
<kentonv>
I guess in my mind jsx falls into the bucket of template languages... :)
<isd>
I guess what distinguishes it is it isn't separate from javascript -- it's just some extra syntax in your existing PL. So it doesn't take language constructs away from you
<isd>
(there are a bunch of places in the sandstorm templates that are screaming for higher-order functions... which we could just use if it were jsx).
frigginglorious has quit [Read error: Connection reset by peer]
frigginglorious has joined #sandstorm
frigginglorious has quit [Read error: Connection reset by peer]