This is a wrapper for the TypeScript, JavaScript superset language by Microsoft.
It enables you to use the .ts
extension in the Asset Pipeline and also in ActionView Templates.
The credit for the overall structure and the tests goes to the people that wrote the coffee-rails Gem, since I shamelessly copy&pasted some of their code.
The current version requires that tsc is
installed on the system.
This gem uses tsc
directly.
Add this line to your application's Gemfile:
gem 'typescript-rails'
And then execute:
$ bundle
Just add a .js.ts
file in your app/assets/javascripts
directory and include it just like you are used to do.
Configurations:
# Its defaults are `--target ES5 --noImplicitAny --removeComments`.
Typescript::Rails::Compiler.default_options = [ ... ]
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
FUJI Goro [email protected]
Klaus Zanders [email protected]