News for hackers. Stuff that matters.
Re:The cost of transpiling ES2015 in 2016 by mbrock on Monday February 08, 2016 @12:52PM (#11059623)
I agree, and I think ES5 even has a benefit as a language: it's extremely simple. The trajectory of ES2015 seems to be, basically: add as much cool stuff as possible. Thus increasing the syntactic surface area, and the amount of stuff to learn.

With a slightly more clever and more concise definition of `createElement`, I also have no need for JSX.

    tag("div.widget.fancy", {}, [
      tag("h1#title", {}, "Hello, world!")
    ])
I'm fine with that. My editor understands the indentation.

And... such an enormous benefit... there is no compilation step.

Right now at work, our code base takes 20 seconds to compile with Babel. Enough said.

The feeling, after being used to all this transpilation business, of writing code that's just already ready to serve, is very nice. I can even work on it with nothing but a text editor and a web browser.

Unfortunately everyone thinks I am crazy for preferring this.

Re:The cost of transpiling ES2015 in 2016 by bhauer on Monday February 08, 2016 @01:27PM (#11059919)
That looks a lot like the element builder function that Fastmail put together back in 2012.

https://blog.fastmail.com/2012/02/20/building-the-new-ajax-m...

I too am fond of that approach.

Re:The cost of transpiling ES2015 in 2016 by mbrock on Monday February 08, 2016 @01:39PM (#11059994)
Yeah, same idea.

The dream that designers, being comfortable with HTML, would be able to mess around with JSX is, as far as I can tell, unrealistic anyway, because it's always full of React-specific weird stuff that the designer doesn't understand and doesn't want to mess with.

Re:The cost of transpiling ES2015 in 2016 by WickyNilliams on Tuesday February 09, 2016 @09:18AM (#11065378)
You should separate your Presentational and Container components [0]. Presentational components can be pure and stateless, containing no/minimal React-specific weird stuff - that should go into the Containers.

[0] https://medium.com/@dan_abramov/smart-and-dumb-components-7c...

Re:The cost of transpiling ES2015 in 2016 by endemic on Monday February 08, 2016 @01:00PM (#11059700)
I've started going back to straight ES5 for my side projects. It removes the annoying "compile" step, which I find pretty dumb for an interpreted language. For deployment, of course, I concat and minify. But the speed with which I can iterate using vanilla Javascript is refreshing in this day and age.
Re:The cost of transpiling ES2015 in 2016 by mbrock on Monday February 08, 2016 @01:15PM (#11059809)
I would be interested in a compilation step if it gives me something like PureScript, that is, real, serious benefits from the compiler: algebraic data types, type checking, type classes, and so on.

But ES2015 is just a bunch of syntax sugar. Nice syntax sugar, but still. Okay, async/await is significantly useful... but you still have to understand how the promises work under the hood... and I can live with raw promise coding.

Re:The cost of transpiling ES2015 in 2016 by spb on Monday February 08, 2016 @02:51PM (#11060438)
This is basically exactly how my function "cre" works (except you can omit the empty attribute object): https://github.com/stuartpb/cre
Re:The cost of transpiling ES2015 in 2016 by guscost on Monday February 08, 2016 @05:45PM (#11061484)
Nope, you're not crazy. I'm doing the same thing at work (but have looked into setting up TSX in the future).
Re:The cost of transpiling ES2015 in 2016 by ENGNR on Monday February 08, 2016 @04:27PM (#11061013)
I've been avoiding the compile step too just for simplicity.

But have you found sensible ways to test without them?

Re:The cost of transpiling ES2015 in 2016 by mbrock on Monday February 08, 2016 @05:54PM (#11061560)
What's the problem with testing, you mean? Sure, I've done plenty of testing of ES5 code without transpilers.
Re:The cost of transpiling ES2015 in 2016 by Scarbutt on Monday February 08, 2016 @04:31PM (#11061026)
during development, doesn't react with addons allows to use JSX without pulling in any tooling or additional dependencies?