lib/graph/recycle.js
function diff(node) {
		var oldBundle = (cachedData.loader.bundle || []).slice();

		return getDependencies(node.load).then(function(result){
			var newBundle = (cachedData.loader.bundle || []).slice();

			// If the deps are the same we can return the existing graph.
			if(same(node.deps, result.deps) &&
			   same(oldBundle, newBundle)) {
				clean(node, result.source);

				if(result.virtualModules.length) {
					var promises = result.virtualModules.map(function(l){
						var node = cachedData.graph[l.name];
						node.load.source = l.source;
						node.load.metadata.useSource = true;
						return diff(node);
					});

					return Promise.all(promises).then(function(results){
						result.same = results.every(function(res){
							return res.same;
						});
						return result;
					});
				}

				result.same = true;
			}
			return result;
		});

	}
function diff(node) {
		var oldBundle = (cachedData.loader.bundle || []).slice();

		return getDependencies(node.load).then(function(result){
			var newBundle = (cachedData.loader.bundle || []).slice();

			// If the deps are the same we can return the existing graph.
			if(same(node.deps, result.deps) &&
			   same(oldBundle, newBundle)) {
				clean(node, result.source);

				if(result.virtualModules.length) {
					var promises = result.virtualModules.map(function(l){
						var node = cachedData.graph[l.name];
						node.load.source = l.source;
						node.load.metadata.useSource = true;
						return diff(node);
					});

					return Promise.all(promises).then(function(results){
						result.same = results.every(function(res){
							return res.same;
						});
						return result;
					});
				}

				result.same = true;
			}
			return result;
		});

	}
function diff ( node ) { var oldBundle = ( cachedData . loader . bundle || [ ] ) . slice ( ) ; return getDependencies ( node . load ) . then ( function ( result ) { var newBundle = ( cachedData . loader . bundle || [ ] ) . slice ( ) ; // If the deps are the same we can return the existing graph. if ( same ( node . deps , result . deps ) && same ( oldBundle , newBundle ) ) { clean ( node , result . source ) ; if ( result . virtualModules . length ) { var promises = result . virtualModules . map ( function ( l ) { var node = cachedData . graph [ l . name ] ; node . load . source = l . source ; node . load . metadata . useSource = true ; return diff ( node ) ; } ) ; return Promise . all ( promises ) . then ( function ( results ) { result . same = results . every ( function ( res ) { return res . same ; } ) ; return result ; } ) ; } result . same = true ; } return result ; } ) ; }
Check to see if the node has changed. Do this by looking at the source
and running it through System.instantiate to see if new deps were added.
Recursively do the same for any System.defined modules.
Check to see if the node has changed . Do this by looking at the source and running it through System . instantiate to see if new deps were added . Recursively do the same for any System . defined modules .