1. 12 Nov, 2020 1 commit
    • Robert Knight's avatar
      Optimize and fix a bug in `isNodeInRange` if node had no parent · 7d196444
      Robert Knight authored
      `isNodeInRange` in range would throw an exception if the passed node had
      no parent because `range.selectNode(...)` requires its argument to have
      a parent.
      
      This commit rewrites `isNodeInRange` to use `range.comparePoint` which
      avoids creating a temporary live range and handle exceptions that
      `comparePoint` may throw. It also updates the JSDoc to more accurately
      describe what the function does.
      7d196444
  2. 11 Nov, 2020 1 commit
  3. 10 Nov, 2020 2 commits
    • Robert Knight's avatar
      Don't try to resolve sidebar app URL when booting sidebar app · 9d0621df
      Robert Knight authored
      When attempting to create a build of the browser extension using the
      local dev client and the production h service I encountered an issue where
      resolving the `sidebarAppUrl` setting in `src/boot/index.js` failed.
      
      This happens because the extension does not set this setting in the
      sidebar app so the boot script fell back to trying to resolve the URL
      template baked into the development client. This in turn failed
      because `document.currentScript` is not set in this context.
      
      The `sidebarAppUrl` setting is not actually needed when booting the sidebar app, so
      this commit refactors the boot code to avoid generating it in this
      context. This is done by moving the responsibility for determining which
      part of the client to load from `boot/boot.js` into `boot/index.js` and
      only resolving the necessary settings.
      9d0621df
    • Eduardo Sanz García's avatar
      Remove npm depency · 0079b15d
      Eduardo Sanz García authored
      Rely exclusively on `yarn`.
      0079b15d
  4. 09 Nov, 2020 11 commits
  5. 06 Nov, 2020 2 commits
  6. 05 Nov, 2020 3 commits
    • Robert Knight's avatar
      Remove ES 2015 and ES 2016 polyfill sets · f17f6901
      Robert Knight authored
      All of the browsers we currently support, as specified by the
      `browserslist` key in package.json, fully support ES 2015 and ES 2016.
      
      The only exception I'm aware of is that Edge Legacy v17 and v18 do not
      support using string regex search/match methods with custom (non-regex)
      types via `Symbol.{match, search, replace}`. That's not something we've
      ever used AFAIK.
      f17f6901
    • Robert Knight's avatar
      Replace `build/manifest.json` make target with `make build` · 9d89ffc9
      Robert Knight authored
      `make build` is a more obvious name for a command that creates a
      production build of the client. It also resolves an issue that `make
      build/manifest.json` did nothing if `node_modules/` was up to date but
      other dependencies had changed.
      9d89ffc9
    • Robert Knight's avatar
      Avoid creating unnecessary production build when running `make dev` · 20b558f4
      Robert Knight authored
      `make dev` would unnecessarily create a production build before starting
      the development server if `package.json` or `yarn.lock` had been touched
      since the previous run of `make dev`. This was happening because `make dev`
      had a dependency on `build/manifest.json`, which triggers a production
      build, rather than `node_modules/.uptodate`, which just runs `yarn
      install`. I can't remember the historical reason why it was this way, but it
      doesn't make sense any more.
      
      Fix this by changing `make dev` to only depend on `node_modules/` being
      up to date before starting the dev server.
      20b558f4
  7. 04 Nov, 2020 1 commit
    • Robert Knight's avatar
      Replace babel-plugin-angularjs-annotate with babel-plugin-inject-args · cacdd635
      Robert Knight authored
      It is confusing to have a Babel plugin with an Angular-related name and
      Angular-sounding annotations (`@ngInject`) in the code, even though
      we're not using AngularJS. Although we're not using AngularJS any more,
      we still have services that are instantiated by a dependency injection
      container.  The container reads dependency names from a `$inject`
      property on service functions/classes. This `$inject` property is added
      by `babel-plugin-angularjs-annotate`.
      
      This commit replaces the `angularjs-annotate` Babel plugin with one
      maintained by us [1]. The new plugin provides only the functionality that we
      need (eg. only processes explicitly annotated functions) and uses a more generic
      `@inject` annotation.
      
      [1] https://github.com/hypothesis/babel-plugin-inject-args
      cacdd635
  8. 03 Nov, 2020 3 commits
  9. 02 Nov, 2020 6 commits
  10. 30 Oct, 2020 5 commits
  11. 29 Oct, 2020 2 commits
  12. 27 Oct, 2020 3 commits