plouc / mozaik-demo

Sample mozaïk app with two dashboards
http://mozaik.rocks/
103 stars 75 forks source link

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

Closed smithandrewl closed 5 years ago

smithandrewl commented 5 years ago

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 commented 5 years ago

What's the behavior regarding output?

plouc commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.