Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

skip packages that have already been visited #953

Merged
merged 2 commits into from
Jan 28, 2013
Merged

skip packages that have already been visited #953

merged 2 commits into from
Jan 28, 2013

Conversation

drewfish
Copy link
Contributor

No description provided.

@@ -1093,6 +1095,7 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
this.selectors = {};
this._appRVs = [];
this._mojitRVs = {};
this._packagesVisited = {};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is _packagesVisited initialized twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's initialized for every call to preloadResourceVersions(). Internally, preload() calls preloadResourceVersions() twice. The first time is mainly to find RS addons (which can also be found in node_modules). The second time is the "real" load, done once the store has all its addons plugged in. If we didn't clear out packagesVisited then the RS addons wouldn't get a chance to see the resources in the NPM modules.

Said another way, the packages (and app itself) are used to populate _appRVs and _mojitRVs. Anytime we (re)initialized those structures we need to (re)initialize _packagesVisited as well, so that those RV structures can get repopulated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it!

@caridy
Copy link
Contributor

caridy commented Jan 25, 2013

+1

drewfish added a commit that referenced this pull request Jan 28, 2013
skip packages that have already been visited
@drewfish drewfish merged commit fe1bf9b into YahooArchive:develop Jan 28, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants