metro/react-packager/src/Packager
Martín Bigio 49fde903b8 [react-packager] Promote Cache to top level
Summary:
The cache is only used for JSTransformer at the moment. We're doing IO and some computation to get each module's name, whether is a haste or node module and it's dependencies. This work happens on startup so by caching this value we shouldbe able to reduce the start up time. Lets promote the Cache to the Packager level to be able to use it by any of the components of the packager. For now, on this diff we'll start using it to cache the mentioned fields.

Also we had to introduce the concept of fields in the cache as manually merging the date we had for each path is not possible as we're using promisses all around. With the new API, each field is a promise.

@amasad and I did some manual testing to measure the impact of this change and looks like it's saves 1 second when building the haste map (which represents 50% of the time). Overall this reduces 1 second of start up time which was currently about 8s on my mac book pro.
2015-08-10 16:25:03 -08:00
..
__tests__ Replace bluebird with promise 2015-06-22 08:44:03 -08:00
Package.js [react-packager] Introduce buildPackage API 2015-05-22 17:28:27 -08:00
base64-vlq.js [react-packager] Fix lint errors 2015-02-25 20:29:42 -08:00
index.js [react-packager] Promote Cache to top level 2015-08-10 16:25:03 -08:00