emad-elsaid/xlog

dev mode and File watcher and Tree view.

Opened this issue · 3 comments

Just an idea from using it.

What if we have a mode called DEV, where you get a tree view on the left of the Directories and files ?

It would be setup with a server side file watcher, that updates the tree when the file system changes, sending what changed to the frontend. We are not watching the contents of the files, just the Directory structure.

If you have lots of files we can send only what has changed ( Created, Updated, deleted ).

  • It's a nice idea. I don't need it personally as I tried it earlier and didn't work for me. but it's just me as I'm used to code editors without side panel for files.
  • I suggest the idea to be implemented as an extension
  • An extension can define a before_view_widget or after_view_widget that renders the tree HTML and JS API
  • an HTTP Get handler that gets polled from JS to update the tree.
  • The handler's implementation can depend on something like fsnotify to watch for filesystem changes. add changes to a buffered channel and read the channel every time the handler is called.

The extension can be developed as follows:

  • many examples are here
  • Documentation is here
  • and API docs are here
  • a separate repository can include the extension until it reaches maturity and then we can merge it to Xlog repository. and example of custom Xlog build with external extensions can be found here

thanks @emad-elsaid

I can see now how to do it as an extension.

I will have to swing back on this when i get time though..

gedw99 commented

Also for reference https://github.com/adhocteam/pushup has a nice file system watcher and event system.

So any markup or images / videos change then the gui could be told via a push ( SSE etc ) and then reload all the page.

so it give collaboration