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

React Native support #18

Open
iamdustan opened this issue Mar 30, 2015 · 13 comments
Open

React Native support #18

iamdustan opened this issue Mar 30, 2015 · 13 comments

Comments

@iamdustan
Copy link
Contributor

I haven’t peaked behind the covers of react-native too much yet so I have no idea on the effort involved. Is this something you’d be interested in this project supporting?

@ericclemmons
Copy link
Owner

Absolutely! I'm rewriting this to be a HoC (much like we've been seeing since React Conf), and now that React Native has been open-sourced since F8, testing this should be possible.

Would you mind if I requested your help on the React Native part?

@iamdustan
Copy link
Contributor Author

I’d be happy to. Help come up with a list or pointers on what will need to be resolved (if anything) between the implementations and I’ll throw some weight at it.

@ericclemmons
Copy link
Owner

Will do! Once this next version is released, we can do a patch for React Native support, since it's the bomb-diggity.

@iamdustan
Copy link
Contributor Author

👍 looking forward to it. I’ve just been doing npm install --force to use this with react 0.13 (and falling back to React.createClass where I need to) 😄

@ericclemmons
Copy link
Owner

@iamdustan Wanna take a stab @ seeing what this does within React Native? :)

@iamdustan
Copy link
Contributor Author

Sure do! I’ll hopefully get to this tomorrow or over the weekend.

@iamdustan
Copy link
Contributor Author

Initial status: react-native’s haste module system/dependency graph seems to be failing for me.

[11:44:07] <START> find dependencies
Error: Cannot find package main file for package: /NativeWithResolverExperiment/node_modules/react-native/node_modules/react-tools/src
    at DependecyGraph.resolveDependency (/NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.j
    at /NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:122:22
    at Array.forEach (native)
    at collect (/NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:120:25)
    at /NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:135:9
    at Array.forEach (native)
    at collect (/NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:120:25)
    at /NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:135:9
    at Array.forEach (native)
    at collect (/NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js:120:25)
    at DependecyGraph.getOrderedDependencies (/NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/in
    at /NativeWithResolverExperiment/node_modules/react-native/packager/react-packager/src/DependencyResolver/haste/index.js:91:35
    at tryCatcher (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/promise.js:454:31)
    at Promise._settlePromiseAt (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/promise.js:530:18)
    at Async._drainQueue (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/async.js:180:12)
    at Async._drainQueues (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/async.js:185:10)
    at Async.drainQueues (/NativeWithResolverExperiment/node_modules/react-native/node_modules/bluebird/js/main/async.js:15:14)

@ericclemmons
Copy link
Owner

React Tools? I wonder if that's related to the need for react/addons causing issues in #27:

#27 (comment)

@ericclemmons
Copy link
Owner

I know it's poor taste to close issues just to re-create them in the future, but the React landscape has changed quite a bit & I'm not sure that React Native fits well with this project.

If it does fit well, then I'll re-address post v2.

@jbreemhaar
Copy link

I know this issue is old but you might find it interesting:
I'm currently using/protyping react-resolver in react-native with 3 small changes in the source (removed the window reference, renderToStaticMarkup and the static render in Resolver).

All my resolver code written for web (and lots of components) pretty much works instantly on react-native. Awesome.

@ericclemmons ericclemmons reopened this Aug 29, 2017
@ericclemmons
Copy link
Owner

@jeroentradecast Re-opening because you were able to get it to work.

Would you be able to supply a bit of a diff or a PR for these changes?

I've honestly never ran React Native, so I don't have a clue where to begin :)

I imagine if we were to publish, there'd be a react-resolver/native export that would fix these signatures.

@jbreemhaar
Copy link

jbreemhaar commented Aug 30, 2017

@ericclemmons

I don't think I'll have enough time in the coming two weeks (almost vacation yay) to write out a complete PR for this feature but I've written some pseudo PR you could have a look at. #130.

edit. The problem I currently have is the import of react-dom/server, it'll try to resolve node modules (stream).

@ericclemmons
Copy link
Owner

@jeroentradecast Thanks for #130, and no worries. Enjoy your vacation :)

The changes look minimal. I think I'll take #130 and finally create a react-native example to test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants