@@ -5,7 +5,12 @@ import {
5
5
setOwner ,
6
6
} from '@ember/-internals/owner' ;
7
7
import { enumerableSymbol , guidFor } from '@ember/-internals/utils' ;
8
- import { addChildView , setElementView , setViewElement } from '@ember/-internals/views' ;
8
+ import {
9
+ addChildView ,
10
+ sendCoreViewEvent ,
11
+ setElementView ,
12
+ setViewElement ,
13
+ } from '@ember/-internals/views' ;
9
14
import type { Nullable } from '@ember/-internals/utility-types' ;
10
15
import { assert , debugFreeze } from '@ember/debug' ;
11
16
import { _instrumentStart } from '@ember/instrumentation' ;
@@ -305,20 +310,20 @@ export default class CurlyComponentManager
305
310
addChildView ( parentView , component ) ;
306
311
}
307
312
308
- component . trigger ( 'didReceiveAttrs' ) ;
313
+ sendCoreViewEvent ( component , 'didReceiveAttrs' ) ;
309
314
310
315
let hasWrappedElement = component . tagName !== '' ;
311
316
312
317
// We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components
313
318
if ( ! hasWrappedElement ) {
314
319
if ( isInteractive ) {
315
- component . trigger ( 'willRender' ) ;
320
+ sendCoreViewEvent ( component , 'willRender' ) ;
316
321
}
317
322
318
323
component . _transitionTo ( 'hasElement' ) ;
319
324
320
325
if ( isInteractive ) {
321
- component . trigger ( 'willInsertElement' ) ;
326
+ sendCoreViewEvent ( component , 'willInsertElement' ) ;
322
327
}
323
328
}
324
329
@@ -342,7 +347,7 @@ export default class CurlyComponentManager
342
347
}
343
348
344
349
if ( isInteractive && hasWrappedElement ) {
345
- component . trigger ( 'willRender' ) ;
350
+ sendCoreViewEvent ( component , 'willRender' ) ;
346
351
}
347
352
348
353
endUntrackFrame ( ) ;
@@ -407,7 +412,7 @@ export default class CurlyComponentManager
407
412
408
413
if ( isInteractive ) {
409
414
beginUntrackFrame ( ) ;
410
- component . trigger ( 'willInsertElement' ) ;
415
+ sendCoreViewEvent ( component , 'willInsertElement' ) ;
411
416
endUntrackFrame ( ) ;
412
417
}
413
418
}
@@ -420,8 +425,8 @@ export default class CurlyComponentManager
420
425
didCreate ( { component, isInteractive } : ComponentStateBucket ) : void {
421
426
if ( isInteractive ) {
422
427
component . _transitionTo ( 'inDOM' ) ;
423
- component . trigger ( 'didInsertElement' ) ;
424
- component . trigger ( 'didRender' ) ;
428
+ sendCoreViewEvent ( component , 'didInsertElement' ) ;
429
+ sendCoreViewEvent ( component , 'didRender' ) ;
425
430
}
426
431
}
427
432
@@ -443,13 +448,13 @@ export default class CurlyComponentManager
443
448
component . setProperties ( props ) ;
444
449
component [ IS_DISPATCHING_ATTRS ] = false ;
445
450
446
- component . trigger ( 'didUpdateAttrs' ) ;
447
- component . trigger ( 'didReceiveAttrs' ) ;
451
+ sendCoreViewEvent ( component , 'didUpdateAttrs' ) ;
452
+ sendCoreViewEvent ( component , 'didReceiveAttrs' ) ;
448
453
}
449
454
450
455
if ( isInteractive ) {
451
- component . trigger ( 'willUpdate' ) ;
452
- component . trigger ( 'willRender' ) ;
456
+ sendCoreViewEvent ( component , 'willUpdate' ) ;
457
+ sendCoreViewEvent ( component , 'willRender' ) ;
453
458
}
454
459
455
460
endUntrackFrame ( ) ;
@@ -464,8 +469,8 @@ export default class CurlyComponentManager
464
469
465
470
didUpdate ( { component, isInteractive } : ComponentStateBucket ) : void {
466
471
if ( isInteractive ) {
467
- component . trigger ( 'didUpdate' ) ;
468
- component . trigger ( 'didRender' ) ;
472
+ sendCoreViewEvent ( component , 'didUpdate' ) ;
473
+ sendCoreViewEvent ( component , 'didRender' ) ;
469
474
}
470
475
}
471
476
0 commit comments