GithubHelp home page GithubHelp logo

ziishaned / deskgap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from branchseer/deskgap

1.0 2.0 1.0 210 KB

A cross-platform desktop app framework based on Node.js and the system webview

Home Page: https://deskgap.com/

License: MIT License

CMake 1.19% CSS 0.57% HTML 4.74% JavaScript 12.72% Python 1.36% TypeScript 21.24% C++ 36.04% Objective-C++ 20.21% Objective-C 1.91% Shell 0.01%

deskgap's Introduction

DeskGap

DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS).

To enable native capabilities while keeping the size down, DeskGap bundles a Node.js runtime and leaves the HTML rendering to the operating system‘s webview.

Supported Platforms

  • Mac OS X Yosemite (version 10.10) or later
  • Windows 10 October 2018 Update (version 1809) or later

Downloads

Prebuilt Binaries

npm install --save-dev deskgap

API Demos

The DeskGap API Demos app shows some of the DeskGap features and APIs with interactive scripts.

macOS Windows Source Code
Download Download GitHub

Pym: A Real-Life App Built With DeskGap

To test DeskGap on field, squoosh is wrapped into a desktop app "Pym" with DeskGap and submitted to the app stores.

macOS Windows Source Code
Download on Mac App Store Download on Microsoft Store GitHub

Getting Started

Creating a Node.js Package for your app

hello-deskgap/
├── package.json
├── index.js
└── index.html

package.json points to the app's entry file and provides the script that starts your app:

{
  "name": "hello-deskgap",
  "main": "index.js",
  "scripts": {
    "start": "deskgap ."
  }
}

index.js is the entry file that creates a window which will render a HTML page:

const { app, BrowserWindow } = require('deskgap');

app.once('ready', () => {
    const win = new BrowserWindow();
    win.loadFile('index.html');
});

index.html is the page to render:

<!DOCTYPE html>
<html>
  <head><meta charset="utf-8" /><title>Hello DeskGap</title></head>
  <body><h1>Hello DeskGap</h1></body>
</html>

Installing DeskGap

npm install --save-dev deskgap

Starting Your App

npm start

Documentation

Work in Progress

FAQ

What’s the difference between DeskGap and Electron?

DeskGap is designed to be a more lightweight alternative to Electron. It does not bundle Chromium or any other web engines. Instead, the ability of rendering HTML pages comes from the webview provided by the operating system, specifically, WKWebView on macOS and Microsoft.Toolkit.Forms.UI.Controls.WebView on Windows.

DeskGap is at its early stage. The API is still quite limited compared to Electron. Many functionalities are under development and some of them will probably never be possible. See this and this for more information.

There are already similar attempts (electrino and Quark for instance) out there. What makes DeskGap different?

With a Node.js runtime bundled, DeskGap comes with support for npm packages and all the battle-tested native capabilities in Node.js such as fs, net, http. The price is a larger executable size (about 8 MB zipped and 20 MB unzipped).

Why is the supported version of Windows so high? Any plan of supporting Windows 7 and Linux?

Older Windows’ do not have a modern browser engine, only the one that powers Internet Explorer. Windows 10 1809 is the first version that provides a modern webview with enough functionalities for DeskGap to be possible.

To support Windows 7, app developers would have to face compatibility issues coming from as low as IE 8. I personally don’t have enough motivation and interest to do this, but pull requests are always welcome.

Linux support would be great but I have little knowledge of Linux app development. For now I am looking at Qt WebEngine. Any advice & help is appreciated.

If you want to try DeskGap but dropping Windows 7 (or Linux) support is a no-go for your app, consider packaging the app with Electron for the unsupported platform. The DeskGap API is intentionally designed to be like Electron’s. The following code is a good start:

let appEngine;
try {
  appEngine = require('deskgap');
}
catch (e) {
  appEngine = require('electron');
}
const { app, BrowserWindow } = appEngine;

So I can port my Electron app to DeskGap?

Probably no. The DeskGap API is still quite limited. If you start building an app with DeskGap, getting it running on Electron may be easy, but not the other way around.

deskgap's People

Contributors

branchseer avatar ziishaned avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

y0zer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.