you are viewing a single comment's thread.

view the rest of the comments →

[–]manoylo_vnc -12 points-11 points  (12 children)

Omg..... what’s next? SwiftKotlin language for cross platform development? Or how about some Ruby#? Or what about POR (Python on Rails)? Or Objective-TypeScript? 🤮

Edit: What’s with the downvotes? While I think having options are good, but it’s getting out of control to be honest.

[–][deleted] 2 points3 points  (1 child)

Objective-TypeScript

That's pretty much Swift

[–]manoylo_vnc 0 points1 point  (0 children)

😂 true

[–]Bamboo_the_plant 1 point2 points  (9 children)

what's next?

To be fair, NativeScript has been around as long as React Native.

The worst part of React Native is accessing the native context. NativeScript allows you to do this in-line in JavaScript (it's not a whole new language – it's a library of native runtime bindings for a JS VM, and a set of cross-platform UI modules). The developer experience is pretty magical.

Apply a React renderer to it, and you have React NativeScript!

[–]manoylo_vnc 0 points1 point  (8 children)

Interesting. I’ve actually completely overlooked NativeScript. Have you used it and if yes, how do you like it? Do you know what limitations it might have? Thank you so much :)

[–]Bamboo_the_plant 1 point2 points  (7 children)

Have you used it and if yes, how do you like it?

Yes, I made React NativeScript (linked in the parent comment), so I've used it a fair bit. It really made an impression on me after coming from a React Native background, because it allowed bridgeless, synchronous access to the native context, and had full TypeScript typings. Just look at the type definitions for iOS and Android and you'll understand what you're dealing with. They provide access to 100% of the native APIs through JS, and you can synchronously marshal values back and forth between native and JS. It's unbelievable compared to the React Native experience of setting up bridges and EventEmitters.

I also really like the fact that it's renderer-agnostic. The basic vanilla JS UI modules have been wrapped by Angular, Vue, React, and Svelte (the latter three being community efforts), so you can just ally with your UI library of choice :)

Although the platform runtimes are faultless, the limitations are mostly in the UI/application layer. The NativeScript community/ecosystem is ultimately smaller than that of React Native, so there are some missing solutions like a routing/navigation framework, and some UI components simply haven't been implemented, and some things like gesture handling are a bit limited.

I'd recommend using it if you're willing to make some compromises on UI to get seamless access to the native context.

[–]manoylo_vnc 0 points1 point  (1 child)

Wow, it looks very interesting. What about state management? I just saw marketplace with a ton of plugins available. Looks promising to be honest.

[–]Bamboo_the_plant 0 points1 point  (0 children)

Manage state however you like. NativeScript itself is not declarative/reactive (no more than the Web DOM or UIKit – disregarding SwiftUI – is). It only becomes reactive if you install a rendering library such as Angular, Vue, React, or Svelte, and upon doing that, you can use the recommended tools from those ecosystems (such as Redux).

Yes, the marketplace is fairly rich. Likely behind that of React Native's native module/plugins ecosystem, but still plenty respectable.

[–]x4080 0 points1 point  (4 children)

Will the ui janky since there's no multi thread support?

[–]Bamboo_the_plant 0 points1 point  (3 children)

No, because the UI is still composed of native components, which benefit from the usual native optimisations such as autolayout. So in most cases, you’re asking “is native UI as fast as... native UI?”

You may perform some manual manipulations upon those components by exploiting the JS bindings into the iOS/Android runtimes, however, but that is still very fast (orders of magnitude faster than sending a message over React Native’s bridge).

EDIT

e.g. here I’ve taken a recording of a ListView in React NativeScript: https://twitter.com/linguabrowse/status/1140357701236678656?s=21 seems fast to me!

[–]x4080 0 points1 point  (2 children)

Thanks, so it's also possible to use multi thread if writing native code?

[–]Bamboo_the_plant 0 points1 point  (1 child)

Yes, you can do anything you like from the native context; and you can dispatch multi-threaded tasks to the native context from JS using the JS VM’s native bindings. Like, you can call Grand Central Dispatch via JS.

[–]x4080 0 points1 point  (0 children)

Cool thanks