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

Auto Increment Port #263

Closed
wants to merge 3 commits into from
Closed

Auto Increment Port #263

wants to merge 3 commits into from

Conversation

al5ina5
Copy link

@al5ina5 al5ina5 commented Aug 19, 2020

Silently bumps the IP address if taken. Quick fix for several of the reported issues.

Copy link
Owner

@alallier alallier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something makes my spidey senses tingle by auto incrementing an explicit port in an application automatically with no choice at all.

I'm inclined to only allow auto incrementing a port on the command line side of reload (which currently has a PR open #262) but I think there is a possible argument to be made that reload is development only feature and auto incrementing the port in a development environment can make things easier. I'd like to call on @kethinov and @Autre31415 for some second opinions here.

Depending on the result of this conversation the following action items required are:

  • Put the auto increment behind an option and provide a console log stating that an auto increment occurred and what the new port reload is running on
  • Re-run the GitHub Actions and fix errors
  • Write tests

@@ -57,7 +57,7 @@ module.exports = function reload (app, opts, server) {
}

// Application setup
setupClientSideCode()
// setupClientSideCode(port)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being done below in your changes so please remove the old call here

@kethinov
Copy link
Contributor

Some thoughts:

  1. Auto-incrementing by default seems fine to me. I really see no drawbacks.
  2. I agree that it should be a feature that is configurable and can be turned off.
  3. The constructor should return the port number that was chosen so the app instantiating reload has that info if they should need it.

alallier added a commit that referenced this pull request Nov 19, 2020
… the port if it is already in use. This commit adds the following to the existing work:

* Added new tests
* Added the port to reload's return object so the calling program knows what port reload ending up using if the port auto increments
* Added autoIncrementPort optional param to realod to turn off auto port incrementing. Default `true`
* Tweaked the code to work correctly, like handling the promise return correctly
* Small tweaks to how the generated client side code replace works. Removed a branch that wasn't hitting in coverage and made it more readable
* Updated README with API changes
@alallier
Copy link
Owner

Closing in favor of #278

@alallier alallier closed this Nov 19, 2020
alallier added a commit that referenced this pull request Nov 21, 2020
… the port if it is already in use. This commit adds the following to the existing work:

* Added new tests
* Added the port to reload's return object so the calling program knows what port reload ending up using if the port auto increments
* Added autoIncrementPort optional param to realod to turn off auto port incrementing. Default `true`
* Tweaked the code to work correctly, like handling the promise return correctly
* Small tweaks to how the generated client side code replace works. Removed a branch that wasn't hitting in coverage and made it more readable
* Updated README with API changes
alallier added a commit that referenced this pull request Nov 21, 2020
… the port if it is already in use. This commit adds the following to the existing work:

* Added new tests
* Added the port to reload's return object so the calling program knows what port reload ending up using if the port auto increments
* Added autoIncrementPort optional param to realod to turn off auto port incrementing. Default `true`
* Tweaked the code to work correctly, like handling the promise return correctly
* Small tweaks to how the generated client side code replace works. Removed a branch that wasn't hitting in coverage and made it more readable
* Updated README with API changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants