• Robert Knight's avatar
    Remove `onConnect` method from Bridge · c72257a9
    Robert Knight authored
    Simplify the Bridge class by removing the `onConnect` API and replacing
    current calls with alternative approaches.
    
    The `onConnect` method was a way to register a callback that would be invoked
    after a test RPC call over a newly-connected channel succeeded.
    
    The purpose of this method was not that clear however and its existence
    suggested that it is necessary to wait for the callback to be invoked before
    making RPC requests on the new channel. This is not the case, as the underlying
    transport buffers messages until the receiver is ready to consume them. Therefore
    RPC requests can be made as soon as `createChannel` returns.
    
    The current uses of `onConnect` were replaced as follows:
    
     1. The host frame used it to be notified when the sidebar application has
        loaded. This has been replaced with an explicit `ready` RPC call.
    
     2. The sidebar waited for this callback before querying metadata for a
        newly-connected guest. It now sends a metadata query to the guest
        immediately when it receives the guest port from the host frame. This saves
        an unnecessary round-trip between the host and guest. In future we can
        optimize metadata querying more by having the guest _push_ metadata to
        the sidebar rather than waiting for the sidebar to query it.
    c72257a9
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.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-boot.config.mjs Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tailwind.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...