pluralsight/guides

Missing information re compiling typescript in the angular2-rails guide

NColey opened this issue · 7 comments

The react-vs-angular-2-integration-with-rails guide is missing information on how to compile the typescript files into javascript.

After explaining how and where to add the typescript files the guide says to run rails server and visit localhost:3000, unfortunately, this doesn't work because the browser is looking for boot.js and there is no information on what command would need to be run to get that. I double checked against the completed repo linked in the guide and all of my files are identical, except the completed repo already includes the .js files (with no indication of how they got there).

It would be much clearer if the guide could be updated to include that extra step. Thanks!

Good point @NColey. Any thoughts on this @Kaizeras?

@NColey it does. Have a look at the the section with the node package manager and running npm install before starting your app

Hi, sorry, just a quick update, npm install doesn't actually compile the typescript files into javascript, it just installs the packages specified in package.json. I tried it just now using the repo linked in the guides (this one) (I used the linked repo to make sure it wasn't an issue with my code) and when I ran npm install it installed the various packages as it should have, but did not actually compile the typescript files into javascript. Is there perhaps a step I'm missing?

It seems to me that the reason that repo works when you start a rails server is because it comes with the javascript files already compiled. Any user following along with the guide at home wouldn't have those files already (or alternatively, if someone were to clone down the repo and update or modify the typescript files) and so running npm install wouldn't create the javascript files they need to run the app. Again I'm just doing this based on what is in the guides and what is in the linked completed repo so please let me know if there is another step.

I did some more googling just now and it looks like the command needed to compile the typescript files into javascript is npm run tsc. That's currently not a step specified in the guide but perhaps it could be added to the same section that instructs readers to run npm install so that they know they need to run that both to compile the files but also after any changes or updates to their typescript files so that it compiles before starting a rails server? Just a thought! Thanks!

Thanks for the heads up, @NColey! Couldn't detect the problem because I already had Typescript configured and everything ran well. I added the npm run tsc to the tutorial as you requested.

Once again, thanks!

Great point @NColey. Sorry I prematurely closed this issue. Feel free to post back with anymore suggestions. Great work @NColey and @Kaizeras!

No problem, and thank you!!