Currently website development (not only for In-Portal-based websites) requires a developer to reload page in browser (by pressing F5 or Command+R) to see updated page content. Although it seems, that this is the way it must be, but I think we can improve that.
Concept
- during page run remember files, involved in page generation:
- template name, that was rendered
- template names, that were included in the process
- PHP files (tag processors, event handlers, other classes) that were included in the process
- 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.