-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Move React Core Integration and Injection to the Core Repo #6338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f463b73
Copy files from the react-native repo
sebmarkbage 6c885d2
Remove duplicates and move files out of native/vendor
sebmarkbage fe395de
Move React Native platform files back
sebmarkbage 8806463
Add Object Spread Support to Our Babel Config
sebmarkbage caa6aba
Build an dedicated npm package for react-native-renderer
sebmarkbage 240dfae
Add React Native Modules to module map + fix fbjs
sebmarkbage 91e62c7
Strip isomorphic stuff from the ReactNative module
sebmarkbage d8e8ea5
Add test and mocks
sebmarkbage f833516
Fix 0.15 compatibility
sebmarkbage 97b079b
Fix ReactNativeComponentEnvironment providesModule
sebmarkbage 75cec60
Get rid of rootNodeIDs they're just tags now
sebmarkbage 3287d93
Build up a native component cache for event dispatching
sebmarkbage 4fcdf02
Listeners are not attached by ID in the API
sebmarkbage dc188dd
Update ReactNativeDOMIDOperations to deal with a single parent node
sebmarkbage 0640921
Bump package versions
sebmarkbage 22a8f99
Don't try to get the target node for responder if there is no listener
sebmarkbage c7d90e2
Ensure react-native-renderer package gets copied
sebmarkbage 5470972
Update devtools injection
sebmarkbage 744548a
Fix lint for moved ReactNative
sebmarkbage ada60c4
Remove ReactDOM.native shim
sebmarkbage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 @@ | ||
| 'use strict'; | ||
|
|
||
| var fs = require('fs'); | ||
| var grunt = require('grunt'); | ||
|
|
||
| var src = 'packages/react-native-renderer/'; | ||
| var dest = 'build/packages/react-native-renderer/'; | ||
|
|
||
| function buildRelease() { | ||
| if (grunt.file.exists(dest)) { | ||
| grunt.file.delete(dest); | ||
| } | ||
|
|
||
| // Copy to build/packages/react-native-renderer | ||
| var mappings = [].concat( | ||
| grunt.file.expandMapping('**/*', dest, {cwd: src}), | ||
| grunt.file.expandMapping('{LICENSE,PATENTS}', dest) | ||
| ); | ||
| mappings.forEach(function(mapping) { | ||
| var mappingSrc = mapping.src[0]; | ||
| var mappingDest = mapping.dest; | ||
| if (grunt.file.isDir(mappingSrc)) { | ||
| grunt.file.mkdir(mappingDest); | ||
| } else { | ||
| grunt.file.copy(mappingSrc, mappingDest); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| function packRelease() { | ||
| var done = this.async(); | ||
| var spawnCmd = { | ||
| cmd: 'npm', | ||
| args: ['pack', 'packages/react-native-renderer'], | ||
| }; | ||
| grunt.util.spawn(spawnCmd, function() { | ||
| var buildSrc = 'react-native-renderer-' + grunt.config.data.pkg.version + '.tgz'; | ||
| var buildDest = 'build/packages/react-native-renderer.tgz'; | ||
| fs.rename(buildSrc, buildDest, done); | ||
| }); | ||
| } | ||
|
|
||
| module.exports = { | ||
| buildRelease: buildRelease, | ||
| packRelease: packRelease, | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
| # `react-native-renderer` | ||
|
|
||
| This package is the renderer that is used by the react-native package. | ||
| It is intended to be used inside the react-native environment. It is not | ||
| intended to be used stand alone. |
This file contains hidden or 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,3 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = require('react/lib/ReactNative'); |
This file contains hidden or 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,23 @@ | ||
| { | ||
| "name": "react-native-renderer", | ||
| "version": "16.0.0-alpha", | ||
| "description": "React package for use inside react-native.", | ||
| "main": "index.js", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/facebook/react.git" | ||
| }, | ||
| "keywords": [ | ||
| "react", | ||
| "react-native" | ||
| ], | ||
| "license": "BSD-3-Clause", | ||
| "bugs": { | ||
| "url": "https://github.com/facebook/react/issues" | ||
| }, | ||
| "homepage": "https://facebook.github.io/react-native/", | ||
| "dependencies": { | ||
| "fbjs": "^0.8.0", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove this. |
||
| "react": "^16.0.0-alpha" | ||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/renderers/native/ReactIOS/IOSDefaultEventPluginOrder.js
This file contains hidden or 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,19 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, 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 IOSDefaultEventPluginOrder | ||
| * @flow | ||
| */ | ||
| 'use strict'; | ||
|
|
||
| var IOSDefaultEventPluginOrder = [ | ||
| 'ResponderEventPlugin', | ||
| 'IOSNativeBridgeEventPlugin', | ||
| ]; | ||
|
|
||
| module.exports = IOSDefaultEventPluginOrder; |
71 changes: 71 additions & 0 deletions
71
src/renderers/native/ReactIOS/IOSNativeBridgeEventPlugin.js
This file contains hidden or 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,71 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, 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 IOSNativeBridgeEventPlugin | ||
| * @flow | ||
| */ | ||
| 'use strict'; | ||
|
|
||
| var EventPropagators = require('EventPropagators'); | ||
| var SyntheticEvent = require('SyntheticEvent'); | ||
| var UIManager = require('UIManager'); | ||
|
|
||
| var merge = require('merge'); | ||
| var warning = require('warning'); | ||
|
|
||
| var customBubblingEventTypes = UIManager.customBubblingEventTypes; | ||
| var customDirectEventTypes = UIManager.customDirectEventTypes; | ||
|
|
||
| var allTypesByEventName = {}; | ||
|
|
||
| for (var bubblingTypeName in customBubblingEventTypes) { | ||
| allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; | ||
| } | ||
|
|
||
| for (var directTypeName in customDirectEventTypes) { | ||
| warning( | ||
| !customBubblingEventTypes[directTypeName], | ||
| 'Event cannot be both direct and bubbling: %s', | ||
| directTypeName | ||
| ); | ||
| allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; | ||
| } | ||
|
|
||
| var IOSNativeBridgeEventPlugin = { | ||
|
|
||
| eventTypes: merge(customBubblingEventTypes, customDirectEventTypes), | ||
|
|
||
| /** | ||
| * @see {EventPluginHub.extractEvents} | ||
| */ | ||
| extractEvents: function( | ||
| topLevelType, | ||
| targetInst, | ||
| nativeEvent, | ||
| nativeEventTarget | ||
| ): ?Object { | ||
| var bubbleDispatchConfig = customBubblingEventTypes[topLevelType]; | ||
| var directDispatchConfig = customDirectEventTypes[topLevelType]; | ||
| var event = SyntheticEvent.getPooled( | ||
| bubbleDispatchConfig || directDispatchConfig, | ||
| targetInst, | ||
| nativeEvent, | ||
| nativeEventTarget | ||
| ); | ||
| if (bubbleDispatchConfig) { | ||
| EventPropagators.accumulateTwoPhaseDispatches(event); | ||
| } else if (directDispatchConfig) { | ||
| EventPropagators.accumulateDirectDispatches(event); | ||
| } else { | ||
| return null; | ||
| } | ||
| return event; | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = IOSNativeBridgeEventPlugin; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to make it short and drop the object, just make it
"facebook/react"?