The language itself has come an extremely long way from being used as only a facilitator of interactions on websites to a fully-fledged, universally useful programming language. We will take you on a journey from its creation to the TypeScript days.
Asynchronous actions in the browser
At one point, people woke up, realising that more can be done. Pages still had to completely reload to show new information, which resulted in a slow and inefficient process. There had to be a way to prevent websites from reloading to get and process new data, right?
The first widespread example of such an innovation was when Microsoft allowed Internet Explorer 5 to make HTTP requests. In 1999, they implemented an object called “XMLHttpRequest” which allowed for getting data from an external source without reloading the page.
Why was this functionality even implemented? Long story short, MSFT did that just so Outlook’s website fetched emails in the background. The long-term effects were much more than making one website run better.
According to Monika Mazurczak, Frontend Developer at ITMAGINATION:
jQuery – building for different browsers without a headache
In 2006, the world saw a solution that aimed to address the problem. Fourteen years ago, jQuery saw the light of day, abstracting the differences in implementations. The image you see above was how jQuery handled the differences in implementations between browsers. What you see below is just calling the “jQuery.ready()” function after a page finishes loading.
Do you know how would it look like now? Thanks to the standardization of implementations, it is pretty straightforward. There are few ways to go about this, and this is one of them:
In comparison, React.js, which is widely regarded as a modern standard for front-end development, React is used on 43.7% of the top 10,000 most popular pages. When it comes to the front-end side, jQuery was the final important step to get the ball rolling. Consistency across browsers allowed developers to create the apps they wanted to, but previously couldn’t.
2009 – arguably the most important year for the ecosystem since the release
One of these events was the initial release of Node.js, the other one being the first revision of the language – ECMAScript 2009 (better known as ES5) saw the light of day.
You see, when you are thinking about writing an app that will get bigger than your standard beginning starter projects, you will run into problems sooner or later. Strongly typed languages, such as Java or C# give you a layer of safety – they will catch some bugs themselves, without having to involve you, the developer, in any way. That’s because they will ensure the correctness of the code themselves upon running it.
TypeScript Comes To The Rescue
It has some features that made it extremely popular among the pros.
Third of all, TypeScript integrates with e.g. React and Vue on the front-end seamlessly. On the backend, all major libraries work with TypeScript out of the box. Nest.js uses TS by default; while Express.js and Fastify have their additional type definitions for you to install and forget.
360° IT Check is a weekly publication where we bring you the latest and greatest in the world of tech. We cover topics like emerging technologies & frameworks, news about innovative startups, and other topics which affect the world of tech directly or indirectly.