commit | 00260cd5b2468f1e9011d6df6b8c897739ee8f8d | [log] [tgz] |
---|---|---|
author | Antoine Musso <hashar@free.fr> | Fri Jul 07 17:31:52 2023 +0200 |
committer | Antoine Musso <hashar@free.fr> | Tue Jun 25 21:49:51 2024 +0200 |
tree | 6382021589737153a1c9a01781696de93eb7863f | |
parent | 8c4c087c30ffd9dd09fcbb4d2584120958413a0b [diff] |
Update Resemble.js 3.2.4 > 4.0.0 Resemble.JS 3.2.4 has support for Node.JS rendering which is done via canvas, canvas, which depends on cairo and in turn requires system libraries to be available. The missing libraries cause the build to fail. Since image-diff is a browser plugin, we do not need the canvas dependency. I tried to find a way to use `yarn install --ignore-optional`, but short of editing the Gerrit main WORKSPACE, I could not find any way to do it. Eventually I have found a later version of Resemble.js changes canvas to an optional dependencies: https://github.com/rsmbl/Resemble.js/commit/35e294dab95ad6bb531138eb5613355571805aa9 It was released with version 4.0.0 of Resemble.JS and removes the dependency upon system libraries. I have noticed the `yarn.lock` is still pointing to resemble@1.2.1 which clearly got forgotten. I don't know how the build still work since Gerrit `yarn_install` refers to that lock file. I have regenerated it with Gerrit 3.5 using: bazel run @yarn//:yarn install -- --cwd plugins/image-diff install The `package-lock.json` has been regenerated with npm 7.21.0 within the Gerrit stable-3.5 branch (for polymer-bridges). Change-Id: I924b66b535619a4072039b7396850ca34caf9e3e
A plugin that provides a rich image diffing experience in PolyGerrit. Currently, the plugin features two modes: Highlight Mode and Onion Skin.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
The build requires to be done from an existing Gerrit tree. All commands below are relative to the root of a copy of Gerrit.
image-diff
repository into the plugins
folder of the gerrit
repo, or link the image-diff
plugin folder to gerrit/plugins
folder.plugins/package.json
with the plugin package.json:ln --symbolic --force image-diff/package.json plugins/package.json
You can remove all depDependencies
from plugins/package.json
as they are not needed for the build (they are only needed for running wct tests).
bazel build plugins/image-diff
This mode uses the Resemble.JS library.
The following features are included in this mode:
Onion Skin mode is a great way for users to notice changes in the images that might be overlooked when you look at them side by side. By overlaying the new image on top of the old image, the users can change the opacity to see the transition that were made.
The following features are included in this mode:
This plugin uses polymer-cli to test.
Inside your image-diff repo, run polymer serve
to start a local web server and open localhost:8080/test
to view your tests. See here for more info.
Or run npm run wct-test
to run all your tests.
Reference here on how to set up your Gerrit testsite and here for PolyGerrit plugin development.
To update dependencies amend package.json
then from the root of the Gerrit repository execute yarn to refresh the yarn.lock
lock file:
bazel run @yarn//:yarn install -- --cwd plugins/image-diff install git add package.json yarn.lock
Then since developers tend to use npm
directly, refresh the package-lock.json
as well:
npm update
Add package.json
, package-lock.json
and yarn.lock
to your git commit.