Skip to content

Differential loading is not working with ng serve / ng build --watch command #14911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SathyaChenniappan opened this issue Jun 26, 2019 · 10 comments

Comments

@SathyaChenniappan
Copy link

SathyaChenniappan commented Jun 26, 2019

Differential loading is not working with ng serve/ng build --watch command. I am using angular 8.

@suhasdeshpande
Copy link
Contributor

First one is generated when I build the project without watch mode.

Screen Shot 2019-06-26 at 4 50 11 PM

This one's with watch mode and it does not create differential bundles. Is this expected behavior or bug?
Screen Shot 2019-06-26 at 4 49 43 PM

@mgechev
Copy link
Member

mgechev commented Jun 27, 2019

Since we want to speed up the development round trip time, it's intentional to not have differential loading on ng serve.

@alan-agius4 can comment about ng build --watch.

Is there any particular reason you need differential loading on ng serve?

@alan-agius4
Copy link
Collaborator

Hi, yeah it is expected that —watch will not trigger differential loading, the main reason for this that we are running builds sequentially which would make the watch experience slower.

@suhasdeshpande
Copy link
Contributor

Alerts
I don't have a very good reason for asking this.

I am in process of migrating angularjs project over to CLI. Our Frontend is served using Rails assets pipeline and Frontend has very tight coupling with Rails. Reason to use watch is so that I can still get reasonable updates when I change Angular code but at the same time don't have to modify my hand-written script tags in Rails ERB template. I understand why this should not be the case but it would be nice if I can provide a flag knowing I will have slower experience to get the same bundles during this process.

@mgechev
Copy link
Member

mgechev commented Jun 27, 2019

Just to make sure I understand, you use this process for development, right? Why is differential loading crucial in the process? Why you can't use only the ES2015 output?

@suhasdeshpande
Copy link
Contributor

suhasdeshpande commented Jun 27, 2019 via email

@cafesanu
Copy link

cafesanu commented Jul 9, 2019

Hi @mgechev, the main reason at least for me is that we test locally ie11 via browserstack before we deploy. Is there a way to do this? I tried ng serve --prod but it still doesn't work

@mgechev
Copy link
Member

mgechev commented Jul 10, 2019

@cafesanu you can build the app (ng build --prod) and serve it with any static web server (for example serve, serve -s dist/[project-name])

@cafesanu
Copy link

cafesanu commented Jul 10, 2019

Thanks @mgechev. Yeah that's is what we've been doing. The only issue is that the dev cycle gets really slow this way as every single change needs the app to be built from scratch, so I end up wasting a lot of time (plus no sourcemaps, although I thing --source-maps would do the trick).

I totally understand your comment "we want to speed up the development round trip time", but the ironic part is that when we are testing ie11 (not all the time) then the dev cycle becomes painfully slow. I think it should of course not be the default with ng serve, but a flag, something like ng serve --diff-loading would be super nice

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants