NativeScript icon indicating copy to clipboard operation
NativeScript copied to clipboard

Support for desktop OSs (OSX, Windows, Linux)

Open pitaj opened this issue 11 years ago • 48 comments

This would be a killer feature. If you even made a layer for NW.js, that would be awesome.

Please vote for this issue in our ideas portal.

Please don't write a comment saying +1. Instead vote for it in the ideas portal or by hitting the quick reply buttons just below this post.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

pitaj avatar Apr 01 '15 01:04 pitaj

How do I up-vote this?

kasajian avatar Apr 06 '15 12:04 kasajian

+1 - Core dev team might want to take a look at the latest version of WinJS library for ideas.

Sibling10 avatar Apr 24 '15 01:04 Sibling10

This'd be pretty cool. And with windows 10 Chakra integration that'd be not too hard, I'd imagine. Maybe it'd also be a step for integrating with windows phone, too.

RangerMauve avatar May 21 '15 00:05 RangerMauve

+1

joao-parana avatar Sep 13 '15 14:09 joao-parana

Can somebody talk about the feasibility of doing this. It looks pretty doable based on the iOS runtime as there is a pretty clean layer for calling Objc-C.

mrjjwright avatar Oct 23 '15 19:10 mrjjwright

Yes it is doable and relatively easy (in a matter of week) a POC app can be created that can show a running MacOS app written in {N} and accessing the native desktop APIs. The real effort will after that when the abstraction layer that will allow you to reuse the UI declarations between mobile and desktop should be written.

I wonder if some of you is interested in doing this POC or dealing with the abstraction layer? It is really not a top priority for the moment and I don't see it becoming a priority in the next 6 months for the core team.

valentinstoychev avatar Oct 26 '15 17:10 valentinstoychev

I wish you keep mobile separated from desktop development. Please, keep the core lite. This can be somekind of optional plugin, dont you think?

alexrainman avatar Oct 26 '15 18:10 alexrainman

+1

listepo avatar Oct 30 '15 14:10 listepo

If desktop support is a lower priority than mobile, maybe it could be implemented on top of Qt?

Since they've already done the work of wrapping up a JS runtime and cross-platform UI abstraction together, it seems like NativeScript could hypothetically just map its own UI markup's primitives to the equivalent QML code.

buu700 avatar May 05 '16 05:05 buu700

+1

anton-staroverov avatar May 07 '16 19:05 anton-staroverov

I don't think QT is needed. Ubuntu already supports QML natively for it's UI markup. And also JavaScript and Swift for it's controller logic.

So only Swift (plus some QML) is necessary to support iOS, OSX, and Ubuntu. But, as mentioned above, the hard part is the API differences.

HOWEVER, with interoperability being an official goal of Swift 3.0, the syntactic differences between Apple APIs (Foundation, AppKit, UIKit, etc) might be lessened. Which should make the {N} abstraction layer easier to create for all 3 platforms.

So perhaps Swift 3.0 is a good runtime target for this goal (even if it temporarily excludes Windows).

zakdances avatar Jul 27 '16 01:07 zakdances

+1

icode avatar Sep 28 '16 03:09 icode

no Swift. Why adding a dependency on a language not absolutely needed for the desktop, in the sense of Java being needed for Android.

andy-tai-leeco avatar Oct 19 '16 01:10 andy-tai-leeco

Are there any plans to support desktop OS in the near future? Maybe macOS?

hypery2k avatar Dec 19 '16 06:12 hypery2k

+1

jboehler avatar May 07 '17 00:05 jboehler

+1

gmhispagnol avatar May 24 '17 14:05 gmhispagnol

PLEASE DO NOT +1 in comments!

pitaj avatar May 30 '17 17:05 pitaj

https://tylergaw.com/articles/building-osx-apps-with-js

vlastik01 avatar Aug 09 '17 19:08 vlastik01

+1

rizwan3d avatar Dec 27 '17 17:12 rizwan3d

that would be awesome :+1:

mehmetxyx avatar Feb 20 '18 17:02 mehmetxyx

Will it work on my RPI a ??

pedromorgan avatar Mar 23 '18 22:03 pedromorgan

I cannot open the vote page. so, I have to vote here :+1:

geminiyellow avatar Apr 16 '18 01:04 geminiyellow

pyqt anyone (dayjob) ?

so we need to parse xml, create the widgets, and bind to js right ?

pedromorgan avatar Apr 21 '18 22:04 pedromorgan

I'm a big supporter of NW.js (been using it for hundreds of projects for about 5 years). However I don't see it (or it's alternative electron) as a good fit for NativeScript.

A better option would be something like libui-node. This is a better option because it actually produces native code and uses the native UI of the OS, which is much more in line with the idea of "Native Script".

I would like to see something like @jlooper's Vue example, but with a desktop template as well:

<template web>
  <div class="App">
    <h1>Hello Web App</h1>
    <h2>{{ msg }}</h2>
    <ImageGallery/>
  </div>
</template>

<template native>
  <StackLayout>
    <Label text="Hello mobile App" style="font-size: 48;"/>
    <Label :text="msg" style="font-size: 40;"/>
    <ImageGallery/>
  </StackLayout>
</template>

In the same manner, have NativeScript-Vue offer Vue components that act as abstractions for LibUI-Node's native UI elements. So you could just have an additional template for native desktop, like:

<template desktop>
  <VerticalBox>
    <AttributedString text="Hello Desktop App" style="font-size: 48"/>
    <AttributedString :text="msg" style="font-size: 40"/>
    <ImageGallery/>
  </VerticalBox>
</template>

Vuido is a new library started for adding a Vue abstraction on top of LibUI-Node, so it may be something that can be referenced. I just think it makes more sense to have that functionality all in one place (NativeScript). Since it falls under the scope of cross-platform native app building and code-sharing.

TheJaredWilcurt avatar May 20 '18 17:05 TheJaredWilcurt

Being able to export a web-app version seems like it is a long term necessity, and should be started sooner than later. Doing this for TypeScript/Angular projects seems like it would almost be trivial, and I'm kind of surprised it's not implemented yet.

zbagley avatar May 22 '18 20:05 zbagley

Native-Script vue already supports building a web-app version (example shown above). I'm saying it would be nice, and make sense, to also support building for native desktop app.

TheJaredWilcurt avatar May 26 '18 03:05 TheJaredWilcurt

Please vote for this issue in our ideas portal.

The "ideas portal" returns

image

alensiljak avatar Oct 08 '18 10:10 alensiljak

+1 watch out, the voting page link is broken

giates avatar Oct 26 '18 09:10 giates

Any progress on this? @TheJaredWilcurt I am completely new to {N} and I too am a nw.js developer wanting a code sharing situation for the business logic across Desktop and Mobile. It seems the only option is with Angular?

Is there now an option to build for Win, OSX, Nix and access the native file system and use anything from plain JS to Vue or whatever we choose? (Like we can in nw.js)

Thanks! Murray

flowt-au avatar Jun 06 '19 02:06 flowt-au

@flowt-au I've just been wrapping Desktop-specific stuff in conditionals if (window.nw) { doThing }.

TheJaredWilcurt avatar Jun 07 '19 23:06 TheJaredWilcurt