.NET 9 is around the corner, and with it support for consuming and emitting nullness metadata in F# projects. JS APIs will often return null/undefined, and while Fable bindings often capture this information by using options, sometimes we give no indication that nulls are a possibility. I think F# 9 will be really useful here, so I'd like to start a discussion about the adoption plan for these annotations.
From the technical point of view, binding projects need to be compiled using .NET 9 SDK, <LangVersion>preview</LangVersion> (for now) and with the --checknulls+ flag (also for now - I think this will be aligned with C#'s <Nullable>enable</Nullable>). TFMs don't matter, so netstandard2.0 assemblies will contain nullness metadata too.
Finally, every API will need to be manually reviewed and annotated as required. In the case of existing bindings that use options with reference types, there's the question of whether we want to preserve options or replace them with null annotations, just so that a single, unified approach is used.
.NET 9 is around the corner, and with it support for consuming and emitting nullness metadata in F# projects. JS APIs will often return
null/undefined, and while Fable bindings often capture this information by using options, sometimes we give no indication thatnulls are a possibility. I think F# 9 will be really useful here, so I'd like to start a discussion about the adoption plan for these annotations.From the technical point of view, binding projects need to be compiled using .NET 9 SDK,
<LangVersion>preview</LangVersion>(for now) and with the--checknulls+flag (also for now - I think this will be aligned with C#'s<Nullable>enable</Nullable>). TFMs don't matter, sonetstandard2.0assemblies will contain nullness metadata too.Finally, every API will need to be manually reviewed and annotated as required. In the case of existing bindings that use options with reference types, there's the question of whether we want to preserve options or replace them with
nullannotations, just so that a single, unified approach is used.