From 1284c5d1f242243eabd0899e8699d705892dc5e5 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 17 Jun 2019 10:53:43 -0700 Subject: [PATCH] Add react-refresh as a dependency Summary: This adds the Fresh Babel plugin and runtime to React Native dependencies. **They're not actually being used or enabled yet**. This is purely additive and just gets the deps setup out of the way for future diffs. The `react-refresh` source of truth is in the React repo. Reviewed By: cpojer Differential Revision: D15828330 fbshipit-source-id: 67ec2dea8c896477ff8b434445f1730e388ea67a --- Libraries/Core/setUpDeveloperTools.js | 7 ++++++- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Libraries/Core/setUpDeveloperTools.js b/Libraries/Core/setUpDeveloperTools.js index 66037c1553ef4f..a0ed7854ee464b 100644 --- a/Libraries/Core/setUpDeveloperTools.js +++ b/Libraries/Core/setUpDeveloperTools.js @@ -49,6 +49,11 @@ if (__DEV__) { if (typeof reload !== 'function') { throw new Error('Could not find the reload() implementation.'); } - (require: any).reload = reload; // flowlint-line unclear-type: off + // flowlint-next-line unclear-type: off + (require: any).reload = reload; + // flowlint-next-line unclear-type: off + (require: any).hot = { + Runtime: require('react-refresh/runtime'), + }; } } diff --git a/package.json b/package.json index 4e67aed0560833..1f4f1aebcac10a 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "promise": "^7.1.1", "prop-types": "^15.7.2", "react-devtools-core": "^3.6.0", + "react-refresh": "0.0.3", "regenerator-runtime": "^0.13.2", "stacktrace-parser": "^0.1.3", "whatwg-fetch": "^3.0.0" diff --git a/yarn.lock b/yarn.lock index 7244e16e7c8414..cb61f158d43f94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5925,6 +5925,11 @@ react-proxy@^1.1.7: lodash "^4.6.1" react-deep-force-update "^1.0.0" +react-refresh@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.0.3.tgz#977bcc5c2235d3ee94ded83e5fa5ca8fc591c6a8" + integrity sha512-m6VDuLteHYjnnQlEK21LDovkyBY7VS3tqArwHMAnmF7WzBbIw135OiG4IDkUnxI2Og+vbUaF+EqQc9V5DHQ8gg== + react-test-renderer@16.8.6: version "16.8.6" resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1"