0

I am trying to do some analysis on Angular 2 and React. One of the things I'm interested in is the size of the core libraries. In others, the minimum needed to get a "hello world" app to run in both.

From my understanding, React just requires the react.min.js file (https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js).

For Angular though, I'm confused. I look at the quick start on Plunkr, and I see four JavaScript files loaded. From my understanding, is optional, but recommended. But then I see zone.js, system.js and systemjs.config.web.js. Are all of these necessary? I just want the bare minimum.

Thank you

user687554
  • 10,663
  • 25
  • 77
  • 138
  • I get where you are coming from, and 'Hello World' is not a bad way to get a feel for different languages or frameworks; however, I don't think comparing minimal code sizes is relevant in this case. Here's why: If you are thinking about pulling in a MV* style framework then you are probably trying to do something less than trivial (if you were doing something trivial, http://vanilla-js.com/ is always going to take less code) and so you should be looking at the minimum needed to get the features you will specifically need – Jens Roland Feb 03 '17 at 13:19
  • @JensRoland - I understand what you're saying. However, I really want to see the minimum needed for an Angular 2 "hello world" app that runs in the browser. – user687554 Feb 03 '17 at 13:39
  • The question is tagged with angularjs. You're confusing AngularJS and Angular 2, they are different frameworks. SystemJS is for modules and Typescript/Babel support if Webpack is not available (like It is on Plunker). For A2 bare minimum is `zone.js`, Reflect metadata polyfill and several `@angular/...` packages. Don't estimate their size by the packages that were published as separate UMD JS files, they are WET and much smaller when being built with Webpack or Rollup (still big enough), and the size may vary greatly. – Estus Flask Feb 03 '17 at 14:43
  • @estus - Thank you for your response. If I'm understanding you correctly, zone.js is the only "required" file for an Angular 2 project. SystemJS is required if I need modules or typescript. However, since I'm interested in "hello world", I don't need SystemJS. Does that sound right? – user687554 Feb 04 '17 at 13:07
  • That's correct, and Reflect polyfill, too. When being used in non-modular environment, A2 exposes global `ng` object. See [this answer](http://stackoverflow.com/a/39029435/3731501) for how it looks like (plunk included). A2 looks really pale without ES6 or CJS modules because it doesn't have built-in modular system. The one will end with a bunch or globals or with inventing his own modular system in multi-file project. I would suggest to look at AngularJS or Vue for simplistic coding style. – Estus Flask Feb 04 '17 at 15:10
  • I second checking out VueJS for a fast, small-footprint library with elegant coding style – Jens Roland Feb 06 '17 at 09:54

0 Answers0