• Robert Knight's avatar
    Use separate channels for guest / host messages from sidebar · 564e8cfe
    Robert Knight authored
    Use separate channels for sending messages to guests vs the host in the
    sidebar, even for the common case when there is only one guest and it is
    the same frame as the host.
    
    This change makes it clear for readers which part of the annotator code
    is intended to handle a particular message from the sidebar. It is also
    a step towards supporting host frames that are not guests. This will be
    needed in ebook readers where the host frame provides the navigation UI
    and contains the frame displaying the book content, but should not be
    annotatble itself.
    
     - Remove the `bridge` service in the sidebar. The `frameSync` service
       now provides the entry point for other services/components to make RPC calls
       to the host or guest frames. Currently the only use case is
       sending notifications to the host via `FrameSyncService.notifyHost`.
    
     - Create separate `Bridge` instances in `FrameSyncService` for sidebar
       <-> guest and sidebar <-> host communication. The sidebar <-> guest
       bridge works the same as before. The sidebar <-> host bridge
       is established by having `FrameSyncService` create a MessageChannel
       when sending the `hypothesisSidebarReady` notification to the host.
    
       The sidebar / host frames then add respective ports of this channel
       to a Bridge instance.
    
     - Change the various existing RPC calls between frames to use either
       the guest <-> sidebar or host <-> sidebar communication channels as
       appropriate
    564e8cfe
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...