-
Notifications
You must be signed in to change notification settings - Fork 16
WIP: React Native Windows Support #193
base: master
Are you sure you want to change the base?
Conversation
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 excited to see this happen! I haven't done much RN at all, so I can't really help you in any good way right now. I know @lelandrichardson (who added RN support for iOS and Android) has been rather busy lately, but hopefully he could chime in here.
@@ -17,6 +17,6 @@ | |||
"happo-viewer": "../happo-viewer", | |||
"happo-core": "../happo-core", | |||
"happo-target-react-native": "../happo-target-react-native", | |||
"happo-uploader-s3": "../happo-target-react-native" | |||
"happo-uploader-s3": "../happo-uploader-s3" |
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 catch!
cc @spikebrehm as well |
"build:server": "../../node_modules/.bin/babel src -d lib --ignore __tests__", | ||
"build": "npm run build:runner:ios && npm run build:runner:android && npm run build:server", | ||
"watch": "npm run build:server -- --watch" | ||
}, | ||
"devDependencies": { | ||
"react-native": "^0.40.0", | ||
"react-native-view-shot": "^1.5.1" | ||
"react-native-view-shot": "^1.5.1", | ||
"react-native-windows": "^0.43.0-rc.0", |
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.
just curious, but does having react-native and react-native-windows both in our dev deps preclude us from doing non react-native-windows development? I'm somewhat ignorant of how this works.
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.
@lelandrichardson It doesn't preclude non react-native-windows development but it is a fairly large dependency to include if you're not working on windows. I was thinking of including as an optional dependency but I wasn't sure if that was the right approach either.
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.
Interesting. I'm tempted to agree this should be an optionalDependency. We could even create happo-target-react-native-windows
, which would include this dependency. It may be a bit more work to modularize the code properly then.
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.
optionalDependency
would be worse, as that would make all of our users install it as well
Other than the included sample project, this looks like a very simple addition - so that's good! One thing to keep in mind is that @spikebrehm and I were discussing not including the runner app as part of the target... but it's really not clear what the right thing to do is at this point. Internally, we've found the runner project to not be all that useful because in order to have meaningful screenshots we need to add in a lot of our own stuff (like fonts for instance), so we end up just creating a small runner project ourselves and don't use the one inside the npm package. I'm curious if @spikebrehm has any thoughts here. |
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.
LGTM! I'm not able to test it without a Windows machine, but I trust you've tested it and it works.
@ryanlntn are you available to provide code reviews for any PRs that touch the Windows stuff?
The build is failing due to ESLint errors:
|
Yeah, the iOS/Android If we find that most apps require some customization of the In any case, this isn't a blocker for this PR! |
@spikebrehm I'm actually still having trouble connecting everything. At this point I have the packager and driver initializing and resolving but the runner app is failing with a |
Hi! I'm working on adding React Native Windows support to the React Native target. So far I've ported react-native-view-shot to Windows and updated the target code the best I can to support the Windows platform but I'm running into a snag when I actually try to run it against the example project. It seems as though the example project isn't being run inside the host RN app but outside where it fails with
__DEV__ is undefined
. I'm still trying to work this out on my end but thought I'd open this PR in case there was something obvious I was missing that you could point out.