2 ms·
Plain JavaScript is of course faster. Not doing something is always faster than doing something. But highly interactive web apps have some problems that need to
by cyco130 4y ago
Plain JavaScript is of course faster. Not doing something is always faster than doing something. But highly interactive web apps have some problems that need to be addressed:
First is syntax extensions: TypeScript (a strictly type JavaScript superset), JSX (a syntax extension for describing DOM nodes popularized by React) and special template syntaxes of other UI libraries/frameworks like Vue and Svelte need to be processed before being sent to the browser. You may also need processing to iron out some of the incompatibilities between JS engines but it's less important nowadays since the IE died.
The second problem is the sheer size: Highly interactive web applications have lots of moving parts. For example at work, my company's product's frontend code contains 4709 modules, roughly 3/4 of which are 3rd party libraries. At this scale you need some level of optimization (like eliminating unused bits of the libraries) and the ability to split the bundled code into chunks depending on what pages they are used.