Migration to v1.x
Installation
- npm
- yarn
npm install --save-dev reassure
yarn add --dev reassure
Breaking changes
Rename measurePerformance to measureRenders
The signature of the function did not change. Old name is still available but will generate warning messages when used.
Rename resetToDefault to resetToDefaults
The signature of the function did not change. Old name is no longer available.
Testing environment
Reassure v0 used Node.js JIT-less mode (--jitless node flag), optionally using different flags if --enable-wasm experimental option was passed. Reassure V1 runs tests using Node.js's non-optimized compilation to better reflect React Native runtime environment.
This means that:
- Tests will run ~2x faster than in V0. This should be visible in the single PR where you update Reassure to V1 in your repo as the baseline measurements will run with the old flags, while the current measurements will run with the new flags. Afterwards, both baseline and current measurement should run with the same compilation options.
- WebAssembly is now enabled by default.
Non-breaking changes
Exporting of Measure* and Compare* types
Reassure now exports following TypeScript types from root reassure package:
MeasureResults- return type ofmeasureRendersandmeasureFunctionMeasureRendersOptions- options passed tomeasureRendersMeasureFunctionOptions- options passed tomeasureFunctionMeasureType- type of measurement:renderorfunctionMeasureHeader- header from performance file (baseline.perf,current.perf)MeasureMetadata- metadata from performance fileMeasureEntry- single entry from performance fileCompareResult- format ofoutput.jsonfileCompareMetadata- metadata fromoutput.jsonfileCompareEntry- single comparison result fromoutput.jsonfileAddedEntry- similar toCompareEntrybut for cases when there is onlycurrentmeasurementRemovedEntry- similar toCompareEntrybut for cases when there is onlybaselinemeasurement
Removal of --enable-wasm flag
Reassure now runs tests with WebAssembly enable by default (see testing environment).