@@ -97,31 +97,25 @@ const dispatchHooks = (hostRef: d.HostRef, isInitialLoad: boolean): Promise<void
97
97
}
98
98
}
99
99
emitLifecycleEvent ( elm , 'componentWillLoad' ) ;
100
- if ( BUILD . cmpWillLoad ) {
101
- // If `componentWillLoad` returns a `Promise` then we want to wait on
102
- // whatever's going on in that `Promise` before we launch into
103
- // rendering the component, doing other lifecycle stuff, etc. So
104
- // in that case we assign the returned promise to the variable we
105
- // declared above to hold a possible 'queueing' Promise
106
- maybePromise = safeCall ( instance , 'componentWillLoad' , undefined , elm ) ;
107
- }
100
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
101
+ // whatever's going on in that `Promise` before we launch into
102
+ // rendering the component, doing other lifecycle stuff, etc. So
103
+ // in that case we assign the returned promise to the variable we
104
+ // declared above to hold a possible 'queueing' Promise
105
+ maybePromise = safeCall ( instance , 'componentWillLoad' , undefined , elm ) ;
108
106
} else {
109
107
emitLifecycleEvent ( elm , 'componentWillUpdate' ) ;
110
108
111
- if ( BUILD . cmpWillUpdate ) {
112
- // Like `componentWillLoad` above, we allow Stencil component
113
- // authors to return a `Promise` from this lifecycle callback, and
114
- // we specify that our runtime will wait for that `Promise` to
115
- // resolve before the component re-renders. So if the method
116
- // returns a `Promise` we need to keep it around!
117
- maybePromise = safeCall ( instance , 'componentWillUpdate' , undefined , elm ) ;
118
- }
109
+ // Like `componentWillLoad` above, we allow Stencil component
110
+ // authors to return a `Promise` from this lifecycle callback, and
111
+ // we specify that our runtime will wait for that `Promise` to
112
+ // resolve before the component re-renders. So if the method
113
+ // returns a `Promise` we need to keep it around!
114
+ maybePromise = safeCall ( instance , 'componentWillUpdate' , undefined , elm ) ;
119
115
}
120
116
121
117
emitLifecycleEvent ( elm , 'componentWillRender' ) ;
122
- if ( BUILD . cmpWillRender ) {
123
- maybePromise = enqueue ( maybePromise , ( ) => safeCall ( instance , 'componentWillRender' , undefined , elm ) ) ;
124
- }
118
+ maybePromise = enqueue ( maybePromise , ( ) => safeCall ( instance , 'componentWillRender' , undefined , elm ) ) ;
125
119
126
120
endSchedule ( ) ;
127
121
@@ -322,14 +316,12 @@ export const postUpdateComponent = (hostRef: d.HostRef) => {
322
316
const instance = BUILD . lazyLoad ? hostRef . $lazyInstance$ : ( elm as any ) ;
323
317
const ancestorComponent = hostRef . $ancestorComponent$ ;
324
318
325
- if ( BUILD . cmpDidRender ) {
326
- if ( BUILD . isDev ) {
327
- hostRef . $flags$ |= HOST_FLAGS . devOnRender ;
328
- }
329
- safeCall ( instance , 'componentDidRender' , undefined , elm ) ;
330
- if ( BUILD . isDev ) {
331
- hostRef . $flags$ &= ~ HOST_FLAGS . devOnRender ;
332
- }
319
+ if ( BUILD . isDev ) {
320
+ hostRef . $flags$ |= HOST_FLAGS . devOnRender ;
321
+ }
322
+ safeCall ( instance , 'componentDidRender' , undefined , elm ) ;
323
+ if ( BUILD . isDev ) {
324
+ hostRef . $flags$ &= ~ HOST_FLAGS . devOnRender ;
333
325
}
334
326
emitLifecycleEvent ( elm , 'componentDidRender' ) ;
335
327
@@ -341,14 +333,12 @@ export const postUpdateComponent = (hostRef: d.HostRef) => {
341
333
addHydratedFlag ( elm ) ;
342
334
}
343
335
344
- if ( BUILD . cmpDidLoad ) {
345
- if ( BUILD . isDev ) {
346
- hostRef . $flags$ |= HOST_FLAGS . devOnDidLoad ;
347
- }
348
- safeCall ( instance , 'componentDidLoad' , undefined , elm ) ;
349
- if ( BUILD . isDev ) {
350
- hostRef . $flags$ &= ~ HOST_FLAGS . devOnDidLoad ;
351
- }
336
+ if ( BUILD . isDev ) {
337
+ hostRef . $flags$ |= HOST_FLAGS . devOnDidLoad ;
338
+ }
339
+ safeCall ( instance , 'componentDidLoad' , undefined , elm ) ;
340
+ if ( BUILD . isDev ) {
341
+ hostRef . $flags$ &= ~ HOST_FLAGS . devOnDidLoad ;
352
342
}
353
343
354
344
emitLifecycleEvent ( elm , 'componentDidLoad' ) ;
@@ -361,18 +351,16 @@ export const postUpdateComponent = (hostRef: d.HostRef) => {
361
351
}
362
352
}
363
353
} else {
364
- if ( BUILD . cmpDidUpdate ) {
365
- // we've already loaded this component
366
- // fire off the user's componentDidUpdate method (if one was provided)
367
- // componentDidUpdate runs AFTER render() has been called
368
- // and all child components have finished updating
369
- if ( BUILD . isDev ) {
370
- hostRef . $flags$ |= HOST_FLAGS . devOnRender ;
371
- }
372
- safeCall ( instance , 'componentDidUpdate' , undefined , elm ) ;
373
- if ( BUILD . isDev ) {
374
- hostRef . $flags$ &= ~ HOST_FLAGS . devOnRender ;
375
- }
354
+ // we've already loaded this component
355
+ // fire off the user's componentDidUpdate method (if one was provided)
356
+ // componentDidUpdate runs AFTER render() has been called
357
+ // and all child components have finished updating
358
+ if ( BUILD . isDev ) {
359
+ hostRef . $flags$ |= HOST_FLAGS . devOnRender ;
360
+ }
361
+ safeCall ( instance , 'componentDidUpdate' , undefined , elm ) ;
362
+ if ( BUILD . isDev ) {
363
+ hostRef . $flags$ &= ~ HOST_FLAGS . devOnRender ;
376
364
}
377
365
emitLifecycleEvent ( elm , 'componentDidUpdate' ) ;
378
366
endPostUpdate ( ) ;
0 commit comments