-
Notifications
You must be signed in to change notification settings - Fork 127
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 a decision about the Dimensions module #291
Comments
Except a bug introduced with RN 0.63 that completely breaks the Dimensions API (which is fixed it seems facebook/react-native#29451), the API works fine most of the time. I would like to address some of the issues here, rather than filing a new bug report for each separate problem (which can take months or will end up just ignored).
Getting precise screen dimensions is sometimes a must for things like images, video, and camera layouts. The current flex-box engine is not enough for some cases, and the only available option is to do the layout ourselves using the dimensions API. Because of this, it is of uttermost importance for these primitives to work across all devices. React native is great, requesting to deprecate it seems like too much, but looking at how each release introduces more bugs than improvements (that are at least useful), I would also recommend to at least get one major version of just bugfixes instead of new features. |
@cristianoccazinsp Thank you for this summary. Just to add up to this, I believe this issue (facebook/react-native#27089) affecting Keyboard events measures is related to the notch inconsistency. Oh and deprecating React Native was intended as an absurd echo to "use a third party plz", it's a joke :-). |
Thanks for posting @jsamr, I appreciate how much care you have for React Native. I agree that Dimensions is in a pretty sad state. There are other classes of problems we've seen with it that haven't been mentioned in your posts yet either. For example, if you have multiple root views it returns the dimensions of the first (I think) root view. That means that on desktop applications for Windows or macOS, if you have multiple windows Dimensions will only return the API for the first window, not the window it is being called from!
While it doesn't actually provide a resolution to the problem, it's worth noting that the team at Facebook agrees that a workaround is not a solution. While we are glad a workaround exists, this is still clearly a footgun that keeps people from falling into the pit of success with React Native for this use case. It's also worth noting that it wasn't closed by a Facebook employee. I'll reopen the issue because it is still a valid issue. As we are a small team working on React Native, we have had to prioritize our attention. That attention has been spent on the major architecture projects like Fabric and TurboModules as these require the most specialized knowledge and we believe will have the biggest impact on the ecosystem. Since we have been unable to prioritize improving these issues around Dimensions, the community has the opportunity to jump in. Either by sending PRs that improve the situation, or by contributing to a solution outside of core. We have merged PRs to Dimensions when they come up, like this one fixing the rotation issue 2 days ago. One worry is that Dimensions has been broken for so long that apps may have hard coded workarounds such that fixes to the semantics to Dimensions would actually break their products. If that's the case, we may need a new API in core like |
I wrote pr facebook/react-native#30919 ☮️ 🙏 ❤️ |
Any ideas if facebook/react-native#29451 would also be fixed with this or other PRs included in the next release? We have been stuck with 0.62.2 for a while now due to this. |
Introduction
A lot of React Native consumers rely on the screen and window dimensions to compute their layouts. Yet, after 5 years of React Native releases, this module is still unreliable. The frustration of users is palpable:
Details
The issue facebook/react-native#23693 has moreover been closed with a dubious rationale, "we've been provided with a hacky workaround, and you could use a third-party library, so I am going to close". For a lot of users, this attitude is infuriating, and makes them wonder what kind of dysfunctional human resources management at Facebook is ruling behind the scene.
Imagine a browser for which document.clientWidth and document.clientHeight behavior would depend on versions, platforms, etc... This is untenable for a project of this reach. Dimensions module is supposed to be a building block, it is expected to have an excellent test coverage, including on-device.
Discussion points
In my opinion, there are three ways to address the issue:
Don't get me wrong, React Native can be awesome. But I believe the community could be treated will a little more care, and I strongly recommend decision makers to take into account the image they project through their policies in Open Source communities.
The text was updated successfully, but these errors were encountered: