-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Move React Core Integration and Injection to the Core Repo #6338
Conversation
I’m curious if you’ve considered doing the inverse of this and moving the DOM renderer out to it’s own repo rather than consolidating the FB renderers in here? |
Once we have a more stable contract for renderers we might do that but currently it is unstable. It is too hard to iterate on the internals and keep them in sync when they're in separate repos. It is also too easy to create massive cross dependencies. The idea isn't that these files will remain RN specific but to make more of this stuff shared and narrow the external contract. |
Copy that. The React external contract is already so solid. It will be an amazing feat of engineering and API design whenever React gets to the point where the custom renderer contract is as stable and small as the public API. |
}, | ||
"homepage": "https://facebook.github.io/react-native/", | ||
"dependencies": { | ||
"fbjs": "0.1.0-alpha.4", |
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.
I’m assuming this is copied out of RN? The current release listed on https://www.npmjs.com/package/fbjs is v0.8.0-alpha.3
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.
good call. This was actually long before fbjs was in RN. I should update this. @zpao Your warning didn't catch this. :)
08d9350
to
2b7128b
Compare
@sebmarkbage updated the pull request. |
var UIManager = require('UIManager'); | ||
|
||
var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); | ||
var invariant = require('fbjs/lib/invariant'); |
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.
Pretty sure these are going to get rewritten to './fbjs/lib/invariant'
, might just want to make them 'invariant'
for now.
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.
hehe. I should've pushed last night. Fixed this locally.
2 RCs deep is not really the time to drop this… Is there a less aggressive thing we can do to make sure RN works with 15 and do something like this for 15.1? Also, looks like this is purely new stuff and doesn't touch any of our existing code that would be in the React package. Could we perhaps just ship React 15 without needing this and then clean this up and ship the new package, like next week. Also also, how is this going to affect our internal syncing? |
I'm still working on compatibility with RN. There are a lot of things broken with 15 in RN. That's exactly why we need to fix this since we've gone way too long without making it RN compatible. Not sure yet if that would need a new release of Ideally we should only have to release a new version of |
Oh right… that. |
Honestly, that makes me want to push to 15.1 even more. Do you expect any core API changes to accommodate RN? As long as our core API doesn't change and we wouldn't need to ship a v16, I'm leaning strongly towards just saying we get 15.0 out and do what ever else we need in 15.1, even if that happens relatively soon after. We've been sitting on this release for too long already and I don't really want to push a couple more weeks & do more RCs. That's the nice thing about having these major version numbers :) |
We might need to stub out the missing files to satisfy the module systems but other than that it shouldn't affect us. We can just pull in the files that won't be required.
I don't think we'll need to make it 16. We can't make it a patch though. The minor could potentially break other renderers like React ART since, again, they still share the same internal modules. If that's the case it is arguable that it would need to be a v16 release. |
2b7128b
to
ad03e18
Compare
@sebmarkbage updated the pull request. |
@sebmarkbage updated the pull request. |
ad03e18
to
5d7771a
Compare
@sebmarkbage updated the pull request. |
61bbb0f
to
ddd395d
Compare
@sebmarkbage updated the pull request. |
This has a different file name from its providesModule. Screws up our build scripts.
Changes to event overloading structure
...even though they technically still are attached by.
This is the new protocol.
This can happen in edge cases where he listeners are already unmounted or not mounted yet or something.
This isn't actually used right now so I can't test it. Because the Chrome devtools are broken for React Native. The Nuclide integration is in the react-native repo.
This is causing build errors. This should be in the downstream repo if anything. Relay has its own shim that should be preferred.
35239c4
to
ada60c4
Compare
@sebmarkbage updated the pull request. |
Clean up package.json after #6338
Move React Core Integration and Injection to the Core Repo (cherry picked from commit c84ad52)
Summary:Adding the react native renderer dependency and various fixes to support React 15. Don't use dispatchID for touchableHandleResponderGrant This callback argument was removed because "IDs" no longer exist. Instead, we'll use the tag from the event target. The corresponding PR on React Core is: facebook/react#6338 Reviewed By: spicyj Differential Revision: D3159788 fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9 fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
Summary:Adding the react native renderer dependency and various fixes to support React 15. Don't use dispatchID for touchableHandleResponderGrant This callback argument was removed because "IDs" no longer exist. Instead, we'll use the tag from the event target. The corresponding PR on React Core is: facebook/react#6338 Reviewed By: spicyj Differential Revision: D3159788 fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9 fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
Summary:Adding the react native renderer dependency and various fixes to support React 15. Don't use dispatchID for touchableHandleResponderGrant This callback argument was removed because "IDs" no longer exist. Instead, we'll use the tag from the event target. The corresponding PR on React Core is: facebook/react#6338 Reviewed By: spicyj Differential Revision: D3159788 fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9 fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
Summary:Adding the react native renderer dependency and various fixes to support React 15. Don't use dispatchID for touchableHandleResponderGrant This callback argument was removed because "IDs" no longer exist. Instead, we'll use the tag from the event target. The corresponding PR on React Core is: facebook/react#6338 Reviewed By: spicyj Differential Revision: D3159788 fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9 fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
Summary:Adding the react native renderer dependency and various fixes to support React 15. Don't use dispatchID for touchableHandleResponderGrant This callback argument was removed because "IDs" no longer exist. Instead, we'll use the tag from the event target. The corresponding PR on React Core is: facebook/react#6338 Reviewed By: spicyj Differential Revision: D3159788 fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9 fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
This creates a new
react-native-renderer
package which contains the React integration for React Native. (Although in reality the files live in thereact
package just like forreact-dom
because builds.)I moved the most core files over but I still want to see how we can further minimize the contract. The individual commits show the process.
Currently everything in
src/renderers/native/ReactNative/__mocks__/
have to required from the platform.This also contains some patches to make this compatible with 15.0. As well as enabling spread properties.
I still need to run further test in the React Native repo to ensure everything works as expected.
We might want to consider this as part of 15.0 to avoid publishing a 15.1 immediately after since we'd have to do a minor bump for this stuff.