Ranvier.View.WebCore.Hmr
0.1.0
See the version list below for details.
dotnet add package Ranvier.View.WebCore.Hmr --version 0.1.0
NuGet\Install-Package Ranvier.View.WebCore.Hmr -Version 0.1.0
<PackageReference Include="Ranvier.View.WebCore.Hmr" Version="0.1.0" />
<PackageVersion Include="Ranvier.View.WebCore.Hmr" Version="0.1.0" />
<PackageReference Include="Ranvier.View.WebCore.Hmr" />
paket add Ranvier.View.WebCore.Hmr --version 0.1.0
#r "nuget: Ranvier.View.WebCore.Hmr, 0.1.0"
#:package Ranvier.View.WebCore.Hmr@0.1.0
#addin nuget:?package=Ranvier.View.WebCore.Hmr&version=0.1.0
#tool nuget:?package=Ranvier.View.WebCore.Hmr&version=0.1.0
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.0
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.mounteddoes 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 | Versions 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. |
-
net10.0
- FSharp.Core (>= 10.1.403)
- Ranvier.FSharp.Checker (>= 0.1.0)
- Ranvier.View (>= 0.1.49)
- Ranvier.View.Dom (>= 0.1.49)
- Ranvier.View.WebCore.Sdl (>= 0.1.0)
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.