Subscribe to my email list now at http://jauyeung.net/subscribe/
Follow me on Twitter at https://twitter.com/AuMayeung
Many more articles at https://medium.com/@hohanga
Even more articles at http://thewebdev.info/
JavaScript is a programming language that's evolving fast, with features that have caught up to or exceeds the feature set of competing languages. 2020 is the year of JavaScript. Lots of new stuff are being added to the JavaScript community.
Here're the top trends of the JavaScript community in 2020.
The Year of TypeScript
JavaScript doesn't have any mechanism to restrict the types of objects and variables on its own. Therefore, external help is needed. TypeScript is the top language for adding type checking to JavaScript.
It's very flexible and conforms to the features of the JavaScript's type system. It just makes everything more explicit and lets us restrict the type of our data and the structure of our JavaScript objects.
TypeScript is supported by many libraries and frameworks like Vue, React, Angular and Express. Many libraries have TypeScript types associated with them via Microsoft's TypeScript language server or type files.
With it, we get autocomplete in our code editors and type checks in our compilers. It helps prevent many type errors that people encountered without TypeScript.
React Reigns
React continues its momentum as the top front end library. It's used by many large companies for the web UI of their products.
It has a big community of libraries and developers associated with it and it's still evolving.
Function components with hooks are offered as a replacement for class-based components and help remove any confusion with this
and classes in class-based components.
There's Also Vue
Vue is the up-and-coming front end framework with a large number of libraries written for it and a growing community that's using it. More or more large companies are using it to build their apps.
It has a router and state management library that's associated with it, which is a Vue Router and Vuex. Together, it's a complete front end app development solution.
The Vue CLI is a great tool for creating new Vue projects. One unique feature of Vue is that it doesn't need build tools for it to be used. Many Vue libraries can also be included without build tools via a script tag.
That makes Vue great for enhancing legacy app front ends. It supports TypeScript and has testing right out of the box, which is another attractive feature of Vue.
Svelte Looks Promising
Svelte is another front end framework that has the component-based architecture. It also makes front end development easy and has a growing community around it.
It's more Vue that React in that it's a more complete solution, whereas React is only a view library.
GraphQL
GraphQL is replacing REST APIs in many places. It has strong typing for queries, which decreases the chance of making mistakes when we make HTTP requests. Also, it only returns the data that we want since we have to specify the fields that we want to query if we want to query a GraphQL API.
It also supports file uploads and custom types via 3rd party libraries. We can also make our own scalar types.
Conclusion
The development of the JavaScript ecosystem is continuing at a breakneck pace to make developer's lives easier. Therefore, there's no better time to embrace the JavaScript community and start developing apps with JavaScript.
TypeScript and frameworks make developing apps easier than error, allowing us to deliver more results in less time.
Top comments (5)
Express supports typescript, really? The express ts support its a joke, and a bad one
At least there's this scaffold to start github.com/Microsoft/TypeScript-No...
Thats not what I was talking about, but take for example req.data, you can't safely use it, a good example of how to do things is koa, where Middleware is generic amd takes a type for your state so you dont have to worry about combinding middleware in wromg ways
I think you have to make your own interfaces and type aliases to type the objects and return types of middleware the way you want. You can have dynamic properties in interfaces.
It's probably not as good as types built into libraries but at least it's an option.
I wasnt saying you cant do it, but its harder than it needs to be and not as flexible