Code Monkey home page Code Monkey logo

web-view's Introduction

web-view   Build Status Latest Version

This library provides Rust bindings for the webview library to allow easy creation of cross-platform Rust desktop apps with GUIs based on web technologies.

It supports two-way bindings for communication between the Rust backend and JavaScript frontend.

It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and MSHTML (IE10/11) on Windows, so your app will be much leaner than with Electron.

For usage info please check out the examples and the original readme.

Contributions and feedback welcome :)

screenshot

Suggestions:

  • If you like type safety, write your frontend in Elm or PureScript*, or use a Rust frontend framework that compiles to asm.js, like yew.
  • Use parcel to bundle & minify your frontend code.
  • Use inline-assets to inline all your assets (css, js, html) into one index.html file and embed it in your Rust app using include_str!().
  • If your app runs on windows, add an icon to your Rust executable to make it look more professional™
  • Use custom npm scripts or just or cargo-make to automate the build steps.
  • Make your app state persistent between sessions using localStorage in the frontend or rustbreak in the backend.
  • Btw, instead of injecting app resources via the js api, you can also serve them from a local http server (e.g. bound to an ephemeral port).
  • Happy coding :)

* The free PureScript By Example book contains several practical projects for PureScript beginners.


Contribution opportunities:

  • Create an issue for any question you have
  • Docs
  • Feedback on this library's API and code
  • Some functions don't have FFI yet, e.g. webview_dialog
  • Test it on non-windows platforms, report any issues you find
  • Showcase your app
  • Add an example that uses Elm or Rust compiled to asm.js
  • Add a PureScript example that does two-way communication with the backend
  • Contribute to the original webview library: E.g. add HDPI support on Windows
  • Make it possible to create the webview window as a child window of a given parent window. This would allow webview to be used for the GUIs of VST audio plugins in Rust.

Ideas for apps:

  • Rust IDE (by porting xi-electron to web-view)
  • Data visualization / plotting lib for Rust, to make Rust more useful for data science
  • Crypto coin wallet
  • IRC client, or client for other chat protocols
  • Midi song editor, VJ controller
  • Rust project template wizard: Generate new Rust projects from templates with user-friendly steps
  • GUI for pijul

Note: The API can still change. Currently there is only one function (run()) that takes all args, but maybe a builder would be better..

web-view's People

Contributors

boscop avatar doctorvwa avatar ortham avatar pzmarzly avatar quadrupleslap avatar sergejjurecko avatar wezm avatar

Watchers

 avatar  avatar

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.