/
Live Reload feature for Developers [5.2.1]

Live Reload feature for Developers [5.2.1]

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

  1. during page run remember files, involved in page generation:
    1. template names, that
      1. was rendered
      2. were included (e.g. via <inp2:m_Include tag) in the process
      3. contained block definitions, that were used on above mentioned templates
    2. PHP files (tag processors, event handlers, other classes) that were included in the process
  2. create a JavaScript class/object that will:
    1. be placed on each opened page (when live reload feature is enabled)
    2. through WebSockets send:
      1. browser identification string (for us to determine which of several browsers to reload later on)
      2. website base url (to determine which website to reload in particular browser)
      3. website base path on Web Server
      4. previously collected files to the "Server Module"
    3. respond to "Server Module" call for page refresh by refreshing the page (with POST data if that was present)
  3. create "Server Module" using (NodeJS, Ruby, PHP or any other language that is good at server programming), that will:
    1. be started once per all In-Portal based websites on same Web Server
    2. will respond to page registration calls by recording provided information
    3. will either monitor whole project folder for file changes or only looking for changes with recorded files
    4. 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

Related Tasks