Skip to content

Enhanced directory watch in mdl serve #383

@douglaswth

Description

@douglaswth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions