- 07 May, 2021 3 commits
-
-
Robert Knight authored
-
Robert Knight authored
Previously all components that used injected services did not have their usage type-checked because `withServices` returned `any`. This commit refactors the API of `withServices` to make it easier to typecheck and adds types. The major API change is that the list of injected services is now passed as a second argument to `withServices` rather than by setting an `injectedProps` property on the component. This makes it easy to infer that the component returned by `withServices(Widget, ['serviceA', 'serviceB'])` has the same props as `Widget` but without `serviceA` or `serviceB`. Making these changes also turned up a handful of mistakes in existing types which are fixed here: - Correct `auth` type used by `HelpPanel` - Correct type of `thread` prop used by `ThreadCard` - Correct optionality of boolean arguments in callbacks to `Excerpt` - Change `showActions` logic in `Annotation` to make it more obvious to TS that the actions are only shown when there is an annotation - Remove unused props passed to `GroupList` Additionally there was a type error with TopBar's `auth` prop which is less trivial to fix, so I have punted it to a future commit.
-
Robert Knight authored
The type of the `props` argument to `TopBar` was not specified, so its props were not type-checked. Specifying a type for `props` turned up several mistakes in other types. - Specify the type of the `props` object so that the props are actually type-checked - Add missing `status` field to `AuthState` type - Correctly set the optionality of various props
-
- 06 May, 2021 6 commits
-
-
Robert Knight authored
This reverts commit df0084c0.
-
Jon Betts authored
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
Switch the markdown parser to the one recommended by the current Sphinx documentation [1]. This fixes an error parsing Markdown code blocks in `adr-003.md` when running `make checkdocs` and makes this file show up under "Architecture Decision Records" in the generated docs. The `requirements/docs.txt` file was updated by directly running `.tox/docs/bin/pip-compile -r requirements/docs.in`. [1] https://www.sphinx-doc.org/en/master/usage/markdown.html
-
Jon Betts authored
* This adds pinned versions of the docs dependencies, so they don't drift between local and CI * This is managed with `hdev requirements` so support for that has been added * Using the pyenv integration we have elsewhere so tox tracks the versions in the version file
-
- 03 May, 2021 31 commits
-
-
Robert Knight authored
-
Robert Knight authored
9bec434d moved the logic for scrolling to an anchor into the document integrations, in order to enable custom logic depending on the document type. The bucket bar however was still using a generic approach. Change the bucket bar to use the same `scrollToAnchor` implementation as when scrolling is triggered by clicking an annotation card in the sidebar. - Add `scrollToAnchor` method to `Guest` - Modify bucket bar controller to use this method Related to https://github.com/hypothesis/client/issues/3269
-
Robert Knight authored
- Rename `reanchoringWait` to `reanchoringMaxWait` to make it clear that this is the maximum time that we'll wait - Rename {initialOffset, targetOffset} => {startOffset, endOffset} for clarity - Add comment to explain a sleep
-
Robert Knight authored
-
Robert Knight authored
The scenario this function tests for is an anchor's highlight being _inside_ a placeholder element rather than _being_ a placeholder element.
-
Robert Knight authored
-
Robert Knight authored
When scrolling to an anchor in a page that has not been rendered by PDF.js, the anchor actually references a placeholder element in the middle of the page. In order to scroll to the correct location in the page scrolling for such anchors needs to happen in three phases: 1. Scroll to the approximate location of the final anchor, given by the placeholder anchor. This will trigger PDF.js to re-render the target page. 2. Wait for PDF.js to finish re-rendering the page and for the client to finish re-anchoring the annotation. 3. Scroll to the real/non-placeholder anchor. Change `PDFIntegration#scrollToAnchor` to implement the above steps. Fixes https://github.com/hypothesis/client/issues/3269
-
Robert Knight authored
-
Robert Knight authored
This uses the real `Intl.DateTimeFormat` API but with a fixed locale to ensure consistent output across systems. This is a more complete test than the previous one. The test assumes that output is consistent across browsers for the date given. In testing with Safari, Firefox and Chrome this was the case for the en-US locale. We accept some small risk that the exact format might change slightly in future releases of one of these browsers.
-
Robert Knight authored
Previously `decayingInterval` exhibited reasonable behavior if the date was invalid by never invoking the callback. However this was not easy to see from the code and not tested. Add explicit checks in `nextFuzzyUpdate` to make this more obvious.
-
Robert Knight authored
- Combine `sidebar/util/date.js` and `sidebar/util/time.js`. It was confusing to have two separate modules when there wasn't a clear separation of "time utilities" vs "date utilities". This also eliminates some redundant caching logic. - Rename `toFuzzyString` and `format` to `formatRelativeDate` and `formatDate` respectively to make the differnce between them more obvious - Add missing test for `formatDate` - Remove the fallback code paths for old browsers that don't support `Intl.DateTimeFormat`. All of our currently supported browsers do. - Remove unused `date` parameter from `decayingInterval` callback. The only consumer in `AnnotationTimestamps` didn't use it. - Improve types in `time.js`
-
dependabot[bot] authored
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.12 to 8.2.13. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.2.12...8.2.13) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.13.3 to 0.13.5. - [Release notes](https://github.com/KaTeX/KaTeX/releases) - [Changelog](https://github.com/KaTeX/KaTeX/blob/master/CHANGELOG.md) - [Commits](https://github.com/KaTeX/KaTeX/compare/v0.13.3...v0.13.5) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 6.3.1 to 6.3.5. - [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.3.1...6.3.5) 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.13.15 to 7.14.0. - [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.14.0/packages/babel-preset-env) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [gulp-replace](https://github.com/lazd/gulp-replace) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/lazd/gulp-replace/releases) - [Commits](https://github.com/lazd/gulp-replace/compare/v1.1.1...v1.1.2) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.11.0 to 3.11.2. - [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/commits/v3.11.2/packages/core-js) 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.13.16 to 7.14.0. - [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.14.0/packages/babel-core) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.32.11 to 1.32.12. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.32.11...1.32.12) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [axe-core](https://github.com/dequelabs/axe-core) from 4.1.4 to 4.2.0. - [Release notes](https://github.com/dequelabs/axe-core/releases) - [Changelog](https://github.com/dequelabs/axe-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/dequelabs/axe-core/compare/v4.1.4...v4.2.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.892.0 to 2.897.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.892.0...v2.897.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.2.7 to 2.2.8. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/2.2.7...2.2.8) Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
`uorigin` is un-idiomatic naming in our codebase, though the meaning was fairly obvious in context.
-
Robert Knight authored
Modernize the `RPC` class in `src/shared/frame-rpc` that serves as both the client and server for RPC requests between frames. This code was originally imported from https://github.com/substack/frame-rpc but now that we've adopted it, it makes sense to modernize it to match the conventions and requirements of the rest of our code. - Convert `frame-rpc.js` to modern syntax - Update JSDoc documentation for methods and class - Convert `RPC` class to a named rather than default export - Inline the `apply` method into the `call` method, since only `call` was used externally - Remove unused option for `methods` constructor argument to be a function - Rename `src` and `dest` public fields to the more explicit `sourceFrame` and `destFrame`
-
Robert Knight authored
-
Robert Knight authored
Convert this service to a class and expand the documentation slightly. This is a straightforward conversion with no API or internal changes. Part of https://github.com/hypothesis/client/issues/3298
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
The current error handling is not that useful in practice because it just results in a console error. With a test in place we can more easily change/refactor this in future though.
-
Robert Knight authored
- Document parameters and return types - Add a link to the documentation for the available options. We currently only ever use `minTimeout` - Add a note about why the code calls `operation.retry()` even if the operation was successful
-
Robert Knight authored
- Convert closures into methods - Remove the `profileFetchRetryOpts` field that was used only to shorten the delay between retries in tests, in favor of mocking `retryPromiseOperation` in tests to remove the delay between retries. - Change `SessionService` instance creation in tests to allow individual tests to run custom setup logic before the service is constructed. This was needed due to allow the `serviceConfig` mock to take effect when the `SessionService` constructor runs - Remove unnecessary custom Sinon sandbox in tests
-