@@ -217,27 +217,22 @@ function getTagTrackedProps(tag, ownTag, level = 0) {
217217 }
218218 const subtags = tag . subtags || ( Array . isArray ( tag . subtag ) ? tag . subtag : [ ] ) ;
219219 if ( tag . subtag && ! Array . isArray ( tag . subtag ) ) {
220- if ( tag . subtag . _propertyKey )
221- props . push (
222- ( tag . subtag . _object ? getObjectName ( tag . subtag . _object ) + '.' : '' ) +
223- tag . subtag . _propertyKey
224- ) ;
220+ if ( tag . subtag . _propertyKey ) props . push ( tag . subtag ) ;
221+
225222 props . push ( ...getTagTrackedProps ( tag . subtag , ownTag , level + 1 ) ) ;
226223 }
227224 if ( subtags ) {
228225 subtags . forEach ( ( t ) => {
229226 if ( t === ownTag ) return ;
230- if ( t . _propertyKey )
231- props . push (
232- ( t . _object ? getObjectName ( t . _object ) + '.' : '' ) + t . _propertyKey
233- ) ;
227+ if ( t . _propertyKey ) props . push ( t ) ;
234228 props . push ( ...getTagTrackedProps ( t , ownTag , level + 1 ) ) ;
235229 } ) ;
236230 }
237231 return props ;
238232}
239233
240- function getTrackedDependencies ( object , property , tag ) {
234+ function getTrackedDependencies ( object , property , tagInfo ) {
235+ const tag = tagInfo . tag ;
241236 const proto = Object . getPrototypeOf ( object ) ;
242237 if ( ! proto ) return [ ] ;
243238 const cpDesc = emberMeta ( object ) . peekDescriptors ( property ) ;
@@ -249,21 +244,32 @@ function getTrackedDependencies(object, property, tag) {
249244 const ownTag = tagForProperty ( object , property ) ;
250245 const props = getTagTrackedProps ( tag , ownTag ) ;
251246 const mapping = { } ;
252- props . forEach ( ( p ) => {
247+ let maxRevision = tagInfo . revision ?? 0 ;
248+ let minRevision = Infinity ;
249+ props . forEach ( ( t ) => {
250+ const p =
251+ ( t . _object ? getObjectName ( t . _object ) + '.' : '' ) + t . _propertyKey ;
253252 const [ objName , ...props ] = p . split ( '.' ) ;
254253 mapping [ objName ] = mapping [ objName ] || new Set ( ) ;
255- props . forEach ( ( p ) => mapping [ objName ] . add ( p ) ) ;
254+ maxRevision = Math . max ( maxRevision , t . revision ) ;
255+ minRevision = Math . min ( minRevision , t . revision ) ;
256+ props . forEach ( ( p ) => mapping [ objName ] . add ( [ p , t . revision ] ) ) ;
256257 } ) ;
257258
259+ const hasChange = maxRevision !== minRevision ;
260+
258261 Object . entries ( mapping ) . forEach ( ( [ objName , props ] ) => {
259262 if ( props . size > 1 ) {
260263 dependentKeys . push ( objName ) ;
261264 props . forEach ( ( p ) => {
262- dependentKeys . push ( ' • -- ' + p ) ;
265+ const changed = hasChange && p [ 1 ] >= maxRevision ? ' 🔸' : '' ;
266+ dependentKeys . push ( ' • -- ' + p [ 0 ] + changed ) ;
263267 } ) ;
264268 }
265269 if ( props . size === 1 ) {
266- dependentKeys . push ( objName + '.' + [ ...props ] [ 0 ] ) ;
270+ const p = [ ...props ] [ 0 ] ;
271+ const changed = hasChange && p [ 1 ] >= maxRevision ? ' 🔸' : '' ;
272+ dependentKeys . push ( objName + '.' + p [ 0 ] + changed ) ;
267273 }
268274 if ( props . size === 0 ) {
269275 dependentKeys . push ( objName ) ;
@@ -325,7 +331,6 @@ export default class extends DebugPort {
325331 tagInfo . tag = track ( ( ) => {
326332 value = object . get ?. ( item . name ) || object [ item . name ] ;
327333 } ) ;
328- tagInfo . revision = tagValue ( tagInfo . tag ) ;
329334 }
330335 tracked [ item . name ] = tagInfo ;
331336 } else {
@@ -344,8 +349,9 @@ export default class extends DebugPort {
344349 dependentKeys = getTrackedDependencies (
345350 object ,
346351 item . name ,
347- tracked [ item . name ] . tag
352+ tracked [ item . name ]
348353 ) ;
354+ tracked [ item . name ] . revision = tagValue ( tracked [ item . name ] . tag ) ;
349355 }
350356 this . sendMessage ( 'updateProperty' , {
351357 objectId,
@@ -1121,12 +1127,12 @@ function calculateCPs(
11211127 item . isTracked = true ;
11221128 }
11231129 }
1124- tagInfo . revision = tagValue ( tagInfo . tag ) ;
11251130 item . dependentKeys = getTrackedDependencies (
11261131 object ,
11271132 item . name ,
1128- tagInfo . tag
1133+ tagInfo
11291134 ) ;
1135+ tagInfo . revision = tagValue ( tagInfo . tag ) ;
11301136 } else {
11311137 value = calculateCP ( object , item , errorsForObject ) ;
11321138 }
0 commit comments