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

Make react-native-windows an optionalDependency and match react-nativ… #191

Merged

Conversation

NathanJolly
Copy link
Contributor

@NathanJolly NathanJolly commented Jun 11, 2020

…e to docs

Summary

Want to fix these erroneous warnings:

warning " > @react-native-community/datetimepicker@2.4.0" has incorrect peer dependency "react@>=16.11".
warning " > @react-native-community/datetimepicker@2.4.0" has incorrect peer dependency "react-native@>=0.61".
warning " > @react-native-community/datetimepicker@2.4.0" has unmet peer dependency "react-native-windows@^0.62.0-preview.1".

README has instructions for react-native <0.60, and there have been no related code changes that would require >=0.61

Also would like to fix: #173

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js)

@vonovak vonovak merged commit feda177 into react-native-datetimepicker:master Jun 14, 2020
@vonovak
Copy link
Member

vonovak commented Jun 14, 2020

thanks!

@rectified95
Copy link
Collaborator

"README has instructions for react-native <0.60, and there have been no related code changes that would require >=0.61"

-> I added Windows support for the date picker a month ago.
React Native Windows officially support the latest RN version, currently 0.62, older ones are best effort, even more so for RNW before 0.61. This is especially important for community modules, where there have been updates to the ABI surface in the communication between core and the modules.

@vonovak I'll soon publish a PR implementing the TimePicker, bringing the Windows part to parity with Android/iOS.
Can we begin a discussion about upgrading the RN version this module supports? It's usually a good idea to track the latest stable from FB.

@leethree
Copy link

how do I not install react-native-windows in my project? I don't want to use it and yarn install --ignore-optional doesn't work.

@luancurti
Copy link
Member

@leethree there are no problem with yarn install an warning should show but I can ignore this warning

@leethree
Copy link

The issue is we don't want to install react-native-windows in our project because our app does not supporting windows and there's no plan to support it. I'm assuming putting it in optionalDependency means it's optional and not required, right?

@rectified95
Copy link
Collaborator

rectified95 commented Jul 30, 2020

@leethree
Yes, optional deps are not required. Optional deps won't fail the app installation process if they don't get installed themselves, but it doesn't mean they get skipped by default.
If yarn install --ignore-optional doesn't work for you, then it sounds like a problem with yarn that you could escalate in their repository.

As a side note, Microsoft and Facebook are investing in Windows support for RN to make it a first-class platform alongside iOS and Android. That will result in one of the 2 scenarios in the future:
either iOS and Android-specific code will be stripped out of RN and become out-of-tree platforms like Windows is now, or Windows will be merged upstream to the RN repo. My point being, at some point not installing Windows with RN might be like saying: "I wanna use RN but not the Android part.."

@leethree
Copy link

@rectified95 Ah make sense. It's probably a yarn issue as it doesn't respect ignore-optional flag for some reason.

I see your point on Windows support but I doubt it will happen any time soon. But thanks a lot for the explanation!

@rectified95
Copy link
Collaborator

@leethree I'd say the effort is pretty advanced, with multiple 1st-party Microsoft apps built on RN already. As a fun fact, FB is now rewriting their desktop Messenger app using React Native for Windows, created by Microsoft. For your reference: https://microsoft.github.io/react-native-windows/docs/getting-started

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer dependency warning
5 participants