1. 26 Jan, 2022 11 commits
  2. 25 Jan, 2022 4 commits
  3. 24 Jan, 2022 11 commits
  4. 21 Jan, 2022 1 commit
    • Eduardo Sanz García's avatar
      Make PortProvider#listen a private method · c5e02b31
      Eduardo Sanz García authored
      I can't see any negative consequence of starting to listen to
      postMessage discovery message immediately after `PortProvider` is
      instantiated. (In fact, this is what it was currently happening). These
      messages won't be lost, and the `PortRPC`s won't create the
      communication channels before the RPC methods are registered.
      
      On the other hand, it simplifies the use of `PortProvider` and
      eliminates the potential problem of `PortProvider#listen` been called
      more than once.
      c5e02b31
  5. 20 Jan, 2022 5 commits
  6. 19 Jan, 2022 3 commits
    • Robert Knight's avatar
      Make some internal method names more concise · 5838a84b
      Robert Knight authored
      Remove an uninformative suffix from two method names.
      5838a84b
    • Robert Knight's avatar
      Push document metadata from guest to sidebar · d7568d7c
      Robert Knight authored
      Change the way document metadata and URIs for guest frames gets from the
      guest to the sidebar, so that the guest _pushes_ the information instead
      of the sidebar requesting it. This achieves two things:
      
       1. It enables the sidebar to get the initial document URI faster, as
          the guest can fetch the information and send it to the sidebar over
          the message channel while the sidebar is still loading. This in turn
          allows the initial annotation search request to be made sooner and
          for annotations to appear quicker.
      
          This fixes https://github.com/hypothesis/client/issues/4094.
      
          In practice this doesn't improve the best case metadata fetch time
          significantly (only 5-10ms or so) but does seem to reduce the variance in
          fetch times.
      
       2. It will in future enable the guest to inform the sidebar of
          URI/metadata changes after the initial load. This can happen if a
          client-side navigation happens in an HTML document for example or if
          the currently loaded PDF is changed in PDF.js.
      d7568d7c
    • Eduardo Sanz García's avatar
      Use an RPC call instead of direct call to `Guest#selectAnnotations` · d4046e03
      Eduardo Sanz García authored
      We want the `BucketBar` to be able to communicate with `Guest`s that are
      in other iframes, like in the Ebook scenario. Currently, the `BucketBar`
      has an instance of the `Guest`, associated with `host` frame, and
      assumes to be the main `Guest`, for communication purposes.
      
      I have replaced the reliance of the direct invocation of
      `Guest#selectAnnotations` by a new `selectAnnotations` RPC event in the
      `guest-host` communication channel. This has the advantage of making no
      assumptions about which iframe contains the annotations.
      
      I have made some minor modification in the types and functionality of
      `range-util`.
      d4046e03
  7. 18 Jan, 2022 5 commits