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

Enhanced directory watch in mdl serve #383

Open
douglaswth opened this issue Mar 24, 2023 · 0 comments
Open

Enhanced directory watch in mdl serve #383

douglaswth opened this issue Mar 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@douglaswth
Copy link
Member

A pattern that we're using for sharing the design objects between different repositories without also sharing the views is to use the following pattern:

  • diagram/model.go contains all of the design object definitions
  • diagram/views/views.go contains the views specific to the repository
  • Run mdl serve -dir diagram/views to build and edit diagrams from the views

However, this means that the file system watch for changes that the current implementation of mdl serve sets up only looks at diagram/views and any subdirectories, so design object changes are not noticed and neither the livereload or a page refresh of the editor will bring in those changes.

One solution would be to invert the pattern so that the views live in the shallower directory while the design objects move down to a deeper directory:

  • diagram/views.go
  • diagram/model/model.go
  • Run mdl serve -dir diagram

But, I'm also wondering if we might want to allow for more flexibility by either allowing the specification of extra directories to watch or looking at the package imports and watching the directories that are found from them that are also in the same Go module.

@douglaswth douglaswth added the enhancement New feature or request label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant