• Eduardo Sanz García's avatar
    Remove `PortProvider#hostPortFrom` method · f364519b
    Eduardo Sanz García authored
    There are two methods to get the host port from `PortProvider`:
    
    - `#hostPortFrom` which returns the host port exclusively from the
      `sidebar-host` channel.
    
    - `#on` allows to register a listener that is fired upon requests
      of host frames for channels other than the `sidebar-host`.
    
    This is an attempt to simplify the API of `PortProvider` and merge both
    methods into one.
    
    Advantages:
    
    - simplifies the `Sidebar` constructor signature (no need to pass the
      host port)
    
    - avoids the pitfall of creating host-sidebar RPC channel before
      registering the RPC methods
    
    - prepares for future guest-host channel see https://github.com/hypothesis/client/blob/ad93317debdac0d2c3abec83eb9d690934632ef3/src/annotator/index.js#L64-L66 (where the `#on` method is use to create the guest-host channel).
    f364519b
Name
Last commit
Last update
..
anchoring Loading commit data...
components Loading commit data...
config Loading commit data...
integrations Loading commit data...
test Loading commit data...
util Loading commit data...
.eslintrc.js Loading commit data...
adder.js Loading commit data...
annotation-counts.js Loading commit data...
annotation-sync.js Loading commit data...
bucket-bar.js Loading commit data...
features.js Loading commit data...
frame-observer.js Loading commit data...
guest.js Loading commit data...
highlighter.js Loading commit data...
hypothesis-injector.js Loading commit data...
icons.js Loading commit data...
index.js Loading commit data...
notebook.js Loading commit data...
range-util.js Loading commit data...
selection-observer.js Loading commit data...
sidebar-trigger.js Loading commit data...
sidebar.js Loading commit data...
toolbar.js Loading commit data...