@@ -83,9 +83,9 @@ export type ProfilerProps = {
83
83
// in certain environments.
84
84
disabled ?: boolean ;
85
85
// If time component is on page should be displayed as spans. True by default.
86
- hasRenderSpan ?: boolean ;
86
+ includeRender ?: boolean ;
87
87
// If component updates should be displayed as spans. True by default.
88
- hasUpdateSpan ?: boolean ;
88
+ includeUpdates ?: boolean ;
89
89
// props given to component being profiled.
90
90
updateProps : { [ key : string ] : any } ;
91
91
} ;
@@ -104,8 +104,8 @@ class Profiler extends React.Component<ProfilerProps> {
104
104
105
105
public static defaultProps : Partial < ProfilerProps > = {
106
106
disabled : false ,
107
- hasRenderSpan : true ,
108
- hasUpdateSpan : true ,
107
+ includeRender : true ,
108
+ includeUpdates : true ,
109
109
} ;
110
110
111
111
public constructor ( props : ProfilerProps ) {
@@ -130,11 +130,11 @@ class Profiler extends React.Component<ProfilerProps> {
130
130
this . mountActivity = null ;
131
131
}
132
132
133
- public componentDidUpdate ( { updateProps, hasUpdateSpan = true } : ProfilerProps ) : void {
133
+ public componentDidUpdate ( { updateProps, includeUpdates = true } : ProfilerProps ) : void {
134
134
// Only generate an update span if hasUpdateSpan is true, if there is a valid mountSpan,
135
135
// and if the updateProps have changed. It is ok to not do a deep equality check here as it is expensive.
136
136
// We are just trying to give baseline clues for further investigation.
137
- if ( hasUpdateSpan && this . mountSpan && updateProps !== this . props . updateProps ) {
137
+ if ( includeUpdates && this . mountSpan && updateProps !== this . props . updateProps ) {
138
138
// See what props haved changed between the previous props, and the current props. This is
139
139
// set as data on the span. We just store the prop keys as the values could be potenially very large.
140
140
const changedProps = Object . keys ( updateProps ) . filter ( k => updateProps [ k ] !== this . props . updateProps [ k ] ) ;
@@ -158,9 +158,9 @@ class Profiler extends React.Component<ProfilerProps> {
158
158
// If a component is unmounted, we can say it is no longer on the screen.
159
159
// This means we can finish the span representing the component render.
160
160
public componentWillUnmount ( ) : void {
161
- const { name, hasRenderSpan = true } = this . props ;
161
+ const { name, includeRender = true } = this . props ;
162
162
163
- if ( this . mountSpan && hasRenderSpan ) {
163
+ if ( this . mountSpan && includeRender ) {
164
164
// If we were able to obtain the spanId of the mount activity, we should set the
165
165
// next activity as a child to the component mount activity.
166
166
this . mountSpan . startChild ( {
0 commit comments