...
- during page run remember files, involved in page generation:
- template namenames, that
- was rendered
- were included (e.g. via
<inp2:m_Include
tag) in the process - contained block definitions, that were used on above mentioned templates
- PHP files (tag processors, event handlers, other classes) that were included in the process
- template namenames, that
- create a JavaScript class/object that will:
- be placed on each opened page (when live reload feature is enabled)
- through WebSockets send:
- browser identification string (for us to determine which of several browsers to reload later on)
- website base url (to determine which website to reload in particular browser)
- website base path on Web Server
- previously collected files to the "Server Module"
- respond to "Server Module" call for page refresh by refreshing the page (with POST data if that was present)
- create "Server Module" using (NodeJS, Ruby, PHP or any other language that is good at server programming), that will:
- be started once per all In-Portal based websites on same Web Server
- will respond to page registration calls by recording provided information
- will either monitor whole project folder for file changes or only looking for changes with recorded files
- if a change is detected then notify corresponding browser page (through WebSockets), that it needs to be reloaded
I think this feature can save more keystrokes then you can imagine since by the time the Developer switches to browser window to see the changes they already will be there.
Resources
- http://nodejs.org/api/fs.html#fs_fs_watch_filename_options_listener - How to watch for changes in folder using NodeJS
- https://github.com/einaros/ws - WebSockets server module for NodeJS (other WebSockets servers: http://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js)