1. https://github.com/jbrantly/ts-jsx-loader (for webpack, but basic approach works in gulp/grunt as well)
Given the improvements in ES6, the fact that the JS community in general is so active, and the fact that I've seen some truly awful TS code (mainly where the devs want to pretend the web doesn't exist) I've been put off exploring TS too far much (beyond looking at the basic language features).
I'm not sure if I should be rethinking though?
I agree. Typescript is an impressive project, but most of the Typescript code I see looks more like C# or Java than Javascript. Sadly, it seems to have been created to accommodate that kind of approach.
But there's a lot to be said for strong and static typing when dealing with large projects.
That's why I'm hopeful for Flow, Facebook's new project to add static typing to Javascript:
Anyway totally agree on the typing angle, navigation/refactoring/discover-ability aspects are useful and I loved the implicit interface approach in Dart. However I wonder whether some of those features won't be added to JS over time (where possible in such a dynamic language). Ta for link to flow, will give it a look thanks.
There are a couple of links to editor syntax files and a link to WebStorm but they're a bit of an after thought.
I keep expecting the homepage update "any day now" but so far I've only really seen VS mentioned as a default environment.
One of the things I like about angular is how it deals with standard HTML. HAML doesn't care about its wacky attributes. Whats the best way to achieve this with react? Does the JSX compiler have hooks for preprocessing of any kind?
div
className: 'navbar-form'
style:
backgroundColor: "green"
,
div
className: 'btn-group'
,
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleDecreaseWpmClick
,
span
className: 'glyphicon glyphicon-chevron-down'
span
className: 'btn btn-default disabled'
,
"#{ @props.status.get('wpm') }"
span
className: 'hidden-xs'
,
" wpm"
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleIncreaseWpmClick
,
span
className: 'glyphicon glyphicon-chevron-up'
(For the curious, "wpm" is short for "words per minute" - this is straight out of my code for http://splashreaderapp.com. More code at http://github.com/rattrayalex/splashreaderapp) div
className: 'navbar-form'
style:
backgroundColor: "green"
div
className: 'btn-group'
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleDecreaseWpmClick
span
className: 'glyphicon glyphicon-chevron-down'
span
className: 'btn btn-default disabled'
"#{ @props.status.get('wpm') }"
span
className: 'hidden-xs'
" wpm"
button
type: 'button'
className: 'btn btn-warning'
onClick: @handleIncreaseWpmClick
span
className: 'glyphicon glyphicon-chevron-up'Best place to start I guess would be to look into the JSX compiler to see how complicated that would be.
However, if you want to use e.g. TypeScript with React, than this is a very big thing! Up until now, it was always a bit of a hassle, and with this change, it's completely straightforward (especially if you don't want JSX). You'll also need propTypes less because you can just use TypeScript interfaces for the `props` constructor parameter. Plus, TypeScript already has property initializers and all that, so all the other annoyances that you get when doing this with plain ES6 classes disappear with TypeScript.
I'm currently really considering porting my current project back to TypeScript for this single reason. The bad mix of TypeScript and JSX is what mostly holds me back. I'd like my view code to be somewhat understandable/hackable by designers and JSX really matters there. Any suggestions?