v0.3.0 - Sir Dillard (Harlequin Duck — Histrionicus histrionicus)
Governance Portal Release v0.3.0 - March 15th
- Release Name: Sir Dillard (Harlequin Duck — Histrionicus histrionicus)
- Version: v0.3.0
- Release Date: March 14th 2022
v0.3.0: The Big Refactor
That's right, GitHub. This release is HUGE, and likely the largest single release the DUX team will ever ship. It has been the result of months of work, with a tangible outcome of ~450 files and over 50k lines of code changed in the Governance Portal codebase.🤯
For this release we took the opportunity to refactor the codebase in order to replace some key dependencies on deprecated Javascript libraries, most notably dai.js. This was by far the biggest chunk of technical debt we had on our backlog, and a big win for our engineering team. Removing these dependencies required a lot of technical research, architecture design and code refactoring in order to make sure all functionalities were covered. It also inspired further optimisations and improvements on how the application fetches and handles data.
In light of the growing number of (recognized) delegates, this release also features improvements related to how delegate profiles are displayed throughout the application.
In addition, this is the first release that passed through our new end-to-end integration testing suite, built using Cypress. Last year we acknowledged the need for improved automated testing practices as the application and governance proposals becomes more complex—we plan to continue improving on this front, but this is a huge step in the right direction.
Lastly, the release includes a large amount of bug fixes, UX optimisations, and security improvements. Refer to the full changelog below.
We strongly believe that this code refactor has resulted in a more stable and secure application, which is also more future-proof (eg. multi—chain features, data-intensive features) and easier to maintain and further develop. It lays the groundwork for more exciting and complex features which we have been working on in parallel.
Featured Changes
Replace deprecated dependencies
As mentioned above, in this release we are removing dependencies on certain deprecated javascript libraries, in favour of more popular open-source alternatives. Most notable is dai.js, a Javascript library once started by the Maker Foundation that DUX team has been maintaining thus far. Over the course of 2021 our engineering team attained the belief that dai.js is deprecated, added significant engineering overhead to our work on the Governance Portal, and is technically inferior to open-source alternatives such as ethers.js. Other dependencies we are removing in this release are testchain.js (in favour of HardHat), and currency.js.
Improvements to delegate profiles
These past few months we have seen many new delegates enter the stage, which has been great to see! We believe vote delegation is an effective mechanism for capturing more MKR into the MakerDAO governance system. This recent spike inspired us to make some improvements to how we view (shadow) delegate profiles on the Governance Portal.
From now on, we are displaying indicators for account types. This makes it easier to distinguish shadow/recognized delegate accounts from regular users. This also enabled us to bring more customisation options to shadow delegates, in the form of improved ENS address resolving and ENS avatar support.
New testing suite
As the Governance Portal grows more complex and feature-rich, we have learned that we needed better automated testing practices in our team. This release is the first one to have passed through our new end-to-end integration testing suite, built with Cypress. It helps us test the most critical user flows in various scenarios—something that would take ages manually. A lot of research has been going into this work and we're very happy with the current setup. We will continue to add more tests and we are exploring a collaboration with the TechOps team regarding testing.
Improved error handling
The Governance Portal is now more resilient to app crashes due to individual components failing or APIs being unavailable. Through error boundaries such events should no longer be able to crash the application and make critical user flows unusable, which has happened in the past. Instead, it will display a user-friendly fallback UI component and logs data that will be useful for us to find & fix the error.
Full Release Notes
- Remove dai.js dependency (https://github.com/makerdao/dai.js) in favour of ethers.js
- Remove testchain dependency (https://github.com/makerdao/testchain) in favour of Hardhat network forking
- Remove currency dependency (https://github.com/makerdao/currency)
- Loading contract types / abis through eth-sdk (https://github.com/dethcrypto/eth-sdk)
- Refactor data fetching mechanisms that were dependant on dai.js: spock queries, web3 queries.
- Added component to switch between networks (Goerli and Mainnet), with future thoughts on multilayer governance
- Increased E2E test suite and use of cypress through the app
- Fix security headers
- Fix security vulnerability for comments api
- Fix security vulnerability on API-docs
- Added error boundaries to wrap errors on certain components and avoid error propagation through the app
- Created "Account" page for people to visualize their own votes, can be accessed by clicking on the account modal.
- Added support for ENS avatars
- New Delegates icons
- UI upgrades in the delegates pictures components through the app
- Added pagination for fetching executives
- Fix date calculation for Delegated MKR
- Remove "Abstain" option from ranked choice voting if any other option has been selected