-
Notifications
You must be signed in to change notification settings - Fork 50.8k
Fork React Native render into an "RT" renderer #11072
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,28 +25,28 @@ | |
| "gzip": 6703 | ||
| }, | ||
| "react-dom.development.js (UMD_DEV)": { | ||
| "size": 613875, | ||
| "gzip": 141842 | ||
| "size": 614249, | ||
|
Contributor
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. Should we update this file or leave it until the next release we build?
Collaborator
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. Doesn't really matter. :-) |
||
| "gzip": 141958 | ||
| }, | ||
| "react-dom.production.min.js (UMD_PROD)": { | ||
| "size": 99469, | ||
| "gzip": 31443 | ||
| "size": 99500, | ||
| "gzip": 31459 | ||
| }, | ||
| "react-dom.development.js (NODE_DEV)": { | ||
| "size": 576136, | ||
| "gzip": 133165 | ||
| "size": 576510, | ||
| "gzip": 133279 | ||
| }, | ||
| "react-dom.production.min.js (NODE_PROD)": { | ||
| "size": 104422, | ||
| "gzip": 32815 | ||
| "size": 104453, | ||
| "gzip": 32832 | ||
| }, | ||
| "ReactDOMFiber-dev.js (FB_DEV)": { | ||
| "size": 573085, | ||
| "gzip": 132629 | ||
| "size": 573391, | ||
| "gzip": 132712 | ||
| }, | ||
| "ReactDOMFiber-prod.js (FB_PROD)": { | ||
| "size": 409433, | ||
| "gzip": 91568 | ||
| "size": 409575, | ||
| "gzip": 91600 | ||
| }, | ||
| "react-dom-test-utils.development.js (NODE_DEV)": { | ||
| "size": 41660, | ||
|
|
@@ -81,36 +81,36 @@ | |
| "gzip": 15465 | ||
| }, | ||
| "react-dom-server.browser.development.js (UMD_DEV)": { | ||
| "size": 129517, | ||
| "gzip": 33434 | ||
| "size": 129604, | ||
| "gzip": 33468 | ||
| }, | ||
| "react-dom-server.browser.production.min.js (UMD_PROD)": { | ||
| "size": 14948, | ||
| "gzip": 5844 | ||
| "size": 14959, | ||
| "gzip": 5848 | ||
| }, | ||
| "react-dom-server.browser.development.js (NODE_DEV)": { | ||
| "size": 99439, | ||
| "gzip": 26329 | ||
| "size": 99526, | ||
| "gzip": 26362 | ||
| }, | ||
| "react-dom-server.browser.production.min.js (NODE_PROD)": { | ||
| "size": 14878, | ||
| "size": 14889, | ||
| "gzip": 5844 | ||
| }, | ||
| "ReactDOMServer-dev.js (FB_DEV)": { | ||
| "size": 98860, | ||
| "gzip": 26238 | ||
| "size": 98947, | ||
| "gzip": 26272 | ||
| }, | ||
| "ReactDOMServer-prod.js (FB_PROD)": { | ||
| "size": 42180, | ||
| "gzip": 11786 | ||
| "size": 42275, | ||
| "gzip": 11813 | ||
| }, | ||
| "react-dom-server.node.development.js (NODE_DEV)": { | ||
| "size": 101717, | ||
| "gzip": 26882 | ||
| "size": 101804, | ||
| "gzip": 26916 | ||
| }, | ||
| "react-dom-server.node.production.min.js (NODE_PROD)": { | ||
| "size": 15803, | ||
| "gzip": 6168 | ||
| "size": 15814, | ||
| "gzip": 6172 | ||
| }, | ||
| "react-art.development.js (UMD_DEV)": { | ||
| "size": 366731, | ||
|
|
@@ -187,6 +187,14 @@ | |
| "react-dom-node-stream.production.min.js (NODE_PROD)": { | ||
| "size": 19585, | ||
| "gzip": 7520 | ||
| }, | ||
| "ReactNativeRTFiber-dev.js (RN_DEV)": { | ||
| "size": 218534, | ||
| "gzip": 37944 | ||
| }, | ||
| "ReactNativeRTFiber-prod.js (RN_PROD)": { | ||
| "size": 167912, | ||
| "gzip": 28774 | ||
| } | ||
| } | ||
| } | ||
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,26 @@ | ||
| /** | ||
| * Copyright (c) 2013-present, Facebook, Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| // Mock of the Native Hooks | ||
|
|
||
| var RCTRTManager = { | ||
| createNode: jest.fn(function createView(tag, classType, props) {}), | ||
| appendChildToDetachedParent: jest.fn(function appendChildToDetachedParent( | ||
| parentTag, | ||
| childTag, | ||
| ) {}), | ||
| beginUpdates: jest.fn(function beginUpdates() {}), | ||
| appendChild: jest.fn(function appendChild(parentTag, childTag) {}), | ||
| prependChild: jest.fn(function prependChild(childTag, beforeTag) {}), | ||
| deleteChild: jest.fn(function deleteChild(childTag) {}), | ||
| updateNode: jest.fn(function updateNode(tag, props) {}), | ||
| completeUpdates: jest.fn(function completeUpdates() {}), | ||
| }; | ||
|
|
||
| module.exports = RCTRTManager; |
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,47 @@ | ||
| /** | ||
| * Copyright (c) 2013-present, Facebook, Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @providesModule ReactNativeRTComponentTree | ||
| * @flow | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| import type {Fiber} from 'ReactFiber'; | ||
|
|
||
| var instanceCache: {[key: number]: Fiber} = {}; | ||
| var instanceProps: {[key: number]: Object} = {}; | ||
|
|
||
| function precacheFiberNode(fiber: Fiber, tag: number): void { | ||
| instanceCache[tag] = fiber; | ||
| } | ||
|
|
||
| function getFiberFromTag(tag: number): null | Fiber { | ||
| return instanceCache[tag] || null; | ||
| } | ||
|
|
||
| function uncacheFiberNode(tag: number): void { | ||
| delete instanceCache[tag]; | ||
| delete instanceProps[tag]; | ||
| } | ||
|
|
||
| function getFiberCurrentPropsFromTag(tag: number): null | Object { | ||
| return instanceProps[tag] || null; | ||
| } | ||
|
|
||
| function updateFiberProps(tag: number, props: Object): void { | ||
| instanceProps[tag] = props; | ||
| } | ||
|
|
||
| var ReactNativeRTComponentTree = { | ||
| precacheFiberNode, | ||
| uncacheFiberNode, | ||
| getFiberFromTag, | ||
| getFiberCurrentPropsFromTag, | ||
| updateFiberProps, | ||
| }; | ||
|
|
||
| module.exports = ReactNativeRTComponentTree; |
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,45 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @providesModule ReactNativeRTEventEmitter | ||
| * @flow | ||
| */ | ||
| 'use strict'; | ||
|
|
||
| var ReactNativeRTComponentTree = require('ReactNativeRTComponentTree'); | ||
| var ReactGenericBatching = require('ReactGenericBatching'); | ||
|
|
||
| var ReactNativeRTEventEmitter = { | ||
| /** | ||
| * Publicly exposed method on module for native objc to invoke when a top | ||
| * level event is extracted. | ||
| * @param {rootNodeID} rootNodeID React root node ID that event occurred on. | ||
| * @param {TopLevelType} topLevelType Top level type of event. | ||
| * @param {object} nativeEventParam Object passed from native. | ||
| */ | ||
| receiveEvent: function( | ||
| rootNodeID: number, | ||
| topLevelType: string, | ||
| nativeEventParam: Object, | ||
| ) { | ||
| var nativeEvent = nativeEventParam; | ||
| var props = ReactNativeRTComponentTree.getFiberCurrentPropsFromTag( | ||
| rootNodeID, | ||
| ); | ||
| if (props == null) { | ||
| return; | ||
| } | ||
| var eventHandler = props[topLevelType]; | ||
| if (typeof eventHandler !== 'function') { | ||
| return; | ||
| } | ||
| ReactGenericBatching.batchedUpdates(function() { | ||
| eventHandler(nativeEvent); | ||
| }); | ||
| }, | ||
| }; | ||
|
|
||
| module.exports = ReactNativeRTEventEmitter; |
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.
No
parentTag? (Is this inferred from thebeforeTag?)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.
yes