This article is more than 1 year old

JavaScript survey: React everywhere, Jest, Webpack on the up... if only it had static typing, sigh developers

The world's favourite language has complex ecosystem in which build tools are now fundamental

The 2020 State of JavaScript report, a survey of over 23,000 developers globally, has revealed growing use of WebPack and Jest, continuing high use of React, Express and TypeScript, and that top of the wishlist is no longer better browser compatibility, but rather static typing.

JavaScript is the most used programming language according to most rankings. Originally called LiveScript and designed in 10 days in 1995 by Netscape's Brendan Eich to work alongside Java Applets, the little language has become the universal language.

Trends in the JavaScript ecosystem are therefore significant, but the fact that Webpack tops the list of most used technologies says a lot about modern JavaScript development. Webpack is a module bundler which runs on Node.js and has plugins for tasks such as minifying JavaScript using Terser. Webpack does tree shaking, meaning that it strips out unused code.

That sounds a lot like a compiler, and that is the story today, not just HTML, CSS and JavaScript, but source code, libraries, modules, and a build process that puts them all together into something that a browser can run. The same is true of CSS: rather than write CSS directly, many developers use Sass to write code that gets compiled to CSS.

This chart of JavaScript technology trends shows most used technologies as well as those most liked: the top right quadrant is the best place to be.

Click to enlarge

The demographics of the survey are depressing for those who yearn for inclusivity, with 91.1 per cent reporting as male, down from, um, 91.3 per cent in 2019, and 82.4 per cent choosing English to complete the survey even though other languages were available.

Asked "what do you feel is currently missing from JavaScript?" the overwhelming top choice was static typing, suggested by nearly 1,000 of those surveyed.

The second choice was for standard libraries, with 239 votes. JavaScript can be a prickly language, free and easy in one context, but unforgiving in another.

Static typing means more errors and typos are caught ahead of time, and introduces more discipline to the language. The demand for this is a big factor in the popularity of TypeScript, a strongly typed language that compiles to JavaScript, which is just behind Webpack, React and Express in the most used technologies according to the survey, with a significant increase in both popularity and satisfaction.

Notable is that only a few developers (62) singled out browser support as a big missing feature. Other than in some business environments, it seems that the struggle to get things to work in Internet Explorer is no longer as big a problem as it used to be. Microsoft's adoption of Chromium and the V8 JavaScript engine, as also used by Chrome, has helped with this.

When it comes to JavaScript frameworks, Facebook’s React retained its lead with 80 per cent usage, followed by Angular at 56 per cent (slightly declined from last year) and Vue at 49 per cent (slightly up). The satisfaction table is illuminating though, with React in second place behind Svelte. Angular has only a 42 per cent rating, up from 38 per cent last year, but perhaps an indication that future usage is likely to decline.

GraphQL, also originally from Facebook, is increasingly popular as a JavaScript data layer, though usage (47 per cent) is behind Redux (67 per cent). Satisfaction, though, is 94 per cent for GraphQL and only 67 per cent for Redux.

In back-end frameworks, used to run server-side code on Node.js or generate static web applications, the survey described Express as "the one dominant tool", with 80 per cent usage, but Next.js was the rising star, only 37 per cent usage (up from 27 per cent) but satisfaction at 92 per cent. Next.js is React-based so there is a strong React flavour to today’s JavaScript landscape.

How do you test a JavaScript application? Mostly with Jest (68 per cent usage, 96 per cent satisfaction) according to the survey, followed by Mocha at 53 per cent usage, 74 per cent satisfaction.

Future direction text

Is JavaScript development a tangled and bloated mess of different tools and frameworks, or a modern and magical route to rich applications that run everywhere? Opinions varied, but over 80 per cent of those surveyed felt that JavaScript is moving in the right direction, though many agree (39 per cent ) or are neutral (26.6 per cent) on the matter of JavaScript being "overly complex".

There is also some support, even amongst these JavaScript developers, that the language is over-used online (25.8 per cent agree, 27.1 per cent neutral). Nearly 90 per cent though said they enjoy building JavaScript apps – perhaps it is not overly complex after all.

Although Node.js barely got a mention in the survey, it is fundamental to today’s JavaScript stack, running it on the server and running tools and libraries in the application build process. That may change. According to another recent survey, this time of the projects most starred by developers on GitHub, the winner is Deno, a second go at a JavaScript runtime from Node’s creator Ryan Dahl.

"The success of Deno confirms two heavy trends," said the survey's authors. "The rise of TypeScript language in both frontend and client sides. The rise of ES6 modules imported on the fly by solutions like Snowpack."

What’s Snowpack? This is an alternative to Webpack that is based on the native module system introduced to JavaScript in its ECMAScript 6.0 specification. If there is one thing above all that characterises the JavaScript ecosystem, it is rapid change. Today, Node and Webpack, tomorrow Deno and Snowpack?

The full State of JavaScript 2020 survey is here. You can also check out the fancy code used to build the survey website which is on GitHub here. ®

More about

More about

More about

TIP US OFF

Send us news


Other stories you might like