small medium large xlarge

Allan_pragsmall
31 Oct 2016, 15:24
Allan Davis (1 post)

I am trying to setup using typescript with the webpack_rails and angular. I have been playing around with a couple different configurations but I am having trouble getting the config to work with the plugin.

Can we get some kind of blog post or to help with this setup for those who want to work through the examples in Typescript.

Dmfcb_pragsmall
31 Oct 2016, 15:55
David Copeland (476 posts)

I haven’t done anything with Typescript at all, but I can look into it once the full book is released if there’s interest.

FWIW, the angular docs use webpack so that might have the webpack configuration needed to make Typescript work. My understanding was that it can all be configured within webpack. I think all webpack-rails really does is bootstrap a config file and add the <script tag for the dev server into your layout.

Generic-user-small
03 Nov 2016, 23:27
Rafal Skorupa (1 post)

I tried to setup Rails with TS Angular2 on webpack using Angular docs about webpack, but my ng2 tags in views aren’t treated as Angular tags. If I get a working solution I could write a short article how to do that if you, David, don’t mind if the article will be based on part of your book (setup chapter).

edit: I’ve just set up the app with Angular 2 working on TypeScript. I’ve you are interesting and have as much troubles as I did, try mine solution - I’m not sure what is necessary to run and how can it be simplified, but I’m going to work to improve this. https://github.com/rafalskorupa/angular2-on-webpack-rails And it’s deployable to heroku.

Generic-user-small
06 Dec 2016, 18:58
Merul Patel (1 post)

The book is extremely useful, but I think the decision to not use TypeScript isn’t the best. A lot of components seem to be written using TypeScript, which is itself far closer to Ruby IMHO than Javascript. Perhaps a chapter on TS and then change all code to use it. OK, 3rd edition…

Dmfcb_pragsmall
06 Dec 2016, 18:59
David Copeland (476 posts)

Yeah, we had talked about that, but the feeling was that since Angular 2 is designed to work with ES5, we’d reduce the new things the reader had to learn.

Generic-user-small
07 Dec 2016, 12:44
Alberto (3 posts)

I can understand your reasoning David, but consider also that in this way you’ll force someone who’s learning this stuff (nearly) for the first time to learn it the “old way” and then re-learn the new way in most of the examples and documentation online (and this is actually true also for who already knows well ES5). It seems better to me to link to new methods or constructs documentation when and if needed. Future-proof.

Dmfcb_pragsmall
07 Dec 2016, 14:03
David Copeland (476 posts)

Yeah, but TypeScript is a superset of JavaScript. In almost every case I’ve seen, the ES5 version is less code than the TypeScript version. But, these are the tradeoffs when writing something like this. The book is already 300 pages! :)

Generic-user-small
16 Aug 2017, 10:15
John Meehan (1 post)

Yeah I really wish this book used Typescript. Its the Angular side using Javascript instead of Typescript which lets this book down. The rest of the book is great.

Generic-user-small
18 Aug 2017, 22:06
Philippe Haussy (13 posts)

Does anyone have any experience setting up jasmine/karma based tests in typescript?

You must be logged in to comment