Closed as not planned
Description
PR #19108 caused some Suspense-related DevTools regressions (more info available on #19368) which we did not catch because of the fact that DevTools tests are only run against the version of React in master.
We should follow the precedent of the regression fixtures tests and have CI run DevTools tests against multiple React versions, including v15, all v16 minors, and the current HEAD of master branch.
Setting this up will involve several things:
- Infra to checkout older React packages and run tests against them.
- Some form of gating so that we can account for expected differences in Store snapshots between React versions.
- Some form of gating so that we can avoid running tests against invalid combinations of features and versions (e.g. don't test for
Suspense
in a version of React that didn't include that component yet).
Which React versions should we test?
In addition to testing against the latest React version in source, I propose that we should also test every minor version going back as far as we support (e.g. starting with v15). We could automate this process like so:
const {exec} = require('child_process');
const semver = require('semver');
const versions = {};
exec('npm view react versions --json', (error, stdout, stderr) => {
if (stdout) {
const json = JSON.parse(stdout);
json.forEach(versionString => {
if (semver.valid(versionString)) {
if (semver.gte(versionString, '15.0.0')) {
const {major, minor, patch} = semver.parse(versionString);
// Filter out RCs and CI-published daily releases.
if (`${major}.${minor}.${patch}` === versionString) {
// Store the last patch for each minor.
// This relies on the view command returning a sorted releases list.
const key = `${major}.${minor}`;
versions[key] = versionString;
}
}
}
});
// The "versions" object now contains all versions we should test again.
}
});