@@ -5,7 +5,12 @@ import {
55 setOwner ,
66} from '@ember/-internals/owner' ;
77import { 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' ;
914import type { Nullable } from '@ember/-internals/utility-types' ;
1015import { assert , debugFreeze } from '@ember/debug' ;
1116import { _instrumentStart } from '@ember/instrumentation' ;
@@ -305,20 +310,20 @@ export default class CurlyComponentManager
305310 addChildView ( parentView , component ) ;
306311 }
307312
308- component . trigger ( 'didReceiveAttrs' ) ;
313+ sendCoreViewEvent ( component , 'didReceiveAttrs' ) ;
309314
310315 let hasWrappedElement = component . tagName !== '' ;
311316
312317 // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components
313318 if ( ! hasWrappedElement ) {
314319 if ( isInteractive ) {
315- component . trigger ( 'willRender' ) ;
320+ sendCoreViewEvent ( component , 'willRender' ) ;
316321 }
317322
318323 component . _transitionTo ( 'hasElement' ) ;
319324
320325 if ( isInteractive ) {
321- component . trigger ( 'willInsertElement' ) ;
326+ sendCoreViewEvent ( component , 'willInsertElement' ) ;
322327 }
323328 }
324329
@@ -342,7 +347,7 @@ export default class CurlyComponentManager
342347 }
343348
344349 if ( isInteractive && hasWrappedElement ) {
345- component . trigger ( 'willRender' ) ;
350+ sendCoreViewEvent ( component , 'willRender' ) ;
346351 }
347352
348353 endUntrackFrame ( ) ;
@@ -407,7 +412,7 @@ export default class CurlyComponentManager
407412
408413 if ( isInteractive ) {
409414 beginUntrackFrame ( ) ;
410- component . trigger ( 'willInsertElement' ) ;
415+ sendCoreViewEvent ( component , 'willInsertElement' ) ;
411416 endUntrackFrame ( ) ;
412417 }
413418 }
@@ -420,8 +425,8 @@ export default class CurlyComponentManager
420425 didCreate ( { component, isInteractive } : ComponentStateBucket ) : void {
421426 if ( isInteractive ) {
422427 component . _transitionTo ( 'inDOM' ) ;
423- component . trigger ( 'didInsertElement' ) ;
424- component . trigger ( 'didRender' ) ;
428+ sendCoreViewEvent ( component , 'didInsertElement' ) ;
429+ sendCoreViewEvent ( component , 'didRender' ) ;
425430 }
426431 }
427432
@@ -443,13 +448,13 @@ export default class CurlyComponentManager
443448 component . setProperties ( props ) ;
444449 component [ IS_DISPATCHING_ATTRS ] = false ;
445450
446- component . trigger ( 'didUpdateAttrs' ) ;
447- component . trigger ( 'didReceiveAttrs' ) ;
451+ sendCoreViewEvent ( component , 'didUpdateAttrs' ) ;
452+ sendCoreViewEvent ( component , 'didReceiveAttrs' ) ;
448453 }
449454
450455 if ( isInteractive ) {
451- component . trigger ( 'willUpdate' ) ;
452- component . trigger ( 'willRender' ) ;
456+ sendCoreViewEvent ( component , 'willUpdate' ) ;
457+ sendCoreViewEvent ( component , 'willRender' ) ;
453458 }
454459
455460 endUntrackFrame ( ) ;
@@ -464,8 +469,8 @@ export default class CurlyComponentManager
464469
465470 didUpdate ( { component, isInteractive } : ComponentStateBucket ) : void {
466471 if ( isInteractive ) {
467- component . trigger ( 'didUpdate' ) ;
468- component . trigger ( 'didRender' ) ;
472+ sendCoreViewEvent ( component , 'didUpdate' ) ;
473+ sendCoreViewEvent ( component , 'didRender' ) ;
469474 }
470475 }
471476
0 commit comments