本文介绍了我应该使用打字稿?或者我可以只使用ES6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我每天的工作就是使用AngularJS客户端开发人员。我们正在评估,如果我们想要去与打字稿。我做了打字稿一些研究,几乎每一个JavaScript的包,我需要必须定义类型的文件。我发现,是不是很方便,尤其是如果我想尝试新的东西,他们没有定义它。它真的令人沮丧。 (目前的jQuery的定义,甚至给我一些问题,如果我想使用打字稿1.5测试版)。我开始寻找ES6和它类似于打字稿。如果我只是用ES6呢?另外,听说角2将有打字稿全力支持,那将是一个原因,我应该坚持下去?My daily job is client developer using AngularJS. We are evaluating if we want to go with TypeScript. I did some research on typescript and almost every JavaScript package I need must have definition type files. I found that is not very convenient, especially if I would like to try something new and they don't have the definition for it. Its really frustrating. (The current jQuery definition even give me some problem if I want to use typescript 1.5 beta). I started looking at ES6 and it looks similar to TypeScript. Should I just use ES6 instead? Also, I heard angular 2 will have full support for TypeScript, will that be one reason I should stay with it?推荐答案我已经用我的当前角度项目打字稿了大约一年半,而时不时的存在与定义的几个问题 DefinitelyTyped 项目做一个了不起的工作在保持与最流行的库的最新版本。I've been using Typescript in my current angular project for about a year and a half and while there are a few issues with definitions every now and then the DefinitelyTyped project does an amazing job at keeping up with the latest versions of most popular libraries.说了这么多有一定的学习曲线过渡时,从香草JavaScript来TS,你应该考虑到你和你的团队做出这种转变的能力。此外,如果你将要使用的角度1.x的大多数,你会在网上找到的例子中会要求你将它们从JS转化为TS和整体,现在有没有使用TS和角度的1.x上大量的资源一起Having said that there is a definite learning curve when transition from vanilla JavaScript to TS and you should take into account the ability of you and your team to make that transition. Also if you are going to be using angular 1.x most of the examples you will find online will require you to translate them from JS to TS and overall there are not a lot of resources on using TS and angular 1.x together right now.如果你打算使用角2有很多的使用TS例子,我认为球队将继续提供最TS文件,但你当然不必使用TS使用角2If you plan on using angular 2 there are a lot of examples using TS and I think the team will continue to provide most of the documentation in TS, but you certainly don't have to use TS to use angular 2. ES6确实有一些不错的功能,我就越来越熟悉,个人计划,但我不认为它在这一点上的生产就绪语言。主要是由于目前的浏览器缺乏支持。请参见这,以便回答更多的细节。当然,你可以写上你code和ES6并使用transpiler得到它ES5,这似乎是流行的东西,现在做的事。ES6 does have some nice features and I personally plan on getting more familiar with it but I would not consider it a production ready language at this point. Mainly due to a lack of support by current browsers. See this SO answer for more details. Of course you can write you code and ES6 and use a transpiler to get it to ES5, which seems to be the popular thing to do right now.总的来说,我认为答案将回落到你和你的团队是什么舒适的学习。我个人认为TS和ES6将有良好的支持和长期期货,我preFER TS,但因为你会得到语言特性更快,现在的工具支持(在我看来)是一个更好一点。Overall I think the answer would come down to what you and your team are comfortable learning. I personally think both TS and ES6 will have good support and long futures, I prefer TS though because you tend to get language features quicker and right now the tooling support(in my opinion) is a little better. 这篇关于我应该使用打字稿?或者我可以只使用ES6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-07 03:27