6 ms·
How many Angular folks are sticking with native ES6 and babel vs TypeScript? Angular is clearly directing folks to TypeScript. I don't want to have to use TypeS
by cdnsteve 11y ago
How many Angular folks are sticking with native ES6 and babel vs TypeScript? Angular is clearly directing folks to TypeScript. I don't want to have to use TypeScript on front-end and ES6 + Babel in Node. Trying to pick one.
- javajoshw 11y agoAs I understand it they have most of their docs written for TypeScript but they plan to fully support ES6 and have the docs to show how to use ES6 too. I would prefer ES6, however it appears that TypeScript is a bit less verbose to write.
- aikah 11y agoThe big difference between TS and ES6 is dependency injection. Types can be resolved through TS types while you need to use decorators with ES6. The problem I have with decorators is that they are not officially part of ES7 spec yet, even if there is a big chance they end up in the final spec, features like ES6 modules are a proof that things can be reworked to death before being standardized.
- davedx 11y agoI'm finding it very difficult due to the sheer number of choices. Angular 2 supports ES5, ES6, TypeScript, and Dart. It's hard enough evaluating what our upgrade path will be from Angular 1.x, let alone which language we should end up using. I kind of have a feeling that by the time we actually need (and have the resources) to upgrade or even start mixing in Angular 2 on our project, native browser support for ES6 will be close enough to complete that we won't need a transpilation step. That might be a nice time to do the migration. Looking forward to hearing what other devs end up using.
- grumblestumble 11y agoA lot of Angular 2 is optimized around using Typescript. A lot of the heavily-used Typescript features (eg. annotations) are on track for ES7, but not part of ES6.
- iLoch 11y agoTypeScript is fully compatible with ES6 as far as I know, so if you want to start using it either on the client side or on the server side, you can start doing that whenever you like (provided you don't mind changing file extensions, etc.)
- ihsw 11y agoThat's a negative, it is the reverse -- MS has always maintained that TS will be a superset of ES and that they are completely open to porting TS features over to ES.
- joshuacc 11y agoWe've been using TypeScript with Angular 1 projects for almost a year now and have really been enjoying it. Having it integrated directly into the framework is a great improvement for my team, at least.
- softinio 11y agoWhen using Typescript with Angular 1 where you able to make use of TS types and type checking? Want to give this a try :-) Thanks
- joshuacc 11y agoYes. You just include a "type definition file" for Angular in your project. There is a very large existing repository of type definitions for popular JS libraries in the DefinitelyTyped project. https://github.com/DefinitelyTyped/DefinitelyTyped https://github.com/DefinitelyTyped/DefinitelyTyped
- ihsw 11y agoTypeScript, all the way. I work with it professionally and I couldn't be happier, especially in comparison to CoffeeScript. I used to love CoffeeScript but, after giving ES6 (with eslint) a shot, it no longer has a special place in my heart. I do enjoy the terseness of it (writing it is fun) but some things are just painful (reading it after the fact). As for TS vs ES6+ -- I would go with TS but only because Angular projects have a tendency to become very large, and having a compile-time type system hold your team's hand is very comforting.
- yesimahuman 11y agoWith Ionic 2, we're giving people Babel + ES6+ for our starter projects, with the option to enable typescript. I agree with you that typescript should "enhance" an app, but not dictate it from the start. We're giving people the option and will see how that goes.
- drinchev 11y agoI'm using TypeScript with NodeJS. It gave me enormous power. I stopped writing half of my tests and I hardly see runtime errors anymore. TypeScript is doing really good.
- disease 11y agoI've been using TypeScript for a few months now and have been so impressed with it that I am beginning to favor Angular 2 over React just because of Angular 2's TS integration. TypeScript basically made JavaScript more powerful and a whole lot more fun for me. I feel so much better about slinging around parameters now that I know my IDE will catch type/parameter mismatches before I run the code, before I build it, even before I save the file! It simply alerts me in the IDE (I use VSCode which I also love). This is a huge time saver. Another great thing is the intellisense, which allows me to keep on coding without looking at some API documentation or other files in the project. The intellisense even has the documentation in it - so this is a really fun and efficient way to learn new libraries and frameworks. I didn't even know how much I missed enums in JavaScript until I started using them in TS. Also love the fact that you can revert to using the Any type if you have to and there is even support for generics as well. All of this stuff can be had in various transpilers or IDEs, but TypeScript and VSCode just bring everything together in a very simple yet powerful way.
- spdionis 11y agoWelcome to the programming world, js developers.
- jgord 11y agoI never jumped on the CoffeeScript bandwagon .. I know people love it, just not me. Hence unlikely I will try TypeScript. Despite all its glaring flaws, javascript is an insanely productive language due to excellent mix of features. To improve upon that Id need to go to lisp / clojure [ but it lacks wide commercial acceptance .. not a criticism at all ] I'm actually wary of using the newer additions to javascript language - ES6, Promises and arrow notation don't seem that much of a win to me, I'm very sceptical of new being good in language design... whereas I really love Ramda.js as a general underscore / lodash replacement. Productivity seems more a function of how we structure our code [ eg. keep state so we can jump back into where we were in the web app, thus iterate easily - as per the Om approach ] and thinking functionally.. rather than language syntax additions. I don't see the need for an IDE .. they tend to come into their own when Your.ColourfulAndCompleteMethodNames are so long they need auto-completion. Thats the beauty of javascript [ and lisp etc ] we should fight to keep things small and terse.
- capkutay 11y agoFrom my understanding the two aren't mutually exclusive. From example, couldn't you use ES6 decorators and typescript in the same project?
- art0rz 11y agoTyoeScript supports decorators with the --enableExperimentalDecorators flag.
- EvanPlaice 11y agoES6 does to if you use Traceur/Babel + config flag.