1. 05 Dec, 2019 7 commits
  2. 04 Dec, 2019 2 commits
  3. 03 Dec, 2019 6 commits
  4. 02 Dec, 2019 13 commits
  5. 28 Nov, 2019 6 commits
    • Robert Knight's avatar
      Move `AnnotationBody` and `AnnotationQuote` styles into own files · c0e0485e
      Robert Knight authored
       - Move the styles for these components out of `annotation.scss` and into
         separate files to follow project conventions.
      
       - Refactor style names to use BEM-ish naming conventions
      
      There are some exceptions here because annotation body and quote
      elements have styles that are customized when the annotation is a reply
      or when the annotation card is hovered. Those customizations are still
      in annotation.scss because they need to match both the parent and child
      components.
      c0e0485e
    • Robert Knight's avatar
      Remove AnnotationBody `hasContent` prop · 8be2569f
      Robert Knight authored
      Remove the `hasContent` prop because it can be inferred by looking at
      the `text` prop instead. If an annotation has been moderated, then the
      `text` will either be non-empty if the user is a moderator or it will be
      redacted and thus be empty if the user is not a moderator.
      8be2569f
    • Robert Knight's avatar
      Make `env NODE_ENV=production gulp watch` work · c033017a
      Robert Knight authored
      Make it easier to test a production build of the client locally by
      making `env NODE_ENV=production gulp watch` build code with production
      JS/CSS transforms applied but still load assets from the dev server
      instead of from https://cdn.hypothes.is.
      
      Add a flag to the function that builds the boot script indicating whether we
      are running the dev server, and take that into account when determining the
      asset path.
      c033017a
    • Robert Knight's avatar
      Wait for final stream to finish · bb0074ea
      Robert Knight authored
      When building the bundle, wait for the final stream to finish writing
      output, rather than the intermediate stream.
      bb0074ea
    • Robert Knight's avatar
      Fix "require" name override breaking sourcemaps · d90346c9
      Robert Knight authored
      In order to avoid conflicts with any existing global `require` functions
      on the host page, JS bundles are configured to export their `require`
      function as `hypothesisRequire` and bundles loader later are modified to
      use that function to import modules from earlier bundles.
      
      Overriding the name used for importing from earlier bundles was
      previously done by prepending some code to the start of the bundle.
      Unfortunately the source map information was not updated so this broke
      sourcemap locations in the generated bundle.
      
      Change the approach instead to modify the "prelude" script that
      Browserify inserts at the top of the bundle.
      d90346c9
    • Robert Knight's avatar
      Read existing sourcemaps from content when minifying code · d4624203
      Robert Knight authored
      When minifying code with terser, make sure the existing sourcemaps for
      the input code are taken into account.
      d4624203
  6. 27 Nov, 2019 1 commit
    • Robert Knight's avatar
      Improve compression of JavaScript bundles · db5d11b8
      Robert Knight authored
      Previously only the _contents_ of modules were minified, but not the
      module infrastructure that Browserify adds around it. Given lots of modules,
      this adds up.
      
      Replace `uglifify` with a small wrapper around terser, the package that
      actually compresses the code, and use it to minify both the contents of
      modules and the generated wrapper code. Calling terser directly allows
      us to a) use the current version of it (uglifyify was stuck on Terser
      3.x) and b) upgrade/configure/replace it more directly in future.
      
      One other change here is that minifying modules is now done _after_ the
      transform that replaces `if (process.env.NODE_ENV == ...)` checks with
      `if (true)` or `if (false)`. This enables dead-code removal to remove
      the logic entirely.
      
      This reduces the minified size of `sidebar.bundle.js` from 368 KB to 311
      KB (-15%) and `annotator.bundle.js` from 170 KB to 152 KB (-12.7%).
      Some vendor bundles are smaller, others are unaffected because they were
      already fully minified. The total minified size of all bundles is reduced by ~7%.
      db5d11b8
  7. 26 Nov, 2019 5 commits