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

fix(@angular-devkit/build-angular): passing port 0 when using serve w… #13919

Merged
merged 1 commit into from Mar 19, 2019

Conversation

Projects
None yet
5 participants
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Mar 14, 2019

…ill not find a suitable port

At the moment, when passing port 0 it will default to 4200 which is incorrect. 4200 should be used a baseport.

This is the same as https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/dev-server/index2.ts#L127

fix(@angular-devkit/build-angular): passing port 0 when using serve w…
…ill not find a suitable port

At the moment, when passing port `0` it will default to `4200` which is incorrect. `4200` should be used a baseport.
@clydin

This comment has been minimized.

Copy link
Member

clydin commented Mar 14, 2019

That entire function should technically be bypassed if the port is zero. The OS knows how to properly handle allocation of the port and can do it far more efficiently than the manual method employed in the check port function.

@alan-agius4

This comment has been minimized.

Copy link
Collaborator Author

alan-agius4 commented Mar 14, 2019

@clydin, totally agree and I think it should be changed through the number of builders that are using it.
I'll try to fit that refactoring and removing the check port method in the coming days, before the RC.

Although in some cases, we rely on the fact of knowing the port before starting the server.

@alexeagle alexeagle merged commit 20a644e into angular:master Mar 19, 2019

12 checks passed

ci/angular: merge status All checks passed!
ci/angular: size No size change against base branch.
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build-bazel Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-large Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@alan-agius4 alan-agius4 deleted the alan-agius4:fix-port-zero branch Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.