Skip to content
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

ng serve --poll #10559

Closed
buu700 opened this issue Apr 30, 2018 · 12 comments
Closed

ng serve --poll #10559

buu700 opened this issue Apr 30, 2018 · 12 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone

Comments

@buu700
Copy link
Contributor

buu700 commented Apr 30, 2018

Was the --poll flag removed in v6, or is that just an error in the newly committed docs? As per #5212 it's needed to support Docker on Windows, which is still the case as far as I'm aware.

@filipesilva
Copy link
Contributor

@buu700 it's still there, but it is a build option and not a serve option. If you add it to projects.project-name.architect.build.options.poll it should work. I tried it on a new project modifying templates and ts files with a 10000ms poll and saw rebuilds.

@buu700
Copy link
Contributor Author

buu700 commented May 1, 2018

Got it, thanks! It'd be easier to use as a command line flag since our serve script conditionally adds it based on whether the host OS is Windows, but not a blocker since copying and transforming angular.json is an option too.

@filipesilva
Copy link
Contributor

You can create a configuration that contains poll, and conditionally use that:

"build": {
  ...
  "configurations": {
    "docker": {
      "poll": 2000

Then use that one on serve. WDYT? Or maybe poll should be on serve as well, as we do have some duplicated options there.

@filipesilva filipesilva added this to the v6.0.0 milestone May 1, 2018
@filipesilva filipesilva added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 1, 2018
@buu700
Copy link
Contributor Author

buu700 commented May 1, 2018

Ah, that could possibly work. Would I be able to stack that with another configuration, like --configuration beta --configuration docker (as I understand, --configuration now replaces --environment?), or would I need to make two different versions of beta in this case?

@filipesilva
Copy link
Contributor

We're adding it to dev-server on angular/devkit#822, but I would like to mention that configuration extensibility/composability is on the radar. ATM there is neither.

@buu700
Copy link
Contributor Author

buu700 commented May 1, 2018

Awesome, thanks! So that will add --poll back to the serve command?

@filipesilva
Copy link
Contributor

Yeap, it should be on the next release of @angular-devkit/build-angular!

@hbarve1
Copy link

hbarve1 commented Sep 26, 2018

poll option is still not available in @angular/[email protected] serve!

is there any other way to enable poll option?

@rogusdev
Copy link

rogusdev commented Nov 19, 2018

The new option is better than the old: it takes an argument for the milliseconds time to wait between polls. (You can see this in the commit referenced above.) However, if you simply pass --poll it has no default so it appears as if it is not working...

ng serve --host 0.0.0.0 --poll 200

^ Works as expected in vagrant on win10 host

ng serve --host 0.0.0.0 --poll

^ Does no polling, so perhaps a sensible default should be added? 500 or 1000 ms?

@maroom1
Copy link

maroom1 commented Aug 20, 2019

I am new to this option, when do you use this poll.. can anybody help on atleast one usecase? where it helps.

Thank you

@clydin
Copy link
Member

clydin commented Aug 24, 2019

@rogusdev The next version (9.0) will default to 500ms if the poll option is provided without a value. #15417

@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 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

6 participants