The Mattermost team wants to improve the quality, security and stability of the code, and one way to do this is by introducing the usage of type checking. Thus, we have decided to introduce Flow in our codebase. As a first step, we want to start migrating the mattermost-redux library (in the future we will also migrate the webapp and mobile app).
This campaign will help with the migration by annotating the javascript code with Flow annotations.
By completing this campaign, we are looking to:
If you’re interested in contributing, please join the Flow channel on community.mattermost.com. Progress on moving individual files to use Flow is tracked on this spreadsheet. If you want to work on one of the files, let us know in the Flow channel or by making a comment on the spreadsheet.
List of current contributors, in alphabetical order:
For guidance on migrating a file to Flow, please read the next section.
There are a few steps involved with migrating a file to use Flow. Some of them may not apply to every file and they may change slightly based on the file you’re working on. In general, you can follow these steps as a checklist for work that needs to be done on each file.
src/types
and create it).
{[string]: Post}
.{|key1: string, key2: string|}
is better than {key1: string, key2: string}
.
src/types/store.js
.make flow
command.You can see example pull requests here: