jmstout / react-native-viewport-units

Incredibly simple utility for (sort of) using viewport units with React Native.
MIT License
158 stars 25 forks source link

Still Maintained? #6

Open DevanB opened 7 years ago

DevanB commented 7 years ago

Is this repo still maintained? If not, would you @jmstout be willing to turn over the repo and nom package to myself? I would love to update and maintain this project so others can use it!

Thanks!

Dauta commented 6 years ago

@DevanB seems like it's not maintained anymore and it refuses to work inside create-react-native-app project. Why don't you fork it and maintain/update the fork?

jmstout commented 6 years ago

Hi @DevanB,

Thanks for reaching out. I regret neglecting my duties as a maintainer of this repo, and would be happy to add you as a contributor or maintainer.

That being said, I think it might be best if this library is deprecated and removed from npm.

Using it will result in blurry text among other rendering issues, and unless we can come up with a decent solution, this module probably does more harm than good.

There's some mention of this problem in the PixelRatio docs.

In iOS, you can specify positions and dimensions for elements with arbitrary precision, for example 29.674825. But, ultimately the physical display only have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334 for iPhone 6. iOS tries to be as faithful as possible to the user value by spreading one original pixel into multiple ones to trick the eye. The downside of this technique is that it makes the resulting element look blurry.

I would like to use viewport syntax with react-native, however I don't believe it's worth it, given the tradeoffs. Perhaps there are solutions – I haven't yet looked into how the react-native team has implemented percentage based values. Maybe there's an answer there.

But, ultimately, I think this functionality belongs in react-native core as the 10*vw syntax is just an ugly hack. Unfortunately, I don't have the time right now to address this.

Let me know what you all think. A solution to the arbitrary precision problem would be great.

diosney commented 5 years ago

A solution to the arbitrary precision problem would be great.

Make a breaking change vh, vw, vmin, vmax to be functions, that round to nearest integer, something like:

height: vh(56);