Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants