hydrotik / node-hapi-react-redux-sass-typescript-mongo-webpack-hmr-gulp

Rapid prototyping full stack framework using our favorite technologies. Inspired by Aqua/Frame with a sprinkle of Mean.io and Mean.js
11 stars 4 forks source link

Hapi-Typescript-React-Views as a Solution #249

Open ghost opened 8 years ago

ghost commented 8 years ago

Base on information gathered from working on #247 and #248, we should at some point discuss the goals of Hapi-Typescript-React-Views vs other alternatives.

Issues with current setup

My opinion is that Typescript's main advantage over vanilla JS are, 1) compile-time error checking and, 2) enabling better IDE feedback.

However, Hapi-Typescript-React-Views runs its transpiler step at server runtime. This essentially defeats 1, since we'll only get errors at runtime. Just as critical, Hapi-Typescript-React-Views runs its own transpiler pipeline separate from what is configured through webpack, tsconfig.json, and npm. And as a consequence, my IDE won't report errors correctly either since it's basing it's checks on the the current project's configuration which is separate from what is defined in Hapi-Typescript-React-Views

Possible Solutions (both eliminate need for Hapi-Typescript-React-Views)

  1. Go back to Hapi-React-Views, and not use Typescript for the views.
  2. Transpile the TSX views through webpack, just like all the other ones in the project, except it outputs transpiled JS files which the Hapi server will load for the views.