1. 19 Jul, 2021 6 commits
  2. 16 Jul, 2021 7 commits
  3. 15 Jul, 2021 8 commits
  4. 14 Jul, 2021 7 commits
    • Robert Knight's avatar
      Use `$imports.$mock` to mock RPC in bridge-test.js · b5e717ae
      Robert Knight authored
      The `Bridge` code was written before we had good mocking tools in the
      client. As a result the `Bridge` class mocks `RPC` in an unconventional
      way where it constructs the real class, but then stubs out specific
      methods. Also tests varied in the degree to which they tested only
      `Bridge` vs Bridge + RPC together.
      
      This commit mocks `RPC` in bridge-test.js using our standard mocking
      tools and makes all tests in the file unit tests. This involved some
      significant changes to the `onConnect` tests.
      b5e717ae
    • Eduardo Sanz García's avatar
      Various improvements based on PR feedback · 12982d25
      Eduardo Sanz García authored
      * change `@deprecated` for a comment
      * added a test to cover some missing lines in `_isValidSender` function.
      * `_isValidMessage` renamed to `_parseMessage`
      * created helper function `waitForMessageDelivery`
      * parametrise test
      12982d25
    • Eduardo Sanz García's avatar
      Cleanup/follow up work on `RPC` · 1aea95e6
      Eduardo Sanz García authored
      RPC:
      * added `@deprecated` statements and additional comments
      * removed `this._destroyed` for the listener checks, because the
        listener is removed when called `destroy()`.
      * added `this._port.close()` in addition to removing the listner.
      
      `bridge-test`:
      * refactor all the `function () {}` to arrow functions
      
      `frame-rpc-test.js`:
      * added these tests to check the `MessageChannel` functionality.
      1aea95e6
    • Eduardo Sanz García's avatar
      Strengthen types · 3e94f694
      Eduardo Sanz García authored
      3e94f694
    • Eduardo Sanz García's avatar
      Simplify internals · b0f23457
      Eduardo Sanz García authored
      Created a couple of utility methods to avoid duplication of code and
      enable to decouple RPC for `Window` or for `MessagePort`.
      b0f23457
    • Eduardo Sanz García's avatar
      Add `ListenerCollection` utility to handle listeners · 75525988
      Eduardo Sanz García authored
      It simplifies the code.
      75525988
    • Eduardo Sanz García's avatar
      Initial support of `MessageChannel` on `RPC` · 87832dbc
      Eduardo Sanz García authored
      It is a bit of a Frankenstein. The plan is to clean up on the next
      commits.
      87832dbc
  5. 13 Jul, 2021 5 commits
  6. 12 Jul, 2021 1 commit
    • Kyle Keating's avatar
      Remove aria-label from TagEditor and AnnotationPublishControl button · 4ae836c4
      Kyle Keating authored
      Per WCAG 2.1 criterion: 2.5.3 Label in Name--we should not differentiate between the aria-label and the visual name in an input element. In the case of the TagEditor, the `placeholder` and `aria-label` were different. The simple fix is to remove `aria-label`.
      
      The second problem is with AnnotationPublishControl's button where the `aria-label` and button's text did not match. Again, the simple fix is to remove `aria-label`.
      4ae836c4
  7. 09 Jul, 2021 2 commits
    • Robert Knight's avatar
      Always use object shorthand for properties · 2cccebc2
      Robert Knight authored
      Enforce the use of object shorthand syntax everywhere for consistency.
      eg. `{ foo }` instead of `{ foo: foo }`. We had already converted most
      occurrences manually.
      2cccebc2
    • Robert Knight's avatar
      Convert remaining anonymous callbacks to arrow functions · 088864e9
      Robert Knight authored
      We've been gradually converting anonymous functions to arrow functions
      since adopting ES6. This commit uses ESLint to finish the process by
      converting the remaining non-named, non-`this`-using callbacks to arrow
      functions.
      
       - Enable `prefer-arrow-callbacks` lint rule. The `allowNamedFunctions`
         option is enabled because we have a few instances (eg. in
         gulpfile.js) of explicitly naming functions for use in debugging /
         logging etc.
      
       - Run `eslint --fix .` and `yarn format` to automatically fix up the
         code
      088864e9
  8. 07 Jul, 2021 1 commit
  9. 06 Jul, 2021 3 commits
    • Kyle Keating's avatar
      Add `Escape` shortcut to hide adder · edf3a10d
      Kyle Keating authored
      The adder now hides when the escape key is pressed. (WCAG 2.1 criterion 1.4.13)
      edf3a10d
    • Robert Knight's avatar
      Remove unused code path in `connect` helper · a9184fd0
      Robert Knight authored
      Given the way the `Socket` helper currently works, the `connect` helper
      cannot be called while there is already a connection. `connect` is
      called once during the initial `Socket` constructor and subsequently to
      initiate an automatic reconnect in the event of an abnormal
      disconnection. In both cases there is no existing connection.
      a9184fd0
    • Robert Knight's avatar
      Document `operation` variable and fix mis-use of it · ac3de0d9
      Robert Knight authored
      Document the type and purpose of `operation` variable and fix a hazard
      where it was assigned a timeout ID instead of a `RetryOperation`, which
      would cause code expecting it to be a `RetryOperation` to fail.
      ac3de0d9