144 points · by rgommezz · 6y ago · 97 comments
RIP native development, long live non-native native development?
Just wait until your BBQ has its own browser - oh shit wait
It's not because JavaScript is portable or accessible (it's definitely not portable, and if you wanted accessibility you could do much better), it's simply because it's the most popular language.
More and more gets ported to the GPU through parallelized algorithms, and smart GPU memory usage — but CPUs still offer a lot in their ability to do generalized computing.
This is why as I’ve gotten older I’ve come to really respect Computer Science fundamentals; the more you understand how to make the most of resource constraints — whether time, or memory, etc — the more magic you can make.
I think Apple has said that Core Animation (and maybe Core Graphics) now use Metal where possible, but vector to bitmap rendering is still done on the cpu.
https://raphlinus.github.io/rust/graphics/gpu/2019/05/08/mod...
If web frameworks really reupload the whole view to GPU on each frame, it's no wonder all apps run like arse and burn battery.
Guaranteed good performance (the bit you picked up on) for a feature people want in an easy to use package sounds great. Well done the author and thanks for sharing your work.
What a trainwreck of a headline. It sounds like someone fell asleep on the push button of a 'modern web dev' phrase generator.
Excited to check this out!
A lot of fluid animations and interactions in React Native are finally not that much of a hurdle anymore thanks to react-native-gesture-handler and reanimated, which are brilliant abstractions that fully offload work to the native thread and don’t interrupt interactions due to work on the main thread.
React Native’s own primitives, like Animated, can only go so far until they require intervention or activation from the main thread.
These libraries by Software Mansion have basically become a “must have” for creating compelling apps in React Native.
I just really recommend to use our library (https://github.com/openland/react-native-fast-animations) for non interactive animations like appearing and disappearing. Since iOS and Android could block UI thread during initial layouting if there are a lot of content and you will get dropped frames or just broken animation (if freeze will be ~200ms).
This is important since iOS actually rely that all animations are done via Core Animation that could not be blocked by main thread and therefore a lot of UI widgets are just slow on first view. Most iOS developers don't care if instantiating view will take 50ms since you have 300ms budget for all transition animations.
This library does same thing for Android by "hacking" native API the same way as official Google Apps do. This is a shame that google not opening this API.
Now we have three to maintain.
I have built native interfaces that would interface C# code, that was slightly less pleasant as a developer experience while I would get a 100% native experience for the user and a better programming language in return.
So what you gain in getting a singular code base for at least your logic and data parts you lose because you're chasing bugs that would never happen if you would have used a better programming language.
The average native project I've seen had 5-15 dependencies. The average React Native project thousands and thousands of them.
I'm interested to read more about that, do you have an article or something?
It's too bad it's an interface element that causes a lot of pain by covering content and embracing dark patterns.
- The user doesn't lose their navigation stack because they can tell the bottom sheet can be dismissed, they know where they "came from"
- The user keeps visual context on whatever triggered the bottom sheet, because they can still see what's behind it
- The user doesn't get forcibly navigated away from whatever they were browsing, they know that once whatever they're doing in the sheet is done, they can "go back".
My only complaint is that Apple added them to stock apps in iOS 12, so many iOS users got used to the pattern, but didn't provide an easy way to give the same experience for developers which creating a need for libraries like this.
I suspect most users wouldn't even know the bottom sheet is there nor how to bring it up nor how to dismiss it had they brought it up.
The visual context on whatever is underneath is lost once the sheet is brought up.
The user absolutely get forcibly navigated away; their context is shifted to the new layer which is slapped on top of the other layer. I can't count the number of times I either accidentally activated the bottom sheet or used it then got lost.
Bottom sheets are like hamburger menus; they are rugs that UX designers sweep all their baggage underneath.
I’ve got several apps on my phone (maps, DoorDash, google maps, etc) all doing the same thing, but inconsistently and it’s infuriating. What makes iOS great (IMO) is consistency in UI patterns with things like navigation controllers, toolbars, etc. floating sheets are worthy of that treatment.
What does this mean? I thought Expo was just tooling for React Native.
There are several of these implementations. I’ve recently had to implement something similar in Xamarin.iOS. It isn’t a breeze.
https://www.youtube.com/watch?v=8ngXakpE2x8
I guess you probably have better insight than the devs of two of the most popular native apps, though. Cheers!
https://expo.io/@rgommezz/react-native-scroll-bottom-sheet-e...
The amount of useless negativity in this thread is really amazing. The repo has ~650 stars right now, so clearly developers are finding this work to be useful. Yet look at all the mindless poo slinging going on in this "community".
Why would you make a remark like this without any explanation or supporting argument? Please don't.
https://reactnavigation.org/docs/apps/
But the coolest example I like to give is this app - https://www.theverge.com/2020/5/4/21246386/augmented-reality...
Energy consumption is definitely a concern, but our app isn't exactly something people are going to be on all the time...it's more of a "check it a few times a day and move on" sort of deal. It's a fairly complex app with quite a few screens and with daily usage I haven't noticed any hit on battery life.
A PWA could be a good fit, and while I think there's many cases where it makes a lot of sense, there's a handful of native features we wanted to utilize (most importantly, push notifications!) that aren't possible yet in the PWA world.
There's always tradeoffs with any of these abstractions and React Native fit the bill with what we were comfortable trading off. I'd love to see the whole thing get the full native experience on iOS and Android once we're profitable and can hire full-time devs on those projects, but we're not there yet and so far the decision to go with RN has paid huge dividends in terms of shipping this. You'd be hard-pressed to tell it wasn't a native app, seriously!
Individual developers / web developers I know who've tried it in personal projects / freelance have gone back to native or looked at Flutter over RN.