Skip to content

Comment on Ask HN: Why this bloat in Angular?parent

Comments

I am not sure about the specifics of Angular (I hate it), but in this sense it is similar to other frameworks of the time.

Vue, React, etc all use a transpiler to turn their code into code compatible with as many browsers as possible. The end result is that the syntactic sugar and niceties of the more modern JS specs get removed and replaced with their older counterparts. A popular tool for this is Babeljs.io

Modules themselves are new in browsers as well, so what actually tends to happen is that they don't just all get concatenated and use global variable scope but a module essentially becomes an enclosure, and all the enclosures are linked to one another at compile time. So there is usually no global variable called "Angular".

So if you generate an Angular app with their CLI, they pre-install all those build steps (along with Typescript, minification, etc). You get Angular using the transpiled module system out of the box.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.