seekshiva / react-native-remote-svg

Adds support for loading svg images in React Native
MIT License
184 stars 71 forks source link

Add native web module for Android #15

Open alekspickle opened 6 years ago

alekspickle commented 6 years ago

I stumbled upon one issue, that Android was just unable to render what I wanted to, while iOS was definately happy with RN WebView, So I was able to increase performance of Android device with another great lib! I thought you could include this. Your call anyway))

P.S. by the way, thank you for great library!

seekshiva commented 5 years ago

Thanks for the PR. Sorry in the delay in getting to reviewing this.

react-native-webview-android has native dependencies, and all the projects I have are built on top of Expo platform and can only be pure JS. So bringing in a native module is not an option for me.

I'm curious about how much perf improvements this library brings over the WebView that comes with react-native. Can you provide some stats on that? Will consider merging this change in if the perf improvement is very drastic.

Thanks

alekspickle commented 5 years ago

I had somewhat specific goal to work (imho) unnecessary complex SVG as avatar pics (with shades and stuff). So without this native webview on Android it was absolutely impossible to debug or use app, because of delays near 20s after each avatar part change. What I have been done is absolute sin and I wouldn't recommend to do that, but again - I had a task and there wasn't neither obvious nor any good solution whatsoever.

As for numbers. I did improved render time in 5-6 times on Android (maybe more, I mean now it at least seems to be not worse than any Instagram lags) and haven't found any solution for those horribly complex SVG on iOS. But as for using SVG in native you are absolutely great, I have no doubt that it would work with reasonable usage👏