Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed *BaseTime Fiber attributes to *baseDuration #13156

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 6, 2018

Resolves issue #13148

This is an unobservable change to all but the (under development) DevTools Profiler plugin. It is being done so that the plugin can safely feature detect a version of React that supports it. The profiler API has existed since the 16.4.0 release, but it did not properly work with the DevTools plugin prior to PR #13058.

I chose to rename "time" to "duration" because it's more descriptive of what the field contains. That being said, the terms "actual duration" and "base duration" are pretty vague. If anyone has suggestions for better names– this is the best time to bikeshed about them.

…n/treeBaseDuration

This is an unobservable change to all but the (under development) DevTools Profiler plugin. It is being done so that the plugin can safely feature detect a version of React that supports it. The profiler API has existed since the 16.4.0 release, but it did not support the DevTools plugin prior to PR facebook#13058.

Side note: I am not a big fan of the term "base duration". Both it and "actual duration" are kind of awkward and vague. If anyone has suggestions for better names– this is the best time to bikeshed about them.
@@ -230,8 +230,8 @@ function FiberNode(
if (enableProfilerTimer) {
this.actualDuration = 0;
this.actualStartTime = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one (actualStartTime) intentionally still called "time"? Or would it be more consistent to rename it too?

If it's intentionally still "time", would you say "time" now always refers to timestamps and "duration" always means length? Or is it still different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start time and commit time are accurate. They both contain performance.now() values. Actual and base durations contain time deltas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So yes, "time" now always means a point in time and "duration" always means a length of time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's almost like this was the plan all along! 😁

@bvaughn bvaughn merged commit 6f6b560 into facebook:master Jul 6, 2018
@bvaughn bvaughn deleted the rename-profiler-base-time branch July 6, 2018 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants