Make ReactPerf.getLastMeasurements() opaque #6286
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a temporary change I want to get into 15.0.
We intend to change the measurement format significantly in #6046. In order to introduce the new
ReactPerf
with a different and more detailed measurement format during 15.x release cycle, I propose to make the measurement structure opaque-ish in 15.0.I searched the GitHub for usage of
ReactPerf.getLastMeasurements()
and couldn’t find any popular projects relying on its internal structure except React Native in this single module. I left__unstable_this_format_will_change
as a workaround in case RN makes a release with 15.0 before we ship 15.1 with the newReactPerf
, or if anyone else really needs reading those measurements in the raw form.In any case I will be working on updating React Native to use the new
ReactPerf
later so I don’t think we should be held back by this. It’s likely that by the time React Native is ready to switch to 15, the newReactPerf
will be ready, but if not,__unstable_this_format_will_change
covers their use case.All existing methods continue to work with the measurements returned from
getLastMeasurements()
so we aren’t breaking the contract. We’re just signaling that the internal format of measurements is an implementation detail in 15.0 until we iron it out and present the new, more detailed one, in 15.1.Test Plan
Verify that
ReactPerf.printExclusive()
,ReactPerf.printInclusive()
,ReactPerf.printWasted()
,ReactPerf.printDOM()
still work both with zero arguments and with a single argument obtained fromReactPerf.getLastMeasurements()
. Verify thatReactPerf.getMeasurementsSummaryMap()
still works with a single argument.Reviewers
@sebmarkbage