State of JavaScript 2017

It’s been two very active years since the release of ES6, and we’ve seen pretty substantial changes in how we build JavaScript applications. While some complain of fatigue, there’s never been a more exciting time to be a JavaScript engineer. So with the new year upon us, it’s time to look at where we are, and where things are going!

Current Trends

Reactive Architectures

ES6+ Features, Transpilation, and Patterns

Stronger JavaScript?

TypeScript is interesting in that types and interfaces are an authoring tool, but are removed from production JavaScript code. We’d love to see a system that can use type information to define constraints and validation rules for forms, which might help add further value. So while we expect that TypeScript adoption will continue to grow, it’s clear that the industry has agreed to disagree at this time.

State, a problem everyone has

React and first Flux and then Redux have recently got everyone thinking about how to manage state in a predictable manner for JavaScript applications. Angular 2 can be used with Redux, there’s a version of Redux for Vue.js users, and Dojo 2 has solid support for managing state in a manner similar to Redux, where the general approach is to manage the state of your app in an object tree. Changes in the state tree emit an action, and then reducers specify how actions transform the state tree.

Whether you follow this approach or one of many others, it’s become clear that state is a big challenge to get right in application architecture, and we’re still in the early stages of having an approach that makes a lot of sense. We’re at the point of having some very nice native language improvements, coupled with strong influences from other functional languages like Elm and PureScript.

Mobile and Progressive web apps

We’re still in the early days of widespread adoption, but the checklist of features and underlying technologies including Service Workers and Web Components are essential to make the web a completely competitive platform for the future.

In the interim, we still have intermediaries like PhoneGap/Cordova, React Native, NativeScript, IBM MobileFirst, Xamarin and Weex which allow us to use web technologies to create native mobile apps.

Rethinking the DOM

In parallel, the web components specification has also evolved, with the two primary features being Custom Elements and the Shadow DOM. Custom Elements are by far the most widely used feature of web components, allowing developers to define the initial configuration and state of a web component. This is performed through the registration of a Custom HTML Element and binding that component to relevant Markup, JavaScript, and CSS information. Its approach is very similar to the work done in the early days of Dijit, except that the API and capabilities are native to the browser.

The Shadow DOM holds the promise of masking a web component’s underlying DOM from the rest of the page, arguably making it safer and easier to work with CSS across components. Alternative approaches such as CSS modules exist to provide similar benefits to the Shadow DOM.

Overall it’s a very exciting time for improvements in how we work with the DOM. Reducing the time our applications spend rendering and repainting/reflowing during changes to application state, improves how we define and build applications.

WebVR

While we wait for native WebVR APIs, including game controller functionality to evolve, we also have A-Frame and React VR available. A-Frame extends the feature-rich but challenging to use Three.js library (which wraps the low level WebGL library). AFrame provides a DOM-based API for working with WebVR scenes and features, and React VR takes a React-based approach for building WebVR apps.

Where We’re Heading

High Quality WebVR

We remain hopeful that WebVR will prevent the need for Web to native VR intermediaries.

Decorator Growth

Externalization

Performance focus

React to Reactive

Functional Programming

Enterprise Features

We also see enterprises increasing embracing cloud computing, in particular AWS and Google Cloud. In particular features like AWS Lambda are particularly interesting to JS applications. We’re also curious to see how voice recognition and machine learning APIs from cloud providers are leveraged for future web applications, as well as features like web payments.

Choice

Originally published on SitePen.com

Modernizing Apps, Tools & Teams | sitepen.com | Twitter: @sitepen