- 26 Jan, 2022 1 commit
-
-
Lyza Danger Gardner authored
To be able to use `frontend-shared` components that use Tailwind utility classes, we need to let Tailwind know not to strip classes used in the frontend-shared package source.
-
- 25 Jan, 2022 4 commits
-
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo Sanz García authored
I have changed the term `anchor` to `annotation` when referring to events related to selecting or focusing annotations. I kept the reference to `anchor` when referring to scrolling.
-
Eduardo Sanz García authored
This PR makes the `Buckets` component to accept a simplified data structure that doesn't contain `anchor`s. The `anchor` objects are no longer needed and the can't be serialised (because they contain DOM elements).
-
Eduardo Sanz García authored
In order to decouple `BucketBar` from `Guest` we need to send RPC events through the `guest-host` inter-frame communication channel. The messages must trigger identical behaviour on the `Guest`. In this PR, we replace the direct use of `Guest#scrollToAnchor` by a new RPC event, `scrollToAnnotations`.
-
- 24 Jan, 2022 11 commits
-
-
dependabot[bot] authored
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.4 to 9.2.0. - [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.4...v9.2.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 13.0.1 to 13.1.1. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/v13.0.1...v13.1.1) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:development update-type: version-update:semver-minor ... 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.8 to 7.16.11. - [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.11/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 [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.7 to 7.16.12. - [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.12/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 6.16.1 to 6.17.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/6.16.1...6.17.0) --- updated-dependencies: - dependency-name: "@sentry/browser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.4 to 4.5.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.4...v4.5.5) --- updated-dependencies: - dependency-name: typescript 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.48.0 to 1.49.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.48.0...1.49.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 [rollup](https://github.com/rollup/rollup) from 2.64.0 to 2.66.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.64.0...v2.66.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 [@sentry/cli](https://github.com/getsentry/sentry-cli) from 1.71.0 to 1.72.0. - [Release notes](https://github.com/getsentry/sentry-cli/releases) - [Changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-cli/compare/1.71.0...1.72.0) --- updated-dependencies: - dependency-name: "@sentry/cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1058.0 to 2.1062.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.1058.0...v2.1062.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 [log4js](https://github.com/log4js-node/log4js-node) from 6.3.0 to 6.4.0. - [Release notes](https://github.com/log4js-node/log4js-node/releases) - [Changelog](https://github.com/log4js-node/log4js-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/log4js-node/log4js-node/compare/v6.3.0...v6.4.0) --- updated-dependencies: - dependency-name: log4js dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 21 Jan, 2022 1 commit
-
-
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.
-
- 20 Jan, 2022 5 commits
-
-
Robert Knight authored
Construction of the integration was recently moved to happen earlier in the Guest. This caused a regression in the VitalSource integration, which may synchronously call `Guest#injectClient` when constructed. `injectClient` in turn relies on `_hypothesisInjector` being initialized, which was not the case. The error could be seen in the dev server's VS test case at http://localhost:3000/document/vitalsource-epub. Fix the issue by moving `_hypothesisInjector` initialization to happen earlier in the Guest constructor, before `createIntegration` is called.
-
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 4 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>
-