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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docz-core): auto open browser when start dev mode #774

Merged
merged 2 commits into from Apr 10, 2019

Conversation

fi3ework
Copy link
Contributor

@fi3ework fi3ework commented Apr 7, 2019

Description

Auto open bowser when running dev mode(just like create-react-app). Or we could determine if auto open browser in command, such as docz dev -o. For now, I made it as default cause auto-open directly might be more in line with the intuition.馃

@fi3ework fi3ework changed the base branch from master to dev April 7, 2019 14:48
@Glazy
Copy link
Contributor

Glazy commented Apr 8, 2019

Nice @fi3ework! 馃敟

Not sure what @pedronauck thinks (?) but I think it would be good to introduce this functionality behind a flag like you suggested (-o) 馃憤

@pedronauck
Copy link
Member

pedronauck commented Apr 8, 2019

I think that since this feature is something native in webpack-dev-server we could have some argument like -o, but just use the flag to set the option like that:
https://webpack.js.org/configuration/dev-server/#devserveropen

@fi3ework
Copy link
Contributor Author

fi3ework commented Apr 9, 2019

hi @Glazy @pedronauck 馃:
I made it optional now, the argument to enable it is docz dev --open or docz dev -o. But for now still not use the native open browser method from webpackDevServer. The current open browser file is copied from create-react-app. I guess this custom open function might be more robust and reliable than the native open browser method from webpackDevServer(not confirmed, just speculate). Any suggestions for improvement?

@fi3ework
Copy link
Contributor Author

fi3ework commented Apr 10, 2019

I took a closer look at the code, may it's better to implement openBrowser in plugins, just adjacent to friendlyErrors 馃

@pedronauck pedronauck merged commit c0e6c13 into doczjs:dev Apr 10, 2019
pedronauck added a commit that referenced this pull request Apr 10, 2019
* 'dev' of github.com:pedronauck/docz:
  fix(docz-theme-default): table media query style (#782)
  feat(docz-core): auto open browser when start dev mode (#774)
fi3ework added a commit to fi3ework/docz that referenced this pull request Apr 15, 2019
* feat(docz-core): auto open browser when start dev mode

* fix(docz-core): optional open browser when starting dev
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