Confidenceman02 / django-elm

A framework for using Elm programs in Django
MIT License
29 stars 1 forks source link

watch command: changes to widget flags dooesn't generate models for widget programs #108

Closed Confidenceman02 closed 4 months ago

Confidenceman02 commented 4 months ago

Changes to flags will mean that their respective program models will also change. When using the watch command djelm intercepts flag changes and generates the model for that particular program. This however doesn't function for widget programs.

Proposed solution

Detect flag changes for widgets and generate the respective widget Model.

Confidenceman02 commented 4 months ago

This was fairly simple to do but I did notice that we get double generations on programs.

I think this is because we load the flags module and under the hood python modifies the files when it loads the module for it's own caching reasons. Thus the watch process picks up 2 file mods instead of 1.

It's not a huge deal, but we should be able to get around this when we start validating file changes more robustly.

Confidenceman02 commented 4 months ago

Released in 0.14.0