DEV Community

Discussion on: The different tech strategies to building a cross-platform app

Collapse
 
nathanwalker profile image
Nathan Walker • Edited

Great breakdowns, thank you for all this. It's always helpful to enumerate an exciting space of great options. When possible to update a few inaccuracies regarding NativeScript would help to bring better understanding:
Inaccurate: * Uses a WebView.
Accurate: * Uses natural native platform view rendering

Inaccurate: "a major contributor"
Accurate: All the major contributors are involved on a daily basis and meet once a month on a growing Technical Steering Committee formalized with best practices from the OpenJS Foundation for healthy open source innovation.

One can find negative posts across all open source communities (everything on this list) and it's okay; anyone can voice their opinion anytime as it helps establish some understandings. I agree with a lot of sentiments in the ycombinator link mentioned. NativeScript was a bit ahead of its time with marketing in the beginning but it should not detract from what the technology is. It's a promising technology that is being led and cared for by a loving community and if you believe in bringing innovation to the JavaScript community, NativeScript offers a lot that others can be involved with in the spirit of open source to take it well beyond past complaints (that is why we all engage in open source to begin with).

I'm a fan of everything on this list.

Collapse
 
redbar0n profile image
Magne Playful Programming

Thanks for the feedback and corrections!

Inaccurate: * Uses a WebView.
Accurate: * Uses natural native platform view rendering

I meant you’d display your PWA in a WebView. Since it’s about crossplatform development (including web).

Is there another way to achieve that in NativeScript?

Inaccurate: "a major contributor"
Accurate: All the major contributors are involved.

oh, so you mean all major contributors left?

Collapse
 
nathanwalker profile image
Nathan Walker • Edited

Thank you for updating to clarify that point much appreciated. With web/mobile sharing NativeScript is just TypeScript driven so you can share as much as you’d like to achieve best result on the target platform. Since NativeScript is just JavaScript there’s an immense amount of code you can share to drive both web and mobile tailored UX. Don’t believe I’ve ever heard of anyone putting a PWA into a NativeScript app’s webview. I would also recommend combining NativeScript with Ionic Portals if one was going that route ({N} being inherently flexible works with everything on your list):

Hope that helps bring more understanding to a great breakdown.

Thread Thread
 
redbar0n profile image
Magne Playful Programming

Thank you for your insights!

If you want a cross-platform app that shares as much code as possible between iOS + Android + Web, how would you ideally go about it with NativeScript?

I updated the section on NativeScript with some options, as I see them, after doing a bit more research into it. It's still not entirely clear what the best cross-platform strategy with NativeScript would be. I think I'm still leaning towards a Web View, since it would allow running most of the same code on both native and web..

Thread Thread
 
nathanwalker profile image
Nathan Walker • Edited

The degree of flexibility possible with iOS+Android+Web without compromises is the core reason I became interested in NativeScript many years ago (I personally didn't pay attention to the marketing of it -- what it was under the hood is what interested me the most).

Regarding cross-platform strategy with NativeScript + web development, the key part about this technology is it aims to be just natural JavaScript development, meaning all the same strategies you would use to share TypeScript/JavaScript code apply. This is a large topic with tons of options (and opinions) but the NativeScript TSC provides, as a starting base, some suggestions to frame a good fundamental understanding in terms of best practices:
docs.nativescript.org/code-sharing...

In short, any monorepo strategy is great for TypeScript driven "shared" (aka "code sharing") developments. Npm workspaces, yarn workspaces, Nrwl Nx, Turborepo, Microsoft Rush, the list goes on and on.

To expand on this with even more fine grain guidance, nStudio (professional software services), provides a whole set of tooling, simply called "xplat", aimed at enhancing Nrwl Nx specifically for diverse cross platform developments. It could also be adapted to work in any other monorepo tooling as well.

To answer your question, "not entirely clear what the best cross-platform strategy with NativeScript would be"... Here's some helpful information on xplat, which provide generators to get teams off the ground with a set of best practices for diverse "cross-platform" developments. This approach has been put to use successfully for several years and continues to be used to scale large TypeScript driven projects (enterprise and consumer facing):

There's quite a lot of work going on around NativeScript which continues to open up desirable workflows for TypeScript/JavaScript driven teams. On the inverse side, interestingly, some of the more recent work explores powerful workflows for purely native teams (Swift, Obj-C, Kotlin, Java) to work hand-in-hand with web teams to make use of diverse talent working better together without cornering teams into one style to bring ideas to life.

To conclude for me personally, the reason I'm attracted to NativeScript and enjoy working around it is it's ability to open up all the options on your list with angles to make them work together without cornering one out. I love technology and want to be working with all innovation at all times or, at a minimum, at least be able to, without inherent barriers from the get go; which is why I'm a fan of everything on your list -- I can work with it all by taking advantage of NativeScript.