Kitware / trame-cookiecutter

Cookie Cutter template for creating trame application/module
16 stars 8 forks source link

Hot Reload #11

Closed giiyms closed 1 year ago

giiyms commented 1 year ago

Hello,

I see hot reload has recently be added to trame (2.3.0+)

Is hot reload integrated behind the scenes and activated with a passed argument or does the main.py file need to be updated in this cookiecutter?

Thanks

jourdain commented 1 year ago

The cookiecutter should definitely be updated to better support hot reload out of the box. (use classes instead of closure)

But in general, hot reload can be activated with just an arg (--hot-reload)

giiyms commented 1 year ago

Thanks that works great. Is there any way to hot reload the HTML/layout?

jourdain commented 1 year ago

Yes, you just need to tight the UI definition into a function and have that function being called. We have that "on_server_reload" hook that will add a button in the footer (when using the vuetify UI stuff). But you can make your own "dev reload" button...

You can see an example here.

giiyms commented 1 year ago

Got it. thanks again