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

feat: allow string value for port #3354

Merged
merged 5 commits into from May 28, 2021
Merged

feat: allow string value for port #3354

merged 5 commits into from May 28, 2021

Conversation

snitin315
Copy link
Member

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Motivation / Use-Case

Allow string for client.webSocketURL.port

Breaking Changes

None

Additional Info

No

@codecov
Copy link

codecov bot commented May 27, 2021

Codecov Report

Merging #3354 (b89d4fe) into master (cde0fdd) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3354      +/-   ##
==========================================
+ Coverage   95.65%   95.67%   +0.02%     
==========================================
  Files          33       33              
  Lines        1288     1295       +7     
  Branches      373      377       +4     
==========================================
+ Hits         1232     1239       +7     
  Misses         52       52              
  Partials        4        4              
Impacted Files Coverage Δ
lib/utils/normalizeOptions.js 98.37% <100.00%> (-1.63%) ⬇️
lib/utils/DevServerPlugin.js 97.16% <0.00%> (-0.95%) ⬇️
lib/Server.js 96.00% <0.00%> (+0.20%) ⬆️
lib/servers/WebsocketServer.js 97.05% <0.00%> (+2.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cde0fdd...b89d4fe. Read the comment docs.

@snitin315 snitin315 marked this pull request as ready for review May 28, 2021 01:14
Copy link
Member

@anshumanv anshumanv left a comment

Choose a reason for hiding this comment

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

Can we add a simple e2e so it doesn't fail during compilation?

@snitin315
Copy link
Member Author

Added 👍🏻

anshumanv
anshumanv previously approved these changes May 28, 2021
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

We also can have port: string and webSocketServer: { type: 'ws', options: { port: string } }, let's add these tests too, maybe will be great to move it in normalize and convert to Number to avoid working with different types:

if (typeof this.options.port === 'string' && this.options.port !== 'auto') {
  this.options.port = Number(this.options.port)
}

// Same for `websocketUrl.port` and `webSocketServer.options.port`

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Feel free to merge when CI will be green

@snitin315 snitin315 merged commit f5e7f8f into master May 28, 2021
@snitin315 snitin315 deleted the string-port branch May 28, 2021 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants