Replies: 93 comments 185 replies
-
@ry and I recently talked about it, and we presented the intent at TSConf, but there was no issue for it. There was some conversation on Gitter recently as well. |
Beta Was this translation helpful? Give feedback.
-
An Electron-ish thing built with Deno would be a big deal to me. I'd put a lot of effort into switching my apps to it, since the security improvements alone would be quite substantial. I suspect the resource efficiency would be much better, too, if Deno's startup time is anything to go by. |
Beta Was this translation helpful? Give feedback.
-
@kitsonk Thanks, I didn't know about it. Having a full-blown browser bundled would be something absolutely perfect, if only the overhead is not prohibitively expensive - but since you are already considering it with Ryan then I guess that happily it isn't. Will what you were presenting with Ryan at TSConf about this be available online to watch? Or maybe it is already? It would be great if Servo could be used here. The tight coupling with SpiderMonkey seems like a problem, unless it would be used just as a completely separated frontend and communicate with the main Deno process with a WebSocket or something like that, maybe having Deno transpiling the frontend code from TS to JS on the fly. It is actually pretty interesting how it could be done - from GUI windows being just lightweight browsers, getting all assets via some proxy or file protocol and communicating via WebSockets with the Deno process, to having some duality like Electron, to having a browser part using the same engine or even the same process and event loop as the main Deno code. I wonder what is your and @ry's idea of what would be optimal here. |
Beta Was this translation helpful? Give feedback.
-
@sholladay Yeah, I am currently writing an app that needs a GUI which I am doing it in Electron but it is something that could be written in Deno with the current API with no problems if I could only do GUI with Deno (and unfortunately it cannot be a web app). I am concerned exactly with security of what I am doing right now, that the app will have full access to user's data, which could be nicely restricted with Deno. Not to mention the transpilation steps etc. |
Beta Was this translation helpful? Give feedback.
-
Having a built-in module which bundles a cross-platform webview implementation would be the killer-feature that would get me to start experimenting/migrating from node.js. |
Beta Was this translation helpful? Give feedback.
-
I have some basic feature requests. Few native dialogs. Alert, prompt, confirm and file/folder picker/save dialogs. Because sometimes you have app running in the background it will throw an error but user can't notice it so you have to show some dialog about what is going on and in Node.js there is no easy way to do that. |
Beta Was this translation helpful? Give feedback.
-
Ya’ll should have a chat with @nothingismagick and the other fine folks at Tauri: https://github.com/tauri-apps/tauri/ A lot of what has been described here, they’re already working on or have already thought a great deal about. |
Beta Was this translation helpful? Give feedback.
-
@erlend-sh Are you sure this project is alive? The tauri.studio domain (from github.com/tauri-apps/tauri.studio) redirects to a domain parking page and on tauri-apps.org (the documentation link in the readme of github.com/tauri-apps/tauri) I get ERR_CONNECTION_TIMED_OUT:
|
Beta Was this translation helpful? Give feedback.
-
Yes - its alive. We're preparing our site to launch this month. |
Beta Was this translation helpful? Give feedback.
-
@rsp - we've had so many moving parts that we couldn't justify publishing the docs about how to use tauri until we've got a stabilized API and build system. Feel free to drop by our discord server if you want some quick support about getting setup with it. On a sidenote, we do plan to release a deno CLI and rust integration once deno is stable enough for that too. |
Beta Was this translation helpful? Give feedback.
-
@nothingismagick Thanks for the info. The project after reading the readme looks almost too good to be true. Really looking forward to reading the docs when they are available. It's great to hear that you plan releasing a Deno CLI as well. |
Beta Was this translation helpful? Give feedback.
-
yeah - we just a comment from a svelte user today. they confirmed a final linux build size of ca 600KB. |
Beta Was this translation helpful? Give feedback.
-
But I know we can break the 500KB boundary for sure. Here's the discord if you want to stop in and have a chat: |
Beta Was this translation helpful? Give feedback.
-
It would be great if we remembered that this is a Deno issue tracker. 😄 |
Beta Was this translation helpful? Give feedback.
-
I would very much like to port my desktop environment to Deno, watching. |
Beta Was this translation helpful? Give feedback.
-
We need a deno powered electron like experience. It's the killer app. Please someone I'm not a system programmer. 🤷 I will sponsor anybody that is working on this. For real |
Beta Was this translation helpful? Give feedback.
-
This project it is NOT mine, perhaps it can help some people: https://github.com/marc2332/tauri-deno-starter |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, I think I have something that fits this perfectly, it is basically Deno + IPC + Webview. It works using a modified Deno binary to compile your programs, just as This is more of a proof of concept, if added to deno I would see it as follows: The main issue would be windows, which by default opens the command line. |
Beta Was this translation helpful? Give feedback.
-
By "this" you mean all the features of deuteron? I agree that would ultimately be the right place, because with deno most people are going to be doing "deno upgrade" and if deuteron falls behind the main version too far then its going to break that model where they need multiple versions locally, and to be constantly worrying about having the right versions and compatibility, etc. If it was natively supported it would be much more likely to always be in sync and to have a more rapid adoption. It would be really cool to break down the individual features that would be required and see if they can't get added incrementally. I think you have at least 3 that I heard:
Maybe those can be broken down further? I think the deno team has been pretty gracious about accepting reasonably scoped PR's from outside teams. If it was broken down into small pr's, the sum of which added to this end result it could work. Local File StrategySo given that the local file webview requires a server, and it sort of seems like a given to me that many apps will want to have stand alone binaries which have all code/resource files bundled with it (not pulled from a url), it seems possibly like having an embedded webserver be part of the webview launch.... What would that look like? sequenceDiagram
Main->>+Server: launch 127.0.0.1:12345
Main->>Render: webview launches
Render-->>Server: http://127.0.0.1:12345/index.html
Server->>Main: file("./index.html")
Server->>Render: index.html
Render-->>Server: http://127.0.0.1:12345/main.ts
Server->>Main: downcompile("./main.ts")
Server->>Render: main.ts, application/javascript
Could that be driven from a runtime module? // main.ts
import { Application } from "https://deno.land/x/deuteron/mod.ts";
const app = new Application({
webviewUrl: "./index.html"
});
// todo: ipc handling here...
await app.run(); This would sort of push the launching of the webview into a deno runtime api instead of a command line startup flag, such as maybe const window = Deno.webview(url); |
Beta Was this translation helpful? Give feedback.
-
Just another idea: I found this project: https://github.com/oooutlk/tcltk - Rust bindings to Tcl/Tk commands |
Beta Was this translation helpful? Give feedback.
-
It was interesting |
Beta Was this translation helpful? Give feedback.
-
It was interesting content |
Beta Was this translation helpful? Give feedback.
-
@rsp have you seen this? It is written in pure-C, works like a dream. |
Beta Was this translation helpful? Give feedback.
-
It's actually a TAR file, not ZIP. Use |
Beta Was this translation helpful? Give feedback.
-
with current FFI interface, we can use sdl2 to provide native gui for desktop application: |
Beta Was this translation helpful? Give feedback.
-
can i bundle deno runtime to execute scripts from my electron app? |
Beta Was this translation helpful? Give feedback.
-
I noticed that Deno already supports JSX/TSX, so maybe we could take advantage of that. By using a concept similar to ReactNative a full GUI-API could be built without the overhead of a browser instance. The implementation basically consists of React/Preact (Preact already works with Deno/Fresh), Yoga-Layout (C/C++ implementation of modern CSS Layout) and bindings to platform-native ui components (already existing for Windows, Mac (ReactNative Desktop), Android and iOS (ReactNative)). This solution would preserve the speed of Deno and could be (if it's not too big) included by default (providing an alternative version without GUI support for server-side applications like Deno Deploy). The API should be designed in a way which allows code to be shared with Fresh. Although the discussion focusses on desktop, this paves the way for mobile development. Those who wish to use HTML/CSS could use a Webview/Iframe (Chromium loaded on-demand; automatically downloaded if needed and not already installed (on Windows the Edge installation could be used)). |
Beta Was this translation helpful? Give feedback.
-
Here I made a demo compilable deno server runs frontend in a chrome window: https://github.com/galaxydo/deno-chrome-app |
Beta Was this translation helpful? Give feedback.
-
When you propose to run Deno UI in webview or something like that. It does not work great when you e.g. need only alert/confirm/prompt dialogs... it also does not include tray icon access... also custom dialogs like folder picker, file picker would be great. Being able to show these without rendering webpage first would be cool. Also webview has usually problem with multi-monitor setup. I personally used NodeJS to create plugin for Photoshop because those plugins are in JS... so makes sense I can share code between external and internal proces. So the use case is not always server only. |
Beta Was this translation helpful? Give feedback.
-
Deno with a official gui module that can start a webview like tauri does would change the world 4 sure. Tauri is great. I have used it for several apps and i like it a lot. Getting a web view window up and running from one file and i'm trying out webui at the moment. webui if Deno could get a webui, we could be able to call backend functions directly in the frontend. |
Beta Was this translation helpful? Give feedback.
-
Has there been any discussion about having a standard way of doing GUI in Deno? I don't necessarily mean that it all has to be in the core or std modules, and I don't mean anything complicated or very high-level, just something that lets us open native windows, show dialogs and generally create GUI apps using just JS/TS.
In issue #1629 about WebGL from January (the only issue related to GUI that I've found) @ry you said that you want to support WebGL in core eventually. If it is possible to open a native window and draw using WebGL then it will be possible to use it to create a GUI framework as a third party module, but thinking about it I started wondering about a Web way to do GUIs, which is really HTML. I'm not arguing that it is the best way but this is certainly the most Web-style way. And since one of the goals of Deno is to have a similar API for the things that people are used to in browsers, then it seems like something worth thinking about.
If Deno doesn't use a Web way of creating GUIs then soon it will have to reinvent HTML and CSS, plus some logic of dispatching the click events etc. and it will soon get quite complicated.
If, on the other hand, Deno is able to open a window with HTML even with very limited functionality (like only text and canvas, for example), then it will be relatively easier to not go too far away from what people are used to in the browsers.
Of course having something like Electron bundled in Deno might be a little overkill (or maybe not? any thoughts on that?), but having a possibility to write an Electron-like framework as a third-party module without producing a separate Deno binary to be able to do that, would be something to think about.
Running
deno run https://www.example.com/gui-example.ts
to start a GUI program, instead ofdeno-electron-like-fork run https://www.example.com/gui-example.ts
would be something to consider.I wonder if there has already been any discussion about it.
Beta Was this translation helpful? Give feedback.
All reactions