1. 03 Nov, 2020 3 commits
  2. 02 Nov, 2020 6 commits
  3. 30 Oct, 2020 5 commits
  4. 29 Oct, 2020 2 commits
  5. 27 Oct, 2020 9 commits
  6. 23 Oct, 2020 3 commits
  7. 22 Oct, 2020 5 commits
    • Robert Knight's avatar
      Run "yarn upgrade" · 0e74bb63
      Robert Knight authored
      This resolves errors building some indirect dependencies in the most
      recent versions of Node.
      0e74bb63
    • Robert Knight's avatar
      Enable terser workarounds for Safari 10 · bb83c852
      Robert Knight authored
      This fixes an error in production builds of the client in Safari 10:
      
      ```
      SyntaxError: Cannot declare a let variable twice: 't'.
      ```
      
      Fixes #2664
      bb83c852
    • Robert Knight's avatar
      Remove unused iframe attributes · 25d3aa48
      Robert Knight authored
       - Remove `seamless` attribute which has not been supported by major
         browsers for years [1]
       - Remove the `name="hyp_sidebar_frame"` attribute which is not
         referenced anywhere else in the code. I did find a couple of
         references to it in Google, but only in scripts written by Hypothesis
         team members which are not run regularly.
      
      [1] https://caniuse.com/iframe-seamless
      25d3aa48
    • Robert Knight's avatar
      Update Babel compilation targets · f2d50edc
      Robert Knight authored
      Update Babel compilation targets to match the browsers we currently support,
      rather than transpiling everything down to ES5.
      
      This reduces the size of our JS bundles and improves performance by using native
      implementations of ES2015+ language features. It should also avoid
      occassional issues in development caused by interactions of Babel plugins that
      compile native features to older syntax (eg. `transform-async-to-promises`).
      
      The client's boot script has a different configuration than the rest of the
      client because it needs to be able to run in older browsers in order to show a
      warning when the browser is not supported.
      
      The production bundle size changes resulting from this are:
      
      Sidebar bundle: 398 KB => 329 KB
      Annotator bundle: 219 KB => 169 KB
      f2d50edc
    • Robert Knight's avatar
      Fix test failures when arrow functions are not transformed · 8dd7a112
      Robert Knight authored
      Native (non-transpiled) arrow functions cannot be used with the `new` operator.
      This commit fixes a couple of cases where that was happening.
      8dd7a112
  8. 21 Oct, 2020 2 commits
    • Robert Knight's avatar
      Merge Host and Sidebar classes · 11542d1f
      Robert Knight authored
      The `Host` class is never constructed directly and only has one
      subclass, `Sidebar`. There wasn't a clear separation of responsibilities between
      `Host` and `Sidebar`. This commit therefore moves the functionality of `Host` into
      `Sidebar` and merges the tests.
      11542d1f
    • Lyza Danger Gardner's avatar
      Re-implement bucket generation and usage · d2f88164
      Lyza Danger Gardner authored
      Restructure the way that buckets are generated and represented. Simplify
      what `BucketBar` needs to do with the buckets. Fix a bug in which
      anchors can be occasionally included in multiple buckets.
      
      Fixes #397
      Fixes #2618
      d2f88164
  9. 20 Oct, 2020 5 commits
    • Robert Knight's avatar
      Move `jsonConfigsFrom` function from `src/shared` to `src/boot` · a50898b3
      Robert Knight authored
      Code in the `boot/` module needs to be compiled to work in older
      browsers than code shared between the annotator and sidebar applications
      in `src/shared`. To ensure this it helps to avoid dependencies from
      code in `src/boot` on code in `src/shared`, but the converse is OK.
      
      This commit moves the `jsonConfigsFrom` function from `shared/settings`
      to `boot/parse-json-config` so that it is compiled with the same
      settings as the rest of the code in the `boot/` module and to reduce the
      chances of someone accidentally introducing ES6+ features into this code
      in future and forgetting about older browsers.
      
      The function was also renamed to make it more obvious that it parses
      JSON config, and thus may fail, rather than returning a JSON string.
      a50898b3
    • Robert Knight's avatar
      Move `src/shared/polyfills` to `src/boot/polyfills` · 1dea77ea
      Robert Knight authored
      The code in `polyfills/index.js` which determines which polyfills are
      needed are compiled as part of the boot script and not used by other
      parts of the application.
      
      Because this code is compiled as part of the boot script it needs to be
      compiled to parse in older browsers, even those which don't support the client
      (eg. IE 10/11). Putting the `polyfills/` dir in side `src/boot` means
      that it will inherit any custom Babel configuration for the `src/boot`
      directory.
      1dea77ea
    • Robert Knight's avatar
      Make `processUrlTemplate` fail if script origin is unknown · 0b12d7f9
      Robert Knight authored
      `document.currentScript` is supported by all browsers that we support.
      If it returns `null` this indicates that it was called in the wrong
      context and so fail loudly to make this obvious.
      0b12d7f9
    • Robert Knight's avatar
      Remove various workarounds for IE 11 · 834f96ac
      Robert Knight authored
      Remove workarounds for IE that are no longer needed since IE 11 is not
      supported any more.
      
       - Remove optional and deprecated arguments to `document.createNodeIterator`
      
       - Update references to IE 11 for checks/code which is still applicable
         to other browsers
      
       - Remove `window.msCrypto` fallback for `window.crypto`
      
       - Remove unused `isIE11` helper
      
       - Remove IE 11 reference in `polyfills/index.js`. We don't actually
         need the check because the browser check in `boot/index.js` will fail
         if `Promise` is missing, but I left it in because that knowledge is
         contained in a separate part of the code and
         `shared/polyfills/index.js` is currently written as if it may be used
         in a pre-ES2015 environment.
      834f96ac
    • Robert Knight's avatar
      Remove IE 11 deprecation banner · 2abc6b6f
      Robert Knight authored
      This banner is no longer needed because the client does not support IE
      11 and aborts startup in that browser.
      2abc6b6f