Skip to content

Commit

Permalink
Update to frontend-shared 8.16
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Jan 20, 2025
1 parent 9c67018 commit dc00cad
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 169 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.16.7",
"@hypothesis/frontend-build": "^3.0.0",
"@hypothesis/frontend-shared": "^8.13.0",
"@hypothesis/frontend-shared": "^8.16.0",
"@hypothesis/frontend-testing": "^1.3.1",
"@npmcli/arborist": "^9.0.0",
"@octokit/rest": "^21.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/annotator/bucket-bar-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ListenerCollection } from '../shared/listener-collection';
import { ListenerCollection } from '@hypothesis/frontend-shared';

import type { PortRPC } from '../shared/messaging';
import type { Anchor, Destroyable } from '../types/annotator';
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/guest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import { TinyEmitter } from 'tiny-emitter';

import { ListenerCollection } from '../shared/listener-collection';
import { PortFinder, PortRPC } from '../shared/messaging';
import { generateHexString } from '../shared/random';
import { matchShortcut } from '../shared/shortcut';
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/integrations/image-text-layer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import debounce from 'lodash.debounce';
import type { DebouncedFunction } from 'lodash.debounce';

import { ListenerCollection } from '../../shared/listener-collection';
import {
rectCenter,
rectsOverlapHorizontally,
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/integrations/pdf.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import debounce from 'lodash.debounce';
import { TinyEmitter } from 'tiny-emitter';

import { ListenerCollection } from '../../shared/listener-collection';
import type {
Anchor,
AnnotationData,
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/integrations/vitalsource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import { TinyEmitter } from 'tiny-emitter';

import { documentCFI, stripCFIAssertions } from '../../shared/cfi';
import { ListenerCollection } from '../../shared/listener-collection';
import type {
Anchor,
AnnotationData,
Expand Down
3 changes: 2 additions & 1 deletion src/annotator/selection-observer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ListenerCollection } from '../shared/listener-collection';
import { ListenerCollection } from '@hypothesis/frontend-shared';

import { selectedRange } from './range-util';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ToastMessage } from '@hypothesis/frontend-shared';
import { ListenerCollection } from '@hypothesis/frontend-shared';
import classnames from 'classnames';
import { render } from 'preact';

import { addConfigFragment } from '../shared/config-fragment';
import { sendErrorsTo } from '../shared/frame-error-capture';
import { ListenerCollection } from '../shared/listener-collection';
import { PortRPC } from '../shared/messaging';
import type {
AnchorPosition,
Expand Down
3 changes: 2 additions & 1 deletion src/annotator/util/drag-handler.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ListenerCollection } from '../../shared/listener-collection';
import { ListenerCollection } from '@hypothesis/frontend-shared';

import type { Destroyable } from '../../types/annotator';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/annotator/util/navigation-observer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global Navigation */
import { ListenerCollection } from '../../shared/listener-collection';
import { ListenerCollection } from '@hypothesis/frontend-shared';

/**
* Monkey-patch an object to observe calls to a method.
Expand Down
75 changes: 0 additions & 75 deletions src/shared/listener-collection.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/shared/messaging/port-finder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';

import type { Destroyable } from '../../types/annotator';
import { ListenerCollection } from '../listener-collection';
import { generateHexString } from '../random';
import { isMessage } from './port-util';
import type { Frame } from './port-util';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/messaging/port-provider.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import { TinyEmitter } from 'tiny-emitter';

import type { Destroyable } from '../../types/annotator';
import { captureErrors, sendError } from '../frame-error-capture';
import { ListenerCollection } from '../listener-collection';
import { isMessage, isMessageEqual, isSourceWindow } from './port-util';
import type { Message } from './port-util';

Expand Down
3 changes: 2 additions & 1 deletion src/shared/messaging/port-rpc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';

import type { Destroyable } from '../../types/annotator';
import { ListenerCollection } from '../listener-collection';

/*
This module was adapted from `index.js` in https://github.com/substack/frame-rpc.
Expand Down
2 changes: 1 addition & 1 deletion src/shared/test/integration/messaging-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ListenerCollection as ListenerCollection_ } from '@hypothesis/frontend-shared';
import { delay } from '@hypothesis/frontend-testing';

import { ListenerCollection as ListenerCollection_ } from '../../listener-collection';
import {
PortFinder as PortFinder_,
PortProvider as PortProvider_,
Expand Down
72 changes: 0 additions & 72 deletions src/shared/test/listener-collection-test.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/sidebar/components/ThreadList.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ListenerCollection } from '@hypothesis/frontend-shared';
import classnames from 'classnames';
import debounce from 'lodash.debounce';
import { useEffect, useLayoutEffect, useMemo, useState } from 'preact/hooks';

import { ListenerCollection } from '../../shared/listener-collection';
import type { Annotation, EPUBContentSelector } from '../../types/api';
import type { Thread } from '../helpers/build-thread';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/services/frame-sync.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ToastMessage } from '@hypothesis/frontend-shared';
import { ListenerCollection } from '@hypothesis/frontend-shared';
import debounce from 'lodash.debounce';
import type { DebouncedFunction } from 'lodash.debounce';
import shallowEqual from 'shallowequal';

import { ListenerCollection } from '../../shared/listener-collection';
import {
PortFinder,
PortRPC,
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/util/observe-element-size.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListenerCollection } from '../../shared/listener-collection';
import { ListenerCollection } from '@hypothesis/frontend-shared';

/**
* Watch for changes in the size (`clientWidth` and `clientHeight`) of
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2228,15 +2228,15 @@ __metadata:
languageName: node
linkType: hard

"@hypothesis/frontend-shared@npm:^8.13.0":
version: 8.15.0
resolution: "@hypothesis/frontend-shared@npm:8.15.0"
"@hypothesis/frontend-shared@npm:^8.16.0":
version: 8.16.0
resolution: "@hypothesis/frontend-shared@npm:8.16.0"
dependencies:
highlight.js: ^11.6.0
wouter-preact: ^3.0.0
peerDependencies:
preact: ^10.25.1
checksum: 7489c92e3f0887a01ad541983a097e717fb57155bbaea1c83caaf26476c98f17061e4b195331b8a800790a523ed801e0fe93c0aa65b58d6918bdaca932691b79
checksum: 3eaebe55fed28cae226405a2d847020d9ecfa3991a0628a4df1b09b8133455151172467824abad20b704f22c55b66c0e11ec0083571987ecc348d10f03d27bd5
languageName: node
linkType: hard

Expand Down Expand Up @@ -8705,7 +8705,7 @@ __metadata:
"@babel/preset-react": ^7.0.0
"@babel/preset-typescript": ^7.16.7
"@hypothesis/frontend-build": ^3.0.0
"@hypothesis/frontend-shared": ^8.13.0
"@hypothesis/frontend-shared": ^8.16.0
"@hypothesis/frontend-testing": ^1.3.1
"@npmcli/arborist": ^9.0.0
"@octokit/rest": ^21.0.0
Expand Down

0 comments on commit dc00cad

Please sign in to comment.