-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: **This PR depends on an unreleased version of `fbjs`, so DO NOT MERGE.** When merged along with facebook/react-native#5084, facebook/fbjs#95, and whatever PR fixes facebook/react-native#4062 (which I will update this issue with when I push it), this fixes #26. The changes to Relay itself are super minor here: 1. Remove the reliance on ReactDOM. The only use of ReactDOM is `unstable_batchedupdates`. So to fix, I abstracted the reference to `unstable_batchedupdates` to it's own module, and then took advantage of the "react-native" `package.json` option, supported by the React Native packager, to load the correct version of this function given the execution context. 2. Removed `react-dom` from peerDependencies (but kept it in devDependencies, for use in tests), and also upgrade the `fbjs` dependency to a (yet unreleased) version that provides better compatibility with React Native. Closes #713 Reviewed By: yungsters Differential Revision: D2872129 fb-gh-sync-id: f6ba6d06cfdde8ad8cbb0c7cd9d645f44f65e437
- Loading branch information
Showing
7 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = require.requireActual('relayUnstableBatchedUpdates'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule relayUnstableBatchedUpdates | ||
* @flow | ||
* @typechecks | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const ReactDOM = require('ReactDOM'); | ||
|
||
module.exports = ReactDOM.unstable_batchedUpdates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule relayUnstableBatchedUpdates | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const ReactNative = require('ReactNative'); | ||
|
||
module.exports = ReactNative.unstable_batchedUpdates; | ||
This comment has been minimized.
Sorry, something went wrong.
josephsavona
Contributor
|
@skevy for reference, this is the alternative to adding a module to the jest config - it's a bit easier for us since there are multiple jest configs (FB, GitHub) that would have to be updated.