Skip to content
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

Merged
merged 20 commits into from
Apr 20, 2016

Conversation

sebmarkbage
Copy link
Collaborator

This creates a new react-native-renderer package which contains the React integration for React Native. (Although in reality the files live in the react package just like for react-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.

@sebmarkbage sebmarkbage added this to the 15.0 milestone Mar 25, 2016
@iamdustan
Copy link
Contributor

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?

@sebmarkbage
Copy link
Collaborator Author

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.

@iamdustan
Copy link
Contributor

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",
Copy link
Contributor

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

Copy link
Collaborator Author

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. :)

@facebook-github-bot
Copy link

@sebmarkbage updated the pull request.

var UIManager = require('UIManager');

var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
var invariant = require('fbjs/lib/invariant');
Copy link
Member

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.

Copy link
Collaborator Author

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.

@zpao
Copy link
Member

zpao commented Mar 25, 2016

We might want to consider this as part of 15.0

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?

@sebmarkbage
Copy link
Collaborator Author

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 react to fix it regardless.

Ideally we should only have to release a new version of react-native-renderer to do these fixes, but we can't because everything still actually lives in react and we don't have flat bundles that copies the relevant shared code to each renderer package. They still share the same modules.

@zpao
Copy link
Member

zpao commented Mar 25, 2016

we can't because everything still actually lives in react

Oh right… that.

@zpao
Copy link
Member

zpao commented Mar 25, 2016

I'm still working on compatibility with RN. There are a lot of things broken with 15 in RN

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 :)

@sebmarkbage
Copy link
Collaborator Author

Also also, how is this going to affect our internal syncing?

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.

As long as our core API doesn't change and we wouldn't need to ship a v16

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.

@facebook-github-bot
Copy link

@sebmarkbage updated the pull request.

@zpao zpao modified the milestones: 15.x, 15.0 Mar 30, 2016
@facebook-github-bot
Copy link

@sebmarkbage updated the pull request.

@facebook-github-bot
Copy link

@sebmarkbage updated the pull request.

@facebook-github-bot
Copy link

@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 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.
@sebmarkbage sebmarkbage merged commit c84ad52 into facebook:master Apr 20, 2016
@facebook-github-bot
Copy link

@sebmarkbage updated the pull request.

zpao added a commit to zpao/react that referenced this pull request Apr 20, 2016
@zpao zpao modified the milestones: 15.0.x, 15.x Apr 20, 2016
zpao added a commit that referenced this pull request Apr 20, 2016
zpao pushed a commit that referenced this pull request Apr 20, 2016
Move React Core Integration and Injection to the Core Repo
(cherry picked from commit c84ad52)
zpao added a commit that referenced this pull request Apr 20, 2016
Clean up package.json after #6338
(cherry picked from commit bddecc9)
ghost pushed a commit to facebook/react-native that referenced this pull request Apr 21, 2016
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
@zpao zpao modified the milestones: 15.0.2, 15.0.x Apr 28, 2016
ptmt pushed a commit to ptmt/react-native that referenced this pull request May 9, 2016
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
zebulgar pushed a commit to nightingale/react-native that referenced this pull request Jun 18, 2016
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
samerce pushed a commit to iodine/react-native that referenced this pull request Aug 23, 2016
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
cpojer pushed a commit to facebook/metro that referenced this pull request Jan 26, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants