- 20 Jan, 2022 4 commits
-
-
Eduardo Sanz García authored
`BucketBar` was setting the focus when hovering on the left-pointed buckets. That relied on direct access to the anchors, which it is not always possible. Instead, now the `BucketBar` communicates with a new RPC event, `focusAnnotations`, in the `guest-host` channel (analogous to the `focusAnnotations` in the `sidebar-guest` channel. I have made a small improvement: when hovering a left-pointed bucket, not only focus the anchor's highlights but also the corresponding annotation cards in the sidebar. The same can be done for top and bottom-pointed buckets.
-
Eduardo Sanz García authored
The `@implements` tag works with or without braces. We decided to include braces following the document: https://jsdoc.app/tags-implements.html See also: https://github.com/hypothesis/client/pull/4048/files#r786462923
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo Sanz García authored
This new integration test checks that `PortFinder`, `PortProvider` and `PortRPC` work in harmony. One change in one could lead to the others no working as planned.
-
- 19 Jan, 2022 3 commits
-
-
Robert Knight authored
Remove an uninformative suffix from two method names.
-
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.
-
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`.
-
- 18 Jan, 2022 11 commits
-
-
Robert Knight authored
Fix a race condition where inter-frame RPC calls would silently fail if made before the MessagePort discovery process had completed. Fix the issue by queuing calls in PortRPC and then dispatching them once a port is connected. This is similar to how MessagePort buffers messages until they are consumed by calling `start`.
-
Robert Knight authored
The "frame" part is redundant. Guests are always other frames in this context. Also this is consistent with `_connectGuest` in the `Sidebar` class.
-
Robert Knight authored
-
Robert Knight authored
This avoids hazards with conflicts between map keys and built-in object property names.
-
Robert Knight authored
-
Robert Knight authored
Reduce the number of layers involved in inter-frame communication by combining the Bridge and PortRPC classes. PortRPC still only supports sending requests to a single port, but now has an API that is more like the Bridge class, where construction of the class, registering of RPC method handlers and connecting to a MessagePort are separate steps. This separation is convenient because it allows the RPC client to be set up before the MessagePort retrieval process, which is async in non-host frames, has completed. Existing uses of Bridge have been replaced either with a single PortRPC instance, for 1:1 connections between frames, or an array of PortRPC instances for 1:N connections between the sidebar/host and guest frames. Migrating to an array for 1:N connections paves the way to sending certain requests only to specific guests, whereas they are currently sent to _all_ guests. Bridge's `call` method had logic for gathering results from multiple guests, timing out and disconnecting clients in the event of an error. This logic was inappropriate in various ways and has not been re-implemented in PortRPC. - The timeout value was hardcoded at 1000ms for all calls. This may be too short depending on what the call does or what code is executing in the destination frame. - Disconnecting clients in the event of _any_ error, whether with the connection or an error on the client end in handling the call, doesn't make sense. - The `call` method returned a single Promise, so an error from any client would replace successful results from other clients. Also the client would have to wait until the results from all callers was available before sending a response. - The `call` method always passed a callback function to `PortRPC.call`, resulting in PortRPC always sending a response message back over the message channel, even when the code calling `bridge.call` did not use the response. Currently _no_ calls to `bridge.call` used the response, so this was just wasted traffic. The changes in detail are: 1. Change the PortRPC API to be more like Bridge, where an instance is constructed, RPC handlers are added via `on` and the client is then connected to a port via `connect`. 2. Replace use of Bridge with either a single PortRPC or array of PortRPCs in the `Guest`, `Sidebar` and `FrameSyncService` classes. This required changes in various tests to simulate a guest frame connecting before testing that a particular event resulted in an RPC call being made to a guest frame. 3. Rename `bridge-events.d.ts` => `port-rpc-events.d.ts` to match (2) 4. Remove the `Bridge` class, its tests and the PortRPC-Bridge integration tests, as they are now unused. Two existing issues were identified in this work but are not yet resolved: 1. `FrameSyncService` does not tear down the PortRPC client for a guest when the guest frame disconnects. 2. If a cross-frame RPC call is attempted before the async port discovery has completed, nothing happens. It will probably make sense to queue calls similar to how MessagePort queues messages.
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo Sanz García authored
This is a step towards making the bucket bar works for a `guest` frame that is not in the `host` frame. When that's the case the observation of scrolling and resize can't happen in the `host` frame. A new service has been created, `BucketService`. The service is instantiated only in the `guest` frame that contains the main annotatable content. The service observes changes in the elements that could impact the relative position of the anchors relative to the viewport. If these changes are detected, as well as addition or deletion of anchors, it sends the `anchorsChanged` RPC event to the `host` frame so that the positions can be recalculated. As a result of the new service the `BucketBar` has been simplified.
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.6.0...v8.7.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
-
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.
-
- 17 Jan, 2022 10 commits
-
-
dependabot[bot] authored
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.3 to 9.1.4. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v9.1.3...v9.1.4) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.47.0 to 1.48.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.47.0...1.48.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.0.12 to 3.0.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...v3.0.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.10 to 6.3.11. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v6.3.10...v6.3.11) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.7 to 7.16.8. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.16.8/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1053.0 to 2.1058.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1053.0...v2.1058.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js) from 3.20.2 to 3.20.3. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/compare/v3.20.2...v3.20.3) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [rollup](https://github.com/rollup/rollup) from 2.63.0 to 2.64.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.63.0...v2.64.0) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.15.1 to 0.15.2. - [Release notes](https://github.com/KaTeX/KaTeX/releases) - [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md) - [Commits](https://github.com/KaTeX/KaTeX/compare/v0.15.1...v0.15.2) --- updated-dependencies: - dependency-name: katex dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.0 to 1.14.7. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.0...v1.14.7) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 10 Jan, 2022 7 commits
-
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1051.0 to 2.1053.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1051.0...v2.1053.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.1 to 10.4.2. - [Release notes](https://github.com/postcss/autoprefixer/releases) - [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/autoprefixer/compare/10.4.1...10.4.2) --- updated-dependencies: - dependency-name: autoprefixer dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.46.0 to 1.47.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.46.0...1.47.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.0.11 to 3.0.12. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...v3.0.12) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.9 to 6.3.10. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v6.3.9...v6.3.10) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [fancy-log](https://github.com/gulpjs/fancy-log) from 1.3.3 to 2.0.0. - [Release notes](https://github.com/gulpjs/fancy-log/releases) - [Changelog](https://github.com/gulpjs/fancy-log/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/fancy-log/compare/v1.3.3...v2.0.0) --- updated-dependencies: - dependency-name: fancy-log dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 07 Jan, 2022 5 commits
-
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.45.2 to 1.46.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.45.2...1.46.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.0.8 to 3.0.11. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.0.8...v3.0.11) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 13.1.2 to 13.1.3. - [Release notes](https://github.com/rollup/plugins/releases) - [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/node-resolve-v13.1.3/packages/node-resolve) --- updated-dependencies: - dependency-name: "@rollup/plugin-node-resolve" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1048.0 to 2.1051.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1048.0...v2.1051.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [rollup](https://github.com/rollup/rollup) from 2.62.0 to 2.63.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.62.0...v2.63.0) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-