Skip to content

[WIP]: add "open" option to node api to allow opening in browser #1627

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

Conversation

amilajack
Copy link

  • 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

Node api does not support open option

Breaking Changes

Additional Info

@amilajack
Copy link
Author

amilajack commented Jan 16, 2019

Does this conflict with #1540?

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #1627 into master will decrease coverage by 0.24%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1627      +/-   ##
==========================================
- Coverage   74.27%   74.02%   -0.25%     
==========================================
  Files          10       10              
  Lines         688      693       +5     
==========================================
+ Hits          511      513       +2     
- Misses        177      180       +3
Impacted Files Coverage Δ
bin/utils.js 51.85% <ø> (+7.4%) ⬆️
lib/Server.js 79.33% <28.57%> (-1.89%) ⬇️

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 349e733...7f326f8. Read the comment docs.

`${openMessage}. If you are running in a headless environment, please do not use the --open flag`
);
});
}
Copy link
Member

Choose a reason for hiding this comment

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

Don't move this from utils

if (this.options.open) {
const suffix = (this.options.inline !== false || this.options.lazy === true ? '/' : '/webpack-dev-server/');
const uri = createDomain({ host: hostname, port }, this.listeningApp) + suffix;
openBrowser(uri, this.options, this.log);
Copy link
Member

Choose a reason for hiding this comment

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

It is should be in listen event and remove logic for open from bin file

Copy link
Author

Choose a reason for hiding this comment

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

remove logic for open from bin file

I'm not sure what do you mean by this. The previous comment says that open logic should be kept in bin

Copy link
Author

Choose a reason for hiding this comment

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

Also socksjs doesn't seem to register a 'listen' event. On what object should i listen for and where should i call it?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

But if I listen with express what port should i listen on? Also i don't understand the reason for listening on another port with express. Can you please explain this.

@amilajack
Copy link
Author

@evilebottnawi @michael-ciniawsky it seems like #1540 does the same thing as this PR. Should this PR be closed in favor of that PR?

@alexander-akait
Copy link
Member

@amilajack PR was abadoned, so you can continue develop

@codecov-io
Copy link

codecov-io commented Mar 14, 2019

Codecov Report

Merging #1627 into master will decrease coverage by 0.24%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1627      +/-   ##
==========================================
- Coverage   74.27%   74.02%   -0.25%     
==========================================
  Files          10       10              
  Lines         688      693       +5     
==========================================
+ Hits          511      513       +2     
- Misses        177      180       +3
Impacted Files Coverage Δ
bin/utils.js 51.85% <ø> (+7.4%) ⬆️
lib/Server.js 79.33% <28.57%> (-1.89%) ⬇️

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 349e733...7f326f8. Read the comment docs.

@hiroppy
Copy link
Member

hiroppy commented Apr 29, 2019

friendly ping @amilajack

@hiroppy hiroppy mentioned this pull request May 11, 2019
6 tasks
@hiroppy hiroppy closed this May 11, 2019
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.

4 participants