1. 15 Apr, 2021 2 commits
    • Robert Knight's avatar
      Introduce types for route name and route params · f879ec7e
      Robert Knight authored
       - Introduce a union type for current route names
      
       - Use `Record<Key, Value>` rather than `Object.<Key, Value>` as it is
         stricter (eg. it is non-nullable)
      f879ec7e
    • Robert Knight's avatar
      Convert `router` service to a native ES class · 179271b7
      Robert Knight authored
      Services in `src/sidebar/services` are effectively classes. They are
      currently implemented with a convention that was more common pre-ES6 where
      the constructor is a function that creates the fields as local variables
      and the methods using closures and returns an object that references the
      closures.
      
      This pattern has advantages, especially pre-ES6, as it avoids issues with
      incorrect use of `this` and hides internal state from consumers. However
      it also has downsides:
      
       - It is less obvious to readers that they are looking at something that
         is logically a class
      
       - This is not an idiom we use elsewhere in the codebase, where we use
         native classes instead
      
       - Static analysis tools don't support this pattern for creating a class
         as well as they support a native class. For example `TS` creates a
         named type for native classes, which is convenient to reference
         in JSDoc comments
      
      This commit starts a process of refactoring service classes to ES
      classes which are named `<Thing>Service`, using the router service as a
      first example. Per recently agreed conventions, the classes are named
      rather than default exports.
      179271b7
  2. 14 Apr, 2021 1 commit
    • Kyle Keating's avatar
      Allow `group` to be passed to the merged config · da4d67b5
      Kyle Keating authored
      When the host config value for `requestConfigFromFrame` is an object containing a string and a number, it is assumed that the remaining host config is be fetched from the parent frame via RPC. In this context, any other values passed along via the iframe URL hash are ignored. One such value is the `group` which is used by the notebook to focus a group and filter only to that groups annotations.
      
      This changes the method that merges the configs to allow that `group` value to be taken from the iframe's url and incorporated into the final merged config so that the notebook can set that value in its own store.
      da4d67b5
  3. 13 Apr, 2021 6 commits
  4. 12 Apr, 2021 15 commits
  5. 09 Apr, 2021 10 commits
  6. 08 Apr, 2021 2 commits
  7. 07 Apr, 2021 4 commits