All Projects → fable-compiler → fable-electron

fable-compiler / fable-electron

Licence: MIT license
Fable bindings for Electron apps

Programming Languages

F#
602 projects

Projects that are alternatives of or similar to fable-electron

Feliz.MaterialUI
Feliz-style Fable bindings for Material-UI
Stars: ✭ 57 (+90%)
Mutual labels:  fable, fable-bindings
Feliz.ViewEngine
Feliz DSL and engine for HTML generation and server side rendering (SSR)
Stars: ✭ 53 (+76.67%)
Mutual labels:  fable
Fable React
Fable bindings and helpers for React and React Native
Stars: ✭ 223 (+643.33%)
Mutual labels:  fable
hacn
A "monad" or DSL for creating React components using Fable and F# computation expressions
Stars: ✭ 34 (+13.33%)
Mutual labels:  fable
elmish-getting-started
A simple and minimalistic template to easily get up and running with Elmish and Fable
Stars: ✭ 22 (-26.67%)
Mutual labels:  fable
Yobo
F# Yoga Class Booking System
Stars: ✭ 88 (+193.33%)
Mutual labels:  fable
Fable.remoting
Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
Stars: ✭ 175 (+483.33%)
Mutual labels:  fable
Fable.Lit
Write Fable Elmish apps with Lit
Stars: ✭ 64 (+113.33%)
Mutual labels:  fable
Fable.Extras
A more functional construct on-top of Fable.Core.
Stars: ✭ 42 (+40%)
Mutual labels:  fable
raspberry-fsharp
F# full-stack IoT starter project for Raspberry Pi
Stars: ✭ 33 (+10%)
Mutual labels:  fable
Feliz.Router
A router component for React and Elmish that is focused, powerful and extremely easy to use.
Stars: ✭ 66 (+120%)
Mutual labels:  fable
FSharp-CrossPlatform
This is a sample F# project that uses the SAFE stack for web frontend/backend and Fabulous/Xamarin for the iOS and Android mobile apps
Stars: ✭ 23 (-23.33%)
Mutual labels:  fable
SAFE.Simplified
A lightweight alternative template of SAFE for happy cross-IDE full-stack F# development
Stars: ✭ 97 (+223.33%)
Mutual labels:  fable
The Elmish Book
A practical guide to building modern and reliable web applications in F# from first principles
Stars: ✭ 231 (+670%)
Mutual labels:  fable
navigation-bar-with-feliz
Modern navigation bar built with Feliz
Stars: ✭ 20 (-33.33%)
Mutual labels:  fable
Fable
F# to JavaScript Compiler
Stars: ✭ 2,282 (+7506.67%)
Mutual labels:  fable
V2releases
A friendly ARM assembler and simulator for educational use
Stars: ✭ 46 (+53.33%)
Mutual labels:  fable
SAFE-Stack.github.io
Website for Saturn + Azure + Fable + Elmish aka SAFE-Stack
Stars: ✭ 17 (-43.33%)
Mutual labels:  fable
Feliz.Recoil
Fable bindings in Feliz style for Facebook's experimental state management library recoil.
Stars: ✭ 43 (+43.33%)
Mutual labels:  fable
Thoth.Fetch
Thoth.Fetch provides an easy to use API for working with Fable.Fetch and Thoth.Json
Stars: ✭ 31 (+3.33%)
Mutual labels:  fable

Fable.Electron

Fable bindings for Electron.

Maintainer wanted!

If you are actively using Fable.Electron or otherwise interested in seeing these bindings being kept up to date, please consider taking over this project!

I am not actively using Fable.Electron and will not be able to prioritize keeping it up to date with new Electron releases. I am therefore seeking a new maintainer.

Work involved: The only thing I have been doing so far is using a website scanner (I use Wachete, but use whatever you want) to monitor https://www.electronjs.org/docs/all for changes, and update the bindings accordingly. Minor releases and relevant documentation updates occur at most once a week (often less) and usually involve 15m to an hour of work (including deployment), while major Electron releases may take a several hours.

This documentation-driven approach is slightly complicated by the fact that the docs may have bugs, i.e. something should be an array but is documented as a single value. Use your best judgement and search the Electron source code if you’re unsure whether the docs are correct.

Contributions are welcome!

Pull requests are more than welcome, whether it’s bindings for new APIs, new helpers, bugfixes, or just improving typos and formatting in the documentation. If you want to create a PR with non-trivial changes, consider opening an issue first so you don’t waste time and effort on something that might not be accepted or might already be underway.

How to use the bindings

Note that since Fable.Electron is mostly just bindings, the official Electron docs is the place to go for general Electron usage.

For an example app with complete boilerplate for Electron apps using Fable and Elmish with hot module reloading, time-travel debugging, etc., check out Fable-Elmish-Electron-Material-UI demo.

To get started with the bindings, simply:

  • Install the Fable.Electron Nuget package as well as the electron npm package. Make sure the electron version is compatible with the bindings. Fable.Electron supports Femto.
  • open Electron. In addition to all the the type definitions, you now have access to two entry points for the Electron API:
    • main for everything that can be used from the main process
    • renderer for everything that can be used from the renderer process

You can also use electron to access everything, but consider using only main or renderer.

By convention, class constructors are accessible as static Create members. For example, to instantiate a BrowserWindow, you call main.BrowserWindow.Create().

Helpers

In addition to the bindings, Fable.Electron also gives you access to some convenience helpers if you open Electron.Helpers:

Accelerators (keyboard shortcuts)

Accelerators in Electron are simply strings with a specific format. If you want, you can use createAccelerator with the Modifier and Key helper types to create them in a strongly typed manner:

// Returns an accelerator string that can be used to register shortcuts
createAccelerator: Modifier list -> Key -> string

Example:

let accelerator = createAccelerator [Modifier.Ctrl; Modifier.Alt] Key.Tilde
main.globalShortcut.register(accelerator, fun () -> (* do stuff *))

// The above is identical to:
main.globalShortcut.register("Ctrl+Alt+~", fun () -> (* do stuff *))

If you need to use a key that is not in the Key type but that you know works, you can use a string with Fable's !! operator, or just skip the helper altogether (also, please make a PR to add the key!):

let accelerator = createAccelerator [Modifier.Ctrl] !!"="

// The above is identical to:
let accelerator = "Ctrl+="

Deployment checklist

  1. Make necessary changes to the code
  2. Update the changelog
  3. Update the version and release notes in the package info, as well as the supported Electron versions in the NpmPackage node
  4. Commit and tag the commit (this is what triggers deployment from AppVeyor). For consistency, the tag should be identical to the package version number.
  5. Push the changes and the tag to the repo. If AppVeyor build succeeds, the package is automatically published to NuGet.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].