@@ -30,6 +30,7 @@ var canLog = require('can-log');
3030var canDev = require ( 'can-log/dev/dev' ) ;
3131var assign = require ( 'can-assign' ) ;
3232var ObservationRecorder = require ( "can-observation-recorder" ) ;
33+ var queues = require ( "can-queues" ) ;
3334require ( 'can-view-model' ) ;
3435
3536// DefineList must be imported so Arrays on the ViewModel
@@ -330,14 +331,28 @@ var Component = Construct.extend(
330331 this . renderer = stache ( viewName , this . renderer ) ;
331332 }
332333
333- // Register this component to be created when its `tag` is found.
334- viewCallbacks . tag ( this . prototype . tag , function ( el , tagData ) {
334+ var renderComponent = function ( el , tagData ) {
335335 // Check if a symbol already exists on the element; if it does, then
336336 // a new instance of the component has already been created
337337 if ( el [ createdByCanComponentSymbol ] === undefined ) {
338338 new self ( el , tagData ) ;
339339 }
340- } ) ;
340+ } ;
341+
342+ //!steal-remove-start
343+ if ( process . env . NODE_ENV !== 'production' ) {
344+ Object . defineProperty ( renderComponent , "name" , {
345+ value : "render <" + this . prototype . tag + ">" ,
346+ configurable : true
347+ } ) ;
348+ renderComponent = queues . runAsTask ( renderComponent , function ( el , tagData ) {
349+ return [ "Rendering" , el , "with" , tagData . scope ] ;
350+ } ) ;
351+ }
352+ //!steal-remove-end
353+
354+ // Register this component to be created when its `tag` is found.
355+ viewCallbacks . tag ( this . prototype . tag , renderComponent ) ;
341356 }
342357 }
343358 } , {
0 commit comments