1

Last month, Microsoft just announced its support for a proposal "on the further development of JavaScript and TypeScript", although this is only a so-called Phase 0 proposal, but Microsoft has announced that it hopes to submit the proposal to TC39 (Technical Committee 39) on time. Some industry developers say that if this proposal is adopted and implemented, it will usher in a sea change for JavaScript and TypeScript.
(Related reading: https://segmentfault.com/a/1190000041543960 )

JavaScript's 20-year history

Looking back over the past 20 years, if we compare web development now and then, we see that while JavaScript as a programming language has grown a lot, the ecosystem around JavaScript has progressed and developed a lot.

The reason for this is due to: first, the JavaScript community has become more specialized over the past 20 years; and second, a fundamental problem with the Internet has become more and more important. At the same time, the above two points are mutually necessary.

As we all know, as developers, we have no control over which browsers our users will use. That is, users can only use the latest features of JavaScript if they update their browsers regularly. Of course this is also a summary of the individual user situation, as many browsers now update automatically, or instruct them to do so without asking.

But for companies, that's not the case (perhaps due to corporate regulations on software and software updates). Many companies often use outdated software, or use outdated browsers to surf the Internet, which also affects HTML and CSS, and the programming language must also be interpreted by the respective browser, so there is a great dependency.

At this point, as web developers, we will have to choose between two concepts: either relying on modern JavaScript, CSS or HTML features that simplify programming or bring better results in terms of usability, or rely on outdated Browsers cannot provide these modern features for everyone (upgrades may cause bugs for a certain number of users).

Other than that, there hasn't been a decent JavaScript module system in decades. And Node.js got the standard with CommonJS, but that's only for the server.

About ten years ago, nothing happened in the browser for a long time, which is why Bundler came along with the transpiler. Even though you're using a JIT (just-in-time) compiled programming language that executes just fine, you always have to deal with a complex build process that converts source code into actual code, which is then executed and interpreted in the browser (this is about ten years ago).

The rise of TypeScript

Ten years ago, Microsoft invented TypeScript. Microsoft believes that "if you need a transpiler to transform JavaScript code before deployment, then adding a step to this build process won't be a big deal".

In the process, developers get a transpiler that converts modern JavaScript into plain JavaScript. Additionally, TypeScript is a static type system that makes JavaScript more scalable, making an important contribution to the efficient development of JavaScript by teams.

It's no wonder that TypeScript quickly established itself as the standard for enterprise JavaScript development today.

Ten years later, the world has changed. While those browsers that don't update are still "alive", they play a much smaller role today than they did in the past.

So, browsers like Evergreen now work without a transpiler, and with ESM (ECMAScript Modules), also includes a native JavaScript-based module system that works both server-side and client-side.

This way, the bundler is unnecessary, at least from a technical point of view. The bundler is just one more step in optimizing HTTP requests so that fewer small files can be loaded from the server, just a few large ones. At the same time, the build process will gradually become simpler or less relevant.

Currently, Microsoft expects the only remaining necessary tool in the future to be the TypeScript compiler, as web browsers and other JavaScript runtime environments simply cannot understand TypeScript.

That said, Microsoft or TypeScript suddenly went from a very useful tool to a rather "annoying" thing. In this regard, Microsoft said that they do not want to be a hindrance, on the contrary, they want to motivate developers.

Of course, Microsoft is also worried about this - sooner or later JavaScript development will be as fast, direct, and efficient as it was 20 years ago, because sooner or later if you don't use TypeScript, things like Transpiler will be obsolete.

Currently, one way to reassure you is to require the integration of TypeScript in web browsers and other runtime environments as an alternative programming language to JavaScript. In theory, this is not far-fetched.

Also, TypeScript is now a more complex programming language, and Microsoft doesn't want to integrate all the functionality of the TypeScript compiler directly into common web browsers. This will be a very complex task that will require the cooperation of Apple, Google, Mozilla and others to integrate a new big standard.

Of course, Microsoft shouldn't want to do that, hence the new proposal "On Further Development of JavaScript and TypeScript" from March.

So, should TypeScript remain completely independent, or will it become the "new JavaScript"? In any case, we may see developments on this proposal in the next few years.


MissD
955 声望40 粉丝