From 974ec059e8af959e2bcff3f57c3c89673187a86d Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Wed, 23 Sep 2015 20:15:18 -0700 Subject: [PATCH] Fix for displayName transform Summary: The `react.displayName` transform was added in 93b9329b758cde3e921b26e11ba91d9700d2a06d. That diff missed to update the `.babelrc` where the comment says it should stay in sync (I'm not sure where it's used though). I added a comment in the other direction so this can be prevented in the future. I also updated the `cacheVersion` so we actually transform the code again to add the missing displayName properties to unchanged components. Closes https://github.com/facebook/react-native/pull/2905 Reviewed By: @vjeux Differential Revision: D2473447 Pulled By: @kassens --- packager/packager.js | 2 +- packager/react-packager/.babelrc | 1 + packager/transformer.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packager/packager.js b/packager/packager.js index 9e5455ea4..9f0fd6c14 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -291,7 +291,7 @@ function getAppMiddleware(options) { nonPersistent: options.nonPersistent, projectRoots: options.projectRoots, blacklistRE: blacklist(), - cacheVersion: '2', + cacheVersion: '3', transformModulePath: transformerPath, assetRoots: options.assetRoots, assetExts: ['png', 'jpeg', 'jpg'], diff --git a/packager/react-packager/.babelrc b/packager/react-packager/.babelrc index b83725855..6409e69a8 100644 --- a/packager/react-packager/.babelrc +++ b/packager/react-packager/.babelrc @@ -20,6 +20,7 @@ "es7.objectRestSpread", "flow", "react", + "react.displayName", "regenerator" ], "sourceMaps": false diff --git a/packager/transformer.js b/packager/transformer.js index b9d6c0f1f..033ad5799 100644 --- a/packager/transformer.js +++ b/packager/transformer.js @@ -31,6 +31,7 @@ function transform(src, filename, options) { comments: false, filename, whitelist: [ + // Keep in sync with packager/react-packager/.babelrc 'es6.arrowFunctions', 'es6.blockScoping', 'es6.classes',