This year in JavaScript |【NPM官方发布2018回顾及2019预测】
本帖最后由 不二如是 于 2018-12-30 16:19 编辑时值年底,大厂 NPM 发布了一个 JavaScript 的测评报告,作为即将迎来《零基础入门学习Web开发》(JavaScript)教程的鱼C,这份总结来的恰到好处。
原文(fān 墙):传送门
This study is adapted from a presentation by Laurie Voss, co-founder and COO of npm, Inc., on npm and the Future of JavaScript. No data is perfect; if you have questions about ours you can read about the methodology used to gather this data.
这份报告是根据Laurie Voss (NPM的联合创始人、COO)在npm and the Future of JavaScript上的演讲整理的。没有任何数据数据是完美的。如果你有任何的疑问,你可以阅读这篇文章,看下我们是如何收集并整理这些数据的。(传送门)
npm has over 10 million users who download well over 30 billion packages every month. On an average Tuesday — npm’s busiest day — users download more than 1.3 billion packages of open source JavaScript. This gives us a lot of information about what JavaScript users are up to. On top of that data, in partnership with the Node.js Foundation and the JS Foundation we survey of over 16,000 developers to ask what they’re up to.
NPM拥有超过1000万用户,每个月下载超过300亿个包。每周二是NPM访问量最大的一天。用户平均在这一天下载超过13亿JavaScript开源代码包。通过分析这些下载数据,我们可以看到JavaScript开发人员们都在从事哪方面的工作。除此之外,我们还和Nodejs Foundation 、JS Foundation 进行了合作,对16,000名开发者进行了调查,询问了他们正在从事哪方面的工作。
From these two sources, we’ve uncovered some insights about the makeup of the npm community, as well as information about what the community considers to be best practices. This will help you make your technical choices in 2019.
通过上面两种方式,我们发现了npm社区的内在组成以及社区的趋势。这将为你在2019年进行技术选型提供帮助。
JavaScript is the world’s most popular programming language
JavaScript是世界上最流行的程序开发语言
It’s no news to anyone that JavaScript is incredibly popular these days. Stack Overflow’s 2018 developer survey has JavaScript as the most popular programming language (with fellow web languages HTML and CSS at the #2 and #3 spots).
JavaScript如此流行对任何人来说都不是一个新闻了。Stack Overflow 2018年的开发者调查显示(传送门),JavaScript是最流行的开发语言,其次是HTML和CSS。
GitHub’s most recent Octoverse infographic ranks languages by the number of pull requests received, and JavaScript is the top there, too.
GitHub最近的Octoverse报告给出了所有开发语言pull requests数量的排名,JavaScript也是位列第一。(传送门)
The total number of JavaScript developers is hard to estimate. Slashdata’s 2018 survey suggests there were 9.7M by the end of 2017 and growing quickly, meaning there are well over 10M at this point. npm’s own estimates suggest there are over 10M npm users, and we see similarly rapid growth. There are JavaScript developers who do not yet use npm, but as a percentage of all JavaScript developers they are quite small, possibly fewer than 10%.
JavaScript开发者的总数量是很难计算的。 Slashdata’s 2018 survey 报告指出,2017年末,JavaScript开发者数量为970万,并且在高速增长。这意味着当前至少已经有1000万开发者了。npm已经有超过1000万用户了,同样在高速增长。不过一部分开发者仍然还没使用过npm,不过这部分开发者的占比很小,估计小于10%。
The npm Registry contributes to the popularity of JavaScript
NPM促进了JavaScript的流行
Without question, JavaScript’s popularity is driven by its ubiquity as the only language directly usable for developing web applications. However, a fascinating paper by Leo Meyerovich and Ariel Rabkin at Berkeley studied the factors contributing to programming language adoption and found that, overall, the availability of open-source libraries relevant to the task at hand was the most important factor in selecting a programming language.
JavaScript是唯一可以开发web应用的语言,毫无疑问,JavaScript的流行与这一点是分不开的。不过,根据伯克利大学的这篇文章来看(传送门),拥有丰富的开源库,是开发者在选择一门开发语言时,最重要的因素。
Our own survey data support the conclusions of this study. The most common reason respondents gave for choosing JavaScript was the number of libraries available.
我们自己的调查也支持了这个结论。开发者选择JavaScript最常见的原因是可用库的数量。
With over 836,000 libraries currently available, npm is the largest single collection of open-source libraries in the world, by a significant margin — although JavaScript’s tendency towards smaller libraries means this comparison isn’t entirely apples-to-apples. Regardless, this enormous reservoir of open source code means that the popularity of JavaScript and npm works both ways: the language gains popularity because of the Registry, and vice versa.
npm拥有超过836,000个可用的开源库,是目前世界上最大的开源库集合。不过,JavaScript更多的是小型库,数量多也是情有可原的。这么巨大的开源代码量,也表明了JavaSciprt和npm的流行是相互促进的。
npm is used to build every kind of application
npm被用来构建各种应用
We asked users where the JavaScript they write is used. An overwhelming 93% of respondents said that they write code for the web, with a still-substantial 70% saying they write JavaScript that runs on servers, i.e., Node.js. However, many other application areas including Internet of Things (IoT), desktop applications, native mobile applications, and others saw substantial numbers of users, too.
我们询问了程序员兄弟们,他们写的JavaScript运行在哪里。93%的人回答他们用来开发web, 70%的人表示他们在服务端使用JavaScript,例如Node.js。当然,还有其他的领域:物联网、桌面应用、端应用等等。
This is a significant change for those of us who work at npm, Inc. and maintain the npm command-line tool. npm was invented to serve the needs of server-side app developers, and the needs of web developers are different. Becoming a majority-web platform has meant changing our priorities, which has ledto new features like package locking by default.
这对于在npm官方工作、维护npm命令行工具的我们,是一个显著的变化。npm起初是为了服务端应用而诞生的,而web开发者的需求是不一样的。成为一个主要为web端服务的平台,改变了我们的优先级,于是,我们开发了例如package-lock.json的新功能。
npm is essential to web development
npm对web开发来说是必须的
When npm, Inc. started in 2014, a tree of a few dozen JavaScript packages was typical. These days, the average modern web application has over 1000 modules, and trees of over 2000 modules are not uncommon. In fact, 97% of the code in a modern web application comes from npm. An individual developer is responsible only for the final 3% that makes their application unique and useful.
当npm在2014年诞生的时候,使用几十个JavaScript包是很极端的。如今,一般的web应用都会使用超过1000个模块,超过2000个模块的也不少。事实上,现代web应用中,97%的代码都来自npm。开发者只需要对剩下的3%代码负责,就能使他们的应用跑起来了。
This is a huge success story for code reuse, for the strength of the npm community, and for open source in general. The time saved by not re-inventing the code in thousands of modules is saving millions of developers hundreds of millions of coding-hours.
这对代码复用,npm社区以及开源界来说是巨大的成功。不需要在数千个模块中创建代码,为数百万开发人员节省了数以亿计的编码时间。
npm has focused on security in 2018
2018年,npm将专注安全
To a great many developers, npm has simply become the way you build a website. This is a responsibility we take seriously. In our survey, 77% of developers said they were concerned about the quality and security of the open source libraries they used, and a worrying 52% said the tools currently available were inadequate. We went into more depth on these results in our post Attitudes to Security in the JavaScript community earlier this year.
对于大多数开发者来说,npm已经成为了开发一个网站的方式。这对于我们来说是责任。在我们的调查中,77%的开发人员担心他们使用的库的质量与安全性,52%的人认为他们所使用的库是不值得信任的。
In April, we announced that we acquired ^Lift Security and their product, the Node Security Platform. Today, the NSP is integrated directly into npm, and every install of npm includes security audits that notify users if they are installing insecure modules. We also furnish tools to easily correct these vulnerabilities by automatically installing secure versions of their modules. In addition, users of npm Enterprise and paid npm Organizations users receive notifications of embargoed vulnerabilities not yet publicly disclosed.
4月份,我们发布了Node Security Platform。如今,Node Security Platform已经集成到了npm中。每一次npm的安装都会有安全审核,告诉开发者他们是否正在安装一个不安全的模块。我们还提供了通过自动安装模块的安全版本来轻松纠正这些漏洞的工具。总之,我们坐了很多事,来保障安全 。
The demographics of npm users
npm用户特征
The basic demographics of our survey respondents are covered in our methodology post, but there are several important facts worth highlighting:
我们调查对象的基本特征在之前发布的报告(传送门)中涵盖了。但有一些事实需要注意。
1、We aremostly new. 25% have been using JavaScript for less than 2 years, and 51% have been using npm for less than 2 years. This is a side effect of the community doubling in size in that time!
1、很多新人。25%的开发人员使用JavaScript不到两年,51%的人使用npm不到两年。这是社区不断壮大的副作用。
2、We are mostly self-taught. 69% of npm users mostly taught themselves JavaScript, with the next highest being 22% who learned on the job.
2、大部分是自学的。69%的npm用户是自学的JavaScript,22%的人是在工作中学习的。
3、We don’t just write JavaScript. People who use npm aren’t always strictly JavaScript developers — 30% each report writing Java, PHP, and Python, and smaller numbers of lots of other languages.
3、不仅仅使用JavaScirpt。npm的使用者并不都是严格的JavaScript开发者 —— 30%的人还使用Java,30%还使用PHP,30%使用Python,还有其他的一些语言。
4、We don’t just work at “tech” companies. 55% of npm users describe themselves as working at a company that wouldn’t be considered a “tech” company.
4、并不在科技公司工作。55%的npm使用者表示他们并不在一个可以被称为【科技】公司的地方工作。
There are also some ways that npm users don’t differ from the general population of software developers, which is itself interesting. For example, npm users work at every size of company, in roughly the same proportion as those companies exist. JavaScript isn’t a “big company” or a “small company” tech. npm users also are evenly distributed across every industry, as well as other demographics such as age and education level.
同时,在某些方面,npm用户与软件开发人员并没有什么不同,这本身是很有意思的事情。比如,npm使用者在各种规模的公司工作,与这些公司的分布比例大致相同。JavaScript并不是一个'"大公司技术"或"小公司技术"。npm用户分布在各个行业,也有着不用的年龄段以及受教育程度。
Everybody would like less tooling
每个人都希望少用工具
JavaScript in 2018 is somewhat notorious for requiring a lot of tooling to get going, which is quite a reversal from the situation in 2014, when Node.js was considered an “everything included” framework. Today, most developers wouldn’t consider Node to be a framework at all. True to that, all of our survey respondents would like to see less tooling, less configuration required to get started, and better documentation of the tools that do exist. But what tools?
2018年的JavaScript,在某种程度上是令人诟病的。因为你需要引入很多的工具才能让代码跑起来。这和2014年的情况是相反的。2014年的时候,Node.js被认为是一个 "包含所有" 的框架。今天,绝大多数的开发者根本不会把Node.js当做一个框架。诚然,我们所有的被调查者都希望使用更少的工具,更少的配置就能开始开发,也希望看到更完善的文档。那么,他们喜欢的是什么样的工具呢?
We went in-depth into the popularity of JavaScript frameworks in our “State of JavaScript Frameworks” series (part 1, part 2, part 3) earlier this year. We won’t reiterate all the findings of that analysis, but rather dive into a few updates of what’s changed in the 9 months since then.
今年初,我们深入调查了各种JavaScript框架的流行度,报告在这里part1(传送门)、part2(传送门)、part3(传送门)。我们不会在这里复述所有的分析结果,但我们可以一起来看看从过去的9个月都发生了些什么。
As a reminder, it’s important to understand the “share of registry” metric we are using here: a “flat” graph in this case means strong growth, just not growth relative to the growth of the registry, which is always growing quickly.
友情提醒,理解我们在这里使用的“注册份额”指标非常重要:在这种情况下,“平面”图表意味着强劲的增长,而不是相对于注册表增长的增长,注册表总是快速增长。
React’s growth has slowed
React增长放缓了
React continues to dominate the web scene. Over 60% of npm’s survey respondents say they are using React, and it has grown further since then. However, that growth in 2018 has been slower than in 2017.
React继续统治web榜。在npm的调查中,超过60%的受访者表示他们正在使用React。这个比例比年初时已经有不小增长。但是,React在2018年的增长速度较2017年已经放缓了。
Angular downloads have stayed flat
Angular的下载量保持平稳
The two major flavors of Angular combined have stayed roughly flat in terms of market share.
两种最主要的Angular版本结合起来,在市场份额方面基本保持不变。
Ember’s popularity has rebounded
Ember的流行程度反弹了
In a very unusual phenomenon, Ember’s popularity, which appeared to be declining, has continued a strong rebound. By September, more than twice as many developers were using Ember as at the beginning of the year. We’re going to keep a close eye on this story, but we think Ember’s resurgence is part of the explanation for the slowdown in React.
一个非常意外的现象,Ember的受欢迎程度本来在下降,但却迎来了强劲的反弹。到9月份,使用Ember的开发者人数已经比年初时的两倍还多。我们将继续关注这个情况。我们认为,Ember的反弹是React增长放缓的原因之一。
Vue’s strong growth has continued
Vue继续强劲增长
Vue was already growing quickly and that continued in 2018. Many Vue users report that they picked it over React because in their opinion it’s easier to get started while maintaining extensibility. Our current theory is that React’s growth has been slowed by many newer users picking Vue.
Vue在2018年继续强劲增长。许多Vue的使用者表示,他们之所以放弃React选用Vue,是因为Vue在保持扩展性的同时,比较容易上手。目前我们的观点是:许多新用户选择使用Vue,导致了React的增长放缓。
GraphQL continues hyper-growth
GraphQL持续高速增长
GraphQL, tracked by its most popular client library Apollo, continues to explode in popularity. We think it’s going to be a technical force to reckon with in 2019.
GraphQL,根据其最受欢迎的客户端库Apollo来看,正在变得越来越受欢迎。我们认为它将在2019年成为新的热门技术。
Transpilers rule, led by Babel — and a surprise: TypeScript
编译依然由Babel领衔,惊喜 - TypeScript
Babel is familiar to any React user as the tool used to transpile React’s next-generation JavaScript into the currently-supported JavaScript standards. In line with React’s 60% market share, 65% of npm users report using Babel. (It also has uses outside of the React ecosystem.)
所有的React使用者来说,Babel并不陌生,它被用来将React下一代的JavaScript转换成现在的语法标准。React占据了60%的市场份额,而65%的npm使用者正在使用Babel(Babel也在React的生态之外被使用).
Something of a surprise, however, was TypeScript, with 46% of survey respondents reporting they use Microsoft’s the type-checked JavaScript variant. This is major adoption for a tool of this kind and might signal a sea change in how developers write JavaScript. We are definitely going to be asking more questions about TypeScript usage in the next version of our survey.
令人略有意外的是,46%的受访者表示他们正在使用微软的带有类型检查的JavaScript - TypeScript. TypeScript的大量使用,也许预示着开发者书写JavaScript的方式将彻底改变。我们将在下一次的调查中,更多关注TypeScirpt的使用情况。
npm’s predictions for 2019
npm对于2019年的预测
It’s always difficult to make predictions about an ecosystem as huge, varied, and fast-changing as JavaScript, but our data has led us to make a few predictions for 2019 that we think we can commit to.
JavaScript拥有一个巨大,多变,快速发展的生态,对其进行预测是困难的。但是我们的数据可以使我们对2019年进行一定的预测。
1、You will abandon one of your current tools. Frameworks and tools don’t last in JavaScript. The average framework has a phase of peak popularity of 3–5 years, followed by years of slow decline as people maintain legacy applications but move to newer frameworks for new work. Be prepared to learn new frameworks, and don’t hold on to your current tools too tightly.
1、你将会放弃你现在使用的工具。JavaScript的框架和工具更新很快。框架的平均流行周期是3-5年。随着人们都在维护遗留的应用程序,框架的流行程度渐渐衰退。当人们开始新的工作时,他们将使用新的框架。做好准备学习使用新的框架吧,不要死抓住你现在的工具不放。
2、Despite a slowdown in growth, React will be the dominant framework in 2019. 60% market share for a web framework is unheard-of, and that’s partly because React isn’t a full framework, just part of one. This allows it to flexibly cover more use-cases. But for building a web app in 2019, more people will use React than anything else, and that will result in a big advantage in terms of tutorials, advice, and bug fixes.
2、尽管增速放缓,React在2019年仍将是最有统治地位的框架。60%的web框架时长份额是前所未有的,部分原因是:React并不是一个完整的框架,而只是其中的一部分。这使得React可以在更多场景灵活使用。2019年,更多的人会使用React来开发web应用,这将为React在教程、建议以及Bug修复上带来优势。
3、You’ll need to learn GraphQL. It might be too early to put GraphQL into production, especially if your API is already done, but 2019 is the year you should get your mind around the concepts of GraphQL. There’s a good chance you’ll be using them in new projects later in the year and in 2020.
3、你需要学习GraphQL。在生产环境中使用GraphQL或许过早了,特别是在你的Api都已经完成的情况下。但是2019年,你应该有意识的接触GraphQL的概念了。当你在2019年末、2020年参与新项目时,这将是你使用GraphQL的好机会。
4、Somebody on your team will bring in TypeScript. 46% adoption implies that TypeScript is more than just a tool for enthusiasts. Real people are getting real value out of the extra safety provided by type-checking. Especially if you’re a member of a larger team, consider adopting TypeScript into your 2019 projects.
4、开发团队中将会引入TypeScript。46%的使用率表示TypeScript不仅仅是一个发烧友的工具。人们是真正体会到了类型检查提供的安全性所带来的好处。特别的,当你身处一个大组时,考虑在2019年使用TypeScript吧。
Stay tuned
敬请关注
One prediction we’re very confident in making is that this community will continue to rapidly grow and expand the capabilities of JavaScript. As it grows, we’ll be documenting new trends and sharing our insights with the community. You can follow along by subscribing to our weekly newsletter and following us on Twitter.
我们可以十分确信的做出预测:社区将会继续高速发展,JavaScript将会拥有很多的能力。随着它的增长,我们将记录新的趋势,并与社区分享我们的见解。你可以订阅我们的周报(传送门),在twitter(传送门)上关注我们,以了解最新的行业动态。
吹水
看完这份报告,其实大家只需要记住四件事:
1、JavaScript语言很牛X,值得学。
2、React是目前使用率最高滴。
3、需要学框架,也要学会放弃框架。
4、学会TypeScript
**** Hidden Message *****
新年快乐鸭 想学JS
页:
[1]