commit | db56a6f62c9acfc81abcdedea28fa0a6c9bb196b | [log] [tgz] |
---|---|---|
author | Wyatt Allen <wyatta@google.com> | Mon Aug 01 15:23:50 2016 -0700 |
committer | Wyatt Allen <wyatta@google.com> | Tue Aug 02 09:51:56 2016 -0700 |
tree | 0e3abe18f4f8ca37edfb035be45496e370907b1e | |
parent | f1063a2690683231e1935b47a64dfde7857a8fe6 [diff] |
Lazy load HighlightJS library Previously, the HighlightJS library (HLJS) was being Vulcanized into the PolyGerrit build, even if the library was not being used (for example if the user does not navigate to a diff or has syntax highlighting disabled in preferences). Because HLJS is a substantial file -- ranging in size from 47KB to more than 455KB (ungizpped) depending on the build environment, this is not ideal. In order to lazy load a JS library: 1) It needs to be copied into the built WAR file to be addressable, and 2) It should not be Vulcanized into the built gr-app.js file. Previously, the PolyGerrit build system supported copying and non-vulcanizing exactly one JS library: namely webcomponents-lite.js. This change generalizes the mechanism by which webcomponents is copied and adds HLJS to that list. This satisfies **1**. Furthermore, the GR-SYNTAX-LAYER is rewritten to dynamically import HLJS in the `process` step by crafting a SCRIPT element and attaching it to the local DOM. (Syntax processing is invoked only after entire diff is rendered.) Code that depends on the library awaits this load before using it. Thus, the conventional JS import can be removed from the element's HTML and will not be recognized by the Vulcanize phase. This satisfies **2**. Tests are updated accordingly. Bug: Issue 4298 Change-Id: I9a95d6d4c211cd8f1ca1bc4daec770b64b22b3d1
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Buck and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && buck build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.