Skip to content

wikimedia/vegalite-wordpress-plugin

Repository files navigation

Vega Lite WordPress Plugin

Developed by Human Made and the Wikimedia Foundation.

Stable tag: 0.5.0

This plugin provides a flexible data visualization block using the Vega-Lite declarative JSON visualization grammar.

Development

This project expects Node 16 and Composer 2. We recommend managing the installed version of Node using nvm, in which case you can select the version of node specified in this project's .nvmrc file by running nvm use in your terminal.

npm install
npm run build

To start a live-reloading dev server, run

npm start

Other useful commands

  • npm run test: Use Jest to run JS unit tests.
  • npm run lint: Use ESLint to check src code for errors.

Release Process

Versioning

This plugin follows Semantic Versioning.

In a nutshell, this means that patch releases, for example, 1.2.3, only contain backwards compatible bug fixes. Minor releases, for example, 1.2.0, may contain enhancements, new features, tests, and pretty much everything that does not break backwards compatibility. Every breaking change to public APIs—be it renaming or even deleting structures intended for reuse, or making backwards-incompatible changes to certain functionality—warrants a major release, for example, 2.0.0.

If you are using Composer to pull this plugin into your website build, choose your version constraint accordingly.

Even when bumping a major version, if the blocks provided by this plugin change in a backwards-incompatible way, a block deprecation should be added to let users migrate their visualizations to the new version of the block.

Publishing a Release

Release management is done using GitHub's built-in Releases functionality. When you tag a commit on the main branch with a version number in the format v#.#.#, a release action will trigger when that tag is pushed to GitHub. The GitHub actions release workflow creates a new built release based on the contents of the tag you created. It copies the tag's current state to a new tag of original/v.*.*.*, then builds the project and pushes the built version to the original tag name v*.*.*. This allows composer to pull in a built version of the project without the need to run webpack to use it.

To prepare a release, follow these steps:

  1. Ensure you are on the main branch and that there are no uncommitted local changes.
  2. Depending on whether you are preparing a major, minor, or patch release (see Versioning above), run one of these three NPM actions to update the version number throughout the project:
  • npm run bump:patch: Update the project's version number to the next patch release number.
  • npm run bump:minor: Update the project's version number to the next minor release number.
  • npm run bump:major: Update the project's version number to the next major release number.
  1. Create a tag with the same number as the updated project version number, e.g. v1.2.3.
  2. Push the updated main branch and tag to GitHub.

Once a release has been created, update the release's description using GitHub's interface to add patch notes. Release notes should be high-level but complete, detailing all New Features, Enhancements, Bug Fixes and potential other changes included in the according version.

Development testing

Any code merged into the develop branch will be build and committed to the release-develop branch. This branch can be used in non-production applications to validate and test proposed changes.

Changelog

0.5.0

  • Upgrade vega-embed from 6.20.2 to 6.23.0; upgrade vega-lite from 5.2.0 to 5.16.3; upgrade vega from 5.21.0 to 5.26.1

0.2.4

  • Upgrade build dependencies for security and performance.
  • Pin the specific SHA1 commits of the GH actions
  • Update build actions to use Node.js version 18

0.2.3

  • Upgrade build dependencies for security and performance.

0.2.2

  • Fix issue where frontend block styles were not getting enqueued for responsive block.

0.2.1

  • Fix issue where blocks did not render on frontend due to block.json being deleted on build.
  • Fix issue where CSV meta was not registered as an array.
  • Fix issue where block scripts loaded on all pages, not only when a block is present.

0.2.0

  • Introduce Responsive Visualization Container block.
  • UI overhaul for Data Visualization block.
  • Fix bug where field dropdowns could de-sync with available fields in dataset.

0.1.0

  • Initial release. Introduce "Data Visualization" block.