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

'yarn start' now supports live reloading while developing #24

Merged
merged 1 commit into from
May 25, 2019

Conversation

smithandrewl
Copy link

yarn start runs the bac-kend API and the client concurrently, allowing for the live reloading of web pages while developing.

This fixes issue #23

@plouc
Copy link
Owner

plouc commented May 25, 2019

What's the behavior regarding output?

@plouc
Copy link
Owner

plouc commented May 25, 2019

I haven't used the concurrently package, that's why I'm asking, I'd like to have the logs from the server, and because CRA clears the output, I'm not sure this will be the case. Thank you.

@smithandrewl
Copy link
Author

Sure, I understand.

Here is the output of running it with yarn start (truncated for brevity):

 yarn start                         ±[yarn-start]
yarn run v1.15.2
$ concurrently --kill-others "react-scripts start" "node server.js"
[1] > using config file: 'conf/config.yml'
[1] 
[1] info: Registered API 'github' (mode: poll)
[1] info: Registered API 'travis' (mode: poll)
[1] info: Registered API 'gitlab' (mode: poll)
[1] info: Registered API 'mozaik' (mode: poll)
[1] info: serving static contents from /home/andrew/files/projects/mozaik-demo/build
[1] info: Mozaïk server started on port 5000
[0] [HPM] Proxy created: function (pathname) {
[0]         return mayProxy(pathname) && pathname.match(context);
[0]       }  ->  ws://localhost:5000
[0] [HPM] Proxy created: function (pathname) {
[0]         return mayProxy(pathname) && pathname.match(context);
[0]       }  ->  http://localhost:5000
[0] Starting the development server...
[0] 
[0] Compiled successfully!
[0] 
[0] You can now view mozaik-demo in the browser.
[0] 
[0]   Local:            http://localhost:3000/
[0]   On Your Network:  http://192.168.1.106:3000/
[0] 
[0] Note that the development build is not optimized.
[0] To create a production build, use yarn build.
[0] 
[0] [HPM] Upgrading to WebSocket
[1] info: Client #1EtyilVc4so2QaHCAAAA connected
[1] info: Added subscription 'travis.repositoryBuildHistory.plouc.mozaik.20'
[1] info: Calling 'travis.repositoryBuildHistory.plouc.mozaik.20'
[1] info: [travis] calling https://api.travis-ci.org/repo/plouc%2Fmozaik
[1] info: Creating scheduler for subscription 'travis.repositoryBuildHistory.plouc.mozaik.20'
[1] info: Added subscription 'travis.repositoryBuildHistory.plouc.mozaik.10'
[1] info: Calling 'travis.repositoryBuildHistory.plouc.mozaik.10'
[1] info: [travis] calling https://api.travis-ci.org/repo/plouc%2Fmozaik
[1] info: Creating scheduler for subscription 'travis.repositoryBuildHistory.plouc.mozaik.10'
[1] info: Added subscription 'github.user.plouc'
[1] info: Calling 'github.user.plouc'
[1] info: [github] calling https://api.github.com/users/plouc
[1] info: Creating scheduler for subscription 'github.user.plouc'
[1] info: Added subscription 'travis.repository.plouc.mozaik'
[1] info: Calling 'travis.repository.plouc.mozaik'
[1] info: [travis] calling https://api.travis-ci.org/repo/plouc%2Fmozaik
[1] info: Creating scheduler for subscription 'travis.repository.plouc.mozaik'
[1] info: Added subscription 'github.branches.plouc/mozaik'
[1] info: Calling 'github.branches.plouc/mozaik'
[1] info: [github] calling https://api.github.com/repos/plouc/mozaik/branches
[1] info: Creating scheduler for subscription 'github.branches.plouc/mozaik'
[1] info: Added subscription 'github.repository.plouc/mozaik'
[1] info: Calling 'github.repository.plouc/mozaik'
[1] info: [github] calling https://api.github.com/repos/plouc/mozaik
[1] info: Creating scheduler for subscription 'github.repository.plouc/mozaik'
[1] info: Added subscription 'github.pullRequests.plouc/mozaik'
[1] info: Calling 'github.pullRequests.plouc/mozaik'
[1] info: [github] calling https://api.github.com/repos/plouc/mozaik/pulls
[1] info: Creating scheduler for subscription 'github.pullRequests.plouc/mozaik'
[1] info: Added subscription 'github.organization.ekino'
[1] info: Calling 'github.organization.ekino'
[1] info: [github] calling https://api.github.com/orgs/ekino
[1] info: Creating scheduler for subscription 'github.organization.ekino'
[1] info: Added subscription 'mozaik.inspector'
[1] info: Calling 'mozaik.inspector'
[1] info: Creating scheduler for subscription 'mozaik.inspector'
[1] info: Caching response for mozaik.inspector subscription
[1] info: Added subscription 'github.repositoryContributorsStats.plouc/mozaik'
[1] info: Calling 'github.repositoryContributorsStats.plouc/mozaik'

I have been using this setup for a week or so and haven't had any issues so far. It shows the log messages (both console.log and mozaik.logger.info) from the custom extensions I have made.

Thank you for Mozaik!

@plouc
Copy link
Owner

plouc commented May 25, 2019

Nice! thank you for the feedback. I have a target in my makefile which does almost the same thing:

demo-start: ##@3 demo start demo
	@$(MAKE) MAKEFLAGS="-j 2" demo-start-ui demo-start-server

But this might be simpler for users to use an npm package.

@plouc plouc merged commit 81b62ff into plouc:mozaik-2 May 25, 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.

2 participants