Ranvier.View.WebCore.Hmr 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ranvier.View.WebCore.Hmr --version 0.1.1
                    
NuGet\Install-Package Ranvier.View.WebCore.Hmr -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ranvier.View.WebCore.Hmr" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ranvier.View.WebCore.Hmr" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Ranvier.View.WebCore.Hmr" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ranvier.View.WebCore.Hmr --version 0.1.1
                    
#r "nuget: Ranvier.View.WebCore.Hmr, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ranvier.View.WebCore.Hmr@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ranvier.View.WebCore.Hmr&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Ranvier.View.WebCore.Hmr&version=0.1.1
                    
Install as a Cake Tool

Ranvier.View.WebCore.Hmr

Hot reload for native Ranvier.View.WebCore apps in development. The dev host keeps the SDL window and the WebCore page alive for the whole session and patches edited components into them, keeping their state.

Experimental. It runs under the JIT only (FSI, reflection), so reference it from Debug builds; the app's normal path is unchanged and stays NativeAOT-compatible.

dotnet add package Ranvier.View.WebCore.Hmr --version 0.1.1

Usage

Replace Window.run in the entry point:

[<EntryPoint>]
let main argv =
    Ranvier.View.WebCore.Hmr.Dev.Run (argv, "My app", 640, 480, App.app, ())
dotnet run                       # the app
dotnet run -- dev                # the dev host, fine-grained patching
dotnet run -- dev -hmr fsi       # remount after an FSI evaluation of the edited file
dotnet run -- dev -hmr alc       # remount after an in-process compile into a collectible load context

Components stay ordinary Component.define code. The window title shows each reload's path and time.

A root whose props need the window (a GPU context, for instance) uses Dev.RunWith (argv, title, width, height, root, fun window -> props): the props are built once per window and survive every reload. Props that implement IDisposable belong to the host, which disposes them after the tree unmounts and before the window. examples/Ranvier.HmrWgpu hot-reloads a Ranvier.Wgpu scene this way.

Strategies

Strategy Save to presented Keeps
fine (default) ~80–130 ms; comment-only edits ~22 ms DOM nodes, instances and their signals, public module-level values
fsi ~80–100 ms, growing with the remounted tree signal values; setups re-run on every save
alc ~550–700 ms signal values; any F# construct, every file recompiled

fine mounts each definition through an instrumented copy of its template: static attribute values and text are signal cells, and every reader, handler and region function goes through a swappable cell. A reload re-evaluates the changed declarations in FSI (only the lets, against the types in use, unless a type changed), writes the cells whose value or code changed, and remounts with state transplant when the template structure changed. Ranvier.FSharp.Checker gates reloads on errors and supplies the declarations that depend on a change, in any file.

An edit with compile errors never reloads; the next passing save is compared with the last applied text.

Constraints

  • Arm (matchWith/branch) components update when their parent is re-evaluated.
  • Hooks.mounted does not re-run on a patch.
  • Private or mutable module-level values reset when their file is re-evaluated.
  • Instances are paired by setup order on a remount; reordering instances of one component can cross their state.

The measurements, edge cases and design record are in docs/research/native-hmr.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 0 11/15/2026
0.1.1 51 11/14/2026
0.1.0 54 11/14/2026
0.1.0-alpha.2 47 11/14/2026

Experimental development tool. JIT only; reference it from Debug builds.