6 ms·
New Architecture is here
- tmitchel2 2y agoLove react native, I'll be updating to this version soon. Really hoping it makes suspense work correctly with libs like Relay. Well done and thank you RN team.
- ramesh31 2y agoIs there any sane way of using RN without locking into the Expo ecosystem? Last I checked it was a nightmare dealing with native dependencies otherwise.
- l_r 2y agoConfig plugins have made this way easier - you’re now able to hook into the native code generation process to add native modules that aren’t already packaged for expo.
- k4rli 2y agoBeen working on one RN project Expo-free since 0.6x. It's really not needed at all, neither is it complicated to set up without Expo. I've only used Expo during hackathons and university to quickly get something running, but for actual production apps it's should be avoided imo.
- stuckinaloop 2y agothat's an interesting perspective, curious to what your reasons are for avoiding expo in production?
- diggan 2y agoLast time I played around with React Native was probably around when it first launched, there was no Expo then, and I haven't used React Native since so I don't even know what Expo is. But another commentator wrote "yet another SaaS with questionable payment tiers" about Expo (https://news.ycombinator.com/item?id=41937886 https://news.ycombinator.com/item?id=41937886) which makes me already not want to use it if I ever touch React Native again. Not sure why a SaaS would be involved at all in this process.
- tcoff91 2y agoYou don't have to use Expo's SaaS to use Expo. Expo framework is 100% FOSS. However Expo Application Services is a really great SaaS product for doing things like cloud builds and Over-The-Air updates. The anti expo sentiment is almost all based on the old days where you had to eject to use native dependencies. Expo is amazing now.
- martinsnow 2y agoI love that you asked this question. As someone who has created a few react native applications in the past, non expo environments has felt as an afterthought. I hope the react native team will improve the documentation and encourage the native platform as well as the expo platform. Some of us don't want to be locked into yet another SaaS with questionable payment tiers - when building your own modules and publishing is: - Easier in the long run - You're able to ship a far more featureful application if you deal with media and/or VoIP - Passing apples reviews seem to be faster if you ship the modules yourself in my experience
- RussianCow 2y ago> - You're able to ship a far more featureful application if you deal with media and/or VoIP Can you expand on this? How does Expo prevent or make it harder for you to ship media- and VOIP-related features?
- martinsnow 2y agoWhen you're using expo you cannot bundle your own native extensions. At my previous job we used pjsip. This extension uses JNI and native calls in iOS via objective-c. You can't bundle native extensions when using expo. You're locked to their prebuilt ones. To use your own extensions you have to eject/or start a new application with their own native libraries. For most of what expo does you can use the unimodules libraries, they're quite good in my experience.
- RussianCow 2y ago> When you're using expo you cannot bundle your own native extensions. [...] You're locked to their prebuilt ones. Unless I'm misunderstanding what you're saying, this isn't true at all. At $day_job we have an Expo app with a custom native library and it works just fine; you just have to write an Expo-specific adapter for it and can't use Expo Go in that case. Source: https://docs.expo.dev/workflow/customizing/ https://docs.expo.dev/workflow/customizing/
- davmar 2y agohow long ago was the last time you checked? expo has solved the native dependencies issue, and it's a fantastic way to build an app. this is one of the few hills i'm willing to die on. expo is great for the RN community. also you can download my RN expo app here: www.shopcats.app.
- tcoff91 2y agoHaving used bare RN for 5 years, and recently started using Expo, there really is no reason to not use Expo at this point. The native dependencies are 100% solved by prebuilds, CNG, and config plugins.
- s_tec 2y agoReact Native added auto-linking years ago, which solved the native dependency problems. Just `yarn add` whatever you need, and if it has native code, the the Android side will incorporate it on the next build. On the iOS side, you do have to run `pod install` to lock in the changes, but everything after that is automatic. Use Expo because you like the extra features it ships with, but not because you have problems with native dependencies. The React Native built-in experience is pretty much perfect to start with.
- pbreit 2y agoCould someone suggest a good CRUD starter kit?
- matlin 2y agoI've used React Native quite a bit in the past and I gotta say I wish it didn't have to exist at all. It's often times fine on iOS and then incredibly slow on Android. Hermes is very exciting but still requires many polyfills to make simple NPM packages work. I hope one day, the web (and embedding web apps on mobile) makes React Native fully obsolete.
- DCH3416 2y agoWho would've thought steve jobs was right (although premature) with the initial iPhones only having web apps. That's interesting though, I would've expected iOS to be slower with android largely leveraging chrome because Google.
- pbreit 2y agoPremature by 17+ years? He was and remains completely wrong.
- candiddevmike 2y agoWith all of the APIs _modern_ browsers are exposing these days, web apps are extremely capable and remain the best multi-platform solution.
- DCH3416 2y agoNo? Most modern apps these days _are_ just web apps. Why does it need the overhead architecture of running full standalone applications when a web clip works just as well? Plus there's no need for updating. The problem at the time was multifaceted. The devices couldn't handle it, the network couldn't handle it, and webkit was still relatively limited. But it did work. https://9to5mac.com/2021/06/03/remembering-apples-sweet-solution-for-iphone-apps-before-the-app-store/ https://9to5mac.com/2021/06/03/remembering-apples-sweet-solu...
- deleted 2y ago[deleted]
- rickhanlonii 2y agoI helped write this post, so feel free to ask me anything about the New Architecture!
- andy_ppp 2y agoThank you! Slightly off topic but every time new Xcode versions happen or as a result of time passing I always seem to get a messed up/corrupted Xcode project and so I end up copying the src folder and create a new project usually with an updated React Native version. This can be a real pain to be honest, taking sometimes a day or two of messing around with package version compatibility hell. Is there a plan to fix this flakiness that I experience every 3 months or so?
- rickhanlonii 2y agoYeah this is a tricky problem, and it's one of the reasons we updated our recommendation to use a framework like Expo that can make upgrades be smoother by being more opinionated about the setup. As the core library, we need to support all the different ways React Native can be added to an app (from fully react native to adding react native to an existing app) and all the different build tools an existing app may use. So it's hard for us to be opinionated about the setup in a way that would make upgrades seamless, but a framework can solve this for you.
- andy_ppp 2y agoMaybe I can un-eject given the plugins system from Expo. I do not like the way they throw all your code around though and I think this ability to steal peoples work given the prevalence of LLMs to unobsfuscate code is problematic. You should consider providing a way to drop the bundle in in byte code or something too... while I'm writing out my laundry list of issues ;-) Seriously, thanks for all your (and team's) hard work, I look forward to all my packages being on the new architecture and upgrading!
- chacham15 2y agoFirst off, thanks for all the work! I have a few questions if thats ok: 1. What is the next thing that the team wants to focus on improving? 2. What are the performance differences between the old architecture & new one? 3. What are your thoughts on the fragmented state of rn wrt react-native-web/react-native-windows/react-native-macos? 4. It is quite difficult to know what supports RN vs what relies on react-dom. Is there any thought to create some ecosystem focused around RN? Or if something like that is too cumbersone, perhaps even just adding some badge to github pages for "Supports RN"? 5. I forget what it was called, but the creator of react-native-web stated that they wanted to start winding down support in favor of an alternate approach which attempts to bring web apis to native instead of trying to make the native api work on web. I.e. instantiate div elements in native instead of view. What are your thoughts on this? 6. React (and IMO Meta as a whole) seems to generally have had the tech philosophy of take what you want, leave what you dont. With the dropping of create-react-app and endorsement of frameworks like Expo, it seems like its getting harder to just take the pieces we want. Is there any thought about this trend? 7. Related: as for the upgrade process: it would be cool if there were a way to "opt-in" to auto upgrades. E.g. what if there were a package which contained a base class controlled by the RN team so that a client side upgrade could be as simple as updating the version of the library the base class is in? (customization would be simple extending the class and doing w/e else needed there) Again, thanks for all the work!
- cynicalpeace 2y agoIs Capacitor a viable solution yet? I saw this tweet saying "it just works" for porting a webapp on NextJS: https://x.com/marc_louvion/status/1836023560462360746 https://x.com/marc_louvion/status/1836023560462360746
- rickhanlonii 2y agoCapacitor is really cool because it allows you to build a web app in iOS and Android and access the platform APIs from JavaScript. The rendering layer is a bit different though, because in React Native you can use the platform APIs _and_ the platform components. In React Native, the views you render on iOS are the same UIKit UIViews that a native app would write. In Capacitor, these are DOM elements in a webview. There are different tradeoffs, but this difference is what makes React Native look and feel more native.
- martinsnow 2y agoIn my opinion no. Capacitor has the same pitfalls like NativeScript. They're both clunky and lacks proper integration between the native layer and the emulated javascript world.
- minhnhut 2y agoNo matter what framework you roll with, you're gonna hit the same ol' clunky mess—it's just how app development goes. The trick is, some frameworks smooth over the rough spots and throw a few sweet perks your way, while others give you a taste of both the good and the gritty.
- martinsnow 2y agoThat is true and neither platform is free from their issues. But NativeScript, Capacitor, Ionic and at last... Cordova. Has each of ther own oddities. NativeScript has a really awesome typing translation of the native apis to typescript. That's honestly the most fantastic to work with of any of all of them. Great for prototyping. But when it comes to performance. None of them beats RN. You can make some good looking continous animation of most of them (not cordova or ionic). But when it comes to lag when moving between screens, RN on mobile comes on top without doubt.
- jurmous 2y agoI have built a React Native app in the past. Nowadays I would go for Kotlin Multiplatform. It is already the primary language on Android and now it is possible to create native binaries on iOS. With Compose multiplatform it also has the ability to also share UI code with a declarative syntax on multiple platforms. I think React Native was the go to place in the past but it has been surpassed now.
- theThree 2y agoI did a performance test last year, rendering thousands of views, and Flutter's rendering speed was 5 times faster than React Native. I wonder if this version will be improved after the update. Interestingly, I used React on the web to render the same number of views, and its speed was much faster than React Native.
- Zelphyr 2y agoI'm speaking out of turn here since I'm not a React Native developer but, it seems to me that it suffers from the penalty of having to use the JS bridge that neither Flutter nor web use.
- rickhanlonii 2y agoIn the post we explain that this release removes the bridge, so the JS thread calls C++ directly without a queue, serialization, or bridge: https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here#removing-the-bridge https://reactnative.dev/blog/2024/10/23/the-new-architecture...
- Zelphyr 2y agoThanks for the clarification.
- jdthedisciple 2y agoI'm telling you, Flutter has amazing performance (+ incredible dev experience).
- theThree 2y agoOK,just now I tested the new version and it is still slow. Use "npx create-expo-app@latest --template default@beta" to install new version. Start with production mode, using android device, it takes about 300ms to render 2000 Views. The same test on React web is still much faster.
- arijo 2y agoGuys, help me understand these changes: Can I comprehend this as a new Virtual Native UI immutable tree running in native space? And react native mounts and updates basically synchronally updating this immutable tree and reconciliation being done in native space, dynamically updating the app layout?
- rickhanlonii 2y agoKind of. We already had a native UI tree running in native (the same way the browser has it's own internal representation of the DOM). The difference in this release is that we rewrote it in C++ and made it immutable. That means instead of having a different UI tree in each platform (one for iOS, one for Android, etc), we have one C++ tree that all platforms use. And since it's immutable, it's thread safe and we can read layout and commit it from different threads if needed. Reconciliation is still done in React on the JS thread, similar to React DOM.
- arijo 2y agoThanks for the clarification. Dumb question: How does the renderer ensure consistency in case o multiple immutable tree references?
- jdthedisciple 2y agoWondering the same (replying to easier find your comment and hopefully the answer since i cant favorite comments)
- adolfojp 2y agoAt the time of writing this comment, we've got: 1 person talking about how they wish react native didn't exist 1 person asking about Capacitor 1 person complaining about Expo 1 person saying that they wouldn't use react native and recommending Kotlin Multiplatform instead 1 person complaining about the quality of the discussion (Me) 0 people talking about the new architecture I still love Hacker News but the discussions are becoming increasingly pointless. All that's missing is: 1 person complaining about the style in which the article was written
- pavlov 2y agoYou forget: 1 person complaining about the amount of JavaScript loaded just to display this one article
- martinsnow 2y agoShould we also complain at the amount of bootstrapping your OS had to do before your browser could show said site?
- robinsonb5 2y agoYes, absolutely. Just because it's been hidden behind decades of advances in CPU and storage technology doesn't mean it's not incredibly wasteful.
- martinsnow 2y agoExplain to me why rendering html in javascript in wasteful? GNOME and Edge does the exact same thing for ther shells.
- esaym 2y agoThe site doesn't even load at all now (lol)
- mdgrech23 2y agoReddit does a lot better of job bringing good relevant comments to the top.
- mhammerc 2y agoI have been working for the past four years exclusively on react-native apps and their backend API, from bootstrap to publishing, adding new features every few months and maintaining the apps. It was a mixed experience. When I migrated to expo two years ago, many problems were solved but not all. But I still encounters bugs and problems with many common dependencies. It is not uncommon to have bugs on certain Android brands, with the community on github reporting the bug but waiting months for it to be fixed. iOS is by far better and more stable than Android. Performance is great on iOS, but less great on Android. Our apps are animation heavy using react-native-reanimated and react-native-skia. Everything went perfect on iOS but we had to remove some animations or simplify them on Android. Upgrading your dependencies every four months will probably break something somewhere : deep links stop working, some animations stop working, or maybe it's another dependency from the JS world. Sometime the fix is easy, other time an issue with the regression can be found on Github, other time we have no data. Overall I'd say react-native is perfectly servicable and is easy to learn for anyone, which is a big plus. I'd recommend react-native because it is easy, have a big JS ecosystem, but I am now on the Flutter side.
- swatcoder 2y agoCongratulations! You've described the universal experience of using cross-platform frameworks. They can be great as long as you and your customers stay on their most well-trodden path. But as these frameworks grow and become more byzantine, and as your project requirements start reaching for more rarified features and your customers start using new and differing runtime platforms, maintenance overhead starts to dominate and you find yourself running into invisible walls that make it hard for you to deliver on your project roadmap or satisfy the support standards you want for your customers. This has always been the case for these frameworks, going back many decades, but especially since the explosion of efforts to build them around web stacks, which are easier for developers to use but harder for framework designers to keep sufficiently robust and capable as they age.
- tcoff91 2y agoThere's no free lunch when it comes to targeting multiple platforms. It sucks to have to maintain separate iOS, android, and web apps, and it also sucks to use a cross platform framework. But I still feel in the end that for many CRUD style apps it's worth it to deal with react native's problems, especially if you can also have significant code sharing with your web app. If you're trying to build the next snapchat or tiktok you'd better go full native though.
- tcoff91 2y agoReact native is finally pretty good this year. It still has problems but I feel like it's really starting to pick up momentum. When react-strict-dom is totally ready for prime time it's going to be a game changer and react native will become an absolute juggernaut.
- RussianCow 2y agoHow so? What makes this a game changer for the average dev?
- tcoff91 2y agoWith react-strict-dom, you'll be able to have far better code sharing between web and native. It will greatly assist the development of universal apps that target Web, iOS, and Android. Right now react-native-web is not nearly as good as iOS and Android react-native. react-strict-dom is a massive leap forward for universal apps.
- serial_dev 2y agoI'm a Flutter dev since 2018 and I am honestly not sure if Flutter or React Native still make sense in 2024 and onwards. When they emerged, the mobile development scene was completely different than today. Today, we have Swift UI and Compose, both are pretty solid. I'm not sure if it's the consensus amongst mobile developers, but I believe that on the mid/long run you will be better off - even if you write things twice. In terms of end user experience, developer experience, and in the business sense, everywhere. Sure if you have an Flutter / RN app that has years of engineering efforts invested into it, go ahead and continue (duh), but I wouldn't start new apps with them.
- johnny22 2y ago> I believe that on the mid/long run you will be better off - even if you write things twice. People have believed this the whole time and also a ton of people didn't then and don't now. What has actually changed?
- serial_dev 2y agoSwift and Kotlin are now the de-facto languages for these two platforms for new development, and Swift UI and Compose got released and gained traction since 2018.
- mixmastamyk 2y agoHmm, what about desktop and/or web?
- serial_dev 2y agoI don't want to say you should never, under any circumstances, use cross platform tools. Sure, if you have Android, iOS, web, macOS, Linux and Windows apps that are all roughly the same, go ahead and use cross platform technologies. I don't think most apps are like that, though. If it is worth having a desktop app (instead of just, you know, having a web app), than that app is probably relying heavily on native integration. Also, mobile apps and desktop apps are usually quite different (as they should), those are two completely different interfaces. About web, I'm not sure about RN, but Flutter IMO is so terrible on web, that it's so rare that it would make sense to use it, that my default advice would be that write the web in something different, even if you use Flutter already on mobile and desktop.
- e63f67dd-065b 2y agoI'm not familiar with UI development at all, but I'm kind of amazed that the old solution of a giant async bridge where the renderer enqueued native function calls worked at all. What was the initial reasoning behind this architecture? (that is to say, why did it seem like a good idea at the time?)
- coldblues 2y agoI will now inform everyone here that the Windows 11 Start Menu uses React Native. You're welcome :)
- theThree 2y agoOnly the "recommended" section.
- terandle 2y agoSeems to be a lot of negativity around RN, and I can understand that if you haven't used it in a while. But these days I have nothing but great things to say about React Native when used with Expo. It's great to want custom bespoke individual native apps for each platform but as a solo dev that just isn't really practical and RN has enabled me to ship things I wouldn't have been able to otherwise. Also that hot reloading react DX is just great in general. And I really want the RN model of using the platforms native controls to win out vs rendering everything to a canvas like Flutter. Can't wait to try out the new arch when 0.76 lands in expo.
- ppsreejith 2y agoThis is pretty incredible, kudos to the team! I wonder if there's still an option to call native modules asynchronously (since I'd guess the synchronous native calls block JS execution?) Also, I remember transferring lots of data through the bridge could be a bottleneck for some use cases. Is that effectively solved with this architecture?
- pixelready 2y agoIt’s looking really good so far. Some known issues in the expo and RN ecosystem are called out under the troubleshooting section here: https://docs.expo.dev/guides/new-architecture/ https://docs.expo.dev/guides/new-architecture/
- pfraze 2y agoWe use Expo/RN for Bluesky. The way I see it, if it's a separate codebase then it's a separate product. I honestly don't think we could've survived trying to build 3 different apps at once, so when I get hit with one of the warts (and believe me we hit them) it's not hard to shrug it off. The team has been able to progressively target the different platforms where needed with native modules and TS files targeting the arch. Expo's build plugins have also saved our bacon. We've been pretty excited for the new architecture. Our early tests show a lot of performance benefits on android, and so far the conversion process has been pretty good.
- tough 2y agois bluesky expo codebase open source?
- stuckinaloop 2y agohttps://github.com/bluesky-social/social-app https://github.com/bluesky-social/social-app
- slorber 2y agoHonestly, can we even trust a technology that is not 1.0 ?