OpenNTF/JavascriptAggregator — pull request #97 by chuckdumont (2014-01-06 16:27:54+00:00)
Title: Reduce cache key instability caused by feature discovery during has!

loader plugin branching. Also simplify/consolidate calculation of expanded dependencies.

Cache key instability results from the updating of cache key generators as new feature dependencies are discovered when modules/layers are built with different features defined. The definition of different features causes different has! loader plugin branching during require list expansion, leading to the potential for new feature dependencies due to has plugin conditionals that were not included in previous expansions. This change reduces cache key instability by performing require list expansion without defining any features and leveraging the has! loader plugin branching capability to discover all potential has! loader plugin feature dependencies the first time dependencies are expanded. The expanded dependencies are then trimmed to exclude dependencies that are not required based on the feature set defined in the request. Note that while this reduces cache key instability, it does not eliminate it. Cache key instability can still result from config alias replacement functions in the server-side loader config.

As part of simplifying/consolidating the calculation of expanded dependencies, the IDependencies interface has changed. Specifically, IDependencies.getExpandedDependencies() has been removed. The DependencyList class in com.ibm.jaggr.service.util is now used for obtaining expanded dependencies. It used to be that there was much duplicated code in these two classes for expanding dependencies. Expansion of nested dependencies is now performed exclusively by DependencyList.