• Robert Knight's avatar
    Live reload dev tool for the Hypothesis client · 70f5676d
    Robert Knight authored
    This implements support and a test environment
    in which the Hypothesis client can live reload
    when scripts, styles etc. are changed.
    
    Live reloading when scripts change currently requires
    support from the hosting page.
    
    There are two parts to this:
    
     - A server which serves test pages
       with the Hypothesis client embedded and notifies
       it when front-end assets (styles, scripts) are changed.
    
       Test pages are served at http://localhost:3000/<any path>
       by default.
    
     - A small client script which connects to the server and
       listens for notifications of asset changes.
    
       When styles change it will reload styles for the page.
    
       When scripts or Angular templates change it will send a
       request to the top-level page to reload.
    
       This enables reloading to work when changing
       both the sidebar app and Annotator code but also avoids
       the need to manually unload the existing Annotator instance
       before reloading.
    70f5676d
live-reload-client.js 2.84 KB