plouc / mozaik

Mozaïk is a tool based on nodejs / react / redux / nivo / d3 to easily craft beautiful dashboards
http://mozaik.rocks
MIT License
3.61k stars 363 forks source link

Improve DX when developing extensions #97

Open plouc opened 8 years ago

plouc commented 8 years ago

Must have

Nice to have

robblovell commented 6 years ago

Hi, Beyond development of extensions, is support being added for hot reload of the dashboard based on both adding of extensions and configuration changes? I guess this would look something like this:

Add a new extension to App.jsx & server.js, and/or changes to the config.js file would hot reload the dashboard. I would imagine in this mode, that changes to the jsx or js files would run weback and rerun the server. Changes to the config.js file would not require webpack reloads, but the server would need to watch for changes to the config file. (actually, I am unsure if the config file is change if webpack has to run...)

Is this the vision?

plouc commented 6 years ago

@robblovell, hot reloading UI is for development purpose only as the code isn't optimized and you've got an extra websocket connection.

However the configuration is reloaded when it changes (yaml) and doesn't require a server restart, the UI receives a notification with the new config.

If you add a new extension, you'll have to restart the server though, but something like nodemon could be used, I implemented this workflow for another project.

plouc commented 6 years ago

You can try the actual implementation with the master branch, using the following commands:

make init
make demo-install
make demo-start-ui
# another session
make demo-start-server

you have several configs available, you can try another config using:

demo-start-server CONF=conf/config-json.yml

for example