News for hackers. Stuff that matters.
Re:Relay Technical Preview by stevebmark on Tuesday August 11, 2015 @04:28PM (#10044143)
I'm spoiled by the niceness of JSX. It's a very clean and expressive and easy to read language, because it's only what I already know, Javascript and HTML. There are no APIs to learn (except for some minor cases, like inline comments). This template language looks like it would only have downsides compared to JSX. It's a new syntax to learn, and less expressive. This templating language even adds HTML-like attributes! What a mess.

Also I don't think the templating language has anything to do with the nature of blocking vs non-blocking data fetching.

Re:Relay Technical Preview by dsp1234 on Tuesday August 11, 2015 @04:39PM (#10044231)
Also I don't think the templating language has anything to do with the nature of blocking vs non-blocking data fetching.

The previous commenter was specifically talking about the issue where the client side of an isomorphic application can "show the view with a 'loading' indicator", but generally the server is not able to stream out the full HTML until all data has been gathered and processed. The templating engine that I mentioned has a solution to that specific issue.

For example, in the first link, you can see that even though the template is rendered on the server, and has a data source with a 3 second delay, it does not prevent the rest of the template from being rendered and sent to the client, and includes a "loader"-like message (you could easily plop a loading gif in there instead of the textual message in the example).

So it does seem relevant to me.

Re:Relay Technical Preview by stevebmark on Tuesday August 11, 2015 @04:49PM (#10044281)
To clarify, the loading case I mentioned is related to single page apps. The server isn't the one rendering the page when the loading indicator pops up, that's entirely a client side render ("isomorphic" being the ability to fully render on client or server side with the same codebase). The server doesn't need to stream a page with a loading indicator in the HTML. Being able to stream part of the app while data is loading (like the header) does seem like an interesting case, but it would only matter for the initial page load in an isomorphic SPA.
Re:Relay Technical Preview by dsp1234 on Tuesday August 11, 2015 @04:44PM (#10044256)
This templating language even adds HTML-like attributes! What a mess.

    <ul>
        <for each="item in items">
            <li>${item}</li>
        </for>
    </ul>
I have no problems with a mess that looks like that. Anyone on my team could pick that up with no problems whatsoever.
Re:Relay Technical Preview by marcusarmstrong on Tuesday August 11, 2015 @04:34PM (#10044203)
it's only what I already know, Javascript and HTML

But it's not. "className", much?

Re:Relay Technical Preview by petrbela on Tuesday August 11, 2015 @05:00PM (#10044344)
Oh boy, "className" and "labelFor". See, wasn't that hard to learn JSX if you already know HTML.
Re:Relay Technical Preview by smhg on Tuesday August 11, 2015 @06:06PM (#10044732)
I think you meant htmlFor, no? But I completely agree with the sentiment that it is nice to stay as close to plain HTML and JS as possible.
Re:Relay Technical Preview by petrbela on Tuesday August 11, 2015 @06:30PM (#10044853)
Yeah, thanks. I don't actually remember if I've ever used it :D
Re:Relay Technical Preview by marcusarmstrong on Tuesday August 11, 2015 @06:04PM (#10044725)
I'm not saying it's hard. But {?variable} isn't hard either.
Re:Relay Technical Preview by Nogs on Tuesday August 11, 2015 @04:43PM (#10044247)
Re:Relay Technical Preview by smhg on Tuesday August 11, 2015 @06:12PM (#10044758)
w3schools might have gotten a bit better lately, but please use MDN as a reference:

https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...

They offer so much more context.

Re:Relay Technical Preview by marcusarmstrong on Tuesday August 11, 2015 @04:54PM (#10044312)
Sure. But that's different than <div className="blah">.
Re:Relay Technical Preview by smhg on Tuesday August 11, 2015 @06:17PM (#10044789)
Not much. These are actually the Web API attribute names you should use when accessing these attributes from a non-HTML language (e.g. JavaScript).

The React folks didn't make them up.