angular: over 290 xhr requests to bootstrap hello world app (many duplicated)

Steps to reproduce and a minimal demo of the problem

create a new A2RC1 app with angular-cli:

ng new blah
cd blah
npm start

load the page with your dev tools open and observe that it submits over 290 xhr requests at startup. beta-14 (from which we just upgraded) loads about 40.

Current behavior

more than 290 requests. (>600 once our 20-30 client-side classes are added)

Many of these requests are duplicated, e.g. exception_handler.js, base_wrapped_exception.js, and collection.js.

Expected/desired behavior

Far fewer requests.

Other information

This many requests is going to KILL us at roll-out time.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 6
  • Comments: 27 (6 by maintainers)

Most upvoted comments

FWIW, there’s no mention of anything being “mostly for plnkers” in the docs, nor any mention of having to build bundles on one’s own (nor any mention of how to do it). They say, paraphrased, “do this, and there’s your app. See how easy that is?”

When we spent a week evaluating/testing A2 it did not have this deficiency, and then blam, it suddenly it does, and the onus is on each and every client app to find its own solution?

What a huge kick in the balls.

(long rant snipped)

Well, i now know what i’ll end up having to do next week, after we explain to the customer during Friday’s end-of-sprint demo that “no, it won’t perform 637 [at last count] XHR requests at startup when we deliver it [in 5 weeks]”…

angular 2 quick start very very slow, it kills development, ~303 http request, ~ 8 sec

very-slow

i beg to differ. Those tickets vaguely describe several script-kiddie half-solutions which do not work out of the box like A2 did before this breaking change. All require significant effort on the client’s side to both understand them and get them working (i spent 2 hours this morning trying unsuccessfully to do both).

This is a major kick in the balls to your users.

In my case a tiny app (I’m not using CLI) makes 350 requests and it takes 4 sec just to see the app. Angular 2 should have remained in beta for a while after introducing so many breaking changes. Announcing RC was premature and can seriously hurt the adoption.

I also agree the new “build” solution is not helping during the development phase as described in #8456

But issues stay closed 😦

This issue is not helping any pro-angular arguments at my company.

I have created my own bundle of Angular2 and required files for doing the plunkr type transpiling in browser. The number of requests are very few (4 to 5). Here is the github project. Also if you don’t want to build it, just download the “release” and see the example folder and the “dist” folder in it.

ng2-bundle ng2-bundle-release

Agreed completely with @sgbeal. The quickstart shouldn’t be “mostly for plnkr”, it’s what everyone starting out with angular2 will be using to structure their app, and currently every single developer will be running into this. Does the “5 minute quickstart” refer to the time your hello world takes to load?

This isn’t even a production issue, this is a development, first few lines of code in angular2 issue.

yep, a proper solution is contained in the linked issues. thnx @adamwuyu

@ericmartinezr that’s not a useful argument. 99+% of angular users follow the docs from the angular team, which say, “do this and this and it works,” and then it works. And suddenly, after an update, it increased the number of requests by 15x, and starts duplicating requests, loading some of the same files many times each. This is all going on under the hood - the users are not loading this stuff. It’s being loaded by deps of deps of deps of deps. We most certainly did not “use the bundles distributed with previous versions” on purpose - they are part of the infrastructure, not part of our apps.