Interstellar


Interstellar

NOTE: This API is not yet guarenteed to be stable or backward-compatible until v1.0, so breaking changes may occur at any time.

Interstellar is an F# library providing a standard, mixed-paradigm API for accessing browser controls on various platforms. Currently, there are 3 combinations platform and browser hosts available. See Examples for a simple sample application. See https://github.com/jwosty/InterstellarFableHelloWorld for an example of combining Interstellar with Fable, achieving a cross-platform desktop app built completely in F#.

Quick Start

You will need the .Net 5 SDK (and the mono SDK on macOS). For the Windows projects, you should be able to use any of the standard IDEs (Visual Studio, Visual Studio Code, Rider [untested but should work]). For the macOS projects, you need to use Visual Studio for Mac.

Create a project from the template:

dotnet new -i Interstellar.Template
dotnet new interstellar -n <project-name>

On Windows, you can run it like so:

dotnet restore <project-name>.Windows.sln
dotnet run -p <project-name>.Windows\<project-name>.Windows.fsproj

On macOS, I recommend opening <project-name>.macOS.sln in Visual Studio for Mac and running it that way. It runs using the mono-based Xamarin.macOS runtime, and as a result you currently can't run it with dotnet run (see xamarin/xamarin-macios#3955). This is on the roadmap for .NET 6. You'll have to use Mono's msbuild instead, if you want to use the CLI.

You should end up with a simple, cross-platform sample app that opens a window built using embeded HTML, CSS, and Javascript.

Sample Interstellar app

Customizing the template

By default, this will create a core sample project, and a host project for each platform (Windows and macOS). To generate a project without a macOS host, use the following:

dotnet new interstellar --macOS false

And to disable Windows:

dotnet new interstellar --Windows false

To see more info about these options:

dotnet new interstellar --help